Documentation

DocGen4.DB.Read

Reading from the Database #

This module contains the code used to read from the database. ReadDB is a structure of functions (like WriteDB) that load module data from a SQLite database. Each function wraps a prepared statement from ReadStmts.

ReadDB is constructed via mkReadDB (called from openForReading in DocGen4.DB). A single ReadDB can be shared across tasks without corruption due to the implicit state associated with SQLite prepared statements because the statements are behind a mutex, but for parallel workloads each task should call openForReading to get its own connection. See htmlOutputResultsParallel in DocGen4.Output.

Column access in the read methods uses positional indices (e.g., stmt.columnInt64 3) that must match the column order in the corresponding SQL query. When modifying a query, make sure to update the column indices in the reader method to match.

def DocGen4.DB.withDbContext {m : TypeType u_1} {α : Type} [MonadLiftT BaseIO m] [MonadControlT IO m] [Monad m] (context : String) (act : m α) :
m α
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Instances For
      def SQLite.Stmt.bind {α : Type u_1} [NullableQueryParam α] (stmt : Stmt) (index : Int32) (param : α) :
      Equations
      Instances For

        Reads RenderedCode from a blob.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For