Ionic Mobile App的LocalForage大小限制 [英] LocalForage size limit for an Ionic Mobile App

查看:289
本文介绍了Ionic Mobile App的LocalForage大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ionic框架构建移动应用程序。我的应用大量使用脱机数据库。我的第一次尝试是使用 ngStorage 使用localStorage,但过了一段时间我达到了大小配额限制5MB。所以我看一下 angular-localForage ,其中说:

I'm building a mobile App using Ionic framework. My app heavily uses offline database. My first attempt was to use ngStorage which uses localStorage but after a while i hit the size quota limit which is about 5MB. So i took a look at angular-localForage , In there it says:


将您的数据存储在浏览器可提供的最佳可用存储解决方案中(IndexedDB / WebSQL或localstorage作为后备)

Store your data in the best available storage solution that your browser can offer (IndexedDB / WebSQL or localstorage as a fallback)

现在我的多平台移动应用程序是否意味着它将使用IndexedDB,它在存储数据方面有更大的限制?或者它会使用localStorage并且我回到原点吗?

Now for my multi-platform Mobile App does it mean it's going to use IndexedDB which has a higher size limit in regards of storing data? Or will it use localStorage and i'm back to square one?

如果它是 IndexedDB ,是否有任何关于我的实际数据的文档移动应用程序可以存储?

If it's IndexedDB, is there any documentation on how much actual data my Mobile App can store?

如果 localForage 处理大小限制,那将是非常出色的,因为它存储数据的方式完全适合我的申请,但我想知道是否有人在他们的应用程序中使用localForage而不用担心他们的数据库大小达到限制。

It would be splendid if localForage takes care of size limit because the way it stores the data is perfectly fit for my application but I'd like to know if someone has used localForage in their app without worrying about their database size hitting a limit.

我也对任何其他选择开放关系sqlite因为我想要一个面向对象的方法。 (以PouchDB为例)

I'm also open to any alternatives except relational sqlite because i want an object-oriented approach. (PouchDB as an example)

推荐答案

将此插件添加到您的应用程序并使用PouchDB。 PouchDB将使用本机sqlite存储,它可以存储多达1 GB的数据。您可以在Cordova / PhoneGap的SQLite插件标题下阅读有关此此处的更多信息。

Add this plugin to your app and use PouchDB. PouchDB will use the native sqlite storage, which can store upto 1 GB of data. You can read more about this here. under heading "SQLite plugin for Cordova/PhoneGap"

http://ngcordova.com/docs/plugins/sqlite/

这篇关于Ionic Mobile App的LocalForage大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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