react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

Locate the updated database of pre-populated database

Open HarshitMadhav opened this issue 5 years ago • 0 comments

Hi! I have a pre-populated database with only tables and I am using code something like this to open the database:

var db =  SQLite.openDatabase(
  {
    name: 'SQLite',
    location: 'default',
    createFromLocation: '~newmydb.sql',
  },
  () => { console.log("Database opened")},
  error => {
    console.log("ERROR: " + error);
  }
);

I have put the database inside path android\app\src\main\assets

I did react-native run-android autolink also done. Everything working fine 💯 opening database , all queries also executes but the problem is when I go back to the android\app\src\main\assets folder I see same size of db as it was when initially. I have inserted almost 80-90 new rows to the tables but still the db file is the same size although I am able to fetch those values inside app. MAYBE I am doing something wrong or missing something here? but inside app I am able to fetch those rows from database.

If anyone could help me locating the path of the updated database of pre-populated database file?

HarshitMadhav avatar Aug 15 '20 15:08 HarshitMadhav