import { ClientConfig, PoolConfig, ClientBase, QueryResultRow, QueryResult, Client, Pool } from '@neondatabase/serverless'; export { Client, FieldDef, Pool, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, QueryResultRow, types } from '@neondatabase/serverless'; type Primitive = string | number | boolean | undefined | null; type ConfigItemsToOmit = 'user' | 'database' | 'password' | 'host' | 'port'; type VercelPostgresClientConfig = Omit; type VercelPostgresPoolConfig = Omit; interface VercelClientBase extends ClientBase { sql: (strings: TemplateStringsArray, ...values: Primitive[]) => Promise>; } interface VercelPoolClient extends VercelClientBase { release: (err?: Error | boolean) => void; } declare class VercelClient extends Client { /** * A template literal tag providing safe, easy to use SQL parameterization. * Parameters are substituted using the underlying Postgres database, and so must follow * the rules of Postgres parameterization. * @example * ```ts * const pool = createClient(); * const userId = 123; * await client.connect(); * const result = await pool.sql`SELECT * FROM users WHERE id = ${userId}`; * // Equivalent to: await pool.query('SELECT * FROM users WHERE id = $1', [id]); * await client.end(); * ``` * @returns A promise that resolves to the query result. */ sql(strings: TemplateStringsArray, ...values: Primitive[]): Promise>; } declare function createClient(config?: VercelPostgresClientConfig): VercelClient; declare class VercelPool extends Pool { Client: typeof VercelClient; private connectionString; constructor(config: VercelPostgresPoolConfig); /** * A template literal tag providing safe, easy to use SQL parameterization. * Parameters are substituted using the underlying Postgres database, and so must follow * the rules of Postgres parameterization. * @example * ```ts * const pool = createPool(); * const userId = 123; * const result = await pool.sql`SELECT * FROM users WHERE id = ${userId}`; * // Equivalent to: await pool.query('SELECT * FROM users WHERE id = $1', [id]); * ``` * @returns A promise that resolves to the query result. */ sql(strings: TemplateStringsArray, ...values: Primitive[]): Promise>; connect(): Promise; connect(callback: (err: Error, client: VercelPoolClient, done: (release?: any) => void) => void): void; } declare function createPool(config?: VercelPostgresPoolConfig): VercelPool; type ConnectionStringType = 'pool' | 'direct'; declare function postgresConnectionString(type?: ConnectionStringType): string | undefined; declare const sql: VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise>); declare const db: VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise>); export { VercelClient, type VercelClientBase, VercelPool, type VercelPoolClient, type VercelPostgresClientConfig, type VercelPostgresPoolConfig, createClient, createPool, db, postgresConnectionString, sql };