import { Logger } from '@200systems/mf-logger'; import { DatabaseClient, DatabaseConfig } from '../interfaces/index.js'; export type DatabaseType = 'postgresql' | 'mysql'; export interface AdapterConfig extends DatabaseConfig { type: DatabaseType; } /** * Database Adapter that provides a unified interface for both PostgreSQL and MySQL * This allows easy switching between database types without changing application code */ export declare class DatabaseAdapter { private client; private logger; private dbType; constructor(config: AdapterConfig, logger?: Logger); private createPostgresClient; private createMySQLClient; /** * Get the database type */ getDatabaseType(): DatabaseType; /** * Initialize the database connection */ initialize(): Promise; /** * Close the database connection */ close(): Promise; /** * Get the underlying database client * This allows access to all database-specific methods */ getClient(): DatabaseClient; /** * Execute a database-agnostic query */ query(sql: string, params?: any[]): Promise<{ rows: T[]; rowCount: number; }>; /** * Execute a transaction with unified interface */ transaction(callback: (client: DatabaseClient) => Promise): Promise; /** * Health check */ healthCheck(): Promise<{ status: 'ok' | 'error'; timestamp: Date; reason?: string; }>; /** * Check if adapter is ready */ isReady(): boolean; } //# sourceMappingURL=DatabaseAdapter.d.ts.map