refactor: rename package

This commit is contained in:
2019-06-21 16:47:18 +08:00
parent 2f990bc41d
commit 7288d33ce2
39 changed files with 39 additions and 38 deletions

13
packages/db/src/index.ts Normal file
View File

@@ -0,0 +1,13 @@
export const DBClient = Symbol.for('DBClient')
export interface DBClient<T = any> {
getProvide<P>(): P;
setTable(table: string): void;
find(filter: object): Promise<T[]>;
findOne(filter: Object): Promise<T>;
findOneById(objectId: string): Promise<T>;
insertOne(model: T): Promise<T>;
updateOne(where: any, model: any): Promise<boolean>;
updateById(objectId: string, model: any): Promise<boolean>;
deleteOne(where: any): Promise<boolean>;
deleteById(objectId: string): Promise<boolean>;
}