IF Commons GitHub

physical/adapters/pglite

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-sql-port FR-007

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());

Source: commons/anyfs-sql/src/physical/adapters/pglite.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

PgliteResultinterfaceno test imports it
interface PgliteResult

What query gives.

MemberTypeWhat it is
rowsreadonly unknown[]
PgliteQueryableinterfaceno test imports it
interface PgliteQueryable

What runs one statement: the database, or a transaction of it.

MemberTypeWhat it is
query(sql: string, params?: readonly SqlValue[] | undefined) => Promise<PgliteResult>
PgliteDatabaseinterfaceno test imports it
interface PgliteDatabase extends PgliteQueryable

A PGlite database.

MemberTypeWhat it is
transaction<T>(work: (tx: PgliteQueryable) => Promise<T>) => Promise<T>
close() => Promise<void>
query(sql: string, params?: readonly SqlValue[] | undefined) => Promise<PgliteResult>
pglitePortfunction
function pglitePort(db: PgliteDatabase): SqlPort

The port of a PGlite database.

Imported by 10 tests of the run (10 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.