I’m building an app that uses a Sqlcipher database (vanilla js), so the first action when the user opens the app is to type the DB password. Then the login page will send the DB info to the main-view-model.js like this:
page.bindingContext = createViewModel(db);
The createViewModel contains all the other functions to add and select data from the DB, so in order to make this information accessible for all the other pages I need to open the DB again and then page.bidingContext in each one of them. Without doing what it’s in bold I get errors like “db is not defined”.This procedure will work perfectly for a non-encrypted DB, otherwise I’d have to ask the user to type the password each time the app needs to request some info.
So, my intention is to open the DB from the login page, passing the info to the createViewModel function and then make all the necessary calls without having to open it again.