MCPcopy Create free account
hub / github.com/Effect-TS/effect / pgDumpFile

Function pgDumpFile

packages/sql/pg/src/PgMigrator.ts:88–97  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

86 )
87
88 const pgDumpFile = (path: string) =>
89 Effect.gen(function*() {
90 const fs = yield* FileSystem.FileSystem
91 const path_ = yield* Path.Path
92 const dump = yield* pgDumpAll
93 yield* fs.makeDirectory(path_.dirname(path), { recursive: true })
94 yield* fs.writeFileString(path, dump)
95 }).pipe(
96 Effect.mapError((error) => new Migrator.MigrationError({ kind: "Failed", message: error.message }))
97 )
98
99 return pgDumpFile(path)
100 }

Callers 1

dumpSchemaFunction · 0.85

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected