/** Describes the result of a query from a {@link PGProvider} */ export interface PGProviderResult { /** The SQL command that generated this result (`SELECT`, `INSERT`, ...) */ command: string; /** Number of rows affected by this query (e.g. added rows in `INSERT`) */ rowCount: number; /** Fields description with `name` (column name) and `oid` (type) */ fields: [name: string, oid: number][]; /** Result rows, as an array of unparsed `string` results from `libpq` */ rows: (string | null)[][]; } export interface PGProviderConnection { query(text: string, params?: (string | null)[]): Promise; } export interface PGProviderConstructor { new (url: URL): PGProvider; } export interface PGProvider extends PGProviderConnection { /** The URL used to create this provider, devoid of any credentials */ readonly url: Readonly; acquire(): Promise; release(connection: Connection): Promise; destroy(): Promise; } export declare abstract class AbstractPGProvider implements PGProvider { constructor(url: URL | string); get url(): Readonly; abstract acquire(): Promise; abstract release(connection: PGProviderConnection): Promise; query(text: string, params?: (string | null)[]): Promise; destroy(): Promise; } /** Register a provider, associating it with the specified protocol */ export declare function registerProvider(protocol: string, constructor: PGProviderConstructor): void; /** Create a new {@link PGProvider} instance for the specified URL */ export declare function createProvider(url: URL): PGProvider;