Thinkwise / cordova-plugin-websql

Cordova WebSQL plugin for Windows Phone
4 stars 9 forks source link

Does not include Windows 8/8.1 SQLitePluginNative.winmd #11

Open joeljeske opened 9 years ago

joeljeske commented 9 years ago

The plugin versions an ARM & an x86 targeted .winmd and adds them to the solution/project. I do not see a winmd targeted for Windows RT (not phone). This means that the WebSQL proxy file has null pointer exceptions when trying to access the SQLitePluginNative object.

Reproduction Steps

  1. Add plugin to existing project
  2. Open project in VS and deploy CordovaApp.Windows80 or CordovaApp.Windows to the local machine.
  3. On the JS console, type, window.SQLitePluginNative and find it is undefined.

Am I missing a dependency? It not, this means that this plugin is only operable for Windows Phone 8/8.1

DickvdBrink commented 9 years ago

Hmz, to be honest I actually didn't test this scenario because I use this plugin with the indexedDbShim and use this plugin for websql support on phones. IndexedDb is available on the Windows platform.

Will check this out & hopefully fix this when I have some spare time! :) Thanks for reporting this!

joeljeske commented 9 years ago

Awesome thank you.

I am a little confused with your use case. Are you saying this plugin uses/expects IndexedDB as the database implementation? What is relationship between this plugin and IndexedDB?

DickvdBrink commented 9 years ago

Are you saying this plugin uses/expects IndexedDB as the database implementation?

Nope, I understand the confusion, sorry about that let me explain (and feel free to ask again if I'm not clear).

This story is about our use case not really about this plugin In our app where we use this plugin we support a lot of different platforms. Some support WebSql, some IndexedDb (but sometimes poorly) and Windows Phone doesn't support either of them.

So on Windows and newer Androids (4.4+) we actually use IndexedDb as a storage mechanism (in our app, not this plugin). Because Windows Phone, older android and iOS don't have support (or it might be very bad) we actually use IndexedDb over WebSql with a polyfill.

This is where we use this plugin for, the polyfill mimics the IndexedDb API and ports every call over to plain SQL statements and stores it in to a sqlite database. So this plugin is perfect for that as the polyfill just executes SQL.

This way when browser support improves for IndexedDb we actually switch over to the native indexedDb implementation.

What is relationship between this plugin and IndexedDB

Actually nothing, but as I write above I use it to mimic IndexedDb. I should not have brought that up because it was a bit irrelevant.. So in a few words: This plugin just brings SQLite/WebSql to Windows Phone (and hopefully in the future to Windows ;)).

Again sorry for the confusion and feel free to ask again if you have more questions.

joeljeske commented 9 years ago

Ok that makes much more sense. I was a little confused when reading the README but this clears it all up. Thanks!

joeljeske commented 9 years ago

Also, Im curious, what led to the decision to use a different implementing sqlite? The original fork used the Community.CsharpSqlite.SQLiteClient.WinRT.dll.

DickvdBrink commented 9 years ago

We had performance issues with the other plugin which we couldn't fix. We discovered that the issues we had originated from the SQLite implementation and we decided to create our own (and later we decided to opensource it)

edit We did have kind of large datasets so that was probably the real issue but we really needed that data locally...

TestVTeam commented 9 years ago

Please check if you can spare some time. I used your plugin to take advantage of async implementation. My app is on the verge of completion, but am stuck as this one doesn't work on windows. I am clueless about how to do this myself, else would have done and committed it here. Would like to thank for at least doing this for WP 8.1, though.

DickvdBrink commented 9 years ago

I really want to work on this so it works on Windows8 but I'm really busy. Will try to do this in my spare time. If I'm lucky it shouldn't be to much work either :)

DickvdBrink commented 9 years ago

ref #16