Appearance
类型: DefineTable
Ƭ DefineTable: (tableName
: string
) => { count
: (options
: Pick
<TableOperationQueryOptions
, "query"
>) => BaseTableOperationResponse
<CountRecordResponse
> ; create
: <TPlain>(data
: object
, options
: Pick
<TableOperationQueryOptions
, "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? CreateRecordResponse
: Response
<CreateRecordResponse
>> ; createMany
: (dataList
: object
[], options
: Pick
<TableOperationQueryOptions
, "enableTrigger"
>) => BaseTableOperationResponse
<CreateManyRecordResponse
> ; delete
: (options
: Pick
<TableOperationQueryOptions
, "id"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
>) => BaseTableOperationResponse
<DeleteRecordResponse
> ; deleteMany
: (options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
>) => BaseTableOperationResponse
<DeleteManyRecordResponse
> ; find
: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "limit"
| "orderBy"
| "expand"
| "select"
| "withCount"
| "plain"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? FindRecordResponse
["objects"
] : Response
<FindRecordResponse
>> ; first
: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "orderBy"
| "expand"
| "select"
| "withCount"
| "plain"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? FindFirstRecordResponse
: Response
<FindFirstRecordResponse
>> ; get
: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "expand"
| "select"
| "plain"
| "id"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? GetRecordResponse
: Response
<GetRecordResponse
>> ; update
: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "id"
| "data"
| "unset"
| "incrementBy"
| "append"
| "uAppend"
| "remove"
| "patchObject"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
| "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? UpdateRecordResponse
: Response
<UpdateRecordResponse
>> ; updateMany
: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "data"
| "unset"
| "incrementBy"
| "append"
| "uAppend"
| "remove"
| "patchObject"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
| "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? UpdateManyRecordResponse
: Response
<UpdateManyRecordResponse
>> }
Type declaration
▸ (tableName
): Object
参数
Name | Type |
---|---|
tableName | string |
返回值
Object
Name | Type |
---|---|
count | (options : Pick <TableOperationQueryOptions , "query" >) => BaseTableOperationResponse <CountRecordResponse > |
create | <TPlain>(data : object , options : Pick <TableOperationQueryOptions , "plain" > & { plain? : TPlain }) => BaseTableOperationResponse <TPlain extends true ? CreateRecordResponse : Response <CreateRecordResponse >> |
createMany | (dataList : object [], options : Pick <TableOperationQueryOptions , "enableTrigger" >) => BaseTableOperationResponse <CreateManyRecordResponse > |
delete | (options : Pick <TableOperationQueryOptions , "id" | "offset" | "limit" | "enableTrigger" | "withCount" >) => BaseTableOperationResponse <DeleteRecordResponse > |
deleteMany | (options : Pick <TableOperationQueryOptions , "query" | "offset" | "limit" | "enableTrigger" | "withCount" >) => BaseTableOperationResponse <DeleteManyRecordResponse > |
find | <TPlain>(options : Pick <TableOperationQueryOptions , "query" | "offset" | "limit" | "orderBy" | "expand" | "select" | "withCount" | "plain" > & { plain : TPlain }) => BaseTableOperationResponse <TPlain extends true ? FindRecordResponse ["objects" ] : Response <FindRecordResponse >> |
first | <TPlain>(options : Pick <TableOperationQueryOptions , "query" | "offset" | "orderBy" | "expand" | "select" | "withCount" | "plain" > & { plain : TPlain }) => BaseTableOperationResponse <TPlain extends true ? FindFirstRecordResponse : Response <FindFirstRecordResponse >> |
get | <TPlain>(options : Pick <TableOperationQueryOptions , "expand" | "select" | "plain" | "id" > & { plain : TPlain }) => BaseTableOperationResponse <TPlain extends true ? GetRecordResponse : Response <GetRecordResponse >> |
update | <TPlain>(options : Pick <TableOperationQueryOptions , "id" | "data" | "unset" | "incrementBy" | "append" | "uAppend" | "remove" | "patchObject" | "offset" | "limit" | "enableTrigger" | "withCount" | "plain" > & { plain? : TPlain }) => BaseTableOperationResponse <TPlain extends true ? UpdateRecordResponse : Response <UpdateRecordResponse >> |
updateMany | <TPlain>(options : Pick <TableOperationQueryOptions , "query" | "data" | "unset" | "incrementBy" | "append" | "uAppend" | "remove" | "patchObject" | "offset" | "limit" | "enableTrigger" | "withCount" | "plain" > & { plain? : TPlain }) => BaseTableOperationResponse <TPlain extends true ? UpdateManyRecordResponse : Response <UpdateManyRecordResponse >> |
count: (options
: Pick
<TableOperationQueryOptions
, "query"
>) => BaseTableOperationResponse
<CountRecordResponse
>
-
create: <TPlain>(data
: object
, options
: Pick
<TableOperationQueryOptions
, "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? CreateRecordResponse
: Response
<CreateRecordResponse
>>
-
createMany: (dataList
: object
[], options
: Pick
<TableOperationQueryOptions
, "enableTrigger"
>) => BaseTableOperationResponse
<CreateManyRecordResponse
>
-
delete: (options
: Pick
<TableOperationQueryOptions
, "id"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
>) => BaseTableOperationResponse
<DeleteRecordResponse
>
-
deleteMany: (options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
>) => BaseTableOperationResponse
<DeleteManyRecordResponse
>
-
find: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "limit"
| "orderBy"
| "expand"
| "select"
| "withCount"
| "plain"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? FindRecordResponse
["objects"
] : Response
<FindRecordResponse
>>
-
first: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "offset"
| "orderBy"
| "expand"
| "select"
| "withCount"
| "plain"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? FindFirstRecordResponse
: Response
<FindFirstRecordResponse
>>
-
get: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "expand"
| "select"
| "plain"
| "id"
> & { plain
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? GetRecordResponse
: Response
<GetRecordResponse
>>
-
update: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "id"
| "data"
| "unset"
| "incrementBy"
| "append"
| "uAppend"
| "remove"
| "patchObject"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
| "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? UpdateRecordResponse
: Response
<UpdateRecordResponse
>>
-
updateMany: <TPlain>(options
: Pick
<TableOperationQueryOptions
, "query"
| "data"
| "unset"
| "incrementBy"
| "append"
| "uAppend"
| "remove"
| "patchObject"
| "offset"
| "limit"
| "enableTrigger"
| "withCount"
| "plain"
> & { plain?
: TPlain
}) => BaseTableOperationResponse
<TPlain
extends true
? UpdateManyRecordResponse
: Response
<UpdateManyRecordResponse
>>
-
packages/uni-mp/io/types/table.d.ts:66