Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SyncKeyValueRWTransaction

A read-write transaction for a synchronous key value store.

Hierarchy

Implemented by

Index

Methods

Methods

abort

  • abort(): void

commit

  • commit(): void

del

  • del(key: string): void

get

  • get(key: string): Buffer | undefined
  • Retrieves the data at the given key. Throws an ApiError if an error occurs or if the key does not exist.

    Parameters

    • key: string

      The key to look under for data.

    Returns Buffer | undefined

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

put

  • put(key: string, data: Buffer, overwrite: boolean): boolean
  • Adds the data to the store under the given key.

    Parameters

    • key: string

      The key to add the data under.

    • data: Buffer

      The data to add to the store.

    • overwrite: boolean

      If 'true', overwrite any existing data. If 'false', avoids storing the data if the key exists.

    Returns boolean

    True if storage succeeded, false otherwise.

Generated using TypeDoc