feat: optimiz db client
This commit is contained in:
		@@ -1,12 +1,13 @@
 | 
			
		||||
export const DBClient = Symbol.for('DBClient')
 | 
			
		||||
export interface DBClient<T = any> {
 | 
			
		||||
    getProvide(): any;
 | 
			
		||||
    find(collection: string, filter: object): Promise<T[]>;
 | 
			
		||||
    findOne(collection: string, filter: Object): Promise<T>;
 | 
			
		||||
    findOneById(collection: string, objectId: string): Promise<T>;
 | 
			
		||||
    insertOne(collection: string, model: T): Promise<T>;
 | 
			
		||||
    updateOne(collection: string, where: any, model: any): Promise<boolean>;
 | 
			
		||||
    updateById(collection: string, objectId: string, model: any): Promise<boolean>;
 | 
			
		||||
    deleteOne(collection: string, where: any): Promise<boolean>;
 | 
			
		||||
    deleteById(collection: string, objectId: string): Promise<boolean>;
 | 
			
		||||
    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>;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user