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

Function backup

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

Source from the content-addressed store, hash-verified

313 return Stream.die("executeStream not implemented")
314 },
315 backup(destination) {
316 return Effect.suspend(() => {
317 let totalPages = 0
318 return Effect.tryPromise({
319 try: () =>
320 backupDatabase(db, destination, {
321 progress: (progress) => {
322 totalPages = progress.totalPages
323 }
324 }).then((pages): BackupMetadata => ({ totalPages: totalPages || pages, remainingPages: 0 })),
325 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to backup database", "backup") })
326 })
327 })
328 },
329 loadExtension(path) {
330 return Effect.acquireUseRelease(
331 Effect.sync(() => setLoadExtensionEnabled(db, true)),

Callers

nothing calls this directly

Calls 1

classifyErrorFunction · 0.70

Tested by

no test coverage detected