| 49 | * Base class for all emscripten built-in filesystems. |
| 50 | */ |
| 51 | export 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. |
nothing calls this directly
no outgoing calls
no test coverage detected