From a1de6e1070e0b8fc69582e6ca19110f4089e9172 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 29 Sep 2015 18:38:51 -0500 Subject: [PATCH] Storage fixes --- ionic/platform/storage/sql.ts | 5 +++-- ionic/platform/storage/storage.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ionic/platform/storage/sql.ts b/ionic/platform/storage/sql.ts index 05222c8513..a219385d9b 100644 --- a/ionic/platform/storage/sql.ts +++ b/ionic/platform/storage/sql.ts @@ -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 diff --git a/ionic/platform/storage/storage.ts b/ionic/platform/storage/storage.ts index f1b2ede1fc..135f7f2a1f 100644 --- a/ionic/platform/storage/storage.ts +++ b/ionic/platform/storage/storage.ts @@ -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);