Skip to content

@usine/durable/backup

A failed durable storage backup, with both paths because a copy error can come from either file.

  • Schema.Class

new DurableStorageBackupError(…args): DurableStorageBackupError

Parameter Type
…args [props: object, options?: MakeOptions]

DurableStorageBackupError

readonly cause: unknown

readonly destination: string

readonly operation: "stage" | "open" | "copy" | "publish"

readonly reason: string

readonly source: string

const backup: (instanceDirectory, destination) => Effect.Effect<boolean, DurableStorageBackupError, never>

Copies the instance’s .usine/durable.sqlite to destination while the orchestrator runs, through SQLite’s backup API on a read-only connection, so the copy holds every committed transaction, including those still in the WAL. The copy is written beside the destination, then hard-linked into place, so an existing file is never overwritten; the destination directory must exist and support hard links. Returns false, writing nothing, when the instance has no durable storage yet.

Parameter Type
instanceDirectory string & Brand
destination string

Effect.Effect<boolean, DurableStorageBackupError, never>