import type { PoolOptions } from 'mysql2/promise';
import type { PoolConfig } from 'pg';
import type { ClassType } from '../types';
import { BaseDatabase, type BaseDatabaseOptions } from './database';
import type { DatabaseDriver } from './driver';
import { type MySQLPoolLike, type PgPoolLike } from './drivers';
import type { EntityClass } from './metadata';
export type DatabaseDialect = 'mysql' | 'postgres';
export interface SharedDatabaseConfig extends BaseDatabaseOptions {
    enableLocksTable?: boolean;
}
export interface MySQLDatabaseConfig extends PoolOptions, BaseDatabaseOptions {
    enableLocksTable?: boolean;
}
export interface PostgresDatabaseConfig extends PoolConfig, BaseDatabaseOptions {
    enableLocksTable?: boolean;
}
export declare function createDatabaseClass(driverFactory: () => DatabaseDriver, entities?: EntityClass[], options?: BaseDatabaseOptions): {
    new (): {
        readonly entityRegistry: EntityClass[];
        readonly options: Required<BaseDatabaseOptions>;
        readonly schema: import("./schema").DatabaseSchemaBuilder;
        readonly driver: DatabaseDriver;
        query<T extends object>(Entity: EntityClass<T>, session?: import("./session").DatabaseSession): import("./query").QueryBuilder<T>;
        transaction<T>(worker: (session: import("./session").DatabaseSession) => Promise<T>): Promise<T>;
        withTransaction<T>(session: import("./session").DatabaseSession | undefined, worker: (session: import("./session").DatabaseSession) => Promise<T>): Promise<T>;
        withConnection<T>(worker: (db: /*elided*/ any) => T | Promise<T>): Promise<T>;
        rawQuery<T = Record<string, unknown>>(input: import("./sql").SqlInput, session?: import("./session").DatabaseSession): Promise<T[]>;
        rawFind<T = Record<string, unknown>>(input: import("./sql").SqlInput, session?: import("./session").DatabaseSession): Promise<T[]>;
        rawFindTyped<T>(input: import("./sql").SqlInput, session: import("./session").DatabaseSession | undefined, type: import("..").Type): Promise<T[]>;
        rawFindOne<T = Record<string, unknown>>(input: import("./sql").SqlInput, session?: import("./session").DatabaseSession): Promise<T | undefined>;
        createSqlQuery(text: string, bindings?: unknown[]): import("./sql").SqlQuery;
        rawExecute(input: import("./sql").SqlInput, session?: import("./session").DatabaseSession): Promise<import("./driver").ExecuteResult>;
        rawFindUnsafe<T = Record<string, unknown>>(text: string, bindings?: unknown[], session?: import("./session").DatabaseSession, type?: import("..").ReceiveType<T>): Promise<T[]>;
        rawFindOneUnsafe<T = Record<string, unknown>>(text: string, bindings?: unknown[], session?: import("./session").DatabaseSession, type?: import("..").ReceiveType<T>): Promise<T | undefined>;
        rawExecuteUnsafe(text: string, bindings?: unknown[], session?: import("./session").DatabaseSession, _type?: unknown): Promise<import("./driver").ExecuteResult>;
        acquireSessionLock(key: import("./database").MutexKey | import("./database").MutexKey[], session: import("./session").DatabaseSession): Promise<void>;
        persist(entity: object, session?: import("./session").DatabaseSession): Promise<void>;
        saveEntity(entity: object, session?: import("./session").DatabaseSession): Promise<void>;
        deleteEntity(entity: object, session?: import("./session").DatabaseSession): Promise<void>;
    };
};
export declare function createMySQLDatabase(config?: MySQLDatabaseConfig | MySQLPoolLike, entities?: EntityClass[]): ClassType<BaseDatabase>;
export declare function createPostgresDatabase(config?: PostgresDatabaseConfig | PgPoolLike, entities?: EntityClass[]): ClassType<BaseDatabase>;
export declare function createDatabase(config?: SharedDatabaseConfig, entities?: EntityClass[]): ClassType<BaseDatabase>;
export declare function createDatabase(dialect: 'mysql', config?: MySQLDatabaseConfig | MySQLPoolLike, entities?: EntityClass[]): ClassType<BaseDatabase>;
export declare function createDatabase(dialect: 'postgres', config?: PostgresDatabaseConfig | PgPoolLike, entities?: EntityClass[]): ClassType<BaseDatabase>;
//# sourceMappingURL=factory.d.ts.map