Skip to content

@usine/engine/local-sqlite

A failed backup operation, with both paths because SQLite copy errors can come from either file.

  • Schema.Class

new RuntimeStoreBackupError(…args): RuntimeStoreBackupError

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

RuntimeStoreBackupError

readonly cause: unknown

readonly destination: string

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

readonly reason: string

readonly source: string

const backup: (instanceDirectory, destination) => Effect.Effect<void, RuntimeStoreBackupError, never>

Copies .usine/runtime.sqlite to a new file while the orchestrator runs. The destination directory must exist and support hard links. Opens the source read-only and saves a complete backup without overwriting an existing file.

Parameter Type
instanceDirectory string & Brand
destination string

Effect.Effect<void, RuntimeStoreBackupError, never>


const layer: (instanceDirectory) => Layer.Layer<CursorStore | CycleBudgets | ItemProjectionReader | ItemProjectionWriter | LoopControl | RepositoryLabelProjectionReader | RepositoryLabelProjectionWriter | RunEngine | RunReader, RunEngineError, StepExecutor | TriggerCondition>

The local runtime on .usine/runtime.sqlite.

Parameter Type
instanceDirectory InstanceDirectory

Layer.Layer<CursorStore | CycleBudgets | ItemProjectionReader | ItemProjectionWriter | LoopControl | RepositoryLabelProjectionReader | RepositoryLabelProjectionWriter | RunEngine | RunReader, RunEngineError, StepExecutor | TriggerCondition>


const localSqliteLayer: (instanceDirectory) => Layer.Layer<RunDatabase | SqlClient | SqliteClient.SqliteClient, EnginePersistenceError, never>

Parameter Type
instanceDirectory InstanceDirectory

Layer.Layer<RunDatabase | SqlClient | SqliteClient.SqliteClient, EnginePersistenceError, never>


const observationLayer: (instanceDirectory) => Layer.Layer<CycleBudgets | ItemProjectionReader | LoopControl | RepositoryLabelProjectionReader | RunReader, RunEngineError>

Observation services initialize the local database but never recover Runs or start Attempts.

Parameter Type
instanceDirectory InstanceDirectory

Layer.Layer<CycleBudgets | ItemProjectionReader | LoopControl | RepositoryLabelProjectionReader | RunReader, RunEngineError>


const runReaderLayer: (instanceDirectory) => Layer.Layer<RunReader, EnginePersistenceError>

Opens an existing .usine/runtime.sqlite in SQLite read-only mode, without initializing or migrating the database.

Parameter Type
instanceDirectory InstanceDirectory

Layer.Layer<RunReader, EnginePersistenceError>