Skip to content

HttpReadModelStore

API reference for HttpReadModelStore

@delta-base/toolkit


HTTP-based external store (for APIs, databases, etc.)

new HttpReadModelStore(baseUrl, headers): HttpReadModelStore

string

Record<string, string> = {}

HttpReadModelStore

delete(key, options?): Promise<boolean>

Deletes a value by its key.

string

The key of the value to delete

WriteOptions

Optional settings for the delete operation

Promise<boolean>

A promise that resolves to true if the key existed and was deleted, false otherwise

IReadModelStore.delete


get<T>(key, options?): Promise<null | T>

Retrieves a value by its key.

T = unknown

string

The key of the value to retrieve

ReadOptions

Optional settings for the retrieval operation

Promise<null | T>

A promise that resolves with the value, or null if not found

IReadModelStore.get


getAll<T>(options?): Promise<object[]>

Retrieves all values, optionally filtered by a key prefix.

T = unknown

QueryOptions

Optional settings for retrieving all values

Promise<object[]>

A promise that resolves with an array of key-value pairs

IReadModelStore.getAll


getCapabilities(): StoreCapabilities

Returns the capabilities of this store implementation

StoreCapabilities

Store capabilities object

IReadModelStore.getCapabilities


getNativeClient<C>(): C

Gets access to the native database client Allows for direct operations using the underlying database API

C = {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

C

The native client instance

IReadModelStore.getNativeClient


put<T>(key, value, options?): Promise<void>

Stores a value with the given key. If the key already exists, the value will be overwritten.

T = unknown

string

The key under which to store the value

T

The value to store (string, ArrayBuffer, or any type that can be serialized to JSON)

WriteOptions & ExpirationOptions & MetadataOptions

Optional settings for the storage operation

Promise<void>

A promise that resolves when the value has been stored

IReadModelStore.put