我可以在WinRT应用程序(javascript)中使用Sqlite吗? [英] Can I use Sqlite in a WinRT application (javascript)?

查看:121
本文介绍了我可以在WinRT应用程序(javascript)中使用Sqlite吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Windows 8(winRT)javascript应用程序中使用Sqlite数据库?

Is it possible to use a Sqlite database in a windows 8 (winRT) javascript application?

我想要实现的是下载一个Sqlite数据库并存储它在使用前在本地存储。我相信基于javascript的WinRT应用程序可以使用某种形式的本地存储,但我想知道Sqlite在这种情况下是否可用。

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.

我也知道Sqlite的.Net实现使用了一些win32调用,我相信windows8 app cerififcation进程不会允许这些调用。

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提供HTML5 IndexedDB开箱即用。

JavaScript has HTML5 IndexedDB available to it out of the box.

至于SQLite,您可以使用它,前提是您首先将其包装为可以从JavaScript中使用的WinRT组件,例如使用C ++ / CX。它的API表面不是那么大,所以它当然是可能的。我刚刚尝试过编译SQLite for Metro,并且只有少数Win32 API调用在应用程序容器中不可用并且必须被替换 - 没什么大不了的。

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.

这篇关于我可以在WinRT应用程序(javascript)中使用Sqlite吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆