简体   繁体   English

本地数据库选择(Windows Phone 8.1应用程序)

[英]Local database choice (Windows Phone 8.1 application)

I am in the process of making a relatively complex Windows Phone 8.1 application and I need a way to store data from server's database into a local database. 我正在开发一个相对复杂的Windows Phone 8.1应用程序,我需要一种将服务器数据库中的数据存储到本地数据库中的方法。 Data from server is retrieved in JSON format via API. 通过API以JSON格式检索来自服务器的数据。 What are my options here? 我在这里有什么选择? I've tried SQLite database controlled by sqlite-net but it lacks key features such as foreign keys support and 64bit support (?). 我已经尝试过由sqlite-net控制的SQLite数据库,但是它缺少诸如外键支持和64位支持(?)之类的关键功能。 What other choices do I have? 我还有其他选择吗? Local database is used in order to give the user ability to work offline and later sync the data from local database with server's database. 使用本地数据库是为了使用户能够脱机工作并稍后将本地数据库中的数据与服务器数据库同步。

I suggest Portable Class Library for SQLite by Microsoft Open Technologies, Inc. You can install it to your project by visual studio NuGet Package Manager. 我建议使用Microsoft Open Technologies,Inc .的SQLite可移植类库 。您可以通过Visual Studio NuGet软件包管理器将其安装到项目中。

Using SQLitePCL is very easy. 使用SQLitePCL非常容易。 This library truly mimics the C/C++ interface of SQLite. 该库真正模仿了SQLite的C / C ++接口。 You can find the details of the interfaces here: https://www.sqlite.org/cintro.html 您可以在这里找到接口的详细信息: https : //www.sqlite.org/cintro.html

How many choices? 有多少选择? Not many. 不太多。 Local databases for Windows Store apps is a sensitive topic. Windows Store应用程序的本地数据库是一个敏感主题。

You can use foreign keys in sqlite-net if you use the extensions: https://bitbucket.org/twincoders/sqlite-net-extensions 如果使用扩展名,则可以在sqlite-net中使用外键: https : //bitbucket.org/twincoders/sqlite-net-extensions

There is also Lex.DB which supports concurrent R/W and also has a very clean and easy to handle API: http://lexblog.azurewebsites.net/intro-to-lex-db/ 还有Lex.DB支持并发R / W,并且还具有非常干净且易于处理的API: http : //lexblog.azurewebsites.net/intro-to-lex-db/

I don't really see the benefit of x64 support for a Windows Phone application - especially since these devices have an ARM architecture. 我没有真正看到Windows Phone应用程序对x64支持的好处-特别是因为这些设备具有ARM体系结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM