Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Sqlite in a WinRT application (javascript)?

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.

like image 745
AwkwardCoder Avatar asked Oct 20 '11 11:10

AwkwardCoder


3 Answers

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.

like image 107
Pavel Minaev Avatar answered Nov 05 '22 06:11

Pavel Minaev


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.

like image 5
superquadratic Avatar answered Nov 05 '22 06:11

superquadratic


Take a look at this: http://sqlwinrt.codeplex.com/

like image 2
Raman Sharma Avatar answered Nov 05 '22 08:11

Raman Sharma