/** * Universal PostgreSQL Adapter for RevealUI admin * * Supports multiple PostgreSQL providers: * - Neon Database (https://neon.tech) * - Supabase (https://supabase.com) * - Vercel Postgres (https://vercel.com/storage/postgres) * * Automatically detects the provider based on connection string or environment. * * WARNING: This module uses Node.js-specific database drivers. * Do NOT import in client-side code or edge runtime. */ import type { DatabaseAdapter } from '../types/index.js'; export interface UniversalPostgresAdapterConfig { /** * Connection string for the database * Examples: * - Neon: postgresql://user:pass@ep-xxx.us-east-1.aws.neon.tech/dbname?sslmode=require * - Supabase: postgresql://postgres:pass@db.xxx.supabase.co:5432/postgres * - Vercel: postgres://user:pass@host:5432/dbname */ connectionString?: string; /** * Environment variable name for connection string * Defaults to checking: DATABASE_URL, POSTGRES_URL, SUPABASE_DATABASE_URI */ envVar?: string; /** * Force a specific provider (optional, auto-detected if not provided) */ provider?: 'neon' | 'supabase' | 'electric'; /** * Shared pg Pool instance. When provided, the adapter uses this pool * instead of creating its own. This eliminates dual-pool issues where * the CMS adapter and the Drizzle ORM client create separate connections * to the same database. Pass the same pool to both systems. */ pool?: import('pg').Pool; /** * Async factory that returns a shared pg Pool. Called once during * initializeConnection. Use this instead of `pool` when the pool * source can't be imported at the top level (e.g., Turbopack async * module init issues in Next.js). */ poolFactory?: () => Promise; } /** * Creates a universal PostgreSQL adapter that works with Neon, Supabase, and Electric Postgres */ export declare function universalPostgresAdapter(config?: UniversalPostgresAdapterConfig): DatabaseAdapter; /** * Clear all worker-specific PGlite instances and state (useful for test cleanup) * Only affects electric provider * Can optionally clear just the current worker or all workers */ export declare function clearGlobalPGlite(clearAllWorkers?: boolean): void; export default universalPostgresAdapter; //# sourceMappingURL=universal-postgres.d.ts.map