Registry / database / react-native-nitro-sqlite

react-native-nitro-sqlite

JSON →
library9.6.0jsnpmunverified

Fast SQLite library for React Native built using Nitro Modules. Current stable version: 9.6.0. Released frequently with a focus on performance and type safety. Key differentiator: leverages JSI (JavaScript Interface) via Nitro Modules for zero-bridge overhead, providing significantly faster database operations compared to traditional React Native SQLite libraries. Supports both iOS and Android.

npm install react-native-nitro-sqlite
INSTALL
IMPORT
SIG · REACT-NATIVE-NITRO
R
react-native-nitro-sqlite
databasejavascriptv9.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NitroSQLite
import { NitroSQLite } from 'react-native-nitro-sqlite'
const { NitroSQLite } = require('react-native-nitro-sqlite')
ESM-only package; CommonJS require not supported.
open
import { open } from 'react-native-nitro-sqlite'
import open from 'react-native-nitro-sqlite'
open is a named export, not default.
type Database
import { type Database } from 'react-native-nitro-sqlite'
import { Database } from 'react-native-nitro-sqlite'
Database is a type-only export; use 'type' import to avoid runtime side effects.

Opens a SQLite database, creates a table, inserts a row, and selects data.

import { open, type Database } from 'react-native-nitro-sqlite'; async function setupDatabase() { const db: Database = await open({ name: 'example.db', location: 'default', }); await db.execute('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT UNIQUE)'); await db.execute('INSERT INTO users (name, email) VALUES (?, ?)', ['Alice', 'alice@example.com']); const { rows } = await db.execute('SELECT * FROM users'); console.log(rows); await db.close(); } setupDatabase().catch(console.error);
Debug
Known issues
breakingIn v9.0.0, the API was rewritten to use async functions; old synchronous methods removed.
fix
Update all database calls to use async/await.
affects: >=9.0.0
deprecatedUsing 'type' Database import without 'type' keyword may cause issues in bundlers.
fix
Use 'import { type Database }' instead of 'import { Database }'.
affects: >=9.0.0
gotchaReact Native version must be >= 0.75.0; otherwise the addon may not work.
fix
Upgrade React Native to 0.75.0 or newer.
affects: >=9.0.0
gotchaThe 'location' option must be explicitly provided; default is 'default' but may not exist on all platforms.
fix
Always specify a location like 'default' or a custom path.
affects: >=9.0.0
Errors
Common errors & fixes
TypeError: Cannot read property 'NitroSQLite' of undefined
Using CommonJS require instead of ESM import.
fix
Use 'import { NitroSQLite } from 'react-native-nitro-sqlite'' (ESM).
Error: React Native version is not compatible. Please upgrade to at least 0.75.0.
Project uses an older React Native version.
fix
Upgrade React Native to 0.75.0+ or use an older version of this library.
TypeError: db.execute is not a function
Calling execute synchronously; open() returns a Promise that resolves to an object with async methods.
fix
Use await db.execute(...).
Upgrade
Version history
9.6.0latest on npm
Audit
Dependencies
react-native-nitro-modulesrequiredRequired at runtime for Nitro Modules integration
Agent activity
5 hits · last 30 days
node
4
Resources
react-native-nitro-sqlite — npm install react-native-nitro-sqlite · libregistry