Skip to main content
Version: Next

KeyValueStoreBackend

Key-value Store client.

Index

Methods

deleteValue

  • deleteValue(key): Promise<void>
  • Delete a record by key.


    Parameters

    • key: string

    Returns Promise<void>

drop

  • drop(): Promise<void>
  • Remove the key-value store and all its data.


    Returns Promise<void>

getMetadata

  • Returns metadata about the key-value store (id, name, timestamps, etc.).

    Implementations should throw if the underlying storage no longer exists (e.g. it was deleted externally). This method should never return stale data for a storage that has been removed.


    Returns Promise<KeyValueStoreInfo>

getPublicUrl

  • getPublicUrl(key): Promise<undefined | string>
  • Get the public URL for a record, or undefined if unavailable.


    Parameters

    • key: string

    Returns Promise<undefined | string>

getValue

  • Get a record by key. Returns the raw bytes plus content type, or undefined if not found.

    Clients are byte transports and must not parse the body — the KeyValueStore frontend interprets it according to the content type.


    Parameters

    • key: string

    Returns Promise<undefined | KeyValueStoreRecord>

listKeys

  • List a single page of keys in the store. Returns at most limit keys starting after exclusiveStartKey, wrapped in a self-describing page.

    Like DatasetBackend.getData, this returns one page rather than the whole collection; assembling all pages (e.g. for KeyValueStore.keys()) is the frontend's job. The result carries a cursor (isTruncated / nextExclusiveStartKey) so the frontend can paginate deterministically instead of inferring the end from items.length < limit.


    Parameters

    Returns Promise<KeyValueStoreListKeysResult>

purge

  • purge(): Promise<void>
  • Remove all records from the store but keep the store itself.


    Returns Promise<void>

recordExists

  • recordExists(key): Promise<boolean>
  • Check whether a record with the given key exists.


    Parameters

    • key: string

    Returns Promise<boolean>

setValue

  • setValue(record): Promise<void>