import { Pool } from 'pg'; import type { DatabaseAdapter } from '@momentumcms/core'; /** * PostgreSQL adapter options. */ export interface PostgresAdapterOptions { /** * PostgreSQL connection string. * Format: postgresql://user:password@host:port/database */ connectionString: string; /** * Maximum number of clients in the pool. * @default 10 */ max?: number; } /** * Extended adapter interface that includes raw database access for Better Auth. */ export interface PostgresAdapterWithRaw extends DatabaseAdapter { /** Get the pg Pool instance for Better Auth integration */ getPool(): Pool; /** Execute a raw SQL query */ query>(sql: string, params?: unknown[]): Promise; /** Execute a raw SQL query and return a single row */ queryOne>(sql: string, params?: unknown[]): Promise; /** Execute a raw SQL statement (INSERT, UPDATE, DELETE) */ execute(sql: string, params?: unknown[]): Promise; } /** * Creates a PostgreSQL database adapter. */ export declare function postgresAdapter(options: PostgresAdapterOptions): PostgresAdapterWithRaw;