Class SyncTransaction<T>Abstract

Transaction that implements asynchronous operations with synchronous ones

Type Parameters

Hierarchy (view full)

Constructors

Properties

done: boolean = false

Whether the transaction was committed or aborted

store: T

Methods

  • Retrieves data. Throws an error if an error occurs or if the key does not exist.

    Parameters

    • id: bigint

      The key to look under for data.

    Returns Uint8Array

    The data stored under the key, or undefined if not present.

  • Adds the data to the store under an id. Overwrites any existing data.

    Parameters

    • id: bigint

      The key to add the data under.

    • data: Uint8Array

      The data to add to the store.

    Returns Promise<void>

  • Adds the data to the store under and id.

    Parameters

    • id: bigint

      The key to add the data under.

    • data: Uint8Array

      The data to add to the store.

    Returns void