import StorageManager from 'service-framework/src/storage-manager/StorageManager.js'
StorageManager
Constructor Summary
Public Constructor | ||
public |
constructor(db: *, storageName: *, version: number) |
Member Summary
Public Members | ||
public |
db: * |
|
public |
storageName: * |
Method Summary
Public Methods | ||
public |
Delete a entry from the database for a given key. |
|
public |
Get a entry value from the database for a given key. |
|
public |
getVersion(key: string): Promise Get a entry version from the database for a given key. |
|
public |
Adds a new entry to the database for a given key, together with its version. |
Public Constructors
Public Methods
public delete(key: string): Promise source
Delete a entry from the database for a given key.
Params:
Name | Type | Attribute | Description |
key | string |
|
key that was stored using storageManager.set |
public get(key: string): Promise source
Get a entry value from the database for a given key. If no entry is found undefined is returned.
Params:
Name | Type | Attribute | Description |
key | string |
|
key that was stored using storageManager.set |
public getVersion(key: string): Promise source
Get a entry version from the database for a given key. If no entry is found undefined is returned.
Params:
Name | Type | Attribute | Description |
key | string |
|
key that was stored using storageManager.set |
public set(key: string, version: string, value: *): Promise source
Adds a new entry to the database for a given key, together with its version. If an entry for the given key is already stored in the database, it will be updated.
Return:
Promise | result - Promise that will be fulfilled with the key if the entry was stored successfully, otherwise it is rejected with an error. |