IReadModelStore
API reference for IReadModelStore
Interface: IReadModelStore
Section titled “Interface: IReadModelStore”Core read model store interface compatible with multiple database types. Provides methods for storing, retrieving, deleting, and listing key-value pairs.
Methods
Section titled “Methods”batchDelete()?
Section titled “batchDelete()?”
optional
batchDelete(keys
,options?
):Promise
<boolean
[]>
Batch deletion of multiple items
Parameters
Section titled “Parameters”string
[]
Array of keys to delete
options?
Section titled “options?”Optional settings for the batch delete operation
Returns
Section titled “Returns”Promise
<boolean
[]>
A promise that resolves with an array of booleans indicating success/failure
batchGet()?
Section titled “batchGet()?”
optional
batchGet<T
>(keys
,options?
):Promise
<unknown
[]>
Batch retrieval of multiple items by their keys
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”string
[]
Array of keys to retrieve
options?
Section titled “options?”Optional settings for the batch get operation
Returns
Section titled “Returns”Promise
<unknown
[]>
A promise that resolves with an array of key-value pairs
batchPut()?
Section titled “batchPut()?”
optional
batchPut<T
>(items
,options?
):Promise
<void
>
Batch storage of multiple items
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”object
[]
Array of key-value pairs to store
options?
Section titled “options?”WriteOptions
& ExpirationOptions
Optional settings for the batch put operation
Returns
Section titled “Returns”Promise
<void
>
A promise that resolves when all values have been stored
delete()
Section titled “delete()”delete(
key
,options?
):Promise
<boolean
>
Deletes a value by its key.
Parameters
Section titled “Parameters”string
The key of the value to delete
options?
Section titled “options?”Optional settings for the delete operation
Returns
Section titled “Returns”Promise
<boolean
>
A promise that resolves to true if the key existed and was deleted, false otherwise
get<
T
>(key
,options?
):Promise
<null
|T
>
Retrieves a value by its key.
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”string
The key of the value to retrieve
options?
Section titled “options?”Optional settings for the retrieval operation
Returns
Section titled “Returns”Promise
<null
| T
>
A promise that resolves with the value, or null if not found
getAll()
Section titled “getAll()”getAll<
T
>(options?
):Promise
<unknown
[]>
Retrieves all values, optionally filtered by a key prefix.
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional settings for retrieving all values
Returns
Section titled “Returns”Promise
<unknown
[]>
A promise that resolves with an array of key-value pairs
getCapabilities()?
Section titled “getCapabilities()?”
optional
getCapabilities():StoreCapabilities
Returns the capabilities of this store implementation
Returns
Section titled “Returns”Store capabilities object
getNativeClient()?
Section titled “getNativeClient()?”
optional
getNativeClient<C
>():C
Gets access to the native database client Allows for direct operations using the underlying database API
Type Parameters
Section titled “Type Parameters”C
= unknown
Returns
Section titled “Returns”C
The native client instance
listKeys()?
Section titled “listKeys()?”
optional
listKeys(options?
):Promise
<{cursor?
:string
;keys
:object
[];list_complete
:boolean
; }>
Lists keys in the store, optionally filtered by prefix.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional settings for the list operation
cursor?
Section titled “cursor?”string
limit?
Section titled “limit?”number
prefix?
Section titled “prefix?”string
tableName?
Section titled “tableName?”string
Returns
Section titled “Returns”Promise
<{ cursor?
: string
; keys
: object
[]; list_complete
: boolean
; }>
A promise that resolves with the list result containing keys and metadata
put<
T
>(key
,value
,options?
):Promise
<void
>
Stores a value with the given key. If the key already exists, the value will be overwritten.
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”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)
options?
Section titled “options?”WriteOptions
& ExpirationOptions
& MetadataOptions
Optional settings for the storage operation
Returns
Section titled “Returns”Promise
<void
>
A promise that resolves when the value has been stored
query()?
Section titled “query()?”
optional
query<T
>(options
):Promise
<unknown
[]>
Query items using filter criteria or options
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”options
Section titled “options”QueryOptions
& object
Query options and filter criteria
Returns
Section titled “Returns”Promise
<unknown
[]>
A promise that resolves with matching items