4

I am updating the app store with an Ionic version of an old Titanium/Alloy app. The Alloy sql.js sync adapter has:

var ALLOY_DB_DEFAULT = "_alloy_";

A backup of a phone running the old app made with iExplorer contains the file:

(App)/Library/Private Documents/_alloy_.sql

Can I access this database like this in Ionic?

    db = window.sqlitePlugin.openDatabase({
      name: '_alloy_.sql',
      location: 1,
    })

I am trying to run the old app and test the migration, but Titanium Studio is very difficult to get going at this point. My migration works well if I just stuff the old _alloy_.sql file into the iOS Simulator at:

~/Library/Developer/CoreSimulator/Devices/<id>/data/Containers/Data/Application/<id>/Library/
Joe Beuckman
  • 2,264
  • 2
  • 24
  • 63
  • weird to go from a native app to a webview ;) But any file made by Titanium should also be readable by other technology. – Rene Pot Oct 09 '17 at 08:48

1 Answers1

3

Old thread response, hopefully someone still finds the answer useful.

We've solved our own bounty.

The database is stored in the IOS Library in the 'Private Data' directory with the filename _alloy_.sql

let tiAppOptions = {name: "Private Documents/_alloy_.sql", iosDatabaseLocation: 'Library'};

this.sqlite.create(tiAppOptions).then((db: SQLiteObject) => {
    db.executeSql("SELECT * from table_name", {}).then((data) => {
        //do something with the data.
    });
}, err => {
   console.log(err);
});

Android is stored in the 'default' location with filename _alloy_.sql

HGSSO
  • 55
  • 1
  • 8