Skip to main content

BaseKeyValueStoreClient

Abstract base class for key-value store resource clients.

These clients are specific to the type of resource they manage and operate under a designated storage client, like a memory storage client.

Hierarchy

Index

Methods

delete

  • async delete(): None
  • Permanently delete the key-value store managed by this client.


    Returns None

delete_record

  • async delete_record(*, key): None
  • Delete the specified record from the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      The key of the record which to delete.

    Returns None

get

get_public_url

  • async get_public_url(*, key): str
  • Get the public URL for the given key.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record for which URL is required.

    Returns str

get_record

  • Retrieve the given record from the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns KeyValueStoreRecord | None

get_record_as_bytes

  • Retrieve the given record from the key-value store, without parsing it.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns KeyValueStoreRecord[bytes] | None

list_keys

  • List the keys in the key-value store.


    Parameters

    • optionalkeyword-onlylimit: int = 1000

      Number of keys to be returned. Maximum value is 1000.

    • optionalkeyword-onlyexclusive_start_key: str | None = None

      All keys up to this one (including) are skipped from the result.

    Returns KeyValueStoreListKeysPage

set_record

  • async set_record(*, key, value, content_type): None
  • Set a value to the given record in the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      The key of the record to save the value to.

    • optionalkeyword-onlyvalue: Any

      The value to save into the record.

    • optionalkeyword-onlycontent_type: str | None = None

      The content type of the saved value.

    Returns None

stream_record

  • Retrieve the given record from the key-value store, as a stream.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns AsyncContextManager[KeyValueStoreRecord[Response] | None]

update

  • Update the key-value store metadata.


    Parameters

    • optionalkeyword-onlyname: str | None = None

      New new name for the key-value store.

    Returns KeyValueStoreMetadata