performDatadirDump
performDatadirDump(
pglite,compression,startPerf):Promise<{checkpointMs:number;checkpointStartedAtMs:number;dumped:File|Blob;dumpMs:number;dumpStartedAtMs:number; }>
Defined in: packages/client/src/export-store.ts:216
The datadir dump both exports share (ADR-0035): a CHECKPOINT through the store’s normal query path,
then dumpDataDir. The store backup keeps its bytes as the artefact; the diagnostic dump feeds them to a
throwaway clone. Factored out so exactly one implementation of “flush + tar the live datadir” exists —
performStoreExport and performDiagnosticExport cannot drift on the checkpoint ordering or the timing
house style. Returns the raw dumpDataDir output plus the two phase walls, both offset from startPerf
(the caller’s export-start monotonic anchor) so the timings compose into either report.
The CHECKPOINT is a utility statement — Drizzle has no builder for it, so a raw exec is the justified
tier-③ form here. Running it via pglite.exec serialises it behind any in-flight engine work on PGlite’s
single connection, flushing dirty buffers to the datadir the dump then reads — so the tarball reflects
committed state, not a torn mid-write datadir.
Parameters
Section titled “Parameters”pglite
Section titled “pglite”Pick<ClientPGlite, "exec" | "dumpDataDir">
compression
Section titled “compression”"none" | "gzip" | "auto"
startPerf
Section titled “startPerf”number
Returns
Section titled “Returns”Promise<{ checkpointMs: number; checkpointStartedAtMs: number; dumped: File | Blob; dumpMs: number; dumpStartedAtMs: number; }>