PgResultinterfaceno test imports itinterface PgResultWhat query gives.
| Member | Type | What it is |
|---|---|---|
rows | readonly unknown[] |
The port of a PostgreSQL server reached by pg: a pool (each transaction takes a connection of its own, so that writers run side by side and the row locks of the database decide between them) or one client (one transaction at a time). It is typed by the shape of query and connect, so that this library depends on no client. pg gives a BIGINT as text and bytes as a buffer: both are read as the port reads values.
import { pgPort } from "@intellectual-frontiers/anyfs-sql/pg";
// const port = pgPort(new Pool({ connectionString })); // the credentials are the caller's, never part of a placePgResultinterfaceno test imports itinterface PgResultWhat query gives.
| Member | Type | What it is |
|---|---|---|
rows | readonly unknown[] |
PgQueryableinterfaceno test imports itinterface PgQueryableWhat runs one statement: a client, a pool or a connection taken from a pool.
| Member | Type | What it is |
|---|---|---|
query | (text: string, values?: SqlValue[] | undefined) => Promise<PgResult> |
PgPoolClientinterfaceno test imports itinterface PgPoolClient extends PgQueryableA connection taken from a pool.
| Member | Type | What it is |
|---|---|---|
release | (error?: boolean | Error | undefined) => void | |
query | (text: string, values?: SqlValue[] | undefined) => Promise<PgResult> |
PgPoolinterfaceno test imports itinterface PgPool extends PgQueryableA pool of connections.
| Member | Type | What it is |
|---|---|---|
connect | () => Promise<PgPoolClient> | |
end | () => Promise<void> | |
query | (text: string, values?: SqlValue[] | undefined) => Promise<PgResult> |
PgClientinterfaceno test imports itinterface PgClient extends PgQueryableOne client.
| Member | Type | What it is |
|---|---|---|
end | () => Promise<void> | |
query | (text: string, values?: SqlValue[] | undefined) => Promise<PgResult> |
pgPortfunctionfunction pgPort(pool: PgPool): SqlPortThe port of a pool: a transaction takes a connection and gives it back.
pgClientPortfunctionfunction pgClientPort(client: PgClient): SqlPortThe port of one client: a transaction at a time.