1

I'm just curious about the default key-value usage.

import {Storage, SqlStorage } from 'ionic-angular';

let storage = new Storage(SqlStorage);
storage.set(key, value);
storage.get(key).then((value) => { ... });

Where can I find the sqlite file(s)?

I assume I will be able to read/write outside of the app; is that true? Honestly I'm only interested for debugging reasons, so it would be okay if I can only have read access, and only after the app is closed. And I particularly interested on my desktop during development (as opposed to on a device). Do I have to use the backup file option and specify my own path for the database in order to do that?

jmilloy
  • 7,875
  • 11
  • 53
  • 86

2 Answers2

2

the documentation states it is stored to WebSQL unless you have installed the SQLite Plugin

First few lines of the documentation...

http://ionicframework.com/docs/v2/api/platform/storage/SqlStorage/

Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
  • Ah, hmm. I think that the first few lines of the documentation *actually* say that it uses WebSQL if serving the app to a browser, regardless of whether the sqlite plugin is available. Thanks. So, question still stands: where is the data stored (when the sqlite plugin is installed or when WebSQL is installed)? – jmilloy Sep 02 '16 at 02:25
  • 2
    if you open the chrome debugger and click applications, you can see the database(s) that hold the data... also see this for ios - http://stackoverflow.com/questions/4644158/how-to-view-the-data-in-sqlite-file-running-in-iphone-application?noredirect=1&lq=1 – Aaron Saunders Sep 02 '16 at 02:42
  • Documentation link is broken. – maninak Jun 06 '17 at 16:08
0

The default database file name within the app storage folder will be '__ionicstorage' per the source here:

https://github.com/driftyco/ionic/blob/f477aa2391922a399acde23bf50ff095b12a287d/src/storage/sql.ts