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

Function dumpFile

packages/sql-mysql2/src/MysqlMigrator.ts:85–94  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

83 )
84
85 const dumpFile = (file: string) =>
86 Effect.gen(function*() {
87 const fs = yield* FileSystem
88 const path = yield* Path
89 const dump = yield* dumpAll
90 yield* fs.makeDirectory(path.dirname(file), { recursive: true })
91 yield* fs.writeFileString(file, dump)
92 }).pipe(
93 Effect.mapError((error) => new Migrator.MigrationError({ reason: "failed", message: error.message }))
94 )
95
96 return dumpFile(path)
97 }

Callers 1

dumpSchemaFunction · 0.70

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected