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

Function backup

packages/sql/sqlite-node/src/SqliteClient.ts:273–286  ·  view source on GitHub ↗
(destination)

Source from the content-addressed store, hash-verified

271 return Stream.die("executeStream not implemented")
272 },
273 backup(destination) {
274 return Effect.suspend(() => {
275 let totalPages = 0
276 return Effect.tryPromise({
277 try: () =>
278 backupDatabase(db, destination, {
279 progress: (progress) => {
280 totalPages = progress.totalPages
281 }
282 }).then((pages): BackupMetadata => ({ totalPages: totalPages || pages, remainingPages: 0 })),
283 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to backup database", "backup") })
284 })
285 })
286 },
287 loadExtension(path) {
288 return Effect.acquireUseRelease(
289 Effect.sync(() => db.enableLoadExtension(true)),

Callers

nothing calls this directly

Calls 1

classifyErrorFunction · 0.70

Tested by

no test coverage detected