Search code examples
jquerysqlitecordovaphonegap

jQuery mobile with SQLite working sample


I try to make some kind of "rating diary" for kids during exercises. MY plan is to save grades locally, on tablet, without any Internet connection. At first I planned to build it on the top of IndexedDB but as I need some complex SQL-queries I decided to use SQLite. Honestly speaking, my experiences are with MySQL and MS SQL (Win 7) and never touched SQLite. The plan is to make & test jQ app locally, test it and then build with Phonegap Build Online. I made download of SQLite3.exe & dll and unpacked into \windows\system32. Then I started it by typing sqlite3.exe and copied some scripts I found on Net in order to understand how it's working but no one samples gave any result. So, guys and gals, where is possible to find out complete script of basic operation with SQLite: create and open DB, inser record, change (update), delete, findy by classic query eg. Select * from boys where jumpscore > ...? Thank you.


Solution

  • You should use indexedDB and to get rid of the idb complexity - you can use any idb library like jsstore, dexie etc.

    Still, if you want to use sql lite. Here is some links for using sqllite in cordova -

    http://www.oodlestechnologies.com/blogs/Sqlite-in-Cordova-Using-Cordova-Plugin

    https://codesundar.com/lesson/cordova-sqlite-storage/

    Hope this will help you.