4

When using Safari's web inspector on an ios emulator that has an Ionic app loaded, I'd expect to see a database that was created listed under the Databases folder in the Storage tab of Safari's inspector window. My database is not shown at all.

Here's the code in the app to create and verify the database:

if (window.cordova) {
  var db = $cordovaSQLite.openDB({name: "my_media.db",location: 'default'} );
} else {
  var db =  window.openDatabase("my_media.db", '1', '', 1024 * 1024 * 100); // browser
}

var query = 'CREATE TABLE IF NOT EXISTS photos (photo_id,filename,active)';

$cordovaSQLite.execute(db, query).then(function(res) {
   console.log("db created");
}, function (err) {
   console.log("DB ERROR");
   console.error(err);
});

In the Safari console, I see:

OPEN database: my_media.db - OK

DB opened: my_media.db

db created

When I open the Storage tab, I do refresh the app...and yet still no database. So....where is the database in Safari web inspector?

lilbiscuit
  • 2,109
  • 6
  • 32
  • 53

0 Answers0