NitroSQLite

Windows

Install Nitro SQLite in a packaged React Native Windows app.

SQLite stores a database in a local file and can create journal files beside it. On Windows, Nitro SQLite puts these files in the packaged app's per-user LocalState directory. The location option to open() can select a subdirectory.

Use a packaged WinAppSDK x64 app with the React Native Windows 0.85 C++ template and its matching React Native version. Follow the React Native Windows setup guide for Visual Studio and Windows SDK requirements.

Install Nitro SQLite and pin Nitro Modules to the version supported by the Windows project:

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

Add this dependency override to your app's react-native.config.js. Nitro SQLite's Windows project builds the Nitro runtime and registers the NitroModules provider.

module.exports = {
  dependencies: {
    'react-native-nitro-modules': { platforms: { windows: null } },
  },
}

Rebuild the app to autolink Nitro SQLite:

npx react-native run-windows --arch x64

Use the same database lifecycle API as on the other native platforms. Reading a BLOB on Windows copies its bytes into a JavaScript ArrayBuffer.

The Windows project supplies the app's single NitroModules provider. An app that registers another provider or needs other Nitro HybridObjects requires a shared Windows runtime from Nitro. The project uses bundled SQLite with thread safety and RTree enabled. Windows support currently excludes unpackaged apps, ARM64, Nitro V1, custom SQLite flags, system SQLite, SQLite SEE, and sqlite-vec.

On this page

No Headings