React Native是否支持索引数据库? [英] Does React Native support Indexed DB?

查看:72
本文介绍了React Native是否支持索引数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是在GitHub上提出的,答案是嘿,您听说过这个网站的Stack Overflow吗?您应该在那里问这个问题!".

This question was asked on GitHub, with the answer being "Hey, have you heard of this website Stack Overflow? You should ask the question there!".

所以我在这里,问一个问题!

So here I am, asking a question!

重构现有的Web应用程序以支持 react-native 时,是否必须放弃对索引数据库的支持?还是索引数据库开箱即用?

When refactoring an existing web-application to support react-native, does one have to forgo Indexed DB support? Or, does Indexed DB work out of the box?

回答上述问题的原因是什么?索引数据库是否会因为我们不在浏览器中而React Native当前未实现该API而不能正常工作?我们可以在React Native中填充索引数据库吗?或者,我们应该为该平台使用替代的持久性方法吗?

What is the reason for the answer to the above question? Does Indexed DB not work simply because we're not in a browser and React Native doesn't currently implement that API? Can we polyfill Indexed DB in React Native? Or, should we turn to alternative persistence methods for this platform?

我想以此为技术主管,想知道 react-native 对我们团队来说是容易还是困难的过渡.

I am asking this as a technical lead, wanting to know whether or not react-native is going to be an easy or difficult transition for our team.

推荐答案

否,到目前为止,React Native不支持IndexedDB.

No, as of now React Native doesn't support IndexedDB.

对于React Native中的持久存储,选项为:

For persistent storage in React Native the options are:

AsyncStorage :最简单存储对象的方法,提供了基于键值的异步API来存储数据.仅提供基本的获取量API,不适用于搜索查询.

AsyncStorage: The easiest way to store objects, provides Key-value based asynchronous APIs to store data. Only provides basic get-put APIs, not suitable for search queries.

领域 :完全成熟的面向文档的移动数据库,带有复杂查询的能力.同时具有Pro版本和免费开源版本.开发与服务器同步的脱机应用程序的最佳选择.

Realm: Fully fledged document oriented mobile database with the capacity for complex queries. Has both Pro and free open source editions. Best option for developing offline applications synchronised with the server.

这篇关于React Native是否支持索引数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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