Closed ipetepete closed 8 years ago
Doing this is quite trivial. I will post full instructions on GIT later but will try to quickly explain how to here.
adding createFromLocation makes the plugin read your file as template..
That should do it
Would you confirm this works for you and I will close the issue?
Sorry this didn't work. I created a new folder 'storage' added it to the project via 'Create Folder References'
One of the log outputs says this:
using db location: docs
I can try and manipulate the file location within the app and try and get it into the Documents directory to see if that works, but it seems like it is an unnecessary step.
You cannot have a 'storage' folder - it has to be named 'www'. database file should be a child of this folder and must be named exactly the same as the name of db in opendatabase call.
If it doesn't work after you make this adjustment, can you include opendb call you use an provide a screenshot of parent project structure showing how the file is included.
YAY! That worked. Sorry about that, www seems like such an unrelated name for a directory, but it works, thats all that matters.
Thank you!
remember Cordova heritage of this plugin...glad it worked. Maybe I will change the name to something more intuitive in the future..
var db = SQLite.openDatabase({name: "roommate", createFromLocation : 1});
and i didn't got data, :(
"roommate.db" ??
I have a pre-filled sqlite database, what steps are required to get this to open the provided file vs creating a new one?
my db file is called
trivia.sqlite
I'm using this to open it:It opens fine but when I try to get some data out it says:
code 5: 'no such table'