PgliteResultinterfaceno test imports itinterface PgliteResultWhat query gives.
| Member | Type | What it is |
|---|---|---|
rows | readonly unknown[] |
The port of a PGlite database: PostgreSQL itself, run in the process, which is what the tests of PostgreSQL use where there is no server. It is typed by the shape of PGlite's query, exec and transaction. PGlite has one connection and runs one transaction at a time, so a statement outside a transaction waits for it.
import { pglitePort } from "@intellectual-frontiers/anyfs-sql/pglite";
// const port = pglitePort(new PGlite());PgliteResultinterfaceno test imports itinterface PgliteResultWhat query gives.
| Member | Type | What it is |
|---|---|---|
rows | readonly unknown[] |
PgliteQueryableinterfaceno test imports itinterface PgliteQueryableWhat runs one statement: the database, or a transaction of it.
| Member | Type | What it is |
|---|---|---|
query | (sql: string, params?: readonly SqlValue[] | undefined) => Promise<PgliteResult> |
PgliteDatabaseinterfaceno test imports itinterface PgliteDatabase extends PgliteQueryableA PGlite database.
| Member | Type | What it is |
|---|---|---|
transaction | <T>(work: (tx: PgliteQueryable) => Promise<T>) => Promise<T> | |
close | () => Promise<void> | |
query | (sql: string, params?: readonly SqlValue[] | undefined) => Promise<PgliteResult> |
pglitePortfunctionfunction pglitePort(db: PgliteDatabase): SqlPortThe port of a PGlite database.