From 66069ab8faa7869b2df4c31762e9abda31d81840 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 13 Nov 2024 14:02:22 +0100 Subject: [PATCH] feat: Rebrand project to `react-native-nitro-sqlite` (#81) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Oskar Kwaśniewski --- .github/FUNDING.yml | 2 +- .github/workflows/build-android-release.yml | 2 +- .github/workflows/build-ios.yml | 8 +- .github/workflows/lint-typescript.yml | 4 +- CONTRIBUTING.md | 4 +- README.md | 48 +++--- bun.lockb | Bin 570696 -> 570696 bytes example/android/app/build.gradle | 4 +- .../example/MainActivity.kt | 4 +- .../example/MainApplication.kt | 2 +- .../app/src/main/res/values/strings.xml | 2 +- example/android/settings.gradle | 2 +- example/app.json | 12 +- example/babel.config.js | 2 +- .../project.pbxproj | 162 +++++++++--------- .../xcschemes/NitroSQLiteExample.xcscheme | 88 ++++++++++ .../contents.xcworkspacedata | 10 ++ .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../AppDelegate.h | 0 .../AppDelegate.mm | 2 +- .../AppIcon.appiconset/Contents.json | 0 .../Images.xcassets/Contents.json | 0 example/ios/NitroSQLiteExample/Info.plist | 52 ++++++ .../LaunchScreen.storyboard | 74 ++++++++ .../PrivacyInfo.xcprivacy | 0 .../main.m | 0 .../Info.plist | 0 .../NitroSQLiteExampleTests.m} | 4 +- example/ios/Podfile | 6 +- example/ios/Podfile.lock | 10 +- .../xcschemes/QuickSQLiteExample.xcscheme | 88 ---------- .../contents.xcworkspacedata | 10 -- example/ios/QuickSQLiteExample/Info.plist | 52 ------ .../LaunchScreen.storyboard | 47 ----- example/package.json | 6 +- example/src/Database.ts | 4 +- example/src/tests/db.ts | 10 +- example/src/tests/typeorm.spec.ts | 2 +- example/src/tests/unitTests.spec.ts | 19 +- package.json | 14 +- ...ckSQLite.podspec => RNNitroSQLite.podspec} | 8 +- package/android/CMakeLists.txt | 6 +- package/android/build.gradle | 18 +- package/android/cpp-adapter.cpp | 12 +- package/android/gradle.properties | 10 +- package/android/src/main/AndroidManifest.xml | 2 +- .../DocPathSetter.kt | 2 +- .../RNNitroSQLitePackage.kt} | 16 +- .../RNNitroSQLiteOnLoadModule.kt} | 10 +- .../RNNitroSQLiteOnLoadModule.kt} | 6 +- ...Exception.hpp => NitroSQLiteException.hpp} | 34 ++-- package/cpp/ThreadPool.cpp | 6 +- package/cpp/ThreadPool.hpp | 6 +- package/cpp/importSqlFile.cpp | 14 +- package/cpp/importSqlFile.hpp | 2 +- package/cpp/logs.hpp | 4 +- package/cpp/operations.cpp | 41 ++--- package/cpp/operations.hpp | 4 +- package/cpp/specs/HybridNativeQueryResult.cpp | 4 +- package/cpp/specs/HybridNativeQueryResult.hpp | 16 +- ...dQuickSQLite.cpp => HybridNitroSQLite.cpp} | 34 ++-- ...dQuickSQLite.hpp => HybridNitroSQLite.hpp} | 14 +- package/cpp/sqliteExecuteBatch.cpp | 13 +- package/cpp/sqliteExecuteBatch.hpp | 4 +- package/cpp/types.hpp | 6 +- package/cpp/utils.hpp | 6 +- .../project.pbxproj | 76 ++++---- package/ios/OnLoad.mm | 10 +- ...ckSQLite-Swift.h => RNNitroSQLite-Swift.h} | 0 package/nitro.json | 12 +- ....cmake => RNNitroSQLite+autolinking.cmake} | 16 +- ...radle => RNNitroSQLite+autolinking.gradle} | 6 +- ...LiteOnLoad.cpp => RNNitroSQLiteOnLoad.cpp} | 20 +-- ...LiteOnLoad.hpp => RNNitroSQLiteOnLoad.hpp} | 10 +- ...SQLiteOnLoad.kt => RNNitroSQLiteOnLoad.kt} | 0 ...inking.rb => RNNitroSQLite+autolinking.rb} | 8 +- ...cpp => RNNitroSQLite-Swift-Cxx-Bridge.cpp} | 8 +- ...hpp => RNNitroSQLite-Swift-Cxx-Bridge.hpp} | 6 +- ...p => RNNitroSQLite-Swift-Cxx-Umbrella.hpp} | 12 +- ...linking.mm => RNNitroSQLiteAutolinking.mm} | 18 +- ...g.swift => RNNitroSQLiteAutolinking.swift} | 6 +- .../shared/c++/BatchQueryCommand.hpp | 6 +- .../generated/shared/c++/BatchQueryResult.hpp | 6 +- .../generated/shared/c++/ColumnType.hpp | 6 +- .../generated/shared/c++/FileLoadResult.hpp | 6 +- .../c++/HybridNativeQueryResultSpec.cpp | 4 +- .../c++/HybridNativeQueryResultSpec.hpp | 6 +- .../shared/c++/HybridNitroSQLiteSpec.cpp | 31 ++++ ...LiteSpec.hpp => HybridNitroSQLiteSpec.hpp} | 34 ++-- .../shared/c++/HybridQuickSQLiteSpec.cpp | 31 ---- .../shared/c++/SQLiteQueryColumnMetadata.hpp | 8 +- package/package.json | 21 ++- package/src/index.ts | 12 +- package/src/nitro.ts | 6 +- package/src/operations/execute.ts | 6 +- package/src/operations/session.ts | 28 +-- package/src/operations/transaction.ts | 18 +- ....ios.ts => NativeNitroSQLiteOnLoad.ios.ts} | 2 +- ...teOnLoad.ts => NativeNitroSQLiteOnLoad.ts} | 2 +- ...ckSQLite.nitro.ts => NitroSQLite.nitro.ts} | 2 +- package/src/typeORM.ts | 8 +- package/src/types.ts | 4 +- scripts/release.sh | 4 +- 103 files changed, 774 insertions(+), 739 deletions(-) rename example/android/app/src/main/java/com/margelo/{rnquicksqlite => rnnitrosqlite}/example/MainActivity.kt (87%) rename example/android/app/src/main/java/com/margelo/{rnquicksqlite => rnnitrosqlite}/example/MainApplication.kt (97%) rename example/ios/{QuickSQLiteExample.xcodeproj => NitroSQLiteExample.xcodeproj}/project.pbxproj (78%) create mode 100644 example/ios/NitroSQLiteExample.xcodeproj/xcshareddata/xcschemes/NitroSQLiteExample.xcscheme create mode 100644 example/ios/NitroSQLiteExample.xcworkspace/contents.xcworkspacedata rename example/ios/{QuickSQLiteExample.xcworkspace => NitroSQLiteExample.xcworkspace}/xcshareddata/IDEWorkspaceChecks.plist (100%) rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/AppDelegate.h (100%) rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/AppDelegate.mm (93%) rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/Images.xcassets/Contents.json (100%) create mode 100644 example/ios/NitroSQLiteExample/Info.plist create mode 100644 example/ios/NitroSQLiteExample/LaunchScreen.storyboard rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/PrivacyInfo.xcprivacy (100%) rename example/ios/{QuickSQLiteExample => NitroSQLiteExample}/main.m (100%) rename example/ios/{QuickSQLiteExampleTests => NitroSQLiteExampleTests}/Info.plist (100%) rename example/ios/{QuickSQLiteExampleTests/QuickSQLiteExampleTests.m => NitroSQLiteExampleTests/NitroSQLiteExampleTests.m} (95%) delete mode 100644 example/ios/QuickSQLiteExample.xcodeproj/xcshareddata/xcschemes/QuickSQLiteExample.xcscheme delete mode 100644 example/ios/QuickSQLiteExample.xcworkspace/contents.xcworkspacedata delete mode 100644 example/ios/QuickSQLiteExample/Info.plist delete mode 100644 example/ios/QuickSQLiteExample/LaunchScreen.storyboard rename package/{RNQuickSQLite.podspec => RNNitroSQLite.podspec} (93%) rename package/android/src/main/java/com/margelo/{rnquicksqlite => rnnitrosqlite}/DocPathSetter.kt (89%) rename package/android/src/main/java/com/margelo/{rnquicksqlite/RNQuickSQLitePackage.kt => rnnitrosqlite/RNNitroSQLitePackage.kt} (71%) rename package/android/src/newarch/com/margelo/{rnquicksqlite/RNQuickSQLiteOnLoadModule.kt => rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt} (77%) rename package/android/src/oldarch/com/margelo/{rnquicksqlite/RNQuickSQLiteOnLoadModule.kt => rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt} (86%) rename package/cpp/{QuickSQLiteException.hpp => NitroSQLiteException.hpp} (51%) rename package/cpp/specs/{HybridQuickSQLite.cpp => HybridNitroSQLite.cpp} (77%) rename package/cpp/specs/{HybridQuickSQLite.hpp => HybridNitroSQLite.hpp} (82%) rename package/ios/{QuickSQLite.xcodeproj => NitroSQLite.xcodeproj}/project.pbxproj (86%) rename package/ios/{RNQuickSQLite-Swift.h => RNNitroSQLite-Swift.h} (100%) rename package/nitrogen/generated/android/{RNQuickSQLite+autolinking.cmake => RNNitroSQLite+autolinking.cmake} (84%) rename package/nitrogen/generated/android/{RNQuickSQLite+autolinking.gradle => RNNitroSQLite+autolinking.gradle} (76%) rename package/nitrogen/generated/android/{RNQuickSQLiteOnLoad.cpp => RNNitroSQLiteOnLoad.cpp} (62%) rename package/nitrogen/generated/android/{RNQuickSQLiteOnLoad.hpp => RNNitroSQLiteOnLoad.hpp} (67%) rename package/nitrogen/generated/android/{RNQuickSQLiteOnLoad.kt => RNNitroSQLiteOnLoad.kt} (100%) rename package/nitrogen/generated/ios/{RNQuickSQLite+autolinking.rb => RNNitroSQLite+autolinking.rb} (88%) rename package/nitrogen/generated/ios/{RNQuickSQLite-Swift-Cxx-Bridge.cpp => RNNitroSQLite-Swift-Cxx-Bridge.cpp} (50%) rename package/nitrogen/generated/ios/{RNQuickSQLite-Swift-Cxx-Bridge.hpp => RNNitroSQLite-Swift-Cxx-Bridge.hpp} (75%) rename package/nitrogen/generated/ios/{RNQuickSQLite-Swift-Cxx-Umbrella.hpp => RNNitroSQLite-Swift-Cxx-Umbrella.hpp} (70%) rename package/nitrogen/generated/ios/{RNQuickSQLiteAutolinking.mm => RNNitroSQLiteAutolinking.mm} (59%) rename package/nitrogen/generated/ios/{RNQuickSQLiteAutolinking.swift => RNNitroSQLiteAutolinking.swift} (53%) create mode 100644 package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp rename package/nitrogen/generated/shared/c++/{HybridQuickSQLiteSpec.hpp => HybridNitroSQLiteSpec.hpp} (74%) delete mode 100644 package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.cpp rename package/src/specs/{NativeQuickSQLiteOnLoad.ios.ts => NativeNitroSQLiteOnLoad.ios.ts} (89%) rename package/src/specs/{NativeQuickSQLiteOnLoad.ts => NativeNitroSQLiteOnLoad.ts} (74%) rename package/src/specs/{QuickSQLite.nitro.ts => NitroSQLite.nitro.ts} (97%) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 5d3d358..e95d6e9 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -github: [mrousavy] +github: [mrousavy, chrispader] diff --git a/.github/workflows/build-android-release.yml b/.github/workflows/build-android-release.yml index 75dc9e1..327f659 100644 --- a/.github/workflows/build-android-release.yml +++ b/.github/workflows/build-android-release.yml @@ -41,7 +41,7 @@ jobs: with: upload_url: ${{ github.event.release.upload_url }} asset_path: example/android/app/build/outputs/apk/release/app-release.apk - asset_name: "QuickSQLiteExample-${{ github.event.release.tag_name }}.apk" + asset_name: "NitroSQLiteExample-${{ github.event.release.tag_name }}.apk" asset_content_type: application/vnd.android.package-archive # Gradle cache doesn't like daemons diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 2fcdf65..32ab449 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -67,8 +67,8 @@ jobs: run: "set -o pipefail && xcodebuild \ CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ -derivedDataPath build -UseModernBuildSystem=YES \ - -workspace QuickSQLiteExample.xcworkspace \ - -scheme QuickSQLiteExample \ + -workspace NitroSQLiteExample.xcworkspace \ + -scheme NitroSQLiteExample \ -sdk iphonesimulator \ -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 16' \ @@ -114,8 +114,8 @@ jobs: run: "set -o pipefail && xcodebuild \ CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ -derivedDataPath build -UseModernBuildSystem=YES \ - -workspace QuickSQLiteExample.xcworkspace \ - -scheme QuickSQLiteExample \ + -workspace NitroSQLiteExample.xcworkspace \ + -scheme NitroSQLiteExample \ -sdk iphonesimulator \ -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 16' \ diff --git a/.github/workflows/lint-typescript.yml b/.github/workflows/lint-typescript.yml index 8f9efa6..20f5ea3 100644 --- a/.github/workflows/lint-typescript.yml +++ b/.github/workflows/lint-typescript.yml @@ -63,14 +63,14 @@ jobs: - name: Run ESLint CI in example/ working-directory: example run: bun lint-ci - - name: Run ESLint CI in react-native-quick-sqlite + - name: Run ESLint CI in react-native-nitro-sqlite working-directory: package run: bun lint-ci - name: Run ESLint with auto-fix in example/ working-directory: example run: bun lint - - name: Run ESLint with auto-fix in react-native-quick-sqlite + - name: Run ESLint with auto-fix in react-native-nitro-sqlite working-directory: package run: bun lint diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e302aa1..af64350 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,9 +49,9 @@ Remember to add tests for your change if possible. Run the unit tests by: bun test ``` -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`. +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`. -To edit the Kotlin files, open `example/android` in Android studio and find the source files at `rnquicksqlite` under `Android`. +To edit the Kotlin files, open `example/android` in Android studio and find the source files at `rnnitrosqlite` under `Android`. ### Commit message convention diff --git a/README.md b/README.md index b60f911..887febe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![screenshot](https://raw.githubusercontent.com/margelo/react-native-quick-sqlite/main/header2.png) +![screenshot](https://raw.githubusercontent.com/margelo/react-native-nitro-sqlite/main/header2.png)
-    bun add react-native-quick-sqlite
+    bun add react-native-nitro-sqlite
     npx pod-install
@@ -14,7 +14,7 @@

-Quick SQLite embeds the latest version of SQLite and provides a low-level JSI-backed API to execute SQL queries. +Nitro SQLite embeds the latest version of SQLite and provides a low-level JSI-backed API to execute SQL queries. 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. @@ -25,7 +25,7 @@ TypeORM is officially supported, however, there is currently a parsing issue wit ## API ```typescript -import {open} from 'react-native-quick-sqlite' +import {open} from 'react-native-nitro-sqlite' const db = open('myDb.sqlite') @@ -54,7 +54,7 @@ db = { The basic query is **synchronous**, it will block rendering on large operations, further below you will find async versions. ```typescript -import { open } from 'react-native-quick-sqlite'; +import { open } from 'react-native-nitro-sqlite'; try { const db = open('myDb.sqlite'); @@ -83,7 +83,7 @@ Throwing an error inside the callback will ROLLBACK the transaction. 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. ```typescript -await QuickSQLite.transaction('myDatabase', (tx) => { +await NitroSQLite.transaction('myDatabase', (tx) => { const { status } = tx.execute( 'UPDATE sometable SET somecolumn = ? where somekey = ?', [0, 1] @@ -117,7 +117,7 @@ const commands = [ [('INSERT INTO TEST (id) VALUES (?)', [[3], [4], [5], [6]])], ]; -const res = QuickSQLite.executeSqlBatch('myDatabase', commands); +const res = NitroSQLite.executeSqlBatch('myDatabase', commands); console.log(`Batch affected ${result.rowsAffected} rows`); ``` @@ -130,7 +130,7 @@ This can be done by testing the returned data directly, but in some cases may no SQLite datatypes. When fetching data directly from tables or views linked to table columns, SQLite can identify the table declared types: ```typescript -let { metadata } = QuickSQLite.executeSql( +let { metadata } = NitroSQLite.executeSql( 'myDatabase', 'SELECT int_column_1, bol_column_2 FROM sometable' ); @@ -148,7 +148,7 @@ metadata.forEach((column) => { 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. ```ts -QuickSQLite.executeAsync( +NitroSQLite.executeAsync( 'myDatabase', 'SELECT * FROM "User";', []).then(({rows}) => { @@ -170,15 +170,15 @@ SQLite has a limit for attached databases: A default of 10, and a global max of References: [Attach](https://www.sqlite.org/lang_attach.html) - [Detach](https://www.sqlite.org/lang_detach.html) ```ts -QuickSQLite.attach('mainDatabase', 'statistics', 'stats', '../databases'); +NitroSQLite.attach('mainDatabase', 'statistics', 'stats', '../databases'); -const res = QuickSQLite.executeSql( +const res = NitroSQLite.executeSql( 'mainDatabase', 'SELECT * FROM some_table_from_mainschema a INNER JOIN stats.some_table b on a.id_column = b.id_column' ); // You can detach databases at any moment -QuickSQLite.detach('mainDatabase', 'stats'); +NitroSQLite.detach('mainDatabase', 'stats'); if (!detachResult.status) { // Database de-attached } @@ -189,7 +189,7 @@ if (!detachResult.status) { If you have a plain SQL file, you can load it directly, with low memory consumption. ```typescript -const { rowsAffected, commands } = QuickSQLite.loadFile( +const { rowsAffected, commands } = NitroSQLite.loadFile( 'myDatabase', '/absolute/path/to/file.sql' ); @@ -198,7 +198,7 @@ const { rowsAffected, commands } = QuickSQLite.loadFile( Or use the async version which will load the file in another native thread ```typescript -QuickSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then( +NitroSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then( (res) => { const { rowsAffected, commands } = res; } @@ -210,7 +210,7 @@ QuickSQLite.loadFileAsync('myDatabase', '/absolute/path/to/file.sql').then( On iOS you can use the embedded SQLite, when running `pod-install` add an environment flag: ``` -QUICK_SQLITE_USE_PHONE_VERSION=1 npx pod-install +Nitro_SQLITE_USE_PHONE_VERSION=1 npx pod-install ``` 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 Now every time you install your node_modules that line will be added. -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: +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: ```js plugins: [ @@ -250,7 +250,7 @@ plugins: [ 'module-resolver', { alias: { - "react-native-sqlite-storage": "react-native-quick-sqlite" + "react-native-sqlite-storage": "react-native-nitro-sqlite" }, }, ], @@ -266,7 +266,7 @@ bun add babel-plugin-module-resolver 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: ```ts -import { typeORMDriver } from 'react-native-quick-sqlite' +import { typeORMDriver } from 'react-native-nitro-sqlite' datasource = new DataSource({ type: 'react-native', @@ -280,7 +280,7 @@ datasource = new DataSource({ # Loading existing DBs -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.). +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.). 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. @@ -297,7 +297,7 @@ Add a `post_install` block to your `/ios/Podfile` like so: ```ruby post_install do |installer| installer.pods_project.targets.each do |target| - if target.name == "react-native-quick-sqlite" then + if target.name == "react-native-nitro-sqlite" then target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'SQLITE_ENABLE_FTS5=1' end @@ -314,7 +314,7 @@ For example, you could add `SQLITE_ENABLE_FTS5=1` to `GCC_PREPROCESSOR_DEFINITIO You can specify flags via `/android/gradle.properties` like so: ``` -quickSqliteFlags="" +nitroSqliteFlags="" ``` ## Additional configuration @@ -323,15 +323,15 @@ quickSqliteFlags="" 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. -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) +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) ## Community Discord -[Join the Margelo Community Discord](https://discord.gg/6CSHz2qAvA) to chat about react-native-quick-sqlite or other Margelo libraries. +[Join the Margelo Community Discord](https://discord.gg/6CSHz2qAvA) to chat about react-native-nitro-sqlite or other Margelo libraries. ## Oscar -react-native-quick-sqlite was originally created by [Oscar Franco](https://github.com/ospfranco). Thanks Oscar! +react-native-nitro-sqlite was originally created by [Oscar Franco](https://github.com/ospfranco). Thanks Oscar! ## License diff --git a/bun.lockb b/bun.lockb index a30a08cd2c262dec733b790de30599fc39b596a5..a4ec91f6d4c278134277fc92b8c462aecf82320b 100755 GIT binary patch delta 298 zcmX@{O6kNar3rcp^#U6j_+;|7yN7IDrmMZ6(c-46v(e#;=d8_3yv4H$Gy!w(sy`ec+)4Q=!0CkeHmE zn4Zeu$-uy%$iUD5GpT*obk^;=rnBYo!HwH)u#9c0zg%8sNm0ITabZqoNorAQVseRY zUSdgRS*k8rqW$q#w(XC%hF%;f0_TR2_-05jiur~m)} delta 256 zcmX@{O6kNar3rcp)jqqD53=1_#HI95S1z!&th&>1`ww%Qb%jeadepUzVmJC(`EsaK z8g`$N{S&l#g0BK2hh+J-?dvzs{MWq0uYHFfBM>tIF*6XeY~SI>`oKd8rb2R zF+G*RlYxOjk%6HBW>WjE>8#s#O=rvFgB!QqU>Vy~f4Rca%;ap{;=-KFlGLKq#N-m) zyu^~svQ%BLMEm2fY}+4yWpCXp0J8*U - QuickSQLiteExample + NitroSQLiteExample diff --git a/example/android/settings.gradle b/example/android/settings.gradle index e566e76..f5671d5 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,6 +1,6 @@ pluginManagement { includeBuild("../../node_modules/@react-native/gradle-plugin") } plugins { id("com.facebook.react.settings") } extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } -rootProject.name = 'QuickSQLiteExample' +rootProject.name = 'NitroSQLiteExample' include ':app' includeBuild('../../node_modules/@react-native/gradle-plugin') diff --git a/example/app.json b/example/app.json index 4bcf88c..39aa826 100644 --- a/example/app.json +++ b/example/app.json @@ -1,10 +1,10 @@ { - "name": "QuickSQLiteExample", - "displayName": "QuickSQLite Example", + "name": "NitroSQLiteExample", + "displayName": "NitroSQLite Example", "components": [ { - "appKey": "QuickSQLiteExample", - "displayName": "QuickSQLite Example" + "appKey": "NitroSQLiteExample", + "displayName": "NitroSQLite Example" } ], "resources": { @@ -15,9 +15,9 @@ "windows": ["dist/assets", "dist/main.windows.bundle"] }, "android": { - "package": "com.margelo.rnquicksqlite.example" + "package": "com.margelo.rnnitrosqlite.example" }, "ios": { - "bundleIdentifier": "com.margelo.rnquicksqlite.example" + "bundleIdentifier": "com.margelo.rnnitrosqlite.example" } } diff --git a/example/babel.config.js b/example/babel.config.js index 4bad783..3ca7eba 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -11,7 +11,7 @@ module.exports = { alias: { [pak.name]: path.join(__dirname, '../package', pak.source), stream: 'stream-browserify', - 'react-native-sqlite-storage': 'react-native-quick-sqlite', + 'react-native-sqlite-storage': 'react-native-nitro-sqlite', }, }, ], diff --git a/example/ios/QuickSQLiteExample.xcodeproj/project.pbxproj b/example/ios/NitroSQLiteExample.xcodeproj/project.pbxproj similarity index 78% rename from example/ios/QuickSQLiteExample.xcodeproj/project.pbxproj rename to example/ios/NitroSQLiteExample.xcodeproj/project.pbxproj index 37eb6ee..d145531 100644 --- a/example/ios/QuickSQLiteExample.xcodeproj/project.pbxproj +++ b/example/ios/NitroSQLiteExample.xcodeproj/project.pbxproj @@ -7,14 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* QuickSQLiteExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* QuickSQLiteExampleTests.m */; }; + 00E356F31AD99517003FC87E /* NitroSQLiteExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* NitroSQLiteExampleTests.m */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 17EA225CB5C6FBE4FF95B3B8 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = B62F4C3A8445C44CF7F54399 /* PrivacyInfo.xcprivacy */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - D7537A007033719516C57748 /* libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F61ADDCA341B787B4A3AFAFC /* libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a */; }; - F6FA2C48029804D08B79E96F /* libPods-QuickSQLiteExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E776B313FBFED7863A3D /* libPods-QuickSQLiteExample.a */; }; + D7537A007033719516C57748 /* libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F61ADDCA341B787B4A3AFAFC /* libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a */; }; + F6FA2C48029804D08B79E96F /* libPods-NitroSQLiteExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCC1E776B313FBFED7863A3D /* libPods-NitroSQLiteExample.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -23,29 +23,29 @@ containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; proxyType = 1; remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = QuickSQLiteExample; + remoteInfo = NitroSQLiteExample; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00E356EE1AD99517003FC87E /* QuickSQLiteExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QuickSQLiteExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 00E356EE1AD99517003FC87E /* NitroSQLiteExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NitroSQLiteExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* QuickSQLiteExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QuickSQLiteExampleTests.m; sourceTree = ""; }; - 03D39CB013C879B46EC1C979 /* Pods-QuickSQLiteExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickSQLiteExample.release.xcconfig"; path = "Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample.release.xcconfig"; sourceTree = ""; }; - 1251E54A0A604DFB2905E20E /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickSQLiteExample-QuickSQLiteExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests.debug.xcconfig"; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* QuickSQLiteExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickSQLiteExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = QuickSQLiteExample/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = QuickSQLiteExample/AppDelegate.mm; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = QuickSQLiteExample/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = QuickSQLiteExample/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = QuickSQLiteExample/main.m; sourceTree = ""; }; - 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = QuickSQLiteExample/LaunchScreen.storyboard; sourceTree = ""; }; - B62F4C3A8445C44CF7F54399 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = QuickSQLiteExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; - BCC1E776B313FBFED7863A3D /* libPods-QuickSQLiteExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QuickSQLiteExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - CA20110A9117BB91D9E63081 /* Pods-QuickSQLiteExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickSQLiteExample.debug.xcconfig"; path = "Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample.debug.xcconfig"; sourceTree = ""; }; - CE317F99C7B7933DEB58C2E6 /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickSQLiteExample-QuickSQLiteExampleTests.release.xcconfig"; path = "Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests.release.xcconfig"; sourceTree = ""; }; + 00E356F21AD99517003FC87E /* NitroSQLiteExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NitroSQLiteExampleTests.m; sourceTree = ""; }; + 03D39CB013C879B46EC1C979 /* Pods-NitroSQLiteExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroSQLiteExample.release.xcconfig"; path = "Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample.release.xcconfig"; sourceTree = ""; }; + 1251E54A0A604DFB2905E20E /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroSQLiteExample-NitroSQLiteExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests.debug.xcconfig"; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* NitroSQLiteExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NitroSQLiteExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = NitroSQLiteExample/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = NitroSQLiteExample/AppDelegate.mm; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = NitroSQLiteExample/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = NitroSQLiteExample/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = NitroSQLiteExample/main.m; sourceTree = ""; }; + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = NitroSQLiteExample/LaunchScreen.storyboard; sourceTree = ""; }; + B62F4C3A8445C44CF7F54399 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = NitroSQLiteExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + BCC1E776B313FBFED7863A3D /* libPods-NitroSQLiteExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NitroSQLiteExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CA20110A9117BB91D9E63081 /* Pods-NitroSQLiteExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroSQLiteExample.debug.xcconfig"; path = "Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample.debug.xcconfig"; sourceTree = ""; }; + CE317F99C7B7933DEB58C2E6 /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroSQLiteExample-NitroSQLiteExampleTests.release.xcconfig"; path = "Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - F61ADDCA341B787B4A3AFAFC /* libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + F61ADDCA341B787B4A3AFAFC /* libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -53,7 +53,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D7537A007033719516C57748 /* libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a in Frameworks */, + D7537A007033719516C57748 /* libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -61,20 +61,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F6FA2C48029804D08B79E96F /* libPods-QuickSQLiteExample.a in Frameworks */, + F6FA2C48029804D08B79E96F /* libPods-NitroSQLiteExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* QuickSQLiteExampleTests */ = { + 00E356EF1AD99517003FC87E /* NitroSQLiteExampleTests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* QuickSQLiteExampleTests.m */, + 00E356F21AD99517003FC87E /* NitroSQLiteExampleTests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, ); - path = QuickSQLiteExampleTests; + path = NitroSQLiteExampleTests; sourceTree = ""; }; 00E356F01AD99517003FC87E /* Supporting Files */ = { @@ -85,7 +85,7 @@ name = "Supporting Files"; sourceTree = ""; }; - 13B07FAE1A68108700A75B9A /* QuickSQLiteExample */ = { + 13B07FAE1A68108700A75B9A /* NitroSQLiteExample */ = { isa = PBXGroup; children = ( 13B07FAF1A68108700A75B9A /* AppDelegate.h */, @@ -96,15 +96,15 @@ 13B07FB71A68108700A75B9A /* main.m */, B62F4C3A8445C44CF7F54399 /* PrivacyInfo.xcprivacy */, ); - name = QuickSQLiteExample; + name = NitroSQLiteExample; sourceTree = ""; }; 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - BCC1E776B313FBFED7863A3D /* libPods-QuickSQLiteExample.a */, - F61ADDCA341B787B4A3AFAFC /* libPods-QuickSQLiteExample-QuickSQLiteExampleTests.a */, + BCC1E776B313FBFED7863A3D /* libPods-NitroSQLiteExample.a */, + F61ADDCA341B787B4A3AFAFC /* libPods-NitroSQLiteExample-NitroSQLiteExampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -119,9 +119,9 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 13B07FAE1A68108700A75B9A /* QuickSQLiteExample */, + 13B07FAE1A68108700A75B9A /* NitroSQLiteExample */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* QuickSQLiteExampleTests */, + 00E356EF1AD99517003FC87E /* NitroSQLiteExampleTests */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, BBD78D7AC51CEA395F1C20DB /* Pods */, @@ -134,8 +134,8 @@ 83CBBA001A601CBA00E9B192 /* Products */ = { isa = PBXGroup; children = ( - 13B07F961A680F5B00A75B9A /* QuickSQLiteExample.app */, - 00E356EE1AD99517003FC87E /* QuickSQLiteExampleTests.xctest */, + 13B07F961A680F5B00A75B9A /* NitroSQLiteExample.app */, + 00E356EE1AD99517003FC87E /* NitroSQLiteExampleTests.xctest */, ); name = Products; sourceTree = ""; @@ -143,10 +143,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - CA20110A9117BB91D9E63081 /* Pods-QuickSQLiteExample.debug.xcconfig */, - 03D39CB013C879B46EC1C979 /* Pods-QuickSQLiteExample.release.xcconfig */, - 1251E54A0A604DFB2905E20E /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.debug.xcconfig */, - CE317F99C7B7933DEB58C2E6 /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.release.xcconfig */, + CA20110A9117BB91D9E63081 /* Pods-NitroSQLiteExample.debug.xcconfig */, + 03D39CB013C879B46EC1C979 /* Pods-NitroSQLiteExample.release.xcconfig */, + 1251E54A0A604DFB2905E20E /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.debug.xcconfig */, + CE317F99C7B7933DEB58C2E6 /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -154,9 +154,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* QuickSQLiteExampleTests */ = { + 00E356ED1AD99517003FC87E /* NitroSQLiteExampleTests */ = { isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "QuickSQLiteExampleTests" */; + buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "NitroSQLiteExampleTests" */; buildPhases = ( 2CDC9C54CCFE5D9F92A50675 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, @@ -170,14 +170,14 @@ dependencies = ( 00E356F51AD99517003FC87E /* PBXTargetDependency */, ); - name = QuickSQLiteExampleTests; - productName = QuickSQLiteExampleTests; - productReference = 00E356EE1AD99517003FC87E /* QuickSQLiteExampleTests.xctest */; + name = NitroSQLiteExampleTests; + productName = NitroSQLiteExampleTests; + productReference = 00E356EE1AD99517003FC87E /* NitroSQLiteExampleTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 13B07F861A680F5B00A75B9A /* QuickSQLiteExample */ = { + 13B07F861A680F5B00A75B9A /* NitroSQLiteExample */ = { isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "QuickSQLiteExample" */; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NitroSQLiteExample" */; buildPhases = ( 8851BB48F109827B5AB11D8D /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, @@ -192,9 +192,9 @@ ); dependencies = ( ); - name = QuickSQLiteExample; - productName = QuickSQLiteExample; - productReference = 13B07F961A680F5B00A75B9A /* QuickSQLiteExample.app */; + name = NitroSQLiteExample; + productName = NitroSQLiteExample; + productReference = 13B07F961A680F5B00A75B9A /* NitroSQLiteExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -214,7 +214,7 @@ }; }; }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "QuickSQLiteExample" */; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NitroSQLiteExample" */; compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; @@ -227,8 +227,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 13B07F861A680F5B00A75B9A /* QuickSQLiteExample */, - 00E356ED1AD99517003FC87E /* QuickSQLiteExampleTests */, + 13B07F861A680F5B00A75B9A /* NitroSQLiteExample */, + 00E356ED1AD99517003FC87E /* NitroSQLiteExampleTests */, ); }; /* End PBXProject section */ @@ -285,7 +285,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -298,15 +298,15 @@ files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; 6930F3E39E7F1174A4E95A27 /* [CP] Embed Pods Frameworks */ = { @@ -315,15 +315,15 @@ files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 8851BB48F109827B5AB11D8D /* [CP] Check Pods Manifest.lock */ = { @@ -341,7 +341,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-QuickSQLiteExample-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-NitroSQLiteExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -354,15 +354,15 @@ files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample/Pods-QuickSQLiteExample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample/Pods-NitroSQLiteExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 9DED98E0C31C147A92DCCCAA /* [CP] Copy Pods Resources */ = { @@ -371,15 +371,15 @@ files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QuickSQLiteExample-QuickSQLiteExampleTests/Pods-QuickSQLiteExample-QuickSQLiteExampleTests-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroSQLiteExample-NitroSQLiteExampleTests/Pods-NitroSQLiteExample-NitroSQLiteExampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; FD10A7F022414F080027D42C /* Start Packager */ = { @@ -408,7 +408,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* QuickSQLiteExampleTests.m in Sources */, + 00E356F31AD99517003FC87E /* NitroSQLiteExampleTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -426,7 +426,7 @@ /* Begin PBXTargetDependency section */ 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* QuickSQLiteExample */; + target = 13B07F861A680F5B00A75B9A /* NitroSQLiteExample */; targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -434,14 +434,14 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1251E54A0A604DFB2905E20E /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.debug.xcconfig */; + baseConfigurationReference = 1251E54A0A604DFB2905E20E /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = QuickSQLiteExampleTests/Info.plist; + INFOPLIST_FILE = NitroSQLiteExampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -455,17 +455,17 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickSQLiteExample.app/QuickSQLiteExample"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NitroSQLiteExample.app/NitroSQLiteExample"; }; name = Debug; }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CE317F99C7B7933DEB58C2E6 /* Pods-QuickSQLiteExample-QuickSQLiteExampleTests.release.xcconfig */; + baseConfigurationReference = CE317F99C7B7933DEB58C2E6 /* Pods-NitroSQLiteExample-NitroSQLiteExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = QuickSQLiteExampleTests/Info.plist; + INFOPLIST_FILE = NitroSQLiteExampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -479,20 +479,20 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickSQLiteExample.app/QuickSQLiteExample"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NitroSQLiteExample.app/NitroSQLiteExample"; }; name = Release; }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CA20110A9117BB91D9E63081 /* Pods-QuickSQLiteExample.debug.xcconfig */; + baseConfigurationReference = CA20110A9117BB91D9E63081 /* Pods-NitroSQLiteExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = WYL5V2KKR3; ENABLE_BITCODE = NO; - INFOPLIST_FILE = QuickSQLiteExample/Info.plist; + INFOPLIST_FILE = NitroSQLiteExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -504,7 +504,7 @@ "-lc++", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = QuickSQLiteExample; + PRODUCT_NAME = NitroSQLiteExample; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -513,13 +513,13 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 03D39CB013C879B46EC1C979 /* Pods-QuickSQLiteExample.release.xcconfig */; + baseConfigurationReference = 03D39CB013C879B46EC1C979 /* Pods-NitroSQLiteExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = WYL5V2KKR3; - INFOPLIST_FILE = QuickSQLiteExample/Info.plist; + INFOPLIST_FILE = NitroSQLiteExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -531,7 +531,7 @@ "-lc++", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = QuickSQLiteExample; + PRODUCT_NAME = NitroSQLiteExample; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; @@ -700,7 +700,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "QuickSQLiteExampleTests" */ = { + 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "NitroSQLiteExampleTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 00E356F61AD99517003FC87E /* Debug */, @@ -709,7 +709,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "QuickSQLiteExample" */ = { + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NitroSQLiteExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, @@ -718,7 +718,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "QuickSQLiteExample" */ = { + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NitroSQLiteExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, diff --git a/example/ios/NitroSQLiteExample.xcodeproj/xcshareddata/xcschemes/NitroSQLiteExample.xcscheme b/example/ios/NitroSQLiteExample.xcodeproj/xcshareddata/xcschemes/NitroSQLiteExample.xcscheme new file mode 100644 index 0000000..e220b63 --- /dev/null +++ b/example/ios/NitroSQLiteExample.xcodeproj/xcshareddata/xcschemes/NitroSQLiteExample.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/NitroSQLiteExample.xcworkspace/contents.xcworkspacedata b/example/ios/NitroSQLiteExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..cb9898e --- /dev/null +++ b/example/ios/NitroSQLiteExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/example/ios/QuickSQLiteExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/NitroSQLiteExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from example/ios/QuickSQLiteExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to example/ios/NitroSQLiteExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/ios/QuickSQLiteExample/AppDelegate.h b/example/ios/NitroSQLiteExample/AppDelegate.h similarity index 100% rename from example/ios/QuickSQLiteExample/AppDelegate.h rename to example/ios/NitroSQLiteExample/AppDelegate.h diff --git a/example/ios/QuickSQLiteExample/AppDelegate.mm b/example/ios/NitroSQLiteExample/AppDelegate.mm similarity index 93% rename from example/ios/QuickSQLiteExample/AppDelegate.mm rename to example/ios/NitroSQLiteExample/AppDelegate.mm index a617319..dde628a 100644 --- a/example/ios/QuickSQLiteExample/AppDelegate.mm +++ b/example/ios/NitroSQLiteExample/AppDelegate.mm @@ -6,7 +6,7 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.moduleName = @"QuickSQLiteExample"; + self.moduleName = @"NitroSQLiteExample"; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } diff --git a/example/ios/QuickSQLiteExample/Images.xcassets/AppIcon.appiconset/Contents.json b/example/ios/NitroSQLiteExample/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from example/ios/QuickSQLiteExample/Images.xcassets/AppIcon.appiconset/Contents.json rename to example/ios/NitroSQLiteExample/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/example/ios/QuickSQLiteExample/Images.xcassets/Contents.json b/example/ios/NitroSQLiteExample/Images.xcassets/Contents.json similarity index 100% rename from example/ios/QuickSQLiteExample/Images.xcassets/Contents.json rename to example/ios/NitroSQLiteExample/Images.xcassets/Contents.json diff --git a/example/ios/NitroSQLiteExample/Info.plist b/example/ios/NitroSQLiteExample/Info.plist new file mode 100644 index 0000000..eaf978d --- /dev/null +++ b/example/ios/NitroSQLiteExample/Info.plist @@ -0,0 +1,52 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + NitroSQLiteExample + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + + NSLocationWhenInUseUsageDescription + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/example/ios/NitroSQLiteExample/LaunchScreen.storyboard b/example/ios/NitroSQLiteExample/LaunchScreen.storyboard new file mode 100644 index 0000000..4bd4247 --- /dev/null +++ b/example/ios/NitroSQLiteExample/LaunchScreen.storyboard @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/QuickSQLiteExample/PrivacyInfo.xcprivacy b/example/ios/NitroSQLiteExample/PrivacyInfo.xcprivacy similarity index 100% rename from example/ios/QuickSQLiteExample/PrivacyInfo.xcprivacy rename to example/ios/NitroSQLiteExample/PrivacyInfo.xcprivacy diff --git a/example/ios/QuickSQLiteExample/main.m b/example/ios/NitroSQLiteExample/main.m similarity index 100% rename from example/ios/QuickSQLiteExample/main.m rename to example/ios/NitroSQLiteExample/main.m diff --git a/example/ios/QuickSQLiteExampleTests/Info.plist b/example/ios/NitroSQLiteExampleTests/Info.plist similarity index 100% rename from example/ios/QuickSQLiteExampleTests/Info.plist rename to example/ios/NitroSQLiteExampleTests/Info.plist diff --git a/example/ios/QuickSQLiteExampleTests/QuickSQLiteExampleTests.m b/example/ios/NitroSQLiteExampleTests/NitroSQLiteExampleTests.m similarity index 95% rename from example/ios/QuickSQLiteExampleTests/QuickSQLiteExampleTests.m rename to example/ios/NitroSQLiteExampleTests/NitroSQLiteExampleTests.m index 5a3993e..ab7306e 100644 --- a/example/ios/QuickSQLiteExampleTests/QuickSQLiteExampleTests.m +++ b/example/ios/NitroSQLiteExampleTests/NitroSQLiteExampleTests.m @@ -7,11 +7,11 @@ #define TIMEOUT_SECONDS 600 #define TEXT_TO_LOOK_FOR @"Welcome to React" -@interface QuickSQLiteExampleTests : XCTestCase +@interface NitroSQLiteExampleTests : XCTestCase @end -@implementation QuickSQLiteExampleTests +@implementation NitroSQLiteExampleTests - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test { diff --git a/example/ios/Podfile b/example/ios/Podfile index 0862af0..d2a63e9 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -16,7 +16,7 @@ linkage = ENV['USE_FRAMEWORKS'] use_frameworks! :linkage => linkage.to_sym end -target 'QuickSQLiteExample' do +target 'NitroSQLiteExample' do config = use_native_modules! use_react_native!( @@ -25,9 +25,9 @@ target 'QuickSQLiteExample' do :app_path => "#{Pod::Config.instance.installation_root}/.." ) - # pod 'RNQuickSQLite', :path => '../../package' + # pod 'RNNitroSQLite', :path => '../../package' - target 'QuickSQLiteExampleTests' do + target 'NitroSQLiteExampleTests' do inherit! :complete # Pods for testing end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index f5756e1..0296db1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1596,7 +1596,7 @@ PODS: - React-logger (= 0.76.1) - React-perflogger (= 0.76.1) - React-utils (= 0.76.1) - - RNQuickSQLite (8.2.5): + - RNNitroSQLite (8.2.2-nitro.1): - DoubleConversion - glog - hermes-engine @@ -1733,7 +1733,7 @@ DEPENDENCIES: - React-utils (from `../../node_modules/react-native/ReactCommon/react/utils`) - ReactCodegen (from `build/generated/ios`) - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`) - - RNQuickSQLite (from `../../package`) + - RNNitroSQLite (from `../../package`) - RNScreens (from `../../node_modules/react-native-screens`) - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) @@ -1871,7 +1871,7 @@ EXTERNAL SOURCES: :path: build/generated/ios ReactCommon: :path: "../../node_modules/react-native/ReactCommon" - RNQuickSQLite: + RNNitroSQLite: :path: "../../package" RNScreens: :path: "../../node_modules/react-native-screens" @@ -1943,11 +1943,11 @@ SPEC CHECKSUMS: React-utils: 5362bd16a9563f9916e7a56c011ddc533507650f ReactCodegen: 4e26d365313307cc7c95e693529e539acfb5c64c ReactCommon: 422e364463f33e336fc4db196aeb50fd801d90d6 - RNQuickSQLite: 8ef02913f22a4ca65f44cf826acd0185aa5d6771 + RNNitroSQLite: 414f19ca9a1a29aa1a1ff7ecfa6bc03c7884e9b1 RNScreens: e389d6a6a66a4f0d3662924ecae803073ccce8ec SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: db69236006b8b1c6d55ab453390c882306cbf219 -PODFILE CHECKSUM: c6724dc625a6aa9f3f0577b2c2d3f9b39ece8968 +PODFILE CHECKSUM: 27ad3045377187b09e7ab4a604c851aa9838f52d COCOAPODS: 1.15.2 diff --git a/example/ios/QuickSQLiteExample.xcodeproj/xcshareddata/xcschemes/QuickSQLiteExample.xcscheme b/example/ios/QuickSQLiteExample.xcodeproj/xcshareddata/xcschemes/QuickSQLiteExample.xcscheme deleted file mode 100644 index 5f53de4..0000000 --- a/example/ios/QuickSQLiteExample.xcodeproj/xcshareddata/xcschemes/QuickSQLiteExample.xcscheme +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/QuickSQLiteExample.xcworkspace/contents.xcworkspacedata b/example/ios/QuickSQLiteExample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index c1e31da..0000000 --- a/example/ios/QuickSQLiteExample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/example/ios/QuickSQLiteExample/Info.plist b/example/ios/QuickSQLiteExample/Info.plist deleted file mode 100644 index 1b9a707..0000000 --- a/example/ios/QuickSQLiteExample/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - QuickSQLiteExample - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - - NSAllowsArbitraryLoads - - NSAllowsLocalNetworking - - - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/example/ios/QuickSQLiteExample/LaunchScreen.storyboard b/example/ios/QuickSQLiteExample/LaunchScreen.storyboard deleted file mode 100644 index 851d08c..0000000 --- a/example/ios/QuickSQLiteExample/LaunchScreen.storyboard +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/package.json b/example/package.json index c55c395..5f1d186 100644 --- a/example/package.json +++ b/example/package.json @@ -1,6 +1,6 @@ { - "name": "react-native-quick-sqlite-example", - "version": "8.2.3", + "name": "react-native-nitro-sqlite-example", + "version": "8.2.2-nitro.1", "private": true, "scripts": { "start": "react-native start", @@ -24,7 +24,7 @@ "react": "*", "react-native": "*", "react-native-nitro-modules": "*", - "react-native-quick-sqlite": "8.2.5", + "react-native-nitro-sqlite": "8.2.2-nitro.1", "react-native-safe-area-context": "^4.14.0", "react-native-screens": "^3.35.0", "reflect-metadata": "^0.1.13", diff --git a/example/src/Database.ts b/example/src/Database.ts index 2a2514a..e3e1d3a 100644 --- a/example/src/Database.ts +++ b/example/src/Database.ts @@ -1,6 +1,6 @@ import { DataSource } from 'typeorm' -import type { QueryResult } from 'react-native-quick-sqlite' -import { typeORMDriver } from 'react-native-quick-sqlite' +import type { QueryResult } from 'react-native-nitro-sqlite' +import { typeORMDriver } from 'react-native-nitro-sqlite' import { Book } from './model/Book' import { User } from './model/User' let datasource: DataSource diff --git a/example/src/tests/db.ts b/example/src/tests/db.ts index e94b65a..c1b75a4 100644 --- a/example/src/tests/db.ts +++ b/example/src/tests/db.ts @@ -1,13 +1,13 @@ import Chance from 'chance' import type { - QuickSQLiteConnection, + NitroSQLiteConnection, BatchQueryCommand, -} from 'react-native-quick-sqlite' -import { open } from 'react-native-quick-sqlite' +} from 'react-native-nitro-sqlite' +import { open } from 'react-native-nitro-sqlite' const chance = new Chance() -export let testDb: QuickSQLiteConnection | undefined +export let testDb: NitroSQLiteConnection | undefined export function resetTestDb() { try { if (testDb != null) { @@ -26,7 +26,7 @@ export function resetTestDb() { // Taken from "op-sqlite" example project. // Used to demonstrate the performance of NitroSQLite. const ROWS = 300000 -export let largeDb: QuickSQLiteConnection | undefined +export let largeDb: NitroSQLiteConnection | undefined export function resetLargeDb() { try { if (largeDb != null) { diff --git a/example/src/tests/typeorm.spec.ts b/example/src/tests/typeorm.spec.ts index 9f262eb..5e51eec 100644 --- a/example/src/tests/typeorm.spec.ts +++ b/example/src/tests/typeorm.spec.ts @@ -1,7 +1,7 @@ import type { Repository } from 'typeorm' import { DataSource } from 'typeorm' import { beforeAll, it, describe, beforeEachAsync } from './MochaRNAdapter' -import { typeORMDriver } from 'react-native-quick-sqlite' +import { typeORMDriver } from 'react-native-nitro-sqlite' import { User } from '../model/User' import { Book } from '../model/Book' import chai from 'chai' diff --git a/example/src/tests/unitTests.spec.ts b/example/src/tests/unitTests.spec.ts index 79d3fc8..5b53040 100644 --- a/example/src/tests/unitTests.spec.ts +++ b/example/src/tests/unitTests.spec.ts @@ -1,12 +1,11 @@ import Chance from 'chance' import type { - QuickSQLiteConnection, + NitroSQLiteConnection, BatchQueryCommand, -} from 'react-native-quick-sqlite' +} from 'react-native-nitro-sqlite' import { beforeEach, describe, it } from './MochaRNAdapter' import chai from 'chai' import { testDb as testDbInternal, resetTestDb } from './db' -import { User } from '../model/User' function isError(e: unknown): e is Error { return e instanceof Error @@ -16,7 +15,7 @@ const expect = chai.expect const chance = new Chance() export function registerUnitTests() { - let testDb: QuickSQLiteConnection + let testDb: NitroSQLiteConnection beforeEach(() => { try { @@ -119,7 +118,7 @@ export function registerUnitTests() { 'cannot store TEXT value in REAL column User.age' ) } else { - expect.fail('Should have thrown a valid QuickSQLiteException') + expect.fail('Should have thrown a valid NitroSQLiteException') } } }) @@ -343,7 +342,7 @@ export function registerUnitTests() { expect.fail('Should not resolve') } catch (e) { if (isError(e)) expect(e.message).to.equal('Error from callback') - else expect.fail('Should have thrown a valid QuickSQLiteException') + else expect.fail('Should have thrown a valid NitroSQLiteException') } }) @@ -359,7 +358,7 @@ export function registerUnitTests() { } catch (e) { if (isError(e)) expect(e.message).to.include('no such table: tableThatDoesNotExist') - else expect.fail('Should have thrown a valid QuickSQLiteException') + else expect.fail('Should have thrown a valid NitroSQLiteException') } }) @@ -431,7 +430,7 @@ export function registerUnitTests() { const res = testDb.execute('SELECT * FROM User') expect(res.rows?._array).to.eql([]) } else { - expect.fail('Should have thrown a valid QuickSQLiteException') + expect.fail('Should have thrown a valid NitroSQLiteException') } } }) @@ -545,7 +544,7 @@ export function registerUnitTests() { expect.fail('Should not resolve') } catch (e) { if (isError(e)) expect(e.message).to.equal('Error from callback') - else expect.fail('Should have thrown a valid QuickSQLiteException') + else expect.fail('Should have thrown a valid NitroSQLiteException') } }) @@ -562,7 +561,7 @@ export function registerUnitTests() { } catch (e) { if (isError(e)) expect(e.message).to.include('no such table: tableThatDoesNotExist') - else expect.fail('Should have thrown a valid QuickSQLiteException') + else expect.fail('Should have thrown a valid NitroSQLiteException') } }) diff --git a/package.json b/package.json index 5d83c96..23cc643 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "react-native-quick-sqlite-workspace", - "version": "8.2.3", + "name": "react-native-nitro-sqlite-workspace", + "version": "8.2.2-nitro.1", "packageManager": "bun@1.1.21", "private": "true", "workspaces": [ @@ -9,14 +9,14 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/margelo/react-native-quick-sqlite.git" + "url": "git+https://github.com/margelo/react-native-nitro-sqlite.git" }, - "author": "Marc Rousavy (https://github.com/mrousavy)", + "author": "Margelo (https://github.com/margelo)", "license": "MIT", "bugs": { - "url": "https://github.com/margelo/react-native-quick-sqlite/issues" + "url": "https://github.com/margelo/react-native-nitro-sqlite/issues" }, - "homepage": "https://github.com/margelo/react-native-quick-sqlite#readme", + "homepage": "https://github.com/margelo/react-native-nitro-sqlite#readme", "scripts": { "postinstall": "patch-package", "typescript": "bun --filter=\"**\" typescript", @@ -84,7 +84,7 @@ }, { "file": "example/package.json", - "path": "dependencies.react-native-quick-sqlite" + "path": "dependencies.react-native-nitro-sqlite" } ] }, diff --git a/package/RNQuickSQLite.podspec b/package/RNNitroSQLite.podspec similarity index 93% rename from package/RNQuickSQLite.podspec rename to package/RNNitroSQLite.podspec index fab5913..689e43f 100644 --- a/package/RNQuickSQLite.podspec +++ b/package/RNNitroSQLite.podspec @@ -8,7 +8,7 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 performance_mode = 1 Pod::Spec.new do |s| - s.name = "RNQuickSQLite" + s.name = "RNNitroSQLite" s.version = package["version"] s.summary = package["description"] s.homepage = package["homepage"] @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.authors = package["author"] s.platforms = { :ios => min_ios_version_supported, :visionos => "1.0" } - s.source = { :git => "https://github.com/margelo/react-native-quick-sqlite.git", :tag => "#{s.version}" } + s.source = { :git => "https://github.com/margelo/react-native-nitro-sqlite.git", :tag => "#{s.version}" } # s.header_mappings_dir = "cpp" s.source_files = "ios/**/*.{h,hpp,m,mm}", "cpp/**/*.{h,hpp,c,cpp}" @@ -29,7 +29,7 @@ Pod::Spec.new do |s| 'CLANG_CXX_LIBRARY' => 'libc++' } - load 'nitrogen/generated/ios/RNQuickSQLite+autolinking.rb' + load 'nitrogen/generated/ios/RNNitroSQLite+autolinking.rb' add_nitrogen_files(s) # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. @@ -69,7 +69,7 @@ Pod::Spec.new do |s| xcconfig[:OTHER_CFLAGS] = optimizedCflags + ' -DSQLITE_THREADSAFE=1 ' end - if ENV['QUICK_SQLITE_USE_PHONE_VERSION'] == '1' then + if ENV['NITRO_SQLITE_USE_PHONE_VERSION'] == '1' then s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h" s.library = "sqlite3" end diff --git a/package/android/CMakeLists.txt b/package/android/CMakeLists.txt index 8ec763a..adff9c5 100644 --- a/package/android/CMakeLists.txt +++ b/package/android/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.13) -project(RNQuickSQLite) +project(RNNitroSQLite) set (CMAKE_VERBOSE_MAKEFILE ON) set (CMAKE_CXX_STANDARD 20) @@ -14,12 +14,12 @@ file(GLOB_RECURSE cpp_files RELATIVE ${CMAKE_SOURCE_DIR} "cpp-adapter.cpp" ) -# Create library "RNQuickSQLite" and add all C++ files to it +# Create library "RNNitroSQLite" and add all C++ files to it add_library(${CMAKE_PROJECT_NAME} SHARED ${cpp_files} ) -include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/RNQuickSQLite+autolinking.cmake) +include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/RNNitroSQLite+autolinking.cmake) # Specifies a path to native header files. include_directories( diff --git a/package/android/build.gradle b/package/android/build.gradle index eaa5367..f5b8326 100644 --- a/package/android/build.gradle +++ b/package/android/build.gradle @@ -1,6 +1,6 @@ buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault - def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNQuickSQLite_kotlinVersion"] + def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNNitroSQLite_kotlinVersion"] repositories { google() @@ -24,11 +24,11 @@ def isNewArchitectureEnabled() { } def getExtOrDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNQuickSQLite_" + name] + return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNNitroSQLite_" + name] } def getExtOrIntegerDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNQuickSQLite_" + name]).toInteger() + return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNNitroSQLite_" + name]).toInteger() } def safeAppExtGet(prop, fallback) { @@ -63,7 +63,7 @@ def resolveReactNativeDirectory() { return reactNativePackage.parentFile } - throw new GradleException("[react-native-quick-sqlite] Unable to resolve react-native location in node_modules. Your app should define `REACT_NATIVE_NODE_MODULES_DIR` extension property in `app/build.gradle` with a path to react-native in node_modules.") + throw new GradleException("[react-native-nitro-sqlite] Unable to resolve react-native location in node_modules. Your app should define `REACT_NATIVE_NODE_MODULES_DIR` extension property in `app/build.gradle` with a path to react-native in node_modules.") } def reactNativeRootDir = resolveReactNativeDirectory() @@ -73,7 +73,7 @@ file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { rea def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() -def SQLITE_FLAGS = rootProject.properties['quickSqliteFlags'] +def SQLITE_FLAGS = rootProject.properties['nitroSqliteFlags'] apply plugin: "com.android.library" apply plugin: "kotlin-android" @@ -82,11 +82,11 @@ if (isNewArchitectureEnabled()) { apply plugin: "com.facebook.react" } -apply from: '../nitrogen/generated/android/RNQuickSQLite+autolinking.gradle' +apply from: '../nitrogen/generated/android/RNNitroSQLite+autolinking.gradle' android { if (supportsNamespace()) { - namespace "com.margelo.rnquicksqlite" + namespace "com.margelo.rnnitrosqlite" sourceSets { main { @@ -193,7 +193,7 @@ dependencies { if (isNewArchitectureEnabled()) { react { jsRootDir = file("../src/") - libraryName = "RNQuickSQLite" - codegenJavaPackageName = "com.margelo.rnquicksqlite" + libraryName = "RNNitroSQLite" + codegenJavaPackageName = "com.margelo.rnnitrosqlite" } } diff --git a/package/android/cpp-adapter.cpp b/package/android/cpp-adapter.cpp index 6ef673e..d0874bf 100644 --- a/package/android/cpp-adapter.cpp +++ b/package/android/cpp-adapter.cpp @@ -2,20 +2,20 @@ #include #include #include -#include "HybridQuickSQLite.hpp" -#include "RNQuickSQLiteOnLoad.hpp" +#include "HybridNitroSQLite.hpp" +#include "RNNitroSQLiteOnLoad.hpp" -using namespace margelo::nitro::rnquicksqlite; +using namespace margelo::nitro::rnnitrosqlite; JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - return margelo::nitro::rnquicksqlite::initialize(vm); + return margelo::nitro::rnnitrosqlite::initialize(vm); } extern "C" JNIEXPORT void JNICALL -Java_com_margelo_rnquicksqlite_DocPathSetter_setDocPathInJNI(JNIEnv *env, jclass clazz, +Java_com_margelo_rnnitrosqlite_DocPathSetter_setDocPathInJNI(JNIEnv *env, jclass clazz, jstring doc_path) { const char *nativeString = env->GetStringUTFChars(doc_path, nullptr); - HybridQuickSQLite::docPath = std::string(nativeString); + HybridNitroSQLite::docPath = std::string(nativeString); env->ReleaseStringUTFChars(doc_path, nativeString); } diff --git a/package/android/gradle.properties b/package/android/gradle.properties index d4af136..dabd683 100644 --- a/package/android/gradle.properties +++ b/package/android/gradle.properties @@ -1,5 +1,5 @@ -RNQuickSQLite_kotlinVersion=1.7.0 -RNQuickSQLite_minSdkVersion=21 -RNQuickSQLite_targetSdkVersion=31 -RNQuickSQLite_compileSdkVersion=31 -RNQuickSQLite_ndkversion=21.4.7075529 +RNNitroSQLite_kotlinVersion=1.7.0 +RNNitroSQLite_minSdkVersion=21 +RNNitroSQLite_targetSdkVersion=31 +RNNitroSQLite_compileSdkVersion=31 +RNNitroSQLite_ndkversion=21.4.7075529 diff --git a/package/android/src/main/AndroidManifest.xml b/package/android/src/main/AndroidManifest.xml index 8862041..9838318 100644 --- a/package/android/src/main/AndroidManifest.xml +++ b/package/android/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ + package="com.margelo.rnnitrosqlite"> diff --git a/package/android/src/main/java/com/margelo/rnquicksqlite/DocPathSetter.kt b/package/android/src/main/java/com/margelo/rnnitrosqlite/DocPathSetter.kt similarity index 89% rename from package/android/src/main/java/com/margelo/rnquicksqlite/DocPathSetter.kt rename to package/android/src/main/java/com/margelo/rnnitrosqlite/DocPathSetter.kt index c5f2c7b..a7c524a 100644 --- a/package/android/src/main/java/com/margelo/rnquicksqlite/DocPathSetter.kt +++ b/package/android/src/main/java/com/margelo/rnnitrosqlite/DocPathSetter.kt @@ -1,4 +1,4 @@ -package com.margelo.rnquicksqlite +package com.margelo.rnnitrosqlite import com.facebook.react.bridge.ReactApplicationContext diff --git a/package/android/src/main/java/com/margelo/rnquicksqlite/RNQuickSQLitePackage.kt b/package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt similarity index 71% rename from package/android/src/main/java/com/margelo/rnquicksqlite/RNQuickSQLitePackage.kt rename to package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt index dc4ead0..2b83f70 100644 --- a/package/android/src/main/java/com/margelo/rnquicksqlite/RNQuickSQLitePackage.kt +++ b/package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt @@ -1,4 +1,4 @@ -package com.margelo.rnquicksqlite +package com.margelo.rnnitrosqlite import com.facebook.react.TurboReactPackage import com.facebook.react.bridge.NativeModule @@ -6,10 +6,10 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.module.model.ReactModuleInfo import com.facebook.react.module.model.ReactModuleInfoProvider -class RNQuickSQLitePackage : TurboReactPackage() { +class RNNitroSQLitePackage : TurboReactPackage() { override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { - return if (name == RNQuickSQLiteOnLoadModule.NAME) { - RNQuickSQLiteOnLoadModule(reactContext) + return if (name == RNNitroSQLiteOnLoadModule.NAME) { + RNNitroSQLiteOnLoadModule(reactContext) } else { null } @@ -19,9 +19,9 @@ class RNQuickSQLitePackage : TurboReactPackage() { return ReactModuleInfoProvider { val moduleInfos: MutableMap = HashMap() val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED - moduleInfos[RNQuickSQLiteOnLoadModule.NAME] = ReactModuleInfo( - RNQuickSQLiteOnLoadModule.NAME, - RNQuickSQLiteOnLoadModule.NAME, + moduleInfos[RNNitroSQLiteOnLoadModule.NAME] = ReactModuleInfo( + RNNitroSQLiteOnLoadModule.NAME, + RNNitroSQLiteOnLoadModule.NAME, canOverrideExistingModule=false, needsEagerInit=true, hasConstants=true, @@ -34,7 +34,7 @@ class RNQuickSQLitePackage : TurboReactPackage() { companion object { init { - System.loadLibrary("RNQuickSQLite") + System.loadLibrary("RNNitroSQLite") } } } diff --git a/package/android/src/newarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt b/package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt similarity index 77% rename from package/android/src/newarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt rename to package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt index 4aade82..5b019ee 100644 --- a/package/android/src/newarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt +++ b/package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt @@ -1,11 +1,11 @@ -package com.margelo.rnquicksqlite +package com.margelo.rnnitrosqlite import com.facebook.react.bridge.Callback import com.facebook.react.bridge.ReactApplicationContext -import com.margelo.rnquicksqlite.NativeQuickSQLiteOnLoadSpec +import com.margelo.rnnitrosqlite.NativeNitroSQLiteOnLoadSpec -class RNQuickSQLiteOnLoadModule(reactContext: ReactApplicationContext) : - NativeQuickSQLiteOnLoadSpec(reactContext) { +class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) : + NativeNitroSQLiteOnLoadSpec(reactContext) { private var reactApplicationContextReadyCallback: Callback? = null init { @@ -31,7 +31,7 @@ class RNQuickSQLiteOnLoadModule(reactContext: ReactApplicationContext) : } companion object { - const val NAME: String = "RNQuickSQLiteOnLoad" + const val NAME: String = "RNNitroSQLiteOnLoad" var reactContext: ReactApplicationContext? = null private set diff --git a/package/android/src/oldarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt b/package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt similarity index 86% rename from package/android/src/oldarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt rename to package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt index cf1917b..0ed4019 100644 --- a/package/android/src/oldarch/com/margelo/rnquicksqlite/RNQuickSQLiteOnLoadModule.kt +++ b/package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt @@ -1,11 +1,11 @@ -package com.margelo.rnquicksqlite +package com.margelo.rnnitrosqlite import com.facebook.react.bridge.Callback import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod -class RNQuickSQLiteOnLoadModule(reactContext: ReactApplicationContext) : +class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { @@ -33,7 +33,7 @@ class RNQuickSQLiteOnLoadModule(reactContext: ReactApplicationContext) : } companion object { - const val NAME: String = "RNNQuickSQLiteOnLoad" + const val NAME: String = "RNNitroSQLiteOnLoad" var reactContext: ReactApplicationContext? = null private set diff --git a/package/cpp/QuickSQLiteException.hpp b/package/cpp/NitroSQLiteException.hpp similarity index 51% rename from package/cpp/QuickSQLiteException.hpp rename to package/cpp/NitroSQLiteException.hpp index e81c7f5..e224cca 100644 --- a/package/cpp/QuickSQLiteException.hpp +++ b/package/cpp/NitroSQLiteException.hpp @@ -4,7 +4,7 @@ #include #include -enum QuickSQLiteExceptionType { +enum NitroSQLiteExceptionType { UnknownError, DatabaseCannotBeOpened, DatabaseNotOpen, @@ -14,7 +14,7 @@ enum QuickSQLiteExceptionType { NoBatchCommandsProvided }; -inline std::unordered_map exceptionTypeStrings = { +inline std::unordered_map exceptionTypeStrings = { {UnknownError, "UnknownError"}, {DatabaseCannotBeOpened, "DatabaseCannotBeOpened"}, {DatabaseNotOpen, "DatabaseNotOpen"}, @@ -24,17 +24,17 @@ inline std::unordered_map exceptionTypeSt {NoBatchCommandsProvided, "NoBatchCommandsProvided"} }; -inline std::string typeToString(QuickSQLiteExceptionType type) { +inline std::string typeToString(NitroSQLiteExceptionType type) { return exceptionTypeStrings[type]; } -class QuickSQLiteException : public std::exception { +class NitroSQLiteException : public std::exception { public: - explicit QuickSQLiteException(const char* message): QuickSQLiteException(QuickSQLiteExceptionType::UnknownError, message) {} - explicit QuickSQLiteException(const std::string& message): QuickSQLiteException(QuickSQLiteExceptionType::UnknownError, message) {} - QuickSQLiteException(const QuickSQLiteExceptionType& type, const char* message) : QuickSQLiteException(type, std::string(message)) {} - QuickSQLiteException(const QuickSQLiteExceptionType& type, const std::string& message) - : _exceptionString("[react-native-quick-sqlite] " + typeToString(type) + ": " + message) {} + explicit NitroSQLiteException(const char* message): NitroSQLiteException(NitroSQLiteExceptionType::UnknownError, message) {} + explicit NitroSQLiteException(const std::string& message): NitroSQLiteException(NitroSQLiteExceptionType::UnknownError, message) {} + NitroSQLiteException(const NitroSQLiteExceptionType& type, const char* message) : NitroSQLiteException(type, std::string(message)) {} + NitroSQLiteException(const NitroSQLiteExceptionType& type, const std::string& message) + : _exceptionString("[react-native-nitro-sqlite] " + typeToString(type) + ": " + message) {} private: const std::string _exceptionString; @@ -44,20 +44,20 @@ class QuickSQLiteException : public std::exception { return this->_exceptionString.c_str(); } - static QuickSQLiteException DatabaseNotOpen(const std::string& dbName) { - return QuickSQLiteException(QuickSQLiteExceptionType::UnableToAttachToDatabase, dbName + " is not open"); + static NitroSQLiteException DatabaseNotOpen(const std::string& dbName) { + return NitroSQLiteException(NitroSQLiteExceptionType::UnableToAttachToDatabase, dbName + " is not open"); } - static QuickSQLiteException SqlExecution(const std::string& errorMessage) { - return QuickSQLiteException(QuickSQLiteExceptionType::SqlExecutionError, errorMessage); + static NitroSQLiteException SqlExecution(const std::string& errorMessage) { + return NitroSQLiteException(NitroSQLiteExceptionType::SqlExecutionError, errorMessage); } - static QuickSQLiteException DatabaseFileNotFound(const std::string& dbFilePath) { - return QuickSQLiteException(QuickSQLiteExceptionType::SqlExecutionError, "Database file not found: " + dbFilePath); + static NitroSQLiteException DatabaseFileNotFound(const std::string& dbFilePath) { + return NitroSQLiteException(NitroSQLiteExceptionType::SqlExecutionError, "Database file not found: " + dbFilePath); } - static QuickSQLiteException CouldNotLoadFile(const std::string& fileLocation, std::optional additionalLine = std::nullopt) { + static NitroSQLiteException CouldNotLoadFile(const std::string& fileLocation, std::optional additionalLine = std::nullopt) { const auto message = "Could not load file: " + fileLocation + (additionalLine ? (". " + *additionalLine) : ""); - return QuickSQLiteException(QuickSQLiteExceptionType::CouldNotLoadFile, message); + return NitroSQLiteException(NitroSQLiteExceptionType::CouldNotLoadFile, message); } }; diff --git a/package/cpp/ThreadPool.cpp b/package/cpp/ThreadPool.cpp index e9a83c8..c8da028 100644 --- a/package/cpp/ThreadPool.cpp +++ b/package/cpp/ThreadPool.cpp @@ -1,13 +1,13 @@ // // ThreadPool.cpp -// react-native-quick-sqlite +// react-native-nitro-sqlite // // Created by Oscar on 13.03.22. // #include "ThreadPool.hpp" -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { ThreadPool::ThreadPool() : done(false) { // This returns the number of threads supported by the system. If the @@ -88,4 +88,4 @@ void ThreadPool::waitFinished() { workQueueConditionVariable.wait(g, [&] { return workQueue.empty() && (busy == 0); }); } -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/ThreadPool.hpp b/package/cpp/ThreadPool.hpp index 77e75ac..d5e3ead 100644 --- a/package/cpp/ThreadPool.hpp +++ b/package/cpp/ThreadPool.hpp @@ -1,6 +1,6 @@ // // ThreadPool.hpp -// react-native-quick-sqlite +// react-native-nitro-sqlite // // Created by Oscar on 13.03.22. // @@ -15,7 +15,7 @@ #include #include -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { class ThreadPool { public: @@ -47,4 +47,4 @@ class ThreadPool { void doWork(); }; -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/importSqlFile.cpp b/package/cpp/importSqlFile.cpp index 6127167..f2d37f4 100644 --- a/package/cpp/importSqlFile.cpp +++ b/package/cpp/importSqlFile.cpp @@ -5,10 +5,10 @@ #include "importSqlFile.hpp" #include #include -#include "QuickSQLiteException.hpp" +#include "NitroSQLiteException.hpp" #include "operations.hpp" -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string& fileLocation) { std::string line; @@ -24,10 +24,10 @@ SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string SQLiteOperationResult result = sqliteExecuteLiteral(dbName, line); rowsAffected += result.rowsAffected; commands++; - } catch (QuickSQLiteException& e) { + } catch (NitroSQLiteException& e) { sqliteExecuteLiteral(dbName, "ROLLBACK"); sqFile.close(); - throw QuickSQLiteException::CouldNotLoadFile(fileLocation, "Transaction was rolled back"); + throw NitroSQLiteException::CouldNotLoadFile(fileLocation, "Transaction was rolled back"); } } } @@ -38,11 +38,11 @@ SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string } catch (...) { sqFile.close(); sqliteExecuteLiteral(dbName, "ROLLBACK"); - throw QuickSQLiteException(QuickSQLiteExceptionType::UnknownError, "Unexpected error. Transaction was rolled back"); + throw NitroSQLiteException(NitroSQLiteExceptionType::UnknownError, "Unexpected error. Transaction was rolled back"); } } else { - throw QuickSQLiteException::CouldNotLoadFile(fileLocation); + throw NitroSQLiteException::CouldNotLoadFile(fileLocation); } } -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/importSqlFile.hpp b/package/cpp/importSqlFile.hpp index 845836c..0416a10 100644 --- a/package/cpp/importSqlFile.hpp +++ b/package/cpp/importSqlFile.hpp @@ -8,7 +8,7 @@ #include "types.hpp" -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string& fileLocation); diff --git a/package/cpp/logs.hpp b/package/cpp/logs.hpp index aaa5d6d..c603622 100644 --- a/package/cpp/logs.hpp +++ b/package/cpp/logs.hpp @@ -1,7 +1,7 @@ #ifdef ANDROID // LOGS ANDROID #include -#define LOG_TAG "react-native-quick-sqlite" +#define LOG_TAG "react-native-nitro-sqlite" #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__) #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) @@ -11,7 +11,7 @@ #else // LOGS NO ANDROID #include -#define LOG_TAG "react-native-quick-sqlite" +#define LOG_TAG "react-native-nitro-sqlite" #define LOGV(...) \ printf(" "); \ printf(__VA_ARGS__); \ diff --git a/package/cpp/operations.cpp b/package/cpp/operations.cpp index a4af453..0655754 100644 --- a/package/cpp/operations.cpp +++ b/package/cpp/operations.cpp @@ -9,13 +9,13 @@ #include #include #include -#include "QuickSQLiteException.hpp" +#include "NitroSQLiteException.hpp" using namespace facebook; using namespace margelo::nitro; -using namespace margelo::nitro::rnquicksqlite; +using namespace margelo::nitro::rnnitrosqlite; -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { std::map dbMap = std::map(); @@ -29,7 +29,7 @@ void sqliteOpenDb(const std::string& dbName, const std::string& docPath) { exit = sqlite3_open_v2(dbPath.c_str(), &db, sqlOpenFlags, nullptr); if (exit != SQLITE_OK) { - throw QuickSQLiteException(QuickSQLiteExceptionType::DatabaseCannotBeOpened, sqlite3_errmsg(db)); + throw NitroSQLiteException(NitroSQLiteExceptionType::DatabaseCannotBeOpened, sqlite3_errmsg(db)); } else { dbMap[dbName] = db; } @@ -38,7 +38,7 @@ void sqliteOpenDb(const std::string& dbName, const std::string& docPath) { void sqliteCloseDb(const std::string& dbName) { if (dbMap.count(dbName) == 0) { - throw QuickSQLiteException::DatabaseNotOpen(dbName); + throw NitroSQLiteException::DatabaseNotOpen(dbName); } sqlite3* db = dbMap[dbName]; @@ -64,11 +64,11 @@ void sqliteAttachDb(const std::string& mainDBName, const std::string& docPath, c * */ std::string dbPath = get_db_path(databaseToAttach, docPath); std::string statement = "ATTACH DATABASE '" + dbPath + "' AS " + alias; - + try { sqliteExecuteLiteral(mainDBName, statement); - } catch (QuickSQLiteException& e) { - throw QuickSQLiteException(QuickSQLiteExceptionType::UnableToAttachToDatabase, mainDBName + " was unable to attach another database: " + std::string(e.what())); + } catch (NitroSQLiteException& e) { + throw NitroSQLiteException(NitroSQLiteExceptionType::UnableToAttachToDatabase, mainDBName + " was unable to attach another database: " + std::string(e.what())); } } @@ -77,11 +77,11 @@ void sqliteDetachDb(const std::string& mainDBName, const std::string& alias) { * There is no need to check if mainDBName is opened because sqliteExecuteLiteral will do that. * */ std::string statement = "DETACH DATABASE " + alias; - + try { sqliteExecuteLiteral(mainDBName, statement); - } catch (QuickSQLiteException& e) { - throw QuickSQLiteException(QuickSQLiteExceptionType::UnableToAttachToDatabase, mainDBName + " was unable to detach database: " + std::string(e.what())); + } catch (NitroSQLiteException& e) { + throw NitroSQLiteException(NitroSQLiteExceptionType::UnableToAttachToDatabase, mainDBName + " was unable to detach database: " + std::string(e.what())); } } @@ -92,7 +92,7 @@ void sqliteRemoveDb(const std::string& dbName, const std::string& docPath) { std::string dbFilePath = get_db_path(dbName, docPath); if (!file_exists(dbFilePath)) { - throw QuickSQLiteException::DatabaseFileNotFound(dbFilePath); + throw NitroSQLiteException::DatabaseFileNotFound(dbFilePath); } remove(dbFilePath.c_str()); @@ -102,7 +102,6 @@ void bindStatement(sqlite3_stmt* statement, const SQLiteQueryParams& values) { for (int valueIndex = 0; valueIndex < values.size(); valueIndex++) { int sqliteIndex = valueIndex+1; SQLiteValue value = values.at(valueIndex); - // if (std::holds_alternative(value)) // { // sqlite3_bind_null(statement, sqliteIndex); @@ -125,7 +124,7 @@ void bindStatement(sqlite3_stmt* statement, const SQLiteQueryParams& values) { SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::string& query, const std::optional& params) { if (dbMap.count(dbName) == 0) { - throw QuickSQLiteException::DatabaseNotOpen(dbName); + throw NitroSQLiteException::DatabaseNotOpen(dbName); } auto db = dbMap[dbName]; @@ -138,7 +137,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str bindStatement(statement, *params); } } else { - throw QuickSQLiteException::SqlExecution(sqlite3_errmsg(db)); + throw NitroSQLiteException::SqlExecution(sqlite3_errmsg(db)); } auto isConsuming = true; @@ -148,7 +147,6 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str std::string column_name; ColumnType column_declared_type; SQLiteQueryResultRow row; - auto results = std::make_unique(); auto metadata = new SQLiteQueryTableMetadata(); @@ -222,7 +220,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str sqlite3_finalize(statement); if (isFailed) { - throw QuickSQLiteException::SqlExecution(sqlite3_errmsg(db)); + throw NitroSQLiteException::SqlExecution(sqlite3_errmsg(db)); } int rowsAffected = sqlite3_changes(db); @@ -232,7 +230,6 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str ? std::make_optional(std::move(*metadata)) : std::nullopt ); - return { .rowsAffected = rowsAffected, .insertId = static_cast(latestInsertRowId), @@ -244,7 +241,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std::string& query) { // Check if db connection is opened if (dbMap.count(dbName) == 0) { - throw QuickSQLiteException::DatabaseNotOpen(dbName); + throw NitroSQLiteException::DatabaseNotOpen(dbName); } sqlite3* db = dbMap[dbName]; @@ -257,7 +254,7 @@ SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std: if (statementStatus != SQLITE_OK) // statemnet is correct, bind the passed parameters { - throw QuickSQLiteException::SqlExecution(sqlite3_errmsg(db)); + throw NitroSQLiteException::SqlExecution(sqlite3_errmsg(db)); } bool isConsuming = true; @@ -287,10 +284,10 @@ SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std: sqlite3_finalize(statement); if (isFailed) { - throw QuickSQLiteException::SqlExecution(sqlite3_errmsg(db)); + throw NitroSQLiteException::SqlExecution(sqlite3_errmsg(db)); } return {.rowsAffected = sqlite3_changes(db)}; } -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/operations.hpp b/package/cpp/operations.hpp index 1e073e6..24a2dd0 100644 --- a/package/cpp/operations.hpp +++ b/package/cpp/operations.hpp @@ -2,7 +2,7 @@ #include "types.hpp" -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { void sqliteOpenDb(const std::string& dbName, const std::string& docPath); @@ -21,4 +21,4 @@ SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std: void sqliteCloseAll(); -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/specs/HybridNativeQueryResult.cpp b/package/cpp/specs/HybridNativeQueryResult.cpp index bd447a8..65e8a5b 100644 --- a/package/cpp/specs/HybridNativeQueryResult.cpp +++ b/package/cpp/specs/HybridNativeQueryResult.cpp @@ -1,6 +1,6 @@ #include "HybridNativeQueryResult.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { std::optional HybridNativeQueryResult::getInsertId() { return this->_insertId; @@ -17,4 +17,4 @@ std::optional HybridNativeQueryResult::getMetadata() { return this->_metadata; } -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/cpp/specs/HybridNativeQueryResult.hpp b/package/cpp/specs/HybridNativeQueryResult.hpp index c1b9d9a..b792b7e 100644 --- a/package/cpp/specs/HybridNativeQueryResult.hpp +++ b/package/cpp/specs/HybridNativeQueryResult.hpp @@ -4,9 +4,15 @@ #include "types.hpp" #include -using namespace margelo::rnquicksqlite; +<<<<<<< HEAD +using namespace margelo::rnnitrosqlite; -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { +======= +using namespace margelo::rnnitrosqlite; + +namespace margelo::nitro::rnnitrosqlite { +>>>>>>> main class HybridNativeQueryResult : public HybridNativeQueryResultSpec { public: @@ -32,4 +38,8 @@ class HybridNativeQueryResult : public HybridNativeQueryResultSpec { std::optional getMetadata() override; }; -} // namespace margelo::nitro::rnquicksqlite +<<<<<<< HEAD +} // namespace margelo::nitro::rnnitrosqlite +======= +} // namespace margelo::nitro::rnnitrosqlite +>>>>>>> main diff --git a/package/cpp/specs/HybridQuickSQLite.cpp b/package/cpp/specs/HybridNitroSQLite.cpp similarity index 77% rename from package/cpp/specs/HybridQuickSQLite.cpp rename to package/cpp/specs/HybridNitroSQLite.cpp index 3af75c4..ef14790 100644 --- a/package/cpp/specs/HybridQuickSQLite.cpp +++ b/package/cpp/specs/HybridNitroSQLite.cpp @@ -1,7 +1,7 @@ -#include "HybridQuickSQLite.hpp" +#include "HybridNitroSQLite.hpp" #include "HybridNativeQueryResult.hpp" #include "ThreadPool.hpp" -#include "QuickSQLiteException.hpp" +#include "NitroSQLiteException.hpp" #include "logs.hpp" #include "macros.hpp" #include "sqliteExecuteBatch.hpp" @@ -12,12 +12,12 @@ #include #include -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { -auto pool = std::make_shared(); +auto pool = std::make_shared(); const std::string getDocPath(const std::optional& location) { - std::string tempDocPath = std::string(HybridQuickSQLite::docPath); + std::string tempDocPath = std::string(HybridNitroSQLite::docPath); if (location) { tempDocPath = tempDocPath + "/" + *location; } @@ -25,21 +25,21 @@ const std::string getDocPath(const std::optional& location) { return tempDocPath; } -void HybridQuickSQLite::open(const std::string& dbName, const std::optional& location) { +void HybridNitroSQLite::open(const std::string& dbName, const std::optional& location) { const auto docPath = getDocPath(location); sqliteOpenDb(dbName, docPath); } -void HybridQuickSQLite::close(const std::string& dbName) { +void HybridNitroSQLite::close(const std::string& dbName) { sqliteCloseDb(dbName); }; -void HybridQuickSQLite::drop(const std::string& dbName, const std::optional& location) { +void HybridNitroSQLite::drop(const std::string& dbName, const std::optional& location) { const auto docPath = getDocPath(location); sqliteRemoveDb(dbName, docPath); }; -void HybridQuickSQLite::attach(const std::string& mainDbName, const std::string& dbNameToAttach, const std::string& alias, +void HybridNitroSQLite::attach(const std::string& mainDbName, const std::string& dbNameToAttach, const std::string& alias, const std::optional& location) { std::string tempDocPath = std::string(docPath); if (location) { @@ -49,19 +49,19 @@ void HybridQuickSQLite::attach(const std::string& mainDbName, const std::string& sqliteAttachDb(mainDbName, tempDocPath, dbNameToAttach, alias); }; -void HybridQuickSQLite::detach(const std::string& mainDbName, const std::string& alias) { +void HybridNitroSQLite::detach(const std::string& mainDbName, const std::string& alias) { sqliteDetachDb(mainDbName, alias); }; using ExecuteQueryResult = std::shared_ptr; -ExecuteQueryResult HybridQuickSQLite::execute(const std::string& dbName, const std::string& query, +ExecuteQueryResult HybridNitroSQLite::execute(const std::string& dbName, const std::string& query, const std::optional& params) { auto result = sqliteExecute(dbName, query, params); return std::make_shared(result.insertId, result.rowsAffected, *result.results, *result.metadata); }; -std::future HybridQuickSQLite::executeAsync(const std::string& dbName, const std::string& query, +std::future HybridNitroSQLite::executeAsync(const std::string& dbName, const std::string& query, const std::optional& params) { auto promise = std::make_shared>(); auto future = promise->get_future(); @@ -80,14 +80,14 @@ std::future HybridQuickSQLite::executeAsync(const std::strin return future; }; -BatchQueryResult HybridQuickSQLite::executeBatch(const std::string& dbName, const std::vector& batchParams) { +BatchQueryResult HybridNitroSQLite::executeBatch(const std::string& dbName, const std::vector& batchParams) { const auto commands = batchParamsToCommands(batchParams); auto result = sqliteExecuteBatch(dbName, commands); return BatchQueryResult(result.rowsAffected); }; -std::future HybridQuickSQLite::executeBatchAsync(const std::string& dbName, +std::future HybridNitroSQLite::executeBatchAsync(const std::string& dbName, const std::vector& batchParams) { auto promise = std::make_shared>(); auto future = promise->get_future(); @@ -106,12 +106,12 @@ std::future HybridQuickSQLite::executeBatchAsync(const std::st return future; }; -FileLoadResult HybridQuickSQLite::loadFile(const std::string& dbName, const std::string& location) { +FileLoadResult HybridNitroSQLite::loadFile(const std::string& dbName, const std::string& location) { const auto result = importSqlFile(dbName, location); return FileLoadResult(result.commands, result.rowsAffected); }; -std::future HybridQuickSQLite::loadFileAsync(const std::string& dbName, const std::string& location) { +std::future HybridNitroSQLite::loadFileAsync(const std::string& dbName, const std::string& location) { auto promise = std::make_shared>(); auto future = promise->get_future(); @@ -129,4 +129,4 @@ std::future HybridQuickSQLite::loadFileAsync(const std::string& return future; }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/cpp/specs/HybridQuickSQLite.hpp b/package/cpp/specs/HybridNitroSQLite.hpp similarity index 82% rename from package/cpp/specs/HybridQuickSQLite.hpp rename to package/cpp/specs/HybridNitroSQLite.hpp index 6ea7ef7..4436102 100644 --- a/package/cpp/specs/HybridQuickSQLite.hpp +++ b/package/cpp/specs/HybridNitroSQLite.hpp @@ -1,16 +1,16 @@ #pragma once -#include "HybridQuickSQLiteSpec.hpp" +#include "HybridNitroSQLiteSpec.hpp" #include "HybridNativeQueryResultSpec.hpp" #include "types.hpp" -using namespace margelo::rnquicksqlite; +using namespace margelo::rnnitrosqlite; -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { -class HybridQuickSQLite : public HybridQuickSQLiteSpec { +class HybridNitroSQLite : public HybridNitroSQLiteSpec { public: - HybridQuickSQLite() : HybridObject(TAG) {} + HybridNitroSQLite() : HybridObject(TAG) {} public: static std::string docPath; @@ -31,6 +31,6 @@ class HybridQuickSQLite : public HybridQuickSQLiteSpec { std::future loadFileAsync(const std::string& dbName, const std::string& location) override; }; -inline std::string HybridQuickSQLite::docPath = ""; +inline std::string HybridNitroSQLite::docPath = ""; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/cpp/sqliteExecuteBatch.cpp b/package/cpp/sqliteExecuteBatch.cpp index 39cdd22..8e1d599 100644 --- a/package/cpp/sqliteExecuteBatch.cpp +++ b/package/cpp/sqliteExecuteBatch.cpp @@ -4,9 +4,9 @@ #include "sqliteExecuteBatch.hpp" #include "operations.hpp" #include -#include "QuickSQLiteException.hpp" +#include "NitroSQLiteException.hpp" -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { std::vector batchParamsToCommands(const std::vector& batchParams) { auto commands = std::vector(); @@ -35,7 +35,7 @@ std::vector batchParamsToCommands(const std::vector& commands) { size_t commandCount = commands.size(); if (commandCount <= 0) { - throw QuickSQLiteException(QuickSQLiteExceptionType::NoBatchCommandsProvided, "No SQL batch commands provided"); + throw NitroSQLiteException(NitroSQLiteExceptionType::NoBatchCommandsProvided, "No SQL batch commands provided"); } try { @@ -50,21 +50,20 @@ SQLiteOperationResult sqliteExecuteBatch(const std::string& dbName, const std::v try { auto result = sqliteExecute(dbName, command.sql, *command.params.get()); rowsAffected += result.rowsAffected; - } catch (QuickSQLiteException& e) { + } catch (NitroSQLiteException& e) { sqliteExecuteLiteral(dbName, "ROLLBACK"); throw e; } } - sqliteExecuteLiteral(dbName, "COMMIT"); return { .rowsAffected = rowsAffected, .commands = (int)commandCount, }; - } catch (QuickSQLiteException& e) { + } catch (NitroSQLiteException& e) { sqliteExecuteLiteral(dbName, "ROLLBACK"); throw e; } } -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/sqliteExecuteBatch.hpp b/package/cpp/sqliteExecuteBatch.hpp index c8ae698..71ae99a 100644 --- a/package/cpp/sqliteExecuteBatch.hpp +++ b/package/cpp/sqliteExecuteBatch.hpp @@ -9,7 +9,7 @@ using namespace facebook; using namespace margelo::nitro; -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { struct BatchQuery { std::string sql; @@ -27,4 +27,4 @@ std::vector batchParamsToCommands(const std::vector& commands); -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/types.hpp b/package/cpp/types.hpp index a6cafbf..a7bbbe6 100644 --- a/package/cpp/types.hpp +++ b/package/cpp/types.hpp @@ -6,9 +6,9 @@ #include using namespace margelo::nitro; -using namespace margelo::nitro::rnquicksqlite; +using namespace margelo::nitro::rnnitrosqlite; -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { // using SQLiteValue = std::variant, std::monostate>; using SQLiteValue = std::variant>; @@ -50,4 +50,4 @@ inline ColumnType mapSQLiteTypeToColumnType(const char* type) { } } -} // namespace margelo::rnquicksqlite +} // namespace margelo::rnnitrosqlite diff --git a/package/cpp/utils.hpp b/package/cpp/utils.hpp index ee66e25..d1cd3fe 100644 --- a/package/cpp/utils.hpp +++ b/package/cpp/utils.hpp @@ -4,7 +4,7 @@ #include #include -namespace margelo::rnquicksqlite { +namespace margelo::rnnitrosqlite { bool folder_exists(const std::string& foldername) { struct stat buffer; @@ -41,10 +41,10 @@ int mkdir(const char* path) { // create current level if (!folder_exists(current_level) && _mkdir(current_level.c_str()) != 0) return -1; - + current_level += "/"; // don't forget to append a slash } - + return 0; } diff --git a/package/ios/QuickSQLite.xcodeproj/project.pbxproj b/package/ios/NitroSQLite.xcodeproj/project.pbxproj similarity index 86% rename from package/ios/QuickSQLite.xcodeproj/project.pbxproj rename to package/ios/NitroSQLite.xcodeproj/project.pbxproj index 954964b..8381b35 100644 --- a/package/ios/QuickSQLite.xcodeproj/project.pbxproj +++ b/package/ios/NitroSQLite.xcodeproj/project.pbxproj @@ -8,10 +8,10 @@ /* Begin PBXBuildFile section */ 83BC6E412C8F788C00B954D2 /* OnLoad.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E402C8F788C00B954D2 /* OnLoad.mm */; }; - 83BC6E712C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E452C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.cpp */; }; - 83BC6E722C8F78A200B954D2 /* HybridQuickSQLiteSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E4F2C8F78A200B954D2 /* HybridQuickSQLiteSpec.cpp */; }; + 83BC6E712C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E452C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.cpp */; }; + 83BC6E722C8F78A200B954D2 /* HybridNitroSQLiteSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E4F2C8F78A200B954D2 /* HybridNitroSQLiteSpec.cpp */; }; 83BC6E732C8F78A200B954D2 /* HybridSelectQueryResultSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E512C8F78A200B954D2 /* HybridSelectQueryResultSpec.cpp */; }; - 83BC6E742C8F78A200B954D2 /* HybridQuickSQLite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E5A2C8F78A200B954D2 /* HybridQuickSQLite.cpp */; }; + 83BC6E742C8F78A200B954D2 /* HybridNitroSQLite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E5A2C8F78A200B954D2 /* HybridNitroSQLite.cpp */; }; 83BC6E752C8F78A200B954D2 /* HybridSelectQueryResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E5C2C8F78A200B954D2 /* HybridSelectQueryResult.cpp */; }; 83BC6E762C8F78A200B954D2 /* JSIHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E602C8F78A200B954D2 /* JSIHelper.cpp */; }; 83BC6E772C8F78A200B954D2 /* OnLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BC6E642C8F78A200B954D2 /* OnLoad.cpp */; }; @@ -36,28 +36,28 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 134814201AA4EA6300B7C361 /* libQuickSQLite.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libQuickSQLite.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 134814201AA4EA6300B7C361 /* libNitroSQLite.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNitroSQLite.a; sourceTree = BUILT_PRODUCTS_DIR; }; 83BC6E402C8F788C00B954D2 /* OnLoad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OnLoad.mm; sourceTree = ""; }; - 83BC6E422C8F78A200B954D2 /* RNQuickSQLite+autolinking.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "RNQuickSQLite+autolinking.cmake"; sourceTree = ""; }; - 83BC6E432C8F78A200B954D2 /* RNQuickSQLite+autolinking.gradle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "RNQuickSQLite+autolinking.gradle"; sourceTree = ""; }; - 83BC6E452C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "RNQuickSQLite-Swift-Cxx-Bridge.cpp"; sourceTree = ""; }; - 83BC6E462C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "RNQuickSQLite-Swift-Cxx-Bridge.hpp"; sourceTree = ""; }; - 83BC6E472C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Umbrella.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "RNQuickSQLite-Swift-Cxx-Umbrella.hpp"; sourceTree = ""; }; - 83BC6E482C8F78A200B954D2 /* RNQuickSQLite+autolinking.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = "RNQuickSQLite+autolinking.rb"; sourceTree = ""; }; + 83BC6E422C8F78A200B954D2 /* RNNitroSQLite+autolinking.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "RNNitroSQLite+autolinking.cmake"; sourceTree = ""; }; + 83BC6E432C8F78A200B954D2 /* RNNitroSQLite+autolinking.gradle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "RNNitroSQLite+autolinking.gradle"; sourceTree = ""; }; + 83BC6E452C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "RNNitroSQLite-Swift-Cxx-Bridge.cpp"; sourceTree = ""; }; + 83BC6E462C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "RNNitroSQLite-Swift-Cxx-Bridge.hpp"; sourceTree = ""; }; + 83BC6E472C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Umbrella.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "RNNitroSQLite-Swift-Cxx-Umbrella.hpp"; sourceTree = ""; }; + 83BC6E482C8F78A200B954D2 /* RNNitroSQLite+autolinking.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = "RNNitroSQLite+autolinking.rb"; sourceTree = ""; }; 83BC6E4A2C8F78A200B954D2 /* BatchQueryCommand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = BatchQueryCommand.hpp; sourceTree = ""; }; 83BC6E4B2C8F78A200B954D2 /* BatchQueryResult.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = BatchQueryResult.hpp; sourceTree = ""; }; 83BC6E4C2C8F78A200B954D2 /* ColumnMetadata.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ColumnMetadata.hpp; sourceTree = ""; }; 83BC6E4D2C8F78A200B954D2 /* ColumnType.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ColumnType.hpp; sourceTree = ""; }; 83BC6E4E2C8F78A200B954D2 /* FileLoadResult.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = FileLoadResult.hpp; sourceTree = ""; }; - 83BC6E4F2C8F78A200B954D2 /* HybridQuickSQLiteSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridQuickSQLiteSpec.cpp; sourceTree = ""; }; - 83BC6E502C8F78A200B954D2 /* HybridQuickSQLiteSpec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridQuickSQLiteSpec.hpp; sourceTree = ""; }; + 83BC6E4F2C8F78A200B954D2 /* HybridNitroSQLiteSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridNitroSQLiteSpec.cpp; sourceTree = ""; }; + 83BC6E502C8F78A200B954D2 /* HybridNitroSQLiteSpec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridNitroSQLiteSpec.hpp; sourceTree = ""; }; 83BC6E512C8F78A200B954D2 /* HybridSelectQueryResultSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridSelectQueryResultSpec.cpp; sourceTree = ""; }; 83BC6E522C8F78A200B954D2 /* HybridSelectQueryResultSpec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridSelectQueryResultSpec.hpp; sourceTree = ""; }; 83BC6E532C8F78A200B954D2 /* QueryResult.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = QueryResult.hpp; sourceTree = ""; }; 83BC6E542C8F78A200B954D2 /* QueryType.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = QueryType.hpp; sourceTree = ""; }; 83BC6E552C8F78A200B954D2 /* Transaction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Transaction.hpp; sourceTree = ""; }; - 83BC6E5A2C8F78A200B954D2 /* HybridQuickSQLite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridQuickSQLite.cpp; sourceTree = ""; }; - 83BC6E5B2C8F78A200B954D2 /* HybridQuickSQLite.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridQuickSQLite.hpp; sourceTree = ""; }; + 83BC6E5A2C8F78A200B954D2 /* HybridNitroSQLite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridNitroSQLite.cpp; sourceTree = ""; }; + 83BC6E5B2C8F78A200B954D2 /* HybridNitroSQLite.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridNitroSQLite.hpp; sourceTree = ""; }; 83BC6E5C2C8F78A200B954D2 /* HybridSelectQueryResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HybridSelectQueryResult.cpp; sourceTree = ""; }; 83BC6E5D2C8F78A200B954D2 /* HybridSelectQueryResult.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HybridSelectQueryResult.hpp; sourceTree = ""; }; 83BC6E5E2C8F78A200B954D2 /* Types.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Types.hpp; sourceTree = ""; }; @@ -94,7 +94,7 @@ 134814211AA4EA7D00B7C361 /* Products */ = { isa = PBXGroup; children = ( - 134814201AA4EA6300B7C361 /* libQuickSQLite.a */, + 134814201AA4EA6300B7C361 /* libNitroSQLite.a */, ); name = Products; sourceTree = ""; @@ -113,8 +113,8 @@ 83BC6E442C8F78A200B954D2 /* android */ = { isa = PBXGroup; children = ( - 83BC6E422C8F78A200B954D2 /* RNQuickSQLite+autolinking.cmake */, - 83BC6E432C8F78A200B954D2 /* RNQuickSQLite+autolinking.gradle */, + 83BC6E422C8F78A200B954D2 /* RNNitroSQLite+autolinking.cmake */, + 83BC6E432C8F78A200B954D2 /* RNNitroSQLite+autolinking.gradle */, ); path = android; sourceTree = ""; @@ -122,10 +122,10 @@ 83BC6E492C8F78A200B954D2 /* ios */ = { isa = PBXGroup; children = ( - 83BC6E452C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.cpp */, - 83BC6E462C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.hpp */, - 83BC6E472C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Umbrella.hpp */, - 83BC6E482C8F78A200B954D2 /* RNQuickSQLite+autolinking.rb */, + 83BC6E452C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.cpp */, + 83BC6E462C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.hpp */, + 83BC6E472C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Umbrella.hpp */, + 83BC6E482C8F78A200B954D2 /* RNNitroSQLite+autolinking.rb */, ); path = ios; sourceTree = ""; @@ -138,8 +138,8 @@ 83BC6E4C2C8F78A200B954D2 /* ColumnMetadata.hpp */, 83BC6E4D2C8F78A200B954D2 /* ColumnType.hpp */, 83BC6E4E2C8F78A200B954D2 /* FileLoadResult.hpp */, - 83BC6E4F2C8F78A200B954D2 /* HybridQuickSQLiteSpec.cpp */, - 83BC6E502C8F78A200B954D2 /* HybridQuickSQLiteSpec.hpp */, + 83BC6E4F2C8F78A200B954D2 /* HybridNitroSQLiteSpec.cpp */, + 83BC6E502C8F78A200B954D2 /* HybridNitroSQLiteSpec.hpp */, 83BC6E512C8F78A200B954D2 /* HybridSelectQueryResultSpec.cpp */, 83BC6E522C8F78A200B954D2 /* HybridSelectQueryResultSpec.hpp */, 83BC6E532C8F78A200B954D2 /* QueryResult.hpp */, @@ -179,8 +179,8 @@ 83BC6E5F2C8F78A200B954D2 /* specs */ = { isa = PBXGroup; children = ( - 83BC6E5A2C8F78A200B954D2 /* HybridQuickSQLite.cpp */, - 83BC6E5B2C8F78A200B954D2 /* HybridQuickSQLite.hpp */, + 83BC6E5A2C8F78A200B954D2 /* HybridNitroSQLite.cpp */, + 83BC6E5B2C8F78A200B954D2 /* HybridNitroSQLite.hpp */, 83BC6E5C2C8F78A200B954D2 /* HybridSelectQueryResult.cpp */, 83BC6E5D2C8F78A200B954D2 /* HybridSelectQueryResult.hpp */, 83BC6E5E2C8F78A200B954D2 /* Types.hpp */, @@ -216,9 +216,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 58B511DA1A9E6C8500147676 /* QuickSQLite */ = { + 58B511DA1A9E6C8500147676 /* NitroSQLite */ = { isa = PBXNativeTarget; - buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "QuickSQLite" */; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "NitroSQLite" */; buildPhases = ( 58B511D71A9E6C8500147676 /* Sources */, 58B511D81A9E6C8500147676 /* Frameworks */, @@ -228,9 +228,9 @@ ); dependencies = ( ); - name = QuickSQLite; + name = NitroSQLite; productName = RCTDataManager; - productReference = 134814201AA4EA6300B7C361 /* libQuickSQLite.a */; + productReference = 134814201AA4EA6300B7C361 /* libNitroSQLite.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -247,7 +247,7 @@ }; }; }; - buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "QuickSQLite" */; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "NitroSQLite" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -260,7 +260,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 58B511DA1A9E6C8500147676 /* QuickSQLite */, + 58B511DA1A9E6C8500147676 /* NitroSQLite */, ); }; /* End PBXProject section */ @@ -273,17 +273,17 @@ 83BC6E772C8F78A200B954D2 /* OnLoad.cpp in Sources */, 83BC6E792C8F78A200B954D2 /* sqlfileloader.cpp in Sources */, 83BC6E7C2C8F78A200B954D2 /* ThreadPool.cpp in Sources */, - 83BC6E712C8F78A200B954D2 /* RNQuickSQLite-Swift-Cxx-Bridge.cpp in Sources */, + 83BC6E712C8F78A200B954D2 /* RNNitroSQLite-Swift-Cxx-Bridge.cpp in Sources */, 83BC6E762C8F78A200B954D2 /* JSIHelper.cpp in Sources */, 83BC6E7F2C8F7BDD00B954D2 /* Empty.swift in Sources */, 83BC6E7B2C8F78A200B954D2 /* sqliteBridge.cpp in Sources */, - 83BC6E722C8F78A200B954D2 /* HybridQuickSQLiteSpec.cpp in Sources */, + 83BC6E722C8F78A200B954D2 /* HybridNitroSQLiteSpec.cpp in Sources */, 83BC6E732C8F78A200B954D2 /* HybridSelectQueryResultSpec.cpp in Sources */, 83BC6E782C8F78A200B954D2 /* sqlbatchexecutor.cpp in Sources */, 83BC6E752C8F78A200B954D2 /* HybridSelectQueryResult.cpp in Sources */, 83BC6E412C8F788C00B954D2 /* OnLoad.mm in Sources */, 83BC6E7A2C8F78A200B954D2 /* sqlite3.c in Sources */, - 83BC6E742C8F78A200B954D2 /* HybridQuickSQLite.cpp in Sources */, + 83BC6E742C8F78A200B954D2 /* HybridNitroSQLite.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -394,7 +394,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = QuickSQLite; + PRODUCT_NAME = NitroSQLite; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "Sequel-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -413,7 +413,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = QuickSQLite; + PRODUCT_NAME = NitroSQLite; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "Sequel-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -423,7 +423,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "QuickSQLite" */ = { + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "NitroSQLite" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B511ED1A9E6C8500147676 /* Debug */, @@ -432,7 +432,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "QuickSQLite" */ = { + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "NitroSQLite" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B511F01A9E6C8500147676 /* Debug */, diff --git a/package/ios/OnLoad.mm b/package/ios/OnLoad.mm index 2177ee0..6ce7258 100644 --- a/package/ios/OnLoad.mm +++ b/package/ios/OnLoad.mm @@ -1,6 +1,6 @@ #import -#import "RNQuickSQLite-Swift-Cxx-Umbrella.hpp" -#import "HybridQuickSQLite.hpp" +#import "RNNitroSQLite-Swift-Cxx-Umbrella.hpp" +#import "HybridNitroSQLite.hpp" @interface OnLoad : NSObject @end @@ -8,11 +8,11 @@ @interface OnLoad : NSObject @implementation OnLoad using namespace margelo::nitro; -using namespace margelo::nitro::rnquicksqlite; +using namespace margelo::nitro::rnnitrosqlite; + (void)load { // Get appGroupID value from Info.plist using key "AppGroup" - NSString *appGroupID = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RNQuickSQLite_AppGroup"]; + NSString *appGroupID = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RNNitroSQLite_AppGroup"]; NSString *documentPath; if (appGroupID != nil) { @@ -35,7 +35,7 @@ + (void)load { documentPath = [paths objectAtIndex:0]; } - HybridQuickSQLite::docPath = [documentPath UTF8String]; + HybridNitroSQLite::docPath = [documentPath UTF8String]; } @end diff --git a/package/ios/RNQuickSQLite-Swift.h b/package/ios/RNNitroSQLite-Swift.h similarity index 100% rename from package/ios/RNQuickSQLite-Swift.h rename to package/ios/RNNitroSQLite-Swift.h diff --git a/package/nitro.json b/package/nitro.json index 03a5dc8..3ed73be 100644 --- a/package/nitro.json +++ b/package/nitro.json @@ -1,19 +1,19 @@ { "cxxNamespace": [ - "rnquicksqlite" + "rnnitrosqlite" ], "ios": { - "iosModuleName": "RNQuickSQLite" + "iosModuleName": "RNNitroSQLite" }, "android": { "androidNamespace": [ - "rnquicksqlite" + "rnnitrosqlite" ], - "androidCxxLibName": "RNQuickSQLite" + "androidCxxLibName": "RNNitroSQLite" }, "autolinking": { - "QuickSQLite": { - "cpp": "HybridQuickSQLite" + "NitroSQLite": { + "cpp": "HybridNitroSQLite" } }, "ignorePaths": [ diff --git a/package/nitrogen/generated/android/RNQuickSQLite+autolinking.cmake b/package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake similarity index 84% rename from package/nitrogen/generated/android/RNQuickSQLite+autolinking.cmake rename to package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake index 76497de..27743fd 100644 --- a/package/nitrogen/generated/android/RNQuickSQLite+autolinking.cmake +++ b/package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake @@ -1,5 +1,5 @@ # -# RNQuickSQLite+autolinking.cmake +# RNNitroSQLite+autolinking.cmake # This file was generated by nitrogen. DO NOT MODIFY THIS FILE. # https://github.com/mrousavy/nitro # Copyright © 2024 Marc Rousavy @ Margelo @@ -10,7 +10,7 @@ # # To use it, add this to your CMakeLists.txt: # ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/RNQuickSQLite+autolinking.cmake) +# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/RNNitroSQLite+autolinking.cmake) # ``` # Add all headers that were generated by Nitrogen @@ -23,12 +23,12 @@ include_directories( # Add all .cpp sources that were generated by Nitrogen target_sources( # CMake project name (Android C++ library name) - RNQuickSQLite PRIVATE + RNNitroSQLite PRIVATE # Autolinking Setup - ../nitrogen/generated/android/RNQuickSQLiteOnLoad.cpp + ../nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp # Shared Nitrogen C++ sources ../nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp - ../nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.cpp + ../nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp # Android-specific Nitrogen C++ sources ) @@ -40,7 +40,7 @@ find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all Hybri # Link all libraries together target_link_libraries( - RNQuickSQLite + RNNitroSQLite fbjni::fbjni # <-- Facebook C++ JNI helpers ReactAndroid::jsi # <-- RN: JSI react-native-nitro-modules::NitroModules # <-- NitroModules Core :) @@ -49,12 +49,12 @@ target_link_libraries( # Link react-native (different prefab between RN 0.75 and RN 0.76) if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) target_link_libraries( - RNQuickSQLite + RNNitroSQLite ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab ) else() target_link_libraries( - RNQuickSQLite + RNNitroSQLite ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core ) endif() diff --git a/package/nitrogen/generated/android/RNQuickSQLite+autolinking.gradle b/package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle similarity index 76% rename from package/nitrogen/generated/android/RNQuickSQLite+autolinking.gradle rename to package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle index 3cdf613..974fc1a 100644 --- a/package/nitrogen/generated/android/RNQuickSQLite+autolinking.gradle +++ b/package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle @@ -1,5 +1,5 @@ /// -/// RNQuickSQLite+autolinking.gradle +/// RNNitroSQLite+autolinking.gradle /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -10,10 +10,10 @@ /// /// To use it, add this to your build.gradle: /// ```gradle -/// apply from: '../nitrogen/generated/android/RNQuickSQLite+autolinking.gradle' +/// apply from: '../nitrogen/generated/android/RNNitroSQLite+autolinking.gradle' /// ``` -logger.warn("[NitroModules] 🔥 RNQuickSQLite is boosted by nitro!") +logger.warn("[NitroModules] 🔥 RNNitroSQLite is boosted by nitro!") android { sourceSets { diff --git a/package/nitrogen/generated/android/RNQuickSQLiteOnLoad.cpp b/package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp similarity index 62% rename from package/nitrogen/generated/android/RNQuickSQLiteOnLoad.cpp rename to package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp index d3a3e33..b036f83 100644 --- a/package/nitrogen/generated/android/RNQuickSQLiteOnLoad.cpp +++ b/package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp @@ -1,23 +1,23 @@ /// -/// RNQuickSQLiteOnLoad.cpp +/// RNNitroSQLiteOnLoad.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo /// -#include "RNQuickSQLiteOnLoad.hpp" +#include "RNNitroSQLiteOnLoad.hpp" #include #include #include -#include "HybridQuickSQLite.hpp" +#include "HybridNitroSQLite.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { int initialize(JavaVM* vm) { using namespace margelo::nitro; - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; using namespace facebook; return facebook::jni::initialize(vm, [] { @@ -26,15 +26,15 @@ int initialize(JavaVM* vm) { // Register Nitro Hybrid Objects HybridObjectRegistry::registerHybridObjectConstructor( - "QuickSQLite", + "NitroSQLite", []() -> std::shared_ptr { - static_assert(std::is_default_constructible_v, - "The HybridObject \"HybridQuickSQLite\" is not default-constructible! " + static_assert(std::is_default_constructible_v, + "The HybridObject \"HybridNitroSQLite\" is not default-constructible! " "Create a public constructor that takes zero arguments to be able to autolink this HybridObject."); - return std::make_shared(); + return std::make_shared(); } ); }); } -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/android/RNQuickSQLiteOnLoad.hpp b/package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp similarity index 67% rename from package/nitrogen/generated/android/RNQuickSQLiteOnLoad.hpp rename to package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp index 02db941..12d2f40 100644 --- a/package/nitrogen/generated/android/RNQuickSQLiteOnLoad.hpp +++ b/package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp @@ -1,5 +1,5 @@ /// -/// RNQuickSQLiteOnLoad.hpp +/// RNNitroSQLiteOnLoad.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -8,18 +8,18 @@ #include #include -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** - * Initializes the native (C++) part of RNQuickSQLite, and autolinks all Hybrid Objects. + * Initializes the native (C++) part of RNNitroSQLite, and autolinks all Hybrid Objects. * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). * Example: * ```cpp (cpp-adapter.cpp) * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::rnquicksqlite::initialize(vm); + * return margelo::nitro::rnnitrosqlite::initialize(vm); * } * ``` */ int initialize(JavaVM* vm); -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/android/RNQuickSQLiteOnLoad.kt b/package/nitrogen/generated/android/RNNitroSQLiteOnLoad.kt similarity index 100% rename from package/nitrogen/generated/android/RNQuickSQLiteOnLoad.kt rename to package/nitrogen/generated/android/RNNitroSQLiteOnLoad.kt diff --git a/package/nitrogen/generated/ios/RNQuickSQLite+autolinking.rb b/package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb similarity index 88% rename from package/nitrogen/generated/ios/RNQuickSQLite+autolinking.rb rename to package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb index 8a382fd..ebe54b5 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLite+autolinking.rb +++ b/package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb @@ -1,5 +1,5 @@ # -# RNQuickSQLite+autolinking.rb +# RNNitroSQLite+autolinking.rb # This file was generated by nitrogen. DO NOT MODIFY THIS FILE. # https://github.com/mrousavy/nitro # Copyright © 2024 Marc Rousavy @ Margelo @@ -14,13 +14,13 @@ # # ... # # # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/RNQuickSQLite+autolinking.rb' +# load 'nitrogen/generated/ios/RNNitroSQLite+autolinking.rb' # add_nitrogen_files(spec) # end # ``` def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 RNQuickSQLite is boosted by nitro!" + Pod::UI.puts "[NitroModules] 🔥 RNNitroSQLite is boosted by nitro!" spec.dependency "NitroModules" @@ -37,7 +37,7 @@ def add_nitrogen_files(spec) # Generated specs "nitrogen/generated/shared/**/*.{h,hpp}", # Swift to C++ bridging helpers - "nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.hpp" + "nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp" ] current_private_header_files = Array(spec.attributes_hash['private_header_files']) diff --git a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.cpp b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp similarity index 50% rename from package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.cpp rename to package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp index e55bfb8..31dc451 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.cpp +++ b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp @@ -1,17 +1,17 @@ /// -/// RNQuickSQLite-Swift-Cxx-Bridge.cpp +/// RNNitroSQLite-Swift-Cxx-Bridge.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo /// -#include "RNQuickSQLite-Swift-Cxx-Bridge.hpp" +#include "RNNitroSQLite-Swift-Cxx-Bridge.hpp" // Include C++ implementation defined types -namespace margelo::nitro::rnquicksqlite::bridge::swift { +namespace margelo::nitro::rnnitrosqlite::bridge::swift { -} // namespace margelo::nitro::rnquicksqlite::bridge::swift +} // namespace margelo::nitro::rnnitrosqlite::bridge::swift diff --git a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.hpp b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp similarity index 75% rename from package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.hpp rename to package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp index 19a308c..718c8cd 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Bridge.hpp +++ b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp @@ -1,5 +1,5 @@ /// -/// RNQuickSQLite-Swift-Cxx-Bridge.hpp +/// RNNitroSQLite-Swift-Cxx-Bridge.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -20,8 +20,8 @@ * Contains specialized versions of C++ templated types so they can be accessed from Swift, * as well as helper functions to interact with those C++ types from Swift. */ -namespace margelo::nitro::rnquicksqlite::bridge::swift { +namespace margelo::nitro::rnnitrosqlite::bridge::swift { -} // namespace margelo::nitro::rnquicksqlite::bridge::swift +} // namespace margelo::nitro::rnnitrosqlite::bridge::swift diff --git a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Umbrella.hpp b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp similarity index 70% rename from package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Umbrella.hpp rename to package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp index 1b4dcdd..37e1c02 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLite-Swift-Cxx-Umbrella.hpp +++ b/package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp @@ -1,5 +1,5 @@ /// -/// RNQuickSQLite-Swift-Cxx-Umbrella.hpp +/// RNNitroSQLite-Swift-Cxx-Umbrella.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -14,7 +14,7 @@ // C++ helpers for Swift -#include "RNQuickSQLite-Swift-Cxx-Bridge.hpp" +#include "RNNitroSQLite-Swift-Cxx-Bridge.hpp" // Common C++ types used in Swift #include @@ -26,10 +26,10 @@ // Include Swift defined types -#if __has_include("RNQuickSQLite-Swift.h") +#if __has_include("RNNitroSQLite-Swift.h") // This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "RNQuickSQLite". -#include "RNQuickSQLite-Swift.h" +// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "RNNitroSQLite". +#include "RNNitroSQLite-Swift.h" #else -#error RNQuickSQLite's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "RNQuickSQLite", and try building the app first. +#error RNNitroSQLite's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "RNNitroSQLite", and try building the app first. #endif diff --git a/package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.mm b/package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm similarity index 59% rename from package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.mm rename to package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm index 32dc8c7..d20b0ab 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.mm +++ b/package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm @@ -1,5 +1,5 @@ /// -/// RNQuickSQLiteAutolinking.mm +/// RNNitroSQLiteAutolinking.mm /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -10,24 +10,24 @@ #import -#include "HybridQuickSQLite.hpp" +#include "HybridNitroSQLite.hpp" -@interface RNQuickSQLiteAutolinking : NSObject +@interface RNNitroSQLiteAutolinking : NSObject @end -@implementation RNQuickSQLiteAutolinking +@implementation RNNitroSQLiteAutolinking + (void) load { using namespace margelo::nitro; - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; HybridObjectRegistry::registerHybridObjectConstructor( - "QuickSQLite", + "NitroSQLite", []() -> std::shared_ptr { - static_assert(std::is_default_constructible_v, - "The HybridObject \"HybridQuickSQLite\" is not default-constructible! " + static_assert(std::is_default_constructible_v, + "The HybridObject \"HybridNitroSQLite\" is not default-constructible! " "Create a public constructor that takes zero arguments to be able to autolink this HybridObject."); - return std::make_shared(); + return std::make_shared(); } ); } diff --git a/package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.swift b/package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift similarity index 53% rename from package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.swift rename to package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift index d7b8ed4..771c55c 100644 --- a/package/nitrogen/generated/ios/RNQuickSQLiteAutolinking.swift +++ b/package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift @@ -1,12 +1,12 @@ /// -/// RNQuickSQLiteAutolinking.swift +/// RNNitroSQLiteAutolinking.swift /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo /// -public final class RNQuickSQLiteAutolinking { - public typealias bridge = margelo.nitro.rnquicksqlite.bridge.swift +public final class RNNitroSQLiteAutolinking { + public typealias bridge = margelo.nitro.rnnitrosqlite.bridge.swift } diff --git a/package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp b/package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp index cb1e2fe..7c01f89 100644 --- a/package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +++ b/package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp @@ -27,7 +27,7 @@ namespace NitroModules { class ArrayBuffer; } #include #include -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** * A struct which can be represented as a JavaScript object (BatchQueryCommand). @@ -41,11 +41,11 @@ namespace margelo::nitro::rnquicksqlite { explicit BatchQueryCommand(std::string query, std::optional>>, std::vector>>>>> params): query(query), params(params) {} }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite namespace margelo::nitro { - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; // C++ BatchQueryCommand <> JS BatchQueryCommand (object) template <> diff --git a/package/nitrogen/generated/shared/c++/BatchQueryResult.hpp b/package/nitrogen/generated/shared/c++/BatchQueryResult.hpp index 6001db5..ba4b9d4 100644 --- a/package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +++ b/package/nitrogen/generated/shared/c++/BatchQueryResult.hpp @@ -22,7 +22,7 @@ #include -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** * A struct which can be represented as a JavaScript object (BatchQueryResult). @@ -35,11 +35,11 @@ namespace margelo::nitro::rnquicksqlite { explicit BatchQueryResult(std::optional rowsAffected): rowsAffected(rowsAffected) {} }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite namespace margelo::nitro { - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; // C++ BatchQueryResult <> JS BatchQueryResult (object) template <> diff --git a/package/nitrogen/generated/shared/c++/ColumnType.hpp b/package/nitrogen/generated/shared/c++/ColumnType.hpp index d797c99..a9bc219 100644 --- a/package/nitrogen/generated/shared/c++/ColumnType.hpp +++ b/package/nitrogen/generated/shared/c++/ColumnType.hpp @@ -19,7 +19,7 @@ #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** * An enum which can be represented as a JavaScript enum (ColumnType). @@ -33,11 +33,11 @@ namespace margelo::nitro::rnquicksqlite { NULL_VALUE SWIFT_NAME(nullValue) = 5, } CLOSED_ENUM; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite namespace margelo::nitro { - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; // C++ ColumnType <> JS ColumnType (enum) template <> diff --git a/package/nitrogen/generated/shared/c++/FileLoadResult.hpp b/package/nitrogen/generated/shared/c++/FileLoadResult.hpp index fa8f552..3662da9 100644 --- a/package/nitrogen/generated/shared/c++/FileLoadResult.hpp +++ b/package/nitrogen/generated/shared/c++/FileLoadResult.hpp @@ -22,7 +22,7 @@ #include -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** * A struct which can be represented as a JavaScript object (FileLoadResult). @@ -36,11 +36,11 @@ namespace margelo::nitro::rnquicksqlite { explicit FileLoadResult(std::optional commands, std::optional rowsAffected): commands(commands), rowsAffected(rowsAffected) {} }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite namespace margelo::nitro { - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; // C++ FileLoadResult <> JS FileLoadResult (object) template <> diff --git a/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp b/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp index 2415f07..7d01ec1 100644 --- a/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp +++ b/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp @@ -7,7 +7,7 @@ #include "HybridNativeQueryResultSpec.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { void HybridNativeQueryResultSpec::loadHybridMethods() { // load base methods/properties @@ -21,4 +21,4 @@ namespace margelo::nitro::rnquicksqlite { }); } -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp b/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp index 439a634..266d258 100644 --- a/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +++ b/package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp @@ -16,7 +16,7 @@ // Forward declaration of `ArrayBuffer` to properly resolve imports. namespace NitroModules { class ArrayBuffer; } // Forward declaration of `SQLiteQueryColumnMetadata` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { struct SQLiteQueryColumnMetadata; } +namespace margelo::nitro::rnnitrosqlite { struct SQLiteQueryColumnMetadata; } #include #include @@ -26,7 +26,7 @@ namespace margelo::nitro::rnquicksqlite { struct SQLiteQueryColumnMetadata; } #include #include "SQLiteQueryColumnMetadata.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { using namespace margelo::nitro; @@ -71,4 +71,4 @@ namespace margelo::nitro::rnquicksqlite { static constexpr auto TAG = "NativeQueryResult"; }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp b/package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp new file mode 100644 index 0000000..51e5ef2 --- /dev/null +++ b/package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp @@ -0,0 +1,31 @@ +/// +/// HybridNitroSQLiteSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2024 Marc Rousavy @ Margelo +/// + +#include "HybridNitroSQLiteSpec.hpp" + +namespace margelo::nitro::rnnitrosqlite { + + void HybridNitroSQLiteSpec::loadHybridMethods() { + // load base methods/properties + HybridObject::loadHybridMethods(); + // load custom methods/properties + registerHybrids(this, [](Prototype& prototype) { + prototype.registerHybridMethod("open", &HybridNitroSQLiteSpec::open); + prototype.registerHybridMethod("close", &HybridNitroSQLiteSpec::close); + prototype.registerHybridMethod("drop", &HybridNitroSQLiteSpec::drop); + prototype.registerHybridMethod("attach", &HybridNitroSQLiteSpec::attach); + prototype.registerHybridMethod("detach", &HybridNitroSQLiteSpec::detach); + prototype.registerHybridMethod("execute", &HybridNitroSQLiteSpec::execute); + prototype.registerHybridMethod("executeAsync", &HybridNitroSQLiteSpec::executeAsync); + prototype.registerHybridMethod("executeBatch", &HybridNitroSQLiteSpec::executeBatch); + prototype.registerHybridMethod("executeBatchAsync", &HybridNitroSQLiteSpec::executeBatchAsync); + prototype.registerHybridMethod("loadFile", &HybridNitroSQLiteSpec::loadFile); + prototype.registerHybridMethod("loadFileAsync", &HybridNitroSQLiteSpec::loadFileAsync); + }); + } + +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.hpp b/package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp similarity index 74% rename from package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.hpp rename to package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp index b17ae43..ad9a804 100644 --- a/package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.hpp +++ b/package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp @@ -1,5 +1,5 @@ /// -/// HybridQuickSQLiteSpec.hpp +/// HybridNitroSQLiteSpec.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2024 Marc Rousavy @ Margelo @@ -14,15 +14,15 @@ #endif // Forward declaration of `HybridNativeQueryResultSpec` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { class HybridNativeQueryResultSpec; } +namespace margelo::nitro::rnnitrosqlite { class HybridNativeQueryResultSpec; } // Forward declaration of `ArrayBuffer` to properly resolve imports. namespace NitroModules { class ArrayBuffer; } // Forward declaration of `BatchQueryResult` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { struct BatchQueryResult; } +namespace margelo::nitro::rnnitrosqlite { struct BatchQueryResult; } // Forward declaration of `BatchQueryCommand` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { struct BatchQueryCommand; } +namespace margelo::nitro::rnnitrosqlite { struct BatchQueryCommand; } // Forward declaration of `FileLoadResult` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { struct FileLoadResult; } +namespace margelo::nitro::rnnitrosqlite { struct FileLoadResult; } #include #include @@ -36,30 +36,30 @@ namespace margelo::nitro::rnquicksqlite { struct FileLoadResult; } #include "BatchQueryCommand.hpp" #include "FileLoadResult.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { using namespace margelo::nitro; /** - * An abstract base class for `QuickSQLite` - * Inherit this class to create instances of `HybridQuickSQLiteSpec` in C++. + * An abstract base class for `NitroSQLite` + * Inherit this class to create instances of `HybridNitroSQLiteSpec` in C++. * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. * @example * ```cpp - * class HybridQuickSQLite: public HybridQuickSQLiteSpec { + * class HybridNitroSQLite: public HybridNitroSQLiteSpec { * public: - * HybridQuickSQLite(...): HybridObject(TAG) { ... } + * HybridNitroSQLite(...): HybridObject(TAG) { ... } * // ... * }; * ``` */ - class HybridQuickSQLiteSpec: public virtual HybridObject { + class HybridNitroSQLiteSpec: public virtual HybridObject { public: // Constructor - explicit HybridQuickSQLiteSpec(): HybridObject(TAG) { } + explicit HybridNitroSQLiteSpec(): HybridObject(TAG) { } // Destructor - virtual ~HybridQuickSQLiteSpec() { } + virtual ~HybridNitroSQLiteSpec() { } public: // Properties @@ -72,8 +72,8 @@ namespace margelo::nitro::rnquicksqlite { virtual void drop(const std::string& dbName, const std::optional& location) = 0; virtual void attach(const std::string& mainDbName, const std::string& dbNameToAttach, const std::string& alias, const std::optional& location) = 0; virtual void detach(const std::string& mainDbName, const std::string& alias) = 0; - virtual std::shared_ptr execute(const std::string& dbName, const std::string& query, const std::optional>>>& params) = 0; - virtual std::future> executeAsync(const std::string& dbName, const std::string& query, const std::optional>>>& params) = 0; + virtual std::shared_ptr execute(const std::string& dbName, const std::string& query, const std::optional>>>& params) = 0; + virtual std::future> executeAsync(const std::string& dbName, const std::string& query, const std::optional>>>& params) = 0; virtual BatchQueryResult executeBatch(const std::string& dbName, const std::vector& commands) = 0; virtual std::future executeBatchAsync(const std::string& dbName, const std::vector& commands) = 0; virtual FileLoadResult loadFile(const std::string& dbName, const std::string& location) = 0; @@ -85,7 +85,7 @@ namespace margelo::nitro::rnquicksqlite { protected: // Tag for logging - static constexpr auto TAG = "QuickSQLite"; + static constexpr auto TAG = "NitroSQLite"; }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.cpp b/package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.cpp deleted file mode 100644 index d28b154..0000000 --- a/package/nitrogen/generated/shared/c++/HybridQuickSQLiteSpec.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/// -/// HybridQuickSQLiteSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2024 Marc Rousavy @ Margelo -/// - -#include "HybridQuickSQLiteSpec.hpp" - -namespace margelo::nitro::rnquicksqlite { - - void HybridQuickSQLiteSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("open", &HybridQuickSQLiteSpec::open); - prototype.registerHybridMethod("close", &HybridQuickSQLiteSpec::close); - prototype.registerHybridMethod("drop", &HybridQuickSQLiteSpec::drop); - prototype.registerHybridMethod("attach", &HybridQuickSQLiteSpec::attach); - prototype.registerHybridMethod("detach", &HybridQuickSQLiteSpec::detach); - prototype.registerHybridMethod("execute", &HybridQuickSQLiteSpec::execute); - prototype.registerHybridMethod("executeAsync", &HybridQuickSQLiteSpec::executeAsync); - prototype.registerHybridMethod("executeBatch", &HybridQuickSQLiteSpec::executeBatch); - prototype.registerHybridMethod("executeBatchAsync", &HybridQuickSQLiteSpec::executeBatchAsync); - prototype.registerHybridMethod("loadFile", &HybridQuickSQLiteSpec::loadFile); - prototype.registerHybridMethod("loadFileAsync", &HybridQuickSQLiteSpec::loadFileAsync); - }); - } - -} // namespace margelo::nitro::rnquicksqlite diff --git a/package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp b/package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp index 5f106c5..5e77ead 100644 --- a/package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +++ b/package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp @@ -19,12 +19,12 @@ #endif // Forward declaration of `ColumnType` to properly resolve imports. -namespace margelo::nitro::rnquicksqlite { enum class ColumnType; } +namespace margelo::nitro::rnnitrosqlite { enum class ColumnType; } #include #include "ColumnType.hpp" -namespace margelo::nitro::rnquicksqlite { +namespace margelo::nitro::rnnitrosqlite { /** * A struct which can be represented as a JavaScript object (SQLiteQueryColumnMetadata). @@ -39,11 +39,11 @@ namespace margelo::nitro::rnquicksqlite { explicit SQLiteQueryColumnMetadata(std::string name, ColumnType type, double index): name(name), type(type), index(index) {} }; -} // namespace margelo::nitro::rnquicksqlite +} // namespace margelo::nitro::rnnitrosqlite namespace margelo::nitro { - using namespace margelo::nitro::rnquicksqlite; + using namespace margelo::nitro::rnnitrosqlite; // C++ SQLiteQueryColumnMetadata <> JS SQLiteQueryColumnMetadata (object) template <> diff --git a/package/package.json b/package/package.json index 67ded0a..e3fb2be 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { - "name": "react-native-quick-sqlite", - "version": "8.2.5", + "name": "react-native-nitro-sqlite", + "version": "8.2.2-nitro.1", "description": "Fast SQLite for react-native", "source": "./src/index.ts", "main": "./lib/commonjs/index", @@ -20,11 +20,12 @@ "files": [ "src", "lib", + "nitrogen", "android", "ios", "cpp", "nitrogen", - "RNQuickSQLite.podspec", + "RNNitroSQLite.podspec", "!lib/typescript/example", "!android/build", "!android/.cxx", @@ -45,19 +46,21 @@ }, "keywords": [ "react-native", + "sqlite", + "nitro-modules", "ios", "android" ], "repository": { "type": "git", - "url": "git+https://github.com/margelo/react-native-quick-sqlite.git" + "url": "git+https://github.com/margelo/react-native-nitro-sqlite.git" }, - "author": "Marc Rousavy (https://github.com/mrousavy)", + "author": "Margelo (https://github.com/margelo)", "license": "MIT", "bugs": { - "url": "https://github.com/margelo/react-native-quick-sqlite/issues" + "url": "https://github.com/margelo/react-native-nitro-sqlite/issues" }, - "homepage": "https://github.com/margelo/react-native-quick-sqlite#readme", + "homepage": "https://github.com/margelo/react-native-nitro-sqlite#readme", "publishConfig": { "registry": "https://registry.npmjs.org/" }, @@ -81,11 +84,11 @@ "@types/react": "^18.2.44" }, "codegenConfig": { - "name": "QuickSQLite", + "name": "RNNitroSQLite", "type": "modules", "jsSrcsDir": "src", "android": { - "javaPackageName": "com.margelo.rnquicksqlite" + "javaPackageName": "com.margelo.rnnitrosqlite" } }, "jest": { diff --git a/package/src/index.ts b/package/src/index.ts index 64f73b0..35fe9fe 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -1,19 +1,19 @@ import { transaction } from './operations/transaction' -import { HybridQuickSQLite } from './nitro' +import { HybridNitroSQLite } from './nitro' import { open } from './operations/session' -import QuickSQLiteOnLoad from './specs/NativeQuickSQLiteOnLoad' +import NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad' import { execute, executeAsync } from './operations/execute' export * from './types' export { typeORMDriver } from './typeORM' export const onInitialized = new Promise((resolve) => { - QuickSQLiteOnLoad.onReactApplicationContextReady(resolve) + NitroSQLiteOnLoad.onReactApplicationContextReady(resolve) }) -export const QuickSQLite = { - ...HybridQuickSQLite, - native: HybridQuickSQLite, +export const NitroSQLite = { + ...HybridNitroSQLite, + native: HybridNitroSQLite, onInitialized, // Overwrite native functions with session-based JS implementations, // where the database name can be ommited once opened diff --git a/package/src/nitro.ts b/package/src/nitro.ts index c8e98f6..293e5c3 100644 --- a/package/src/nitro.ts +++ b/package/src/nitro.ts @@ -1,9 +1,9 @@ import { NitroModules } from 'react-native-nitro-modules' -import type { QuickSQLite as QuickSQLiteSpec } from './specs/QuickSQLite.nitro' +import type { NitroSQLite as NitroSQLiteSpec } from './specs/NitroSQLite.nitro' import type { PendingTransaction } from './operations/transaction' -export const HybridQuickSQLite = - NitroModules.createHybridObject('QuickSQLite') +export const HybridNitroSQLite = + NitroModules.createHybridObject('NitroSQLite') export const locks: Record< string, diff --git a/package/src/operations/execute.ts b/package/src/operations/execute.ts index 5761723..12d0ab1 100644 --- a/package/src/operations/execute.ts +++ b/package/src/operations/execute.ts @@ -1,4 +1,4 @@ -import { HybridQuickSQLite } from '../nitro' +import { HybridNitroSQLite } from '../nitro' import type { NativeQueryResult } from '../specs/NativeQueryResult.nitro' import type { QueryResult, SQLiteItem, SQLiteQueryParams } from '../types' @@ -7,7 +7,7 @@ export function execute( query: string, params?: SQLiteQueryParams ): QueryResult { - const nativeResult = HybridQuickSQLite.execute(dbName, query, params) + const nativeResult = HybridNitroSQLite.execute(dbName, query, params) const result = buildJsQueryResult(nativeResult) return result } @@ -17,7 +17,7 @@ export async function executeAsync( query: string, params?: SQLiteQueryParams ): Promise> { - const nativeResult = await HybridQuickSQLite.executeAsync( + const nativeResult = await HybridNitroSQLite.executeAsync( dbName, query, params diff --git a/package/src/operations/session.ts b/package/src/operations/session.ts index 17e1a6a..b772047 100644 --- a/package/src/operations/session.ts +++ b/package/src/operations/session.ts @@ -1,9 +1,9 @@ -import { locks, HybridQuickSQLite } from '../nitro' +import { locks, HybridNitroSQLite } from '../nitro' import { transaction } from './transaction' import type { BatchQueryCommand, - QuickSQLiteConnection, - QuickSQLiteConnectionOptions, + NitroSQLiteConnection, + NitroSQLiteConnectionOptions, QueryResult, SQLiteItem, SQLiteQueryParams, @@ -12,16 +12,16 @@ import type { import { execute, executeAsync } from './execute' export function open( - options: QuickSQLiteConnectionOptions -): QuickSQLiteConnection { + options: NitroSQLiteConnectionOptions +): NitroSQLiteConnection { openDb(options.name, options.location) return { close: () => close(options.name), - delete: () => HybridQuickSQLite.drop(options.name, options.location), + delete: () => HybridNitroSQLite.drop(options.name, options.location), attach: (dbNameToAttach: string, alias: string, location?: string) => - HybridQuickSQLite.attach(options.name, dbNameToAttach, alias, location), - detach: (alias: string) => HybridQuickSQLite.detach(options.name, alias), + HybridNitroSQLite.attach(options.name, dbNameToAttach, alias, location), + detach: (alias: string) => HybridNitroSQLite.detach(options.name, alias), transaction: (fn: (tx: Transaction) => Promise | void) => transaction(options.name, fn), execute: ( @@ -33,18 +33,18 @@ export function open( params?: SQLiteQueryParams ): Promise> => executeAsync(options.name, query, params), executeBatch: (commands: BatchQueryCommand[]) => - HybridQuickSQLite.executeBatch(options.name, commands), + HybridNitroSQLite.executeBatch(options.name, commands), executeBatchAsync: (commands: BatchQueryCommand[]) => - HybridQuickSQLite.executeBatchAsync(options.name, commands), + HybridNitroSQLite.executeBatchAsync(options.name, commands), loadFile: (location: string) => - HybridQuickSQLite.loadFile(options.name, location), + HybridNitroSQLite.loadFile(options.name, location), loadFileAsync: (location: string) => - HybridQuickSQLite.loadFileAsync(options.name, location), + HybridNitroSQLite.loadFileAsync(options.name, location), } } export function openDb(dbName: string, location?: string) { - HybridQuickSQLite.open(dbName, location) + HybridNitroSQLite.open(dbName, location) locks[dbName] = { queue: [], @@ -53,6 +53,6 @@ export function openDb(dbName: string, location?: string) { } export function close(dbName: string) { - HybridQuickSQLite.close(dbName) + HybridNitroSQLite.close(dbName) delete locks[dbName] } diff --git a/package/src/operations/transaction.ts b/package/src/operations/transaction.ts index 54f4101..2df390a 100644 --- a/package/src/operations/transaction.ts +++ b/package/src/operations/transaction.ts @@ -1,4 +1,4 @@ -import { locks, HybridQuickSQLite } from '../nitro' +import { locks, HybridNitroSQLite } from '../nitro' import type { QueryResult, SQLiteItem, @@ -25,7 +25,7 @@ export const transaction = ( fn: (tx: Transaction) => Promise | void ): Promise => { if (locks[dbName] == null) - throw Error(`Quick SQLite Error: No lock found on db: ${dbName}`) + throw Error(`Nitro SQLite Error: No lock found on db: ${dbName}`) let isFinalized = false @@ -36,7 +36,7 @@ export const transaction = ( ): QueryResult => { if (isFinalized) { throw Error( - `Quick SQLite Error: Cannot execute query on finalized transaction: ${dbName}` + `Nitro SQLite Error: Cannot execute query on finalized transaction: ${dbName}` ) } return execute(dbName, query, params) @@ -48,7 +48,7 @@ export const transaction = ( ): Promise> => { if (isFinalized) { throw Error( - `Quick SQLite Error: Cannot execute query on finalized transaction: ${dbName}` + `Nitro SQLite Error: Cannot execute query on finalized transaction: ${dbName}` ) } return executeAsync(dbName, query, params) @@ -57,10 +57,10 @@ export const transaction = ( const commit = () => { if (isFinalized) { throw Error( - `Quick SQLite Error: Cannot execute commit on finalized transaction: ${dbName}` + `Nitro SQLite Error: Cannot execute commit on finalized transaction: ${dbName}` ) } - const result = HybridQuickSQLite.execute(dbName, 'COMMIT') + const result = HybridNitroSQLite.execute(dbName, 'COMMIT') isFinalized = true return result } @@ -68,17 +68,17 @@ export const transaction = ( const rollback = () => { if (isFinalized) { throw Error( - `Quick SQLite Error: Cannot execute rollback on finalized transaction: ${dbName}` + `Nitro SQLite Error: Cannot execute rollback on finalized transaction: ${dbName}` ) } - const result = HybridQuickSQLite.execute(dbName, 'ROLLBACK') + const result = HybridNitroSQLite.execute(dbName, 'ROLLBACK') isFinalized = true return result } async function run() { try { - await HybridQuickSQLite.executeAsync(dbName, 'BEGIN TRANSACTION') + await HybridNitroSQLite.executeAsync(dbName, 'BEGIN TRANSACTION') await fn({ commit, diff --git a/package/src/specs/NativeQuickSQLiteOnLoad.ios.ts b/package/src/specs/NativeNitroSQLiteOnLoad.ios.ts similarity index 89% rename from package/src/specs/NativeQuickSQLiteOnLoad.ios.ts rename to package/src/specs/NativeNitroSQLiteOnLoad.ios.ts index 6f006c7..fd4038e 100644 --- a/package/src/specs/NativeQuickSQLiteOnLoad.ios.ts +++ b/package/src/specs/NativeNitroSQLiteOnLoad.ios.ts @@ -1,4 +1,4 @@ -import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeQuickSQLiteOnLoad' +import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeNitroSQLiteOnLoad' export const noop: AndroidOnLoadTurboModuleSpec = { onReactApplicationContextReady: () => undefined, diff --git a/package/src/specs/NativeQuickSQLiteOnLoad.ts b/package/src/specs/NativeNitroSQLiteOnLoad.ts similarity index 74% rename from package/src/specs/NativeQuickSQLiteOnLoad.ts rename to package/src/specs/NativeNitroSQLiteOnLoad.ts index 27db7b7..d3f8fa1 100644 --- a/package/src/specs/NativeQuickSQLiteOnLoad.ts +++ b/package/src/specs/NativeNitroSQLiteOnLoad.ts @@ -4,4 +4,4 @@ export interface Spec extends TurboModule { onReactApplicationContextReady(callback: () => void): void } -export default TurboModuleRegistry.getEnforcing('RNQuickSQLiteOnLoad') +export default TurboModuleRegistry.getEnforcing('RNNitroSQLiteOnLoad') diff --git a/package/src/specs/QuickSQLite.nitro.ts b/package/src/specs/NitroSQLite.nitro.ts similarity index 97% rename from package/src/specs/QuickSQLite.nitro.ts rename to package/src/specs/NitroSQLite.nitro.ts index bee4a7d..551f828 100644 --- a/package/src/specs/QuickSQLite.nitro.ts +++ b/package/src/specs/NitroSQLite.nitro.ts @@ -7,7 +7,7 @@ import type { } from '../types' import type { NativeQueryResult } from './NativeQueryResult.nitro' -export interface QuickSQLite +export interface NitroSQLite extends HybridObject<{ ios: 'c++'; android: 'c++' }> { open(dbName: string, location?: string): void close(dbName: string): void diff --git a/package/src/typeORM.ts b/package/src/typeORM.ts index 9d0f4eb..4705c8c 100644 --- a/package/src/typeORM.ts +++ b/package/src/typeORM.ts @@ -13,7 +13,7 @@ import type { } from './types' import * as Operations from './operations/session' -interface TypeOrmQuickSQLiteConnection { +interface TypeOrmNitroSQLiteConnection { executeSql: ( sql: string, params: SQLiteQueryParams | undefined, @@ -41,13 +41,13 @@ export const typeORMDriver = { name: string location?: string }, - ok: (db: TypeOrmQuickSQLiteConnection) => void, + ok: (db: TypeOrmNitroSQLiteConnection) => void, fail: (msg: string) => void - ): TypeOrmQuickSQLiteConnection | null => { + ): TypeOrmNitroSQLiteConnection | null => { try { const db = Operations.open(options) - const connection: TypeOrmQuickSQLiteConnection = { + const connection: TypeOrmNitroSQLiteConnection = { executeSql: async ( sql: string, params: SQLiteQueryParams | undefined, diff --git a/package/src/types.ts b/package/src/types.ts index aa7e6aa..a00fabe 100644 --- a/package/src/types.ts +++ b/package/src/types.ts @@ -1,9 +1,9 @@ -export interface QuickSQLiteConnectionOptions { +export interface NitroSQLiteConnectionOptions { name: string location?: string } -export interface QuickSQLiteConnection { +export interface NitroSQLiteConnection { close(): void delete(): void attach(dbNameToAttach: string, alias: string, location?: string): void diff --git a/scripts/release.sh b/scripts/release.sh index c9936f8..0d6ffb7 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,7 +1,7 @@ echo "Starting the release process..." echo "Provided options: $@" -echo "Publishing react-native-quick-sqlite to NPM" +echo "Publishing react-native-nitro-sqlite to NPM" cd package bun release $@ @@ -9,4 +9,4 @@ echo "Creating a Git bump commit and GitHub release" cd .. bun run release-it $@ -echo "Successfully released react-native-quick-sqlite!" +echo "Successfully released react-native-nitro-sqlite!"