API Reference / react-native-nitro-sqlite
react-native-nitro-sqlite
Nitro SQLite provides local SQLite databases for React Native. This page lists the package's exported functions, objects, and types. For a guided introduction, start with Getting Started.
Install
Requires React Native 0.75 or newer, React 17 or newer, and react-native-nitro-modules 0.37.1 or newer.
npm install react-native-nitro-sqlite react-native-nitro-modulesInstall iOS pods if your project has an ios directory, then rebuild the native app. Android needs no additional setup for the default database location. Expo projects need a development build; Expo Go cannot load the native module.
npx pod-installOpen a database
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('SELECT id, body FROM notes')
console.log(rows._array)
db.close()Use Getting Started for native setup and a fuller first query. The concepts and guides explain database lifetime, query parameters, and results.
Enumerations
Classes
Interfaces
- BatchQueryCommand
- BatchQueryResult
- FileLoadResult
- NitroSQLiteConnection
- NitroSQLiteConnectionOptions
- NitroSQLiteNative
- NitroSQLiteQueryResult
- Transaction
- TypeOrmNitroSQLiteConnection
Type Aliases
- ExecuteAsyncQuery
- ExecuteQuery
- NitroSQLiteExceptionType
- NitroSQLiteQueryColumnMetadata
- NitroSQLiteQueryResultRows
- QueryResult
- QueryResultRow
- SQLiteQueryParams
- SQLiteValue