Repository navigation
NitroSQLite 10.2.0 improves repeated queries, async result delivery, and Android writes. It also adds runtime error constants and an errors-only entry point for shared code and Node.js tests. This minor release includes compatibility changes to SQL validation and query result objects, so review the upgrade notes before rebuilding your app.
Performance improvements
Each connection now caches its 32 most recently used query and data-change statements. Repeated calls to execute() and executeAsync() can reuse compiled SQL when the query text stays the same. Bind values as parameters to benefit from this cache. Statements such as PRAGMA, ATTACH, and transaction commands still compile on every call. See the performance guide.
Async queries, batches, and file imports now run on a dedicated worker thread per connection. Large managed async queries convert rows to JavaScript in batches while SQLite reads the remaining rows. The promise still resolves once with every row in order; paginate large queries to limit the final result size.
Android builds now use fdatasync() and enable batch atomic writes on supported F2FS filesystems. These changes reduce commit I/O without lowering PRAGMA synchronous. SQLite falls back to its rollback journal when atomic writes are unavailable. See the Android configuration guide for details and build-time opt-outs. #440
Breaking changes and migration
One SQL statement per query
SQL strings containing more than one statement now throw or reject instead of running the first statement and silently ignoring the rest. This affects execute(), executeAsync(), prepare(), each batch command, and each nonempty SQL-file line. Trailing whitespace, comments, and extra semicolons remain allowed. #439
Replace a query such as db.execute('CREATE TABLE foo (id INTEGER); CREATE TABLE bar (id INTEGER);') with separate statements. Use a batch when the changes should commit together:
await db.executeBatchAsync([
{ query: 'CREATE TABLE foo (id INTEGER)' },
{ query: 'CREATE TABLE bar (id INTEGER)' },
])Use separate execute() or executeAsync() calls when you need each statement's results. Inside a transaction callback, execute each statement through the callback's tx methods. SQL files must contain one complete statement per nonempty line; a line with multiple statements now fails and rolls back the import. Do not split SQL by semicolons alone, since semicolons can appear inside strings and trigger bodies. See batch operations and SQL file loading.
Query results are plain objects
NitroSQLiteQueryResult no longer extends Nitro's HybridObject. Results no longer have name, toString(), equals(), or dispose() members from Nitro. Remove result-specific Nitro lifecycle calls and hybrid-object assumptions; ordinary JavaScript garbage collection reclaims results. The data fields rowsAffected, insertId, results, and metadata remain, and managed results retain rows._array, rows.length, and rows.item().
For users calling NitroSQLite.native.executeAsync() directly, the new optional onRows callback receives leading rows in batches. When supplied, those rows are excluded from the resolved result's results array, so combine the callback batches with the final rows if you need the complete result. Omitting the callback returns every row as before. Managed executeAsync() handles this automatically. See native access. #440
Error handling and upgrading
NitroSQLiteExceptionType is now available as runtime constants as well as a TypeScript type. Import it with NitroSQLiteError from react-native-nitro-sqlite/errors to classify failures without importing React Native or initializing the native module. Both exports remain available from the package root. #441
Update react-native-nitro-sqlite to 10.2.0 and, if you use sqlite-vec, update react-native-nitro-sqlite-vec to the same version. Install Pods again on Apple platforms and rebuild your native app. The native bindings changed, so this upgrade requires a new native build.
10.2.0 (2026-10-12)
🛠️ Dependency Upgrades
- deps: bump actions/download-artifact from 4 to 8 (#437) (8f38649)
- deps: bump actions/upload-artifact from 4 to 7 (#438) (251e509)