Ionic SqlStorage

I have problem on android device (android 5.x)
The code

   this.storage = new Storage(SqlStorage, { name: 'home-money' });
    this.dialyTransactionLimit = this.settings.getDialyLimit();
    let transactionTableSetup = 'id INTEGER PRIMARY KEY AUTOINCREMENT,amount REAL, description TEXT, isSynchronized INTEGER, timestamp DATETIME DEFAULT CURRENT_TIMESTAMP'
            this.storage.query(`CREATE TABLE IF NOT EXISTS transactions (${transactionTableSetup})`).then(() => {
                this.storage.set('version', 1)
            });

Work on destop browser but on android device that throw:

SQLitePlugin.js:175 OPEN database: home-money
3SQLitePlugin.js:106 new transaction is waiting for open operation
SQLitePlugin.js:179 OPEN database: home-money - OK
SQLitePlugin.js:80 DB opened: home-money

Source code can be found here here

How I can fix this one

This seems to be normal, this happens when the opening of the app is in process and you execute a query on it, so the query (which is a transaction query under the hood) is queued, thus showing that it’s waiting for the opening operation.

In my app it happens as well, the app works ok though.

1 Like

Ok so why on android device( samsung galaxy s4 ) the data base has not created?

It is created, just not shown in the chrome inspect window, unless you get an explicit error that says error opening the database then it just isn’t shown in the device.