Skip to content

NitroSQLite 10.0.0

Choose a tag to compare

@github-actions github-actions released this 25 Sep 17:03
7d28297

NitroSQLite 10.0.0 is a major release for applications that need more control over SQLite connections and repeated queries. It adds independent database handles, reusable prepared statements, and macOS support for the core and sqlite-vec packages. Async queries, batches, and file imports now enter a native queue without waiting for the previous result to return through JavaScript, while transaction callbacks retain their ordering guarantees.

Independent connections

Open separate handles to the same database file with connection: 'independent'. Each handle has its own native SQLite connection and operation queue, so a reader can run while a writer has an active transaction. Read-only handles are supported, and existing open({ name }) calls keep their default-connection behavior. For concurrent reads and writes, initialize the database first and enable WAL mode on the writer.

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

const writer = open({ name: 'app.sqlite' })
await writer.executeAsync('PRAGMA journal_mode = WAL')

const reader = open({
  name: 'app.sqlite',
  connection: 'independent',
  readOnly: true,
})

SQLite still permits only one writer per file. A reader sees committed data according to its transaction snapshot. See the multiple-connections guide for routing, timeouts, transaction use, and connection lifetimes. #364

Reusable prepared statements

db.prepare(query) prepares SQL once for repeated synchronous or asynchronous execution with new parameters. Finalize the statement before closing its connection. Prepared operations use the connection's managed queue and lock. #294

const statement = writer.prepare('SELECT * FROM items WHERE id = ?')
try {
  const result = await statement.executeAsync([42])
  // Use result.rows._array.
} finally {
  statement.finalize()
}

Native scheduling and macOS

Async queries, batches, and file imports now enter a per-connection native FIFO without waiting for an earlier result to return through JavaScript. Transaction callbacks still reserve their connection until they commit or roll back, and batches and imports remain atomic native jobs. #369

The core SQLite and optional sqlite-vec packages now support macOS. The repository includes a desktop example and integration workflows that run the shared test suite on macOS. #372, #373, #351, #352

Since the first NitroSQLite release

The first react-native-nitro-sqlite npm prerelease arrived in October 2024, followed by the first official 9.0.0 release in November 2024. That release moved the library to Nitro Modules. Since then, the project has added:

  • Better handling of nullable SQL values, clearer database errors, and a JavaScript TypeORM driver. #109, #239, #258
  • Managed transaction and batch queues, followed by stronger operation ordering and connection-lifetime checks. #227, #326
  • Query-result and memory-accounting improvements, including single-pass result materialization. #260, #261, #320
  • Vector search through the companion react-native-nitro-sqlite-vec package, introduced in 9.7.0. #285
  • Android 16 KB page-size support, configurable iOS database storage and migration to Application Support, and configurable SQLite build settings on both mobile platforms. #191, #323, #324, #328, #363

Version 10 builds on that work with the independent connections, prepared statements, native scheduling, and macOS support described above. The full history since 9.0.0 shows every change since the first official release.

Upgrading

  • Rebuild your native apps after upgrading. A JavaScript-only update cannot add the new native connection and statement methods.
  • Existing single-connection calls remain supported. Independent connections are opt-in and require SQLite mutex support; builds with SQLITE_THREADSAFE=0 reject them.
  • Database deletion now rejects a file still used by another connection or attachment. A closed session object cannot operate on a replacement connection opened under the same name.
  • Finalize prepared statements before closing their connection. Custom native integrations may need to adapt to changed C++ signatures.

The release also includes project-owned C++ filename prefixes to avoid native build collisions, expanded API documentation, and release lockfile checks. See the full comparison for every change.


10.0.0 (2026-09-25)

✨ Features

💨 Performance Improvements

  • drain SQLite operations through a native FIFO (#369) (325df74)

🐛 Bug Fixes

🏗️ Project configuration and build flow

📚 Documentation

  • api: describe new connection and prepared statement APIs (#378) (45f400c)
  • describe public SQLite APIs in source (#376) (f82ce09)

New Contributors