You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ Remember to add tests for your change if possible. Run the unit tests by:
49
49
bun test
50
50
```
51
51
52
-
To edit the Objective-C files, open `example/ios/SequelExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-quick-sqlite`.
52
+
To edit the Objective-C files, open `example/ios/SequelExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-nitro-sqlite`.
53
53
54
-
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `rnquicksqlite` under `Android`.
54
+
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `rnnitrosqlite` under `Android`.
Quick SQLite embeds the latest version of SQLite and provides a low-level JSI-backed API to execute SQL queries.
17
+
Nitro SQLite embeds the latest version of SQLite and provides a low-level JSI-backed API to execute SQL queries.
18
18
19
19
Performance metrics are intentionally not presented, [anecdotic testimonies](https://dev.to/craftzdog/a-performant-way-to-use-pouchdb7-on-react-native-in-2022-24ej) suggest anywhere between 2x and 5x speed improvement. On small queries you might not notice a difference with the old bridge but as you send large data to JS the speed increase is considerable.
20
20
@@ -25,7 +25,7 @@ TypeORM is officially supported, however, there is currently a parsing issue wit
25
25
## API
26
26
27
27
```typescript
28
-
import {open} from'react-native-quick-sqlite'
28
+
import {open} from'react-native-nitro-sqlite'
29
29
30
30
const db =open('myDb.sqlite')
31
31
@@ -54,7 +54,7 @@ db = {
54
54
The basic query is **synchronous**, it will block rendering on large operations, further below you will find async versions.
55
55
56
56
```typescript
57
-
import { open } from'react-native-quick-sqlite';
57
+
import { open } from'react-native-nitro-sqlite';
58
58
59
59
try {
60
60
const db =open('myDb.sqlite');
@@ -83,7 +83,7 @@ Throwing an error inside the callback will ROLLBACK the transaction.
83
83
If you want to execute a large set of commands as fast as possible you should use the `executeBatch` method, it wraps all the commands in a transaction and has less overhead.
You might have too much SQL to process and it will cause your application to freeze. There are async versions for some of the operations. This will offload the SQLite processing to a different thread.
149
149
150
150
```ts
151
-
QuickSQLite.executeAsync(
151
+
NitroSQLite.executeAsync(
152
152
'myDatabase',
153
153
'SELECT * FROM "User";',
154
154
[]).then(({rows}) => {
@@ -170,15 +170,15 @@ SQLite has a limit for attached databases: A default of 10, and a global max of
On iOS you can use the embedded SQLite, when running `pod-install` add an environment flag:
211
211
212
212
```
213
-
QUICK_SQLITE_USE_PHONE_VERSION=1 npx pod-install
213
+
Nitro_SQLITE_USE_PHONE_VERSION=1 npx pod-install
214
214
```
215
215
216
216
On Android, it is not possible to link (using C++) the embedded SQLite. It is also a bad idea due to vendor changes, old android bugs, etc. Unfortunately, this means this library will add some megabytes to your app size.
@@ -240,7 +240,7 @@ bun patch-package --exclude 'nothing' typeorm
240
240
241
241
Now every time you install your node_modules that line will be added.
242
242
243
-
Next, we need to trick TypeORM to resolve the dependency of `react-native-sqlite-storage` to `react-native-quick-sqlite`, on your `babel.config.js` add the following:
243
+
Next, we need to trick TypeORM to resolve the dependency of `react-native-sqlite-storage` to `react-native-nitro-sqlite`, on your `babel.config.js` add the following:
@@ -266,7 +266,7 @@ bun add babel-plugin-module-resolver
266
266
Finally, you will now be able to start the app without any metro/babel errors (you will also need to follow the instructions on how to setup TypeORM), now we can feed the driver into TypeORM:
267
267
268
268
```ts
269
-
import { typeORMDriver } from 'react-native-quick-sqlite'
269
+
import { typeORMDriver } from 'react-native-nitro-sqlite'
270
270
271
271
datasource = new DataSource({
272
272
type: 'react-native',
@@ -280,7 +280,7 @@ datasource = new DataSource({
280
280
281
281
# Loading existing DBs
282
282
283
-
The library creates/opens databases by appending the passed name plus, the [documents directory on iOS](https://github.com/margelo/react-native-quick-sqlite/blob/733e876d98896f5efc80f989ae38120f16533a66/ios/QuickSQLite.mm#L34-L35) and the [files directory on Android](https://github.com/margelo/react-native-quick-sqlite/blob/main/android/src/main/java/com/margelo/rnquicksqlite/QuickSQLiteBridge.java#L16), this differs from other SQL libraries (some place it in a `www` folder, some in androids `databases` folder, etc.).
283
+
The library creates/opens databases by appending the passed name plus, the [documents directory on iOS](https://github.com/margelo/react-native-nitro-sqlite/blob/733e876d98896f5efc80f989ae38120f16533a66/ios/NitroSQLite.mm#L34-L35) and the [files directory on Android](https://github.com/margelo/react-native-nitro-sqlite/blob/main/android/src/main/java/com/margelo/rnnitrosqlite/NitroSQLiteBridge.java#L16), this differs from other SQL libraries (some place it in a `www` folder, some in androids `databases` folder, etc.).
284
284
285
285
If you have an existing database file you want to load you can navigate from these directories using dot notation. e.g. `../www/myDb.sqlite`. Note that on iOS the file system is sand-boxed, so you cannot access files/directories outside your app bundle directories.
286
286
@@ -297,7 +297,7 @@ Add a `post_install` block to your `<PROJECT_ROOT>/ios/Podfile` like so:
On iOS, the SQLite database can be placed in an app group, in order to make it accessible from other apps in that app group. E.g. for sharing capabilities.
325
325
326
-
To use an app group, add the app group ID as the value for the `RNQuickSQLite_AppGroup` key in your project's `Info.plist` file. You'll also need to configure the app group in your project settings. (Xcode -> Project Settings -> Signing & Capabilities -> Add Capability -> App Groups)
326
+
To use an app group, add the app group ID as the value for the `RNNitroSQLite_AppGroup` key in your project's `Info.plist` file. You'll also need to configure the app group in your project settings. (Xcode -> Project Settings -> Signing & Capabilities -> Add Capability -> App Groups)
327
327
328
328
## Community Discord
329
329
330
-
[Join the Margelo Community Discord](https://discord.gg/6CSHz2qAvA) to chat about react-native-quick-sqlite or other Margelo libraries.
330
+
[Join the Margelo Community Discord](https://discord.gg/6CSHz2qAvA) to chat about react-native-nitro-sqlite or other Margelo libraries.
331
331
332
332
## Oscar
333
333
334
-
react-native-quick-sqlite was originally created by [Oscar Franco](https://github.com/ospfranco). Thanks Oscar!
334
+
react-native-nitro-sqlite was originally created by [Oscar Franco](https://github.com/ospfranco). Thanks Oscar!
0 commit comments