import type { FullQueryResults, Pool, PoolClient, QueryResult, QueryResultRow } from '@neondatabase/serverless'; import type { BatchItem } from "../batch.js"; import type { WithCacheConfig } from "../cache/core/types.js"; import { entityKind } from "../entity.js"; import type { NeonHttpClient, NeonHttpQueryResultHKT, NeonHttpSessionOptions } from "../neon-http/session.js"; import type { PgDialect } from "../pg-core/dialect.js"; import type { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.js"; import { type PgPreparedQuery, PgSession, PgTransaction, type PgTransactionConfig, type PreparedQueryConfig } from "../pg-core/session.js"; import type * as V1 from "../relations.js"; import { type Query, type SQL } from "../sql/sql.js"; export type NetlifyDbClient = { http: NeonHttpClient; pool: Pool; }; export declare class NetlifyDbSession, TSchema extends V1.TablesRelationalConfig> extends PgSession { private httpClient; private pool; private schema; private options; static readonly [entityKind]: string; private clientQuery; private logger; private cache; constructor(httpClient: NeonHttpClient, pool: Pool, dialect: PgDialect, schema: V1.RelationalSchemaConfig | undefined, options?: NeonHttpSessionOptions); prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { type: 'select' | 'update' | 'delete' | 'insert'; tables: string[]; }, cacheConfig?: WithCacheConfig): PgPreparedQuery; batch, T extends Readonly<[U, ...U[]]>>(queries: T): Promise; query(query: string, params: unknown[]): Promise>; queryObjects(query: string, params: unknown[]): Promise>; count(sql: SQL): Promise; transaction(transaction: (tx: NetlifyDbTransaction) => Promise, config?: PgTransactionConfig): Promise; } /** * Internal WebSocket-based session used only within transactions. * Delegates all queries to a PoolClient over WebSocket, using * NeonPreparedQuery from the neon-serverless adapter. */ export declare class NetlifyDbWsSession, TSchema extends V1.TablesRelationalConfig> extends PgSession { private client; private schema; static readonly [entityKind]: string; private logger; private cache; constructor(client: PoolClient, dialect: PgDialect, schema: V1.RelationalSchemaConfig | undefined, options?: NeonHttpSessionOptions); prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { type: 'select' | 'update' | 'delete' | 'insert'; tables: string[]; }, cacheConfig?: WithCacheConfig): PgPreparedQuery; count(sql: SQL): Promise; query(query: string, params: unknown[]): Promise; queryObjects(query: string, params: unknown[]): Promise>; transaction(_transaction: (tx: NetlifyDbTransaction) => Promise, _config?: PgTransactionConfig): Promise; } export declare class NetlifyDbTransaction, TSchema extends V1.TablesRelationalConfig> extends PgTransaction { static readonly [entityKind]: string; transaction(transaction: (tx: NetlifyDbTransaction) => Promise): Promise; }