Skip to content

Commit de94720

Browse files
mjmasnMike Masonchrispader
authored
Fix incorrect open function parameters. Improve explanation of defining flags for Android. (#26)
Co-authored-by: Mike Mason <[email protected]> Co-authored-by: Christoph Pader <[email protected]>
1 parent 57ef1a6 commit de94720

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ TypeORM is officially supported, however, there is currently a parsing issue wit
4646
```typescript
4747
import {open} from 'react-native-nitro-sqlite'
4848

49-
const db = open({name: 'myDb.sqlite', location: '<optional_file_location>'})
49+
const db = open({ name: 'myDb.sqlite' })
50+
// Or: const db = open({ name: 'myDb.sqlite', location: '/some/location' })
51+
5052

5153
// The db object now contains the following methods:
5254
db = {
@@ -75,7 +77,7 @@ The basic query is **synchronous**, it will block rendering on large operations,
7577
import { open } from 'react-native-nitro-sqlite';
7678

7779
try {
78-
const db = open({name: 'myDb.sqlite', location: '<optional_file_location>'})
80+
const db = open({ name: 'myDb.sqlite' });
7981

8082
let { rows } = db.execute('SELECT somevalue FROM sometable');
8183

@@ -388,6 +390,12 @@ You can specify flags via `<PROJECT_ROOT>/android/gradle.properties` like so:
388390
nitroSqliteFlags="<SQLITE_FLAGS>"
389391
```
390392

393+
Unlike with iOS, you must specify the `-D` prefix when defining your flags:
394+
395+
```
396+
quickSqliteFlags="-DSQLITE_ENABLE_FTS5=1"
397+
```
398+
391399
## Additional configuration
392400

393401
### App groups (iOS only)

0 commit comments

Comments
 (0)