/** * StrictDB — The Unified Database Interface * * One API for MongoDB, PostgreSQL, MySQL, MSSQL, SQLite, and Elasticsearch. * Auto-detects backend from URI. All operations flow through the pipeline: * * Developer/AI call → StrictDB (router) * → sanitize (clean input) * → guardrails (block dangerous ops) * → validate (schema check if enabled) * → adapter (mongo/sql/elastic) * → receipts (wrap result) * → logger (emit event) * → return to caller */ import type { AggregateOptions, BatchOperation, CollectionDescription, CollectionSchema, ConfirmOptions, ConnectionStatus, ExplainResult, IndexDefinition, LookupOptions, NativeBulkWriteOp, OperationReceipt, QueryOptions, StrictDBConfig, StrictDBEvents, StrictFilter, UpdateOperators, ValidationResult } from './types.js'; import type { SqlOptions, SqlMode2Result } from './sql/index.js'; export declare class StrictDB { private adapter; private emitter; private logger; private config; private backend; private schemaValidation; private guardrailsEnabled; private guardrailLimitRequired; private guardrailEmptyFilter; private guardrailNullComparison; private sanitizeEnabled; private sanitizeRules; private timestampConfig; private constructor(); /** * Create a new StrictDB instance. Auto-detects backend from URI. */ static create(config: StrictDBConfig): Promise; 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, options?: ConfirmOptions): Promise; deleteOne(collection: string, filter: StrictFilter, options?: ConfirmOptions): Promise; deleteMany(collection: string, filter: StrictFilter, options?: ConfirmOptions): Promise; batch(operations: BatchOperation[]): Promise; private _sqlAdapter?; private getSqlAdapter; sql(sql: string, options?: SqlOptions): Promise; /** * Execute a native MongoDB aggregate pipeline. * On MongoDB: zero-overhead passthrough — pipeline goes straight to the driver. * On SQL/ES: pipeline stages are translated to the backend's query language. */ aggregate>(collection: string, pipeline: Record[], options?: AggregateOptions): Promise; /** * Execute native MongoDB-format bulk write operations. * Accepts the exact MongoDB bulkWrite format. * On MongoDB: zero-overhead passthrough. * On SQL/ES: operations translated to the backend's write format. */ nativeBulkWrite(collection: string, operations: NativeBulkWriteOp[]): Promise; /** * Alias for nativeBulkWrite — matches MongoDB driver naming convention. */ bulkWrite(collection: string, operations: NativeBulkWriteOp[]): Promise; withTransaction(fn: (tx: StrictDB) => Promise): Promise; registerCollection(definition: CollectionSchema): void; registerIndex(definition: IndexDefinition): void; ensureCollections(options?: { dryRun?: boolean; }): Promise; ensureIndexes(options?: { dryRun?: boolean; }): Promise; describe(collection: string): Promise; validate(collection: string, operation: { filter?: Record; update?: UpdateOperators>; doc?: Record; }): Promise; explain(collection: string, operation: { filter?: Record; sort?: Record; limit?: number; }): Promise; status(): ConnectionStatus; on(event: E, listener: (payload: StrictDBEvents[E]) => void): this; once(event: E, listener: (payload: StrictDBEvents[E]) => void): this; off(event: E, listener: (payload: StrictDBEvents[E]) => void): this; private applyRulesToFilter; private applyRulesToUpdate; close(): Promise; gracefulShutdown(exitCode?: number): Promise; raw(): unknown; } //# sourceMappingURL=strictdb.d.ts.map