MCPcopy
hub / github.com/Effect-TS/effect / dump

Function dump

packages/sql-sqlite-bun/src/SqliteMigrator.ts:38–50  ·  view source on GitHub ↗
(args: Array<string>)

Source from the content-addressed store, hash-verified

36> = Migrator.make({
37 dumpSchema(path, table) {
38 const dump = (args: Array<string>) =>
39 Effect.gen(function*() {
40 const sql = yield* SqliteClient
41 const dump = yield* pipe(
42 Command.make("sqlite3", (sql as SqliteClient).config.filename, ...args),
43 Command.string
44 )
45 return dump.replace(/^create table sqlite_sequence\(.*$/im, "")
46 .replace(/\n{2,}/gm, "\n\n")
47 .trim()
48 }).pipe(
49 Effect.mapError((error) => new Migrator.MigrationError({ reason: "failed", message: error.message }))
50 )
51
52 const dumpSchema = dump([".schema"])
53

Callers 1

dumpSchemaFunction · 0.70

Calls 3

pipeMethod · 0.65
makeMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…