(path: string)
| 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 | } |