A concrete implementation of BaseStore for interacting with a Cassandra database. It provides methods to get, set, delete, and yield keys based on specified criteria.

Hierarchy

  • BaseStore<string, Uint8Array>
    • CassandraKVStore

Constructors

Properties

inClauseSize: number = 1000
yieldKeysFetchSize: number = 5000

Methods

  • Deletes multiple keys and their associated values from the Cassandra database.

    Parameters

    • keys: string[]

      An array of keys to delete from the database.

    Returns Promise<void>

    A promise that resolves when all specified keys have been deleted.

  • Retrieves the values associated with an array of keys from the Cassandra database. It chunks requests for large numbers of keys to manage performance and Cassandra limitations.

    Parameters

    • keys: string[]

      An array of keys for which to retrieve values.

    Returns Promise<(undefined | Uint8Array)[]>

    A promise that resolves with an array of Uint8Array or undefined, corresponding to each key.

  • Sets multiple key-value pairs in the Cassandra database. Each key-value pair is processed to ensure compatibility with Cassandra's storage requirements.

    Parameters

    • keyValuePairs: [string, Uint8Array][]

      An array of key-value pairs to set in the database.

    Returns Promise<void>

    A promise that resolves when all key-value pairs have been set.

  • Yields keys from the Cassandra database optionally based on a prefix, based on the store's keyDelimiter. This method pages through results efficiently for large datasets.

    Parameters

    • Optional prefix: string

      An optional prefix to filter the keys to be yielded.

    Returns AsyncGenerator<string, any, unknown>

    An async generator that yields keys from the database.

Generated using TypeDoc