tarlatan
    Preparing search index...

    Function readStoreVersion

    • Reads PRAGMA user_version on db, decodes it with a Schema into an integer and asks Domain's decideStoreVersion what it allows for a store whose known version is known (knownLedgerVersion or knownLogVersion). A thrown SQLite error or a row that does not decode becomes the store's own error through failure. Reads only. Inside a transaction the read is the transaction's, since the field is in the header on page 1.

      Type Parameters

      • E

      Parameters

      • db: Database
      • known: number
      • failure: (error: unknown) => E

      Returns Effect<StoreVersionRead, E>