MIT License

项目介绍

margelo/react-native-nitro-sqlite 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 MIT License 许可证,目前获得 582 个 Star、50 次 Fork。

仓库全名
margelo/react-native-nitro-sqlite
开源许可证
MIT License
Star 数
582
Fork 数
50
未关闭 Issue
16

README 摘要

Nitro SQLite is a SQLite library for React Native on iOS, macOS, visionOS, and Android, built with Nitro Modules. It provides synchronous and asynchronous queries, transactions, and batch operations. The bundled SQLite build enables R\Tree indexes by default on Apple platforms and Android. Set nitroSQLite.enableRTree to false in your app's package.json to omit it from the native build. Read the documentation for…

完整内容见 GitHub 原始 README 或本页 。

常见问题

react-native-nitro-sqlite 用什么语言开发?

主要使用 C 编写,采用 MIT License 许可证,目前有 582 个 Star。

react-native-nitro-sqlite 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 react-native-nitro-sqlite 的源码?

可以直接克隆仓库:git clone https://github.com/margelo/react-native-nitro-sqlite.git,默认分支为 main;安装与运行步骤见仓库 README。

react-native-nitro-sqlite 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 16 个未关闭 Issue;Star 数为 582,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

💽 Fast SQLite library for React Native built using Nitro Modules

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
686
价值分
363
活跃状态
活跃

语言占比

C
C++
CMake
JavaScript
Kotlin
Objective-C
Objective-C++
Python
Ruby
Shell
Swift
TypeScript

README

Nitro SQLite

Nitro SQLite is a SQLite library for React Native on iOS, macOS, visionOS, and Android, built with Nitro Modules. It provides synchronous and asynchronous queries, transactions, and batch operations.

The bundled SQLite build enables R*Tree indexes by default on Apple platforms and Android. Set nitroSQLite.enableRTree to false in your app’s package.json to omit it from the native build.

Read the documentation for setup, guides, integrations, and the API reference.

If you use a coding agent, give it the NitroSQLite skill. It links to focused guidance for connections, queries, transactions, concurrency, and migration. See the AI agent guide for what to check in generated code.

Installation

Requires React Native 0.75 or newer and react-native-nitro-modules 0.37.1 or newer.

npm install react-native-nitro-sqlite react-native-nitro-modules

Rebuild the native app after installing. Expo projects need a development build; Expo Go cannot load this native module. See Getting Started for details.

Example

import { open } from 'react-native-nitro-sqlite'

const db = open({ name: 'app.sqlite' })
db.execute('CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY, body TEXT)')
db.execute('INSERT INTO notes (body) VALUES (?)', ['Hello'])

const { rows } = db.execute<{ id: number; body: string }>(
  'SELECT id, body FROM notes',
)
console.log(rows._array)

db.close()

Migrating from Quick SQLite

react-native-quick-sqlite 8.x was succeeded by react-native-nitro-sqlite 9.x. Follow the migration guide before updating an app with existing database files.

Community and contributing

Join the Margelo Community Discord. Contributions are welcome through issues and pull requests.

License

MIT.

评论

暂无评论