/**
 * Database Client
 *
 * Drizzle ORM client configuration for Vorion platform.
 * Uses schemas from @vorion/contracts/db.
 *
 * Usage:
 *   import { db, getDb } from '@vorionsys/platform-core/db/client';
 *
 * @packageDocumentation
 */
import { type NodePgDatabase } from "drizzle-orm/node-postgres";
import { Pool, type PoolConfig } from "pg";
import * as schema from "@vorionsys/contracts/db";
export { schema };
/**
 * Database client type with full schema
 */
export type Database = NodePgDatabase<typeof schema>;
/**
 * Database connection configuration
 */
export interface DatabaseConfig {
    /** PostgreSQL connection string */
    connectionString: string;
    /** Maximum number of connections in pool */
    maxConnections?: number;
    /** Idle timeout in milliseconds */
    idleTimeoutMs?: number;
    /** Connect timeout in milliseconds */
    connectionTimeoutMs?: number;
    /** Enable SSL */
    ssl?: boolean | PoolConfig["ssl"];
}
/**
 * Initialize database connection
 */
export declare function initDb(config: DatabaseConfig): Database;
/**
 * Get database client instance
 * @throws Error if database not initialized
 */
export declare function getDb(): Database;
/**
 * Create a new database client instance (does not use singleton)
 */
export declare function createDb(config: DatabaseConfig): {
    db: Database;
    pool: Pool;
};
/**
 * Close database connection
 */
export declare function closeDb(): Promise<void>;
/**
 * Get database connection from environment
 */
export declare function getDbFromEnv(): Database;
/**
 * Get the underlying connection pool
 */
export declare function getPool(): Pool;
export declare const db: {
    init: typeof initDb;
    get: typeof getDb;
    create: typeof createDb;
    close: typeof closeDb;
    fromEnv: typeof getDbFromEnv;
    getPool: typeof getPool;
};
export default db;
//# sourceMappingURL=client.d.ts.map