PgliteTemplate.ts overview
Test-side half of the PGlite template: open databases from the migrated data directory that PgliteTemplate.setup.ts built for this run.
Never published (tsconfig.json excludes src/testing/).
Exports Grouped by Category
utils
migratedPglite
A new in-memory Postgres started from the run’s template rather than from initdb. Each call is its own PGlite instance (its own WASM module and Postgres backend), so nothing written through one is visible through another. The package’s tables are already applied; a file that needs other tables applies its own DDL on top.
Compiling the WASM module and unpacking the template dominate a boot on a loaded machine, so those are paid once per test file in loadArtifacts and every call after the first only instantiates.
Signature
declare const migratedPglite: () => Promise<PGlite>
truncate
Empty the named tables, keeping their schema.
Signature
declare const truncate: (client: PGlite, names: ReadonlyArray<string>) => Promise<void>
truncateTables
Empty every package table migratedPglite created, keeping the schema.
Signature
declare const truncateTables: (client: PGlite) => Promise<void>