import { Query } from 'database-ql/dist/commonjs/query'; import { Db } from 'laf-client-sdk'; import { Page } from './model/Page'; import { QueryChain } from './QueryChain'; import { WithArg } from './type/WithArg'; /** * QueryChainWrapper * @author LL * @date 2022-01-11 上午 10:10 **/ export declare class QueryChainWrapper> extends QueryChain { /** * 引用的表名 * @type {string} * @private */ private readonly tableName; /** * 日志记录器 * @type {Logger} * @private */ private log; private withFlag; private withArg; private withOneFlag; private withOneArg; /** * 构造 * @param {string} tableName 表名 * @param {Db | null} database 数据库引用, 可空; 仅仅在需要独立指定数据库引用时候使用 */ constructor(tableName: string, database?: Db | null); /** * 原版 with, query 参数可以由 {@link QueryChainWrapper#getWithArg} 获得 * @param withArg {{ * query: any, * localField: string, * foreignField: string, * as: string * }} */ with(withArg: WithArg): this; /** * 原版 with, query 参数可以由 {@link QueryChainWrapper#getWithArg} 获得 * @param withArg {{ * query: any, * localField: string, * foreignField: string, * as: string * }} */ withOne(withArg: WithArg): this; /** * 获得 with 中的 参数 * @param foreignField {string} 关联表 关联字段名 一般是对方主键或唯一列 * @param localField {string} 当前表 外键列属性名 * @param as {string} 关联数据别名 * @return */ getWithArg(foreignField: keyof E, localField: keyof T, as?: string): WithArg; /** * 计数查询 * @return {Promise} */ count(): Promise; /** * 列表查询 * @param {number} size 默认100, 最大 1000 * @return {Promise} */ list(size?: number): Promise; /** * Get One * @return {Promise} */ one(): Promise; /** * 分页查询 * @param {Pick, 'currentPage' | 'pageSize'>} page 分页参数, 最小值 1; 默认值 1 20 * @return {Promise>} 查询结果 */ page(page: Pick, 'currentPage' | 'pageSize'>): Promise>; /** * 批量删除 * 默认值能删除多个匹配项中的一个, 多选需要传递 multi 为 true * @param {boolean} multi 批量删除 * @return {Promise} 是否成功 */ delete(multi?: boolean): Promise; protected setField(connection: Query): Query; private setWith; } //# sourceMappingURL=QueryChainWrapper.d.ts.map