import type { ConnectionInfo } from '@prisma/driver-adapter-utils'; import type { IsolationLevel } from '@prisma/driver-adapter-utils'; import * as neon from '@neondatabase/serverless'; import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils'; import type { SqlDriverAdapterFactory } from '@prisma/driver-adapter-utils'; import type { SqlQuery } from '@prisma/driver-adapter-utils'; import type { SqlQueryable } from '@prisma/driver-adapter-utils'; import type { SqlResultSet } from '@prisma/driver-adapter-utils'; import type { Transaction } from '@prisma/driver-adapter-utils'; declare type ARRAY_MODE_ENABLED = true; /** * Base class for http client, ws client and ws transaction */ declare abstract class NeonQueryable implements SqlQueryable { readonly provider = "postgres"; readonly adapterName: string; /** * Execute a query given as SQL, interpolating the given parameters. */ queryRaw(query: SqlQuery): Promise; /** * Execute a query given as SQL, interpolating the given parameters and * returning the number of affected rows. * Note: Queryable expects a u64, but napi.rs only supports u32. */ executeRaw(query: SqlQuery): Promise; /** * Run a query against the database, returning the result set. * Should the query fail due to a connection error, the connection is * marked as unhealthy. */ abstract performIO(query: SqlQuery): Promise; } /** * Base class for WS-based queryables: top-level client and transaction */ declare class NeonWsQueryable extends NeonQueryable { protected client: ClientT; constructor(client: ClientT); performIO(query: SqlQuery): Promise; protected onError(e: any): never; } declare type PerformIOResult = neon.QueryResult | neon.FullQueryResults; export declare class PrismaNeon implements SqlDriverAdapterFactory { private readonly config; private options?; readonly provider = "postgres"; readonly adapterName: string; constructor(config: neon.PoolConfig, options?: PrismaNeonOptions | undefined); connect(): Promise; } declare class PrismaNeonAdapter extends NeonWsQueryable implements SqlDriverAdapter { private options?; private isRunning; constructor(pool: neon.Pool, options?: PrismaNeonOptions | undefined); executeScript(_script: string): Promise; startTransaction(isolationLevel?: IsolationLevel): Promise; getConnectionInfo(): ConnectionInfo; dispose(): Promise; underlyingDriver(): neon.Pool; } export declare class PrismaNeonHttp implements SqlDriverAdapterFactory { private readonly connectionString; private readonly options; readonly provider = "postgres"; readonly adapterName: string; constructor(connectionString: string, options: neon.HTTPQueryOptions); connect(): Promise; } declare type PrismaNeonOptions = { schema?: string; onPoolError?: (err: Error) => void; onConnectionError?: (err: Error) => void; }; export { }