Is it possible to use a Sqlite database in a windows 8 (winRT) javascript application?
What I want to achieve is to download a Sqlite database and store this in local storage before use. I believe some form of local storage is available to javascript based WinRT applications, but I want to know if Sqlite is usable in this scenario.
I'm also aware that the .Net implementation of Sqlite uses some win32 calls and I believe these will not be allowed by the windows8 app cerififcation process.
JavaScript has HTML5 IndexedDB available to it out of the box.
As for SQLite, you can use it, provided that you first wrap it as a WinRT component that can be consumed from JavaScript, e.g. using C++/CX. Its API surface is not that big, so it's certainly possible. I've experimented with compiling SQLite for Metro a while ago, and there were only a few Win32 API calls that were not available in the app container and had to be replaced - nothing major.
We created SQLite3-WinRT for this. It is a WinRT component wrapper for SQLite that passes the Windows metro style app certification. It also includes an easy-to-use JavaScript abstraction.
Take a look at this: http://sqlwinrt.codeplex.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With