Skip to content

Instantly share code, notes, and snippets.

@fedme
Created September 5, 2018 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedme/e4af490a57455c8210bf6a54b425b479 to your computer and use it in GitHub Desktop.
Save fedme/e4af490a57455c8210bf6a54b425b479 to your computer and use it in GitHub Desktop.
How to access Ionic Storage SQLite DB from the console

How to access Ionic Storage SQLite DB from the console

var db = window.sqlitePlugin.openDatabase({name: 'NAME_OF_YOUR_STORAGE', location: 'default', androidDatabaseImplementation: 2});
db.transaction(function(tx) {
    tx.executeSql("SELECT * FROM _ionickv", [], function(tx, rs) {
		  var records = [];
		  for(var i=0; i<rs.rows.length;i++) {records.push(rs.rows.item(i));}
      console.log('ROWS', records);
    }, function(tx, error) {
      console.log('SELECT error: ' + error.message);
    });
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment