include a sqlite database file


Ryan Sytsma
When I create a Cordova build, how can I include a sqlite file? I have added the sqlite file to the app files manager and it sets the path to the file automatically. Can the database file reside there or does it have to be a different location? If I do something like this in JS I am not sure what location:'default' is in relation to where AB want to put included files. Ryan

DecSoft

Hello Sytsma,

Please, refer here the SQLite library that you are using. The file that you add using the File Manager is placed inside the app, so probably something like "name: 'pts.db3'," can't work, since we need to refer to the file using a relative path like "app/files/pts.db3". Please, try that file path, and take a look at the app files and assert hat "pts.db3" is certainly in the "app/files" diretory as expected.

I am not completely sure if that file can be writable in a platform like Android... but you can see this later... the first thing is to provide the right path for the file and see what happen: even if we can't write to the database, in principle we can read it, so we can test if we can read it.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.