Adapter for native SQLite via plugin on Cordova/Phonegap platform - #221
Adapter for native SQLite via plugin on Cordova/Phonegap platform#221dpa99c wants to merge 1 commit into
Conversation
|
Wow, this looks really good, Dave. I haven't packaged to PhoneGap in about a year so I'd like for someone else to download this and provide their experiences before merging it. |
|
Sure thing, a peer review is a good idea. I'm particularly not sure how best to merge the cordova spec project with your existing repo. |
|
Could you elaborate how your adapter might not merge well? Sometimes the core must be modified to accommodate a more complex feature. I read your modifications. Other than a couple unnecessary whitespace changes, everything looks fine to me. For the benefit of whoever reviews your plugin, what's your concern? |
|
While the adapter is functionally very similar to the WebSQL adapter, it's the spec that's a bit tricky. While the other adapters can easily be tested in a desktop browser, hence the qunit tests being run as part of the Make build, this adapter can only be tested from within a Cordova app running on a mobile platform where a native SQLite DB can be made available. Therefore testing this adapter is a manual process that can't be easily automated like for the other adapters. But if you live with that then I can integrate my Cordova test project with the lawnchair repo and update the Make script to deploy the lawnchair and qunit assets to it. That was all :-) |
|
Does the Cordova SQLite implementation require a row's primary key be 'id'? It doesn't allow for a different row key or for compound keys? If it does, the adapter needs to use the methods that hook into the 'keyPath' plugin so users can customize table columns and constraints. |
This adapter is specifically for Cordova/Phonegap.
Advantages are:
I realise it doesn't quite fit with other adapters; particularly when it comes to testing, the existing qunit tests will not work with it as it must be executed in a Cordova environment. I've created a Cordova project which adapts the qunit tests to run in the Cordova environment with this adapter and the others. This could be potentially combined with your existing repo if you wanted.
Understand if it's a bit out of scope and you want to bounce the pull request :-)