Class Transaction<T>Abstract

A transaction for a store.

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.

    Parameters

    • ino: bigint

      The key to look under for data.

    Returns Promise<Uint8Array>

  • 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.

  • Deletes the data at the given key.

    Parameters

    • ino: bigint

      The key to delete from the store.

    Returns Promise<void>

  • Deletes the data at the given key.

    Parameters

    • ino: bigint

      The key to delete from the store.

    Returns void

  • 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.