I made a database using phonegap[cordova 1.7.0] sqlite on IOS5.
But I now want to switch this database with one that I already have on an online server.
Is there some method to do that ?
Thanks a lot.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understood correctly you want to use your current logic for handling database access to connect to remote sqlite database.
I think such use case is not possible out of the box. Cordova is using support for WebSQL built into iOS and Android (or provides own compatible implementation).
There are at least 2 solutions to your problem:
Create service which allows access to your remote database, and then create client side sync service which synchronizes that on the client and server. This way you will have full offline support plus data will be backed up on the server.
Write your own Cordova plugin which allows access to remote sqlite databases but uses WebSQL interface. I guess you could reuse most of the current logic from iOS WebSQL implementation, but instead of accessing local sqlite file on the device, use the database on the server.