/**
 * Database Manager
 * Central database connection management and query execution
 */
import type { SupportedDriver } from '../migrations/enum';
import type { DatabaseConfig, IDatabaseAdapter, QueryResult } from './DatabaseAdapter';
import type { IQueryBuilder } from './QueryBuilder';
export type RawValue = {
    __raw: string;
};
export interface IDatabase {
    connect(): Promise<void>;
    disconnect(): Promise<void>;
    isConnected(): boolean;
    query(sql: string, parameters?: unknown[], isRead?: boolean): Promise<unknown[]>;
    queryOne(sql: string, parameters?: unknown[], isRead?: boolean): Promise<unknown>;
    execute(sql: string, parameters?: unknown[], isRead?: boolean): Promise<QueryResult>;
    raw(value: string): RawValue;
    transaction<T>(callback: (db: IDatabase) => Promise<T>): Promise<T>;
    table(name: string): IQueryBuilder;
    onBeforeQuery(handler: (query: string, params: unknown[]) => void): void;
    onAfterQuery(handler: (query: string, params: unknown[], duration: number) => void): void;
    offBeforeQuery(handler: (query: string, params: unknown[]) => void): void;
    offAfterQuery(handler: (query: string, params: unknown[], duration: number) => void): void;
    getAdapterInstance(isRead?: boolean): IDatabaseAdapter;
    getType(): SupportedDriver;
    getConfig(): DatabaseConfig;
    dispose(): void;
}
export declare const Database: Readonly<{
    /**
     * Create a new database instance
     */
    create(config?: DatabaseConfig): IDatabase;
}>;
export declare const useEnsureDbConnected: (config?: DatabaseConfig | undefined, connectionName?: string) => Promise<ReturnType<typeof useDatabase>>;
export declare function useDatabase(config?: DatabaseConfig, connection?: string): IDatabase;
export declare function resetDatabase(): Promise<void>;
//# sourceMappingURL=Database.d.ts.map