IObjectStore
Extends:
Direct Subclass:
Indirect Subclass:
Implements:
Direct Implemented:
Indirect Implemented:
This interface represents an object store (roughly corresponding to a table in a relational database). It stores key-value pairs where the key is generally considered to be a string and the value is any object. The key is the entry's primary key. Other keys within the object may be accessed by indices as offered by the store.
Method Summary
Public Methods | ||
public abstract |
async put(key: string, value: *): Promise Inserts or replaces a key-value pair. |
|
public abstract |
async remove(key: string): Promise Removes the key-value pair of the given key from the object store. |
|
public abstract |
synchronousTransaction(enableWatchdog: boolean): SynchronousTransaction Creates a new synchronous transaction, ensuring read isolation on the most recently successfully committed state. |
|
public abstract |
transaction(enableWatchdog: boolean): Transaction Creates a new transaction, ensuring read isolation on the most recently successfully committed state. |
Inherited Summary
From class IReadableObjectStore | ||
public get |
connected: boolean |
|
public get abstract |
A map of index names to indices. |
|
public abstract |
async close(): Promise Closes the object store and potential connections. |
|
public abstract |
Returns the count of entries in the given range. |
|
public abstract |
decode(value: *, key: string): * Method called to decode a single value. |
|
public abstract |
encode(value: *): * Method called to encode a single value. |
|
public abstract |
async get(key: string, options: RetrievalConfig): Promise<*> Returns a promise of the object stored under the given primary key. |
|
public abstract |
Returns the index of the given name. |
|
public abstract |
isSynchronous(): boolean Checks whether an object store implements the ISynchronousObjectStore interface. |
|
public abstract |
Iterates over the keys in a given range and direction. |
|
public abstract |
Returns a promise of a set of keys fulfilling the given query. |
|
public abstract |
Returns a promise of the key being maximal for the given range. |
|
public abstract |
Returns a promise of the object whose primary key is maximal for the given range. |
|
public abstract |
Returns a promise of the key being minimal for the given range. |
|
public abstract |
Returns a promise of the object whose primary key is minimal for the given range. |
|
public abstract |
async truncate(): Promise Empties the object store. |
|
public abstract |
valueStream(callback: function(value: *, key: string): boolean, ascending: boolean, query: KeyRange): Promise Iterates over the keys and values in a given range and direction. |
|
public abstract |
Returns a promise of an array of objects whose primary keys fulfill the given query. |
|
protected abstract |
async _apply(tx: Transaction): Promise Internally applies a transaction to the store's state. This needs to be done in batch (as a db level transaction), i.e., either the full state is updated or no changes are applied. |
Public Methods
public abstract async put(key: string, value: *): Promise source
Inserts or replaces a key-value pair.
Params:
Name | Type | Attribute | Description |
key | string | The primary key to associate the value with. |
|
value | * | The value to write. |
Return:
Promise | The promise resolves after writing to the current object store finished. |
public abstract async remove(key: string): Promise source
Removes the key-value pair of the given key from the object store.
Params:
Name | Type | Attribute | Description |
key | string | The primary key to delete along with the associated object. |
Return:
Promise | The promise resolves after writing to the current object store finished. |
public abstract synchronousTransaction(enableWatchdog: boolean): SynchronousTransaction source
Creates a new synchronous transaction, ensuring read isolation on the most recently successfully committed state.
Params:
Name | Type | Attribute | Description |
enableWatchdog | boolean |
|
Boolean allows to disable watchdog timer. |
public abstract transaction(enableWatchdog: boolean): Transaction source
Creates a new transaction, ensuring read isolation on the most recently successfully committed state.
Params:
Name | Type | Attribute | Description |
enableWatchdog | boolean |
|
Boolean allows to disable watchdog timer. |