Install on NitroUI
Use the SQLite adapter in a NitroUI app on iOS and Android.
nitro-sqlite runs Nitro SQLite in NitroUI without React Native. The adapter opens SQLite files in the app's storage directory and exposes the shared SQLite API.
This 11.0.0 pre-release source is not an npm release. Install the adapter from a source checkout or a locally packed archive using one of the paths below.
Requirements
The adapter uses Nitro Core and Nitrogen 1.0.0-alpha.nightly.137.gd4793c40b8b8. The example pins NitroUI SDK 0.2.0 and React 19.3.0. Keep those versions together. React Native's Nitro bindings use a different version.
For iOS, use Xcode with Swift 6.4 or newer. The adapter's Swift package declares iOS 16 or newer. Android uses the NitroUI host's native build requirements. See supported platforms for the OS coverage.
Run the repository example
Use a source checkout of this repository. The app at examples/nitro-ui has its own package.json, lockfile, and dependencies. It installs the SQLite adapter and its Vec and ORM companions from the local checkout.
From the repository root, enter the example and install its dependencies with the Bun version pinned by the example's packageManager field:
cd examples/nitro-ui
bun install --frozen-lockfileInstallation prepares the local adapter and the native app. The environment check verifies that the app uses one React instance, one Nitro Core instance, and the adapter's SQLite source and generated bindings.
Start the JavaScript development server:
bun run startIn a second terminal in examples/nitro-ui, build and launch the app for your device:
bun run ios --device <simulator-udid>
# or
bun run android --device <emulator-serial>The app opens the NitroUI SQLite Example home screen. Choose SQL Console to run queries against sample data, or Unit Tests to run the shared tests on the device.
Add the adapter to an existing app
Use an existing NitroUI app with the compatible versions above. Build a local adapter archive from the source checkout. First install the repository's workspace dependencies, then run these commands from the repository root:
cd packages/nitro-sqlite
bun run packThe package's preparation step includes the TypeScript API, native implementation, bundled SQLite, and generated bindings in nitro-sqlite-11.0.0.tgz. It does not require the shared workspace package at runtime.
From your NitroUI app directory, install that archive. Replace the path with the location of your checkout:
bun add /path/to/checkout/packages/nitro-sqlite/nitro-sqlite-11.0.0.tgzPrepare and rebuild the native app with the compatible NitroUI CLI:
bunx nitro-ui prepare
bunx nitro-ui startIn a second terminal, launch your platform:
bunx nitro-ui ios --device <simulator-udid>
# or
bunx nitro-ui android --device <emulator-serial>Use your app's scripts instead when they perform these steps. A JavaScript reload alone cannot add the native adapter to an existing binary.
Storage and configuration
iOS uses Documents by default. The iOS storage settings also apply to this adapter, including NitroSQLite_DatabaseLocation and NitroSQLite_AppGroup. Android stores persistent databases in the app's files directory and temporary SQLite files in its cache directory.
In the repository example, edit native-settings.json to change the iOS location or app group. Run bun run prepare:native from examples/nitro-ui, then rebuild. The database lifecycle guide explains relative locations and file migration.
The React Native nitroSQLite build settings do not configure this adapter. The NitroUI adapter bundles SQLite with thread safety and RTree enabled. Use the optional Vec package for vector search or the Drizzle driver to query with Drizzle ORM.
Continue with your first NitroUI query.