mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
Storage fixes
This commit is contained in:
@ -94,12 +94,13 @@ export class SqlStorage extends StorageEngine {
|
||||
* like SELECT, INSERT, and UPDATE.
|
||||
*
|
||||
* @param {string} query the query to run
|
||||
* @param {array} params the additional params to use for query placeholders
|
||||
* @return {Promise} that resolves or rejects with an object of the form { tx: Transaction, res: Result (or err)}
|
||||
*/
|
||||
query(query) {
|
||||
query(query, ...params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._db.transaction((tx) => {
|
||||
ts.executeSql(query, [], (tx, res) => {
|
||||
ts.executeSql(query, params, (tx, res) => {
|
||||
resolve({
|
||||
tx: tx,
|
||||
res: res
|
||||
|
@ -8,8 +8,8 @@
|
||||
* during low disk space situations.
|
||||
*/
|
||||
export class Storage {
|
||||
constructor(strategyCls: StorageEngine) {
|
||||
this._strategy = new strategyCls();
|
||||
constructor(strategyCls: StorageEngine, options) {
|
||||
this._strategy = new strategyCls(options);
|
||||
}
|
||||
get(key) {
|
||||
return this._strategy.get(key);
|
||||
|
Reference in New Issue
Block a user