Class SqlCompoundCreditStore

Compound credit over SQL.

Implements

Constructors

Methods

  • Creates the tables unless the first and the newest of them, accounts and documents, answer a read already; does nothing with ensureSchema: false. A store made before the documents table gains it; every statement of the DDL is idempotent.

    Returns Promise<void>

  • Uses this store's rows inside the host's existing storage transaction, so host writes and credit rows commit or roll back together. It neither begins, commits, retries nor closes a transaction: the host owns commit, rollback, retry and lock ordering, and an error reaches the host's enclosing transaction. The schema must already exist.

    Type Parameters

    • T

    Parameters

    • transaction: StorageAdapter

      The host's active adapter transaction on this store's database.

    • fn: ((trx) => Promise<T>)

      Credit work, plus any host writes that must commit with it.

    Returns Promise<T>

    What fn answers.