在React Native中开始使用sqlite

React Native apps come with a simple user interface, code reusability, and allows for the production of stable apps. With React-Native being one of the most popular and ideal frameworks for creating cross-platform mobile applications, the vast majority of the developers and engineers depend on the structure of the framework to deliver high-performing local applications. Because of this, it’s often challenging for developers to choose the right technology stack (including the appropriate database for React Native). In this article we will be discussing SQLite as a local database for React-Native, and work on how to pre-populate data into the database so as to use it in the application.

React Native应用程序具有简单的用户界面,代码可重用性,并允许生产稳定的应用程序。 由于React-Native是用于创建跨平台移动应用程序的最受欢迎和理想的框架之一,因此绝大多数开发人员和工程师都依赖于框架的结构来交付高性能的本地应用程序。 因此,对于开发人员而言,选择正确的技术堆栈(包括适用于React Native的适当数据库)通常具有挑战性。 在本文中,我们将讨论SQLite作为React-Native的本地数据库,并研究如何将数据预填充到数据库中以便在应用程序中使用。

The word “lite” in SQLite describes it as being a lightweight library based database which requires minimal setup. SQLite can be coordinated with a versatile application, allowing us to get to the database in an easy, straightforward manner. It’s also helpful to note that SQLite was designed to provide local storage to mobile apps.

SQLite中的“ lite”一词将其描述为基于轻量级库的数据库,需要最少的设置。 SQLite可以与通用应用程序配合使用,使我们能够以简单,直接的方式访问数据库。 注意到SQLite旨在为移动应用程序提供本地存储也很有帮助。

The two main benefits of using SQLite database are:

使用SQLite数据库的两个主要好处是:

  1. It’s ACID-compliant (an acronym for atomicity, consistency, isolation, and durability)

    它符合ACID( 原子性一致性隔离 耐用 的首字母缩写)

  2. Its offline persistence (which means that it works even when the device is offline)

    它的离线持久性(这意味着即使设备离线也可以工作)

建立资料库 (Creating a database)

First, we need to create a database and store some data in it. https://sqliteonline.com/ can help in creating a SQLite database.

首先我们需要创建一个数据库并在其中存储一些数据。 https://sqliteonline.com/可以帮助创建SQLi

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值