How can i change my sqlite file path while creating it.

27 views
Skip to first unread message

sameer sarswat

unread,
Apr 27, 2015, 10:48:44 AM4/27/15
to phon...@googlegroups.com
Hello every body....

i am very new to Phonegap and trying to make a simple app in which i am using a sqlite db file to store information.

now the scenario is : when i am creating my database file by window.openDatabase(). it is creating an database file but i am not able to reach that file.

will you people please tell me how can i give my own path to this db?

Chris Brody

unread,
Apr 27, 2015, 11:51:17 AM4/27/15
to phon...@googlegroups.com
If you use window.openDatabase(), WebKit will always store your database file in the browser local data path and there is no way to change the behavior.

There are several versions of a sqlite plugin that store your database file in a known location, that can be adapted if you want to hack the source.

The version at github.com/litehelpers/Cordova-sqlite-storage gives you several options where to store the database file (iOS version only).

Chris
Reply all
Reply to author
Forward
0 new messages