From f7642c32907a7aabbb78d1544bdca07f87980279 Mon Sep 17 00:00:00 2001 From: Mike Mason <mmason@aforza.com> Date: Tue, 24 Oct 2023 08:13:23 +0100 Subject: [PATCH] Fix incorrect open function parameters. Improve explanation of defining flags for Android. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 745218bb..349b95a3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ TypeORM is officially supported, however, there is currently a parsing issue wit ```typescript import {open} from 'react-native-quick-sqlite' -const db = open('myDb.sqlite') +const db = open({ name: 'myDb.sqlite' }) +// Or: const db = open({ name: 'myDb.sqlite', location: '/some/location' }) + // The db object now contains the following methods: @@ -57,7 +59,7 @@ The basic query is **synchronous**, it will block rendering on large operations, import { open } from 'react-native-quick-sqlite'; try { - const db = open('myDb.sqlite'); + const db = open({ name: 'myDb.sqlite' }); let { rows } = db.execute('SELECT somevalue FROM sometable'); @@ -317,6 +319,12 @@ You can specify flags via `<PROJECT_ROOT>/android/gradle.properties` like so: quickSqliteFlags="<SQLITE_FLAGS>" ``` +Unlike with iOS, you must specify the `-D` prefix when defining your flags: + +``` +quickSqliteFlags="-DSQLITE_ENABLE_FTS5=1" +``` + ## Additional configuration ### App groups (iOS only)