NitroSQLite

Android

Database storage, batch atomic writes, and Gradle overrides.

See Configuration for shared package.json settings.

Database location

Databases use the app's internal filesDir. See file locations for the location option and prepopulated databases.

Commit I/O

To disable batch atomic writes, set this in your app's package.json:

{
  "nitroSQLite": {
    "enableBatchAtomicWrite": false
  }
}

enableBatchAtomicWrite defaults to true on Android, independently of performanceMode. It uses atomic filesystem commits when supported and otherwise falls back to SQLite's journal. Rebuild after changing it.

SQLite compile flags

Use nitroSqliteFlags in android/gradle.properties for additional SQLite features or to override individual build defaults. For example, to enable FTS5:

nitroSqliteFlags="-DSQLITE_ENABLE_FTS5=1"

Custom definitions take precedence over package.json defaults. To disable batch atomic writes, use enableBatchAtomicWrite: false and remove custom SQLITE_ENABLE_BATCH_ATOMIC_WRITE definitions; setting that flag to 0 still enables it.

Android flushes data with fdatasync(). To use fsync(), add -DHAVE_FDATASYNC=0. Rebuild after changing flags.

Install react-native-nitro-sqlite-vec and add this to android/gradle.properties:

nitroSqliteVec=true

Rebuild and follow the vector search guide. For SEE build settings, see encryption.

On this page