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 commited or aborted

store: T

Methods

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

    Parameters

    • ino: 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 the given key. Overwrites any existing data.

    Parameters

    • ino: 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 the given key.

    Parameters

    • ino: bigint

      The key to add the data under.

    • data: Uint8Array

      The data to add to the store.

    Returns void

    True if storage succeeded, false otherwise.