new Sqlite3ConsumerDb(databaseFilePath)
Sqlite3ConsumerDb extends ConsumerDb to implement the storage of decryption
keys for the consumer using SQLite3.
Create a Sqlite3ConsumerDb to use the given SQLite3 file.
Parameters:
Name | Type | Description |
---|---|---|
databaseFilePath |
string | The path of the SQLite file. |
- Source:
Throws:
ConsumerDb.Error for a database error.
Methods
addKeyPromise(keyName, keyBlob, useSync) → {Promise}
Add the key with keyName and keyBlob to the database.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The key name. |
keyBlob |
Blob | The encoded key. |
useSync |
boolean | (optional) If true then return a rejected promise since this only supports async code. |
- Source:
Returns:
A promise that fulfills when the key is added, or that
is rejected with ConsumerDb.Error if a key with the same keyName already
exists, or other database error.
- Type
- Promise
deleteKeyPromise(keyName, useSync) → {Promise}
Delete the key with keyName from the database. If there is no key with
keyName, do nothing.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The key name. |
useSync |
boolean | (optional) If true then return a rejected promise since this only supports async code. |
- Source:
Returns:
A promise that fulfills when the key is deleted (or there
is no such key), or that is rejected with ConsumerDb.Error for a database
error.
- Type
- Promise
getKeyPromise(keyName, useSync) → {Promise}
Get the key with keyName from the database.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The key name. |
useSync |
boolean | (optional) If true then return a rejected promise since this only supports async code. |
- Source:
Returns:
A promise that returns a Blob with the encoded key (or an
isNull Blob if cannot find the key with keyName), or that is
rejected with ConsumerDb.Error for a database error.
- Type
- Promise
getPromise_()
Call Sqlite3Promise.getPromise, wrapping an Error in ConsumerDb.Error.
- Source:
runPromise_()
Call Sqlite3Promise.runPromise, wrapping an Error in ConsumerDb.Error.
- Source: