MCPcopy Index your code
hub / github.com/electric-sql/pglite / EmscriptenBuiltinFilesystem

Class EmscriptenBuiltinFilesystem

packages/pglite/src/fs/base.ts:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 * Base class for all emscripten built-in filesystems.
50 */
51export class EmscriptenBuiltinFilesystem implements Filesystem {
52 protected dataDir?: string
53 protected pg?: PGlite
54
55 constructor(dataDir?: string) {
56 this.dataDir = dataDir
57 }
58
59 async init(pg: PGlite, emscriptenOptions: Partial<PostgresMod>) {
60 this.pg = pg
61 return { emscriptenOpts: emscriptenOptions }
62 }
63
64 async syncToFs(_relaxedDurability?: boolean) {}
65
66 async initialSyncFs() {}
67
68 async closeFs() {}
69
70 async dumpTar(dbname: string, compression?: DumpTarCompressionOptions) {
71 return dumpTar(this.pg!.Module.FS, PGDATA, dbname, compression)
72 }
73}
74
75/**
76 * Abstract base class for all custom virtual filesystems.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected