ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LeiosDB.Impl.SQLite.Statements

Description

Bundles of prepared statements used by LeiosDB's SQLite backend.

Statements are compiled SQL statements ready to be run on an SQLite connection. Consult SQLite documentation for more details.

Synopsis

Documentation

prepareVolStmts ∷ Database → IO VolStmts Source #

Prepare every statement VolStmts names. Order is not observable.

finalizeVolStmts ∷ VolStmts → IO () Source #

Finalise every statement in VolStmts. Called from close immediately before sqlite3_close_v2, on the connection's owner thread.

data ImmStmts Source #

Prepared statements of the fallback reads into the immutable partition. The partitions share one schema, so these are the volatile SQL strings prepared against the immutable connection (plus the presence probe). Lifecycle mirrors VolStmts: prepared at open time, finalized in close before their connection.

finalizeImmStmts ∷ ImmStmts → IO () Source #

Same use-after-free discipline as finalizeVolStmts.

data GcStmts Source #

The GC tick's prepared statements, prepared once on the writer's volatile connection.

data CopierStmts Source #

The copy statements, prepared on the copier's immutable connection -- main is the immutable file, the volatile file is ATTACHed as vol.

prepareCopierStmts ∷ HasCallStack ⇒ Database → IO CopierStmts Source #

Prepare the copy statements on the copier's immutable connection, which must already have the volatile partition ATTACHed as vol.

prepareSweeperStmts ∷ HasCallStack ⇒ Database → IO SweeperStmts Source #

Prepare the sweep statements on the writer's volatile connection.