/** * StrictDB Abstract Adapter Interface * * Every backend implements this interface. The main StrictDB class * delegates all operations to the active adapter. */ import type { Backend, ConnectionStatus, ConfirmOptions, Driver, LookupOptions, NativeBulkWriteOp, OperationReceipt, QueryOptions, StrictFilter, UpdateOperators } from '../types.js'; export interface DatabaseAdapter { readonly backend: Backend; readonly driver: Driver; connect(): Promise; close(): Promise; status(): ConnectionStatus; queryOne, TDoc = Record>(collection: string, filter: StrictFilter, options?: QueryOptions): Promise; queryMany, TDoc = Record>(collection: string, filter: StrictFilter, options?: QueryOptions): Promise; queryWithLookup(collection: string, options: LookupOptions): Promise; count(collection: string, filter?: StrictFilter): Promise; insertOne(collection: string, doc: T): Promise; insertMany(collection: string, docs: T[]): Promise; updateOne, TDoc = Record>(collection: string, filter: StrictFilter, update: UpdateOperators, upsert?: boolean): Promise; updateMany, TDoc = Record>(collection: string, filter: StrictFilter, update: UpdateOperators): Promise; deleteOne(collection: string, filter: StrictFilter, options?: ConfirmOptions): Promise; deleteMany(collection: string, filter: StrictFilter, options?: ConfirmOptions): Promise; ensureCollections?(definitions: Array<{ name: string; sql?: string; mapping?: Record; }>): Promise; ensureIndexes?(indexes: Array<{ collection: string; fields: Record; unique?: boolean; sparse?: boolean; expireAfterSeconds?: number; }>): Promise; describeCollection?(collection: string): Promise>; getDocumentCount?(collection: string): Promise; getIndexes?(collection: string): Promise; unique?: boolean; }>>; withTransaction?(fn: (txAdapter: DatabaseAdapter) => Promise): Promise; aggregate?(collection: string, pipeline: Record[], options?: { allowDiskUse?: boolean; }): Promise; nativeBulkWrite?(collection: string, operations: NativeBulkWriteOp[]): Promise<{ insertedCount: number; modifiedCount: number; deletedCount: number; insertedIds?: string[]; upsertedIds?: string[]; }>; raw(): unknown; } //# sourceMappingURL=adapter.d.ts.map