marconi-core-1.2.0.0: Modular indexing for rewindable ledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Marconi.Core.Transformer.WithCatchup.SQLite

Synopsis

Documentation

createIndexTable #

Arguments

:: Text

Pretty name of the indexer

-> Trace IO Text

Trace for logging.

-> Connection

SQLite database connection

-> String

SQLite index name

-> Query

SQL statement for creating the index table

-> IO () 

Utility function for creating an SQLite database index.

Typically used with WithCatchup as a way to create SQLite indexes when fully synchronized. This function includes some logging so that the user is informed when the creation of the SQLite indexes is done.

An example would look like:

  let stdoutTrace = ...
      c = ...
      slotNoIndexName = "utxo_slotNo"
      createSlotNoIndexStatement =
        "CREATE INDEX IF NOT EXISTS "
          <> fromString slotNoIndexName
          <> " ON utxo (slotNo)"
  createIndexTable Utxo stdoutTrace c slotNoIndexName createSlotNoIndexStatement