Skip to content

Commit 66069ab

Browse files
feat: Rebrand project to react-native-nitro-sqlite (#81)
Co-authored-by: Oskar Kwaśniewski <[email protected]>
1 parent f37bc1f commit 66069ab

File tree

103 files changed

+774
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+774
-739
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [mrousavy]
1+
github: [mrousavy, chrispader]

.github/workflows/build-android-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
upload_url: ${{ github.event.release.upload_url }}
4343
asset_path: example/android/app/build/outputs/apk/release/app-release.apk
44-
asset_name: "QuickSQLiteExample-${{ github.event.release.tag_name }}.apk"
44+
asset_name: "NitroSQLiteExample-${{ github.event.release.tag_name }}.apk"
4545
asset_content_type: application/vnd.android.package-archive
4646

4747
# Gradle cache doesn't like daemons

.github/workflows/build-ios.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
run: "set -o pipefail && xcodebuild \
6868
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
6969
-derivedDataPath build -UseModernBuildSystem=YES \
70-
-workspace QuickSQLiteExample.xcworkspace \
71-
-scheme QuickSQLiteExample \
70+
-workspace NitroSQLiteExample.xcworkspace \
71+
-scheme NitroSQLiteExample \
7272
-sdk iphonesimulator \
7373
-configuration Debug \
7474
-destination 'platform=iOS Simulator,name=iPhone 16' \
@@ -114,8 +114,8 @@ jobs:
114114
run: "set -o pipefail && xcodebuild \
115115
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
116116
-derivedDataPath build -UseModernBuildSystem=YES \
117-
-workspace QuickSQLiteExample.xcworkspace \
118-
-scheme QuickSQLiteExample \
117+
-workspace NitroSQLiteExample.xcworkspace \
118+
-scheme NitroSQLiteExample \
119119
-sdk iphonesimulator \
120120
-configuration Debug \
121121
-destination 'platform=iOS Simulator,name=iPhone 16' \

.github/workflows/lint-typescript.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ jobs:
6363
- name: Run ESLint CI in example/
6464
working-directory: example
6565
run: bun lint-ci
66-
- name: Run ESLint CI in react-native-quick-sqlite
66+
- name: Run ESLint CI in react-native-nitro-sqlite
6767
working-directory: package
6868
run: bun lint-ci
6969

7070
- name: Run ESLint with auto-fix in example/
7171
working-directory: example
7272
run: bun lint
73-
- name: Run ESLint with auto-fix in react-native-quick-sqlite
73+
- name: Run ESLint with auto-fix in react-native-nitro-sqlite
7474
working-directory: package
7575
run: bun lint
7676

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Remember to add tests for your change if possible. Run the unit tests by:
4949
bun test
5050
```
5151

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`.
5353

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`.
5555

5656
### Commit message convention
5757

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
![screenshot](https://raw.githubusercontent.com/margelo/react-native-quick-sqlite/main/header2.png)
1+
![screenshot](https://raw.githubusercontent.com/margelo/react-native-nitro-sqlite/main/header2.png)
22

33
<div align="center">
44
<pre align="center">
5-
bun add react-native-quick-sqlite
5+
bun add react-native-nitro-sqlite
66
npx pod-install</pre>
77
<a align="center" href="https://github.com/mrousavy?tab=followers">
88
<img src="https://img.shields.io/github/followers/mrousavy?label=Follow%20%40mrousavy&style=social" />
@@ -14,7 +14,7 @@
1414
</div>
1515
<br />
1616

17-
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.
1818

1919
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.
2020

@@ -25,7 +25,7 @@ TypeORM is officially supported, however, there is currently a parsing issue wit
2525
## API
2626

2727
```typescript
28-
import {open} from 'react-native-quick-sqlite'
28+
import {open} from 'react-native-nitro-sqlite'
2929

3030
const db = open('myDb.sqlite')
3131

@@ -54,7 +54,7 @@ db = {
5454
The basic query is **synchronous**, it will block rendering on large operations, further below you will find async versions.
5555

5656
```typescript
57-
import { open } from 'react-native-quick-sqlite';
57+
import { open } from 'react-native-nitro-sqlite';
5858

5959
try {
6060
const db = open('myDb.sqlite');
@@ -83,7 +83,7 @@ Throwing an error inside the callback will ROLLBACK the transaction.
8383
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.
8484

8585
```typescript
86-
await QuickSQLite.transaction('myDatabase', (tx) => {
86+
await NitroSQLite.transaction('myDatabase', (tx) => {
8787
const { status } = tx.execute(
8888
'UPDATE sometable SET somecolumn = ? where somekey = ?',
8989
[0, 1]
@@ -117,7 +117,7 @@ const commands = [
117117
[('INSERT INTO TEST (id) VALUES (?)', [[3], [4], [5], [6]])],
118118
];
119119

120-
const res = QuickSQLite.executeSqlBatch('myDatabase', commands);
120+
const res = NitroSQLite.executeSqlBatch('myDatabase', commands);
121121

122122
console.log(`Batch affected ${result.rowsAffected} rows`);
123123
```
@@ -130,7 +130,7 @@ This can be done by testing the returned data directly, but in some cases may no
130130
SQLite datatypes. When fetching data directly from tables or views linked to table columns, SQLite can identify the table declared types:
131131

132132
```typescript
133-
let { metadata } = QuickSQLite.executeSql(
133+
let { metadata } = NitroSQLite.executeSql(
134134
'myDatabase',
135135
'SELECT int_column_1, bol_column_2 FROM sometable'
136136
);
@@ -148,7 +148,7 @@ metadata.forEach((column) => {
148148
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.
149149

150150
```ts
151-
QuickSQLite.executeAsync(
151+
NitroSQLite.executeAsync(
152152
'myDatabase',
153153
'SELECT * FROM "User";',
154154
[]).then(({rows}) => {
@@ -170,15 +170,15 @@ SQLite has a limit for attached databases: A default of 10, and a global max of
170170
References: [Attach](https://www.sqlite.org/lang_attach.html) - [Detach](https://www.sqlite.org/lang_detach.html)
171171

172172
```ts
173-
QuickSQLite.attach('mainDatabase', 'statistics', 'stats', '../databases');
173+
NitroSQLite.attach('mainDatabase', 'statistics', 'stats', '../databases');
174174

175-
const res = QuickSQLite.executeSql(
175+
const res = NitroSQLite.executeSql(
176176
'mainDatabase',
177177
'SELECT * FROM some_table_from_mainschema a INNER JOIN stats.some_table b on a.id_column = b.id_column'
178178
);
179179

180180
// You can detach databases at any moment
181-
QuickSQLite.detach('mainDatabase', 'stats');
181+
NitroSQLite.detach('mainDatabase', 'stats');
182182
if (!detachResult.status) {
183183
// Database de-attached
184184
}
@@ -189,7 +189,7 @@ if (!detachResult.status) {
189189
If you have a plain SQL file, you can load it directly, with low memory consumption.
190190

191191
```typescript
192-
const { rowsAffected, commands } = QuickSQLite.loadFile(
192+
const { rowsAffected, commands } = NitroSQLite.loadFile(
193193
'myDatabase',
194194
'/absolute/path/to/file.sql'
195195
);
@@ -198,7 +198,7 @@ const { rowsAffected, commands } = QuickSQLite.loadFile(
198198
Or use the async version which will load the file in another native thread
199199

200200
```typescript
201-
QuickSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then(
201+
NitroSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then(
202202
(res) => {
203203
const { rowsAffected, commands } = res;
204204
}
@@ -210,7 +210,7 @@ QuickSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then(
210210
On iOS you can use the embedded SQLite, when running `pod-install` add an environment flag:
211211

212212
```
213-
QUICK_SQLITE_USE_PHONE_VERSION=1 npx pod-install
213+
Nitro_SQLITE_USE_PHONE_VERSION=1 npx pod-install
214214
```
215215

216216
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
240240

241241
Now every time you install your node_modules that line will be added.
242242

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:
244244

245245
```js
246246
plugins: [
@@ -250,7 +250,7 @@ plugins: [
250250
'module-resolver',
251251
{
252252
alias: {
253-
"react-native-sqlite-storage": "react-native-quick-sqlite"
253+
"react-native-sqlite-storage": "react-native-nitro-sqlite"
254254
},
255255
},
256256
],
@@ -266,7 +266,7 @@ bun add babel-plugin-module-resolver
266266
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:
267267

268268
```ts
269-
import { typeORMDriver } from 'react-native-quick-sqlite'
269+
import { typeORMDriver } from 'react-native-nitro-sqlite'
270270

271271
datasource = new DataSource({
272272
type: 'react-native',
@@ -280,7 +280,7 @@ datasource = new DataSource({
280280

281281
# Loading existing DBs
282282

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.).
284284

285285
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.
286286

@@ -297,7 +297,7 @@ Add a `post_install` block to your `<PROJECT_ROOT>/ios/Podfile` like so:
297297
```ruby
298298
post_install do |installer|
299299
installer.pods_project.targets.each do |target|
300-
if target.name == "react-native-quick-sqlite" then
300+
if target.name == "react-native-nitro-sqlite" then
301301
target.build_configurations.each do |config|
302302
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'SQLITE_ENABLE_FTS5=1'
303303
end
@@ -314,7 +314,7 @@ For example, you could add `SQLITE_ENABLE_FTS5=1` to `GCC_PREPROCESSOR_DEFINITIO
314314
You can specify flags via `<PROJECT_ROOT>/android/gradle.properties` like so:
315315

316316
```
317-
quickSqliteFlags="<SQLITE_FLAGS>"
317+
nitroSqliteFlags="<SQLITE_FLAGS>"
318318
```
319319

320320
## Additional configuration
@@ -323,15 +323,15 @@ quickSqliteFlags="<SQLITE_FLAGS>"
323323

324324
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.
325325

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)
327327

328328
## Community Discord
329329

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.
331331

332332
## Oscar
333333

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!
335335

336336
## License
337337

bun.lockb

0 Bytes
Binary file not shown.

example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ android {
7777
buildToolsVersion rootProject.ext.buildToolsVersion
7878
compileSdk rootProject.ext.compileSdkVersion
7979

80-
namespace "com.margelo.rnquicksqlite.example"
80+
namespace "com.margelo.rnnitrosqlite.example"
8181
defaultConfig {
82-
applicationId "com.margelo.rnquicksqlite.example"
82+
applicationId "com.margelo.rnnitrosqlite.example"
8383
minSdkVersion rootProject.ext.minSdkVersion
8484
targetSdkVersion rootProject.ext.targetSdkVersion
8585
versionCode 1

example/android/app/src/main/java/com/margelo/rnquicksqlite/example/MainActivity.kt renamed to example/android/app/src/main/java/com/margelo/rnnitrosqlite/example/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.margelo.rnquicksqlite.example
1+
package com.margelo.rnnitrosqlite.example
22

33
import com.facebook.react.ReactActivity
44
import com.facebook.react.ReactActivityDelegate
@@ -11,7 +11,7 @@ class MainActivity : ReactActivity() {
1111
* Returns the name of the main component registered from JavaScript. This is used to schedule
1212
* rendering of the component.
1313
*/
14-
override fun getMainComponentName(): String = "QuickSQLiteExample"
14+
override fun getMainComponentName(): String = "NitroSQLiteExample"
1515

1616
/**
1717
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]

example/android/app/src/main/java/com/margelo/rnquicksqlite/example/MainApplication.kt renamed to example/android/app/src/main/java/com/margelo/rnnitrosqlite/example/MainApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.margelo.rnquicksqlite.example;
1+
package com.margelo.rnnitrosqlite.example;
22

33
import android.app.Application
44
import com.facebook.react.PackageList

0 commit comments

Comments
 (0)