react-native-nitro-sqlite 9.1.4 → 9.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/RNNitroSQLite.podspec +0 -1
  2. package/android/build.gradle +5 -7
  3. package/android/gradle.properties +2 -2
  4. package/android/src/main/kotlin/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt +27 -0
  5. package/lib/commonjs/OnLoad.android.js +11 -0
  6. package/lib/commonjs/OnLoad.android.js.map +1 -0
  7. package/lib/commonjs/OnLoad.js +10 -0
  8. package/lib/commonjs/OnLoad.js.map +1 -0
  9. package/lib/commonjs/index.js +2 -7
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/specs/NitroSQLiteOnLoad.nitro.js +6 -0
  12. package/lib/commonjs/specs/NitroSQLiteOnLoad.nitro.js.map +1 -0
  13. package/lib/module/OnLoad.android.js +6 -0
  14. package/lib/module/OnLoad.android.js.map +1 -0
  15. package/lib/module/OnLoad.js +5 -0
  16. package/lib/module/OnLoad.js.map +1 -0
  17. package/lib/module/index.js +2 -5
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/module/specs/NitroSQLiteOnLoad.nitro.js +4 -0
  20. package/lib/module/specs/NitroSQLiteOnLoad.nitro.js.map +1 -0
  21. package/lib/typescript/commonjs/OnLoad.android.d.ts +2 -0
  22. package/lib/typescript/commonjs/OnLoad.android.d.ts.map +1 -0
  23. package/lib/typescript/commonjs/OnLoad.d.ts +2 -0
  24. package/lib/typescript/commonjs/OnLoad.d.ts.map +1 -0
  25. package/lib/typescript/commonjs/index.d.ts +0 -2
  26. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  27. package/lib/typescript/commonjs/specs/NitroSQLiteOnLoad.nitro.d.ts +7 -0
  28. package/lib/typescript/commonjs/specs/NitroSQLiteOnLoad.nitro.d.ts.map +1 -0
  29. package/lib/typescript/module/OnLoad.android.d.ts +2 -0
  30. package/lib/typescript/module/OnLoad.android.d.ts.map +1 -0
  31. package/lib/typescript/module/OnLoad.d.ts +2 -0
  32. package/lib/typescript/module/OnLoad.d.ts.map +1 -0
  33. package/lib/typescript/module/index.d.ts +0 -2
  34. package/lib/typescript/module/index.d.ts.map +1 -1
  35. package/lib/typescript/module/specs/NitroSQLiteOnLoad.nitro.d.ts +7 -0
  36. package/lib/typescript/module/specs/NitroSQLiteOnLoad.nitro.d.ts.map +1 -0
  37. package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +2 -1
  38. package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +13 -1
  39. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp +40 -0
  40. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.hpp +62 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoad.kt +18 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec.kt +52 -0
  43. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp +21 -0
  44. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.hpp +62 -0
  45. package/package.json +6 -14
  46. package/src/OnLoad.android.ts +6 -0
  47. package/src/OnLoad.ts +2 -0
  48. package/src/index.ts +2 -5
  49. package/src/specs/NitroSQLiteOnLoad.nitro.ts +5 -0
  50. package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt +0 -40
  51. package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +0 -41
  52. package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +0 -43
  53. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js +0 -11
  54. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js.map +0 -1
  55. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js +0 -9
  56. package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js.map +0 -1
  57. package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js +0 -7
  58. package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js.map +0 -1
  59. package/lib/module/specs/NativeNitroSQLiteOnLoad.js +0 -5
  60. package/lib/module/specs/NativeNitroSQLiteOnLoad.js.map +0 -1
  61. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.d.ts +0 -7
  62. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.d.ts.map +0 -1
  63. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.ios.d.ts +0 -4
  64. package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +0 -1
  65. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts +0 -7
  66. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts.map +0 -1
  67. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts +0 -4
  68. package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +0 -1
  69. package/src/specs/NativeNitroSQLiteOnLoad.ios.ts +0 -7
  70. package/src/specs/NativeNitroSQLiteOnLoad.ts +0 -7
  71. /package/android/src/main/{java → kotlin}/com/margelo/rnnitrosqlite/DocPathSetter.kt +0 -0
@@ -49,7 +49,6 @@ Pod::Spec.new do |s|
49
49
  "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
50
50
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
51
51
  }
52
- s.dependency "React-Codegen"
53
52
  s.dependency "RCT-Folly"
54
53
  s.dependency "RCTRequired"
55
54
  s.dependency "RCTTypeSafety"
@@ -145,13 +145,12 @@ android {
145
145
 
146
146
  sourceSets {
147
147
  main {
148
+ java.srcDirs += [
149
+ "src/main/kotlin"
150
+ ]
151
+
148
152
  if (isNewArchitectureEnabled()) {
149
- java.srcDirs += [
150
- "src/newarch",
151
- // Codegen specs
152
- "generated/java",
153
- "generated/jni"
154
- ]
153
+ java.srcDirs += ["src/newarch"]
155
154
  } else {
156
155
  java.srcDirs += ["src/oldarch"]
157
156
  }
@@ -194,6 +193,5 @@ if (isNewArchitectureEnabled()) {
194
193
  react {
195
194
  jsRootDir = file("../src/")
196
195
  libraryName = "RNNitroSQLite"
197
- codegenJavaPackageName = "com.margelo.rnnitrosqlite"
198
196
  }
199
197
  }
@@ -1,5 +1,5 @@
1
- RNNitroSQLite_kotlinVersion=1.7.0
1
+ RNNitroSQLite_kotlinVersion=2.0.21
2
2
  RNNitroSQLite_minSdkVersion=21
3
3
  RNNitroSQLite_targetSdkVersion=31
4
4
  RNNitroSQLite_compileSdkVersion=31
5
- RNNitroSQLite_ndkversion=21.4.7075529
5
+ RNNitroSQLite_ndkversion=27.1.12297006
@@ -0,0 +1,27 @@
1
+ package com.margelo.rnnitrosqlite
2
+
3
+ import com.facebook.react.TurboReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.module.model.ReactModuleInfo
7
+ import com.facebook.react.module.model.ReactModuleInfoProvider
8
+ import com.margelo.nitro.rnnitrosqlite.RNNitroSQLiteOnLoad
9
+
10
+
11
+ class RNNitroSQLitePackage : TurboReactPackage() {
12
+ @Override
13
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
14
+ return null
15
+ }
16
+
17
+ @Override
18
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
19
+ return ReactModuleInfoProvider { HashMap() }
20
+ }
21
+
22
+ companion object {
23
+ init {
24
+ RNNitroSQLiteOnLoad.initializeNative()
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.init = void 0;
7
+ var _reactNativeNitroModules = require("react-native-nitro-modules");
8
+ const NitroSQLiteOnLoad = _reactNativeNitroModules.NitroModules.createHybridObject('NitroSQLiteOnLoad');
9
+ const init = () => NitroSQLiteOnLoad.init();
10
+ exports.init = init;
11
+ //# sourceMappingURL=OnLoad.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeNitroModules","require","NitroSQLiteOnLoad","NitroModules","createHybridObject","init","exports"],"sourceRoot":"../../src","sources":["OnLoad.android.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAGA,MAAMC,iBAAiB,GACrBC,qCAAY,CAACC,kBAAkB,CAAwB,mBAAmB,CAAC;AACtE,MAAMC,IAAI,GAAGA,CAAA,KAAMH,iBAAiB,CAACG,IAAI,CAAC,CAAC;AAAAC,OAAA,CAAAD,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.init = void 0;
7
+ // NOOP on iOS
8
+ const init = () => {};
9
+ exports.init = init;
10
+ //# sourceMappingURL=OnLoad.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["init","exports"],"sourceRoot":"../../src","sources":["OnLoad.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAAAC,OAAA,CAAAD,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -7,7 +7,6 @@ exports.NitroSQLite = exports.NITRO_SQLITE_NULL = void 0;
7
7
  exports.enableSimpleNullHandling = enableSimpleNullHandling;
8
8
  exports.isNitroSQLiteNull = isNitroSQLiteNull;
9
9
  exports.isSimpleNullHandlingEnabled = isSimpleNullHandlingEnabled;
10
- exports.onInitialized = void 0;
11
10
  Object.defineProperty(exports, "open", {
12
11
  enumerable: true,
13
12
  get: function () {
@@ -23,17 +22,13 @@ Object.defineProperty(exports, "typeORMDriver", {
23
22
  var _transaction = require("./operations/transaction.js");
24
23
  var _nitro = require("./nitro.js");
25
24
  var _session = require("./operations/session.js");
26
- var _NativeNitroSQLiteOnLoad = _interopRequireDefault(require("./specs/NativeNitroSQLiteOnLoad"));
27
25
  var _execute = require("./operations/execute.js");
26
+ var _OnLoad = require("./OnLoad");
28
27
  var _typeORM = require("./typeORM.js");
29
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
- const onInitialized = exports.onInitialized = new Promise(resolve => {
31
- _NativeNitroSQLiteOnLoad.default.onReactApplicationContextReady(resolve);
32
- });
28
+ (0, _OnLoad.init)();
33
29
  const NitroSQLite = exports.NitroSQLite = {
34
30
  ..._nitro.HybridNitroSQLite,
35
31
  native: _nitro.HybridNitroSQLite,
36
- onInitialized,
37
32
  // Overwrite native `open` function with session-based JS abstraction,
38
33
  // where the database name can be ommited once opened
39
34
  open: _session.open,
@@ -1 +1 @@
1
- {"version":3,"names":["_transaction","require","_nitro","_session","_NativeNitroSQLiteOnLoad","_interopRequireDefault","_execute","_typeORM","e","__esModule","default","onInitialized","exports","Promise","resolve","NitroSQLiteOnLoad","onReactApplicationContextReady","NitroSQLite","HybridNitroSQLite","native","open","transaction","execute","executeAsync","ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","isNitroSQLiteNull","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAGA,IAAAM,QAAA,GAAAN,OAAA;AAAyC,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElC,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAIE,OAAO,CAAQC,OAAO,IAAK;EAC1DC,gCAAiB,CAACC,8BAA8B,CAACF,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEK,MAAMG,WAAW,GAAAL,OAAA,CAAAK,WAAA,GAAG;EACzB,GAAGC,wBAAiB;EACpBC,MAAM,EAAED,wBAAiB;EACzBP,aAAa;EACb;EACA;EACAS,IAAI,EAAJA,aAAI;EACJ;EACAC,WAAW,EAAXA,wBAAW;EACXC,OAAO,EAAPA,gBAAO;EACPC,YAAY,EAAZA;AACF,CAAC;AAID,IAAIC,2BAA2B,GAAG,KAAK;AAChC,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AACO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEO,MAAMI,iBAAkC,GAAAhB,OAAA,CAAAgB,iBAAA,GAAG;EAAEC,iBAAiB,EAAE;AAAK,CAAC;AACtE,SAASA,iBAAiBA,CAACC,KAAU,EAA4B;EACtE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,mBAAmB,IAAIA,KAAK,EAAE;IAC7D,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"names":["_transaction","require","_nitro","_session","_execute","_OnLoad","_typeORM","init","NitroSQLite","exports","HybridNitroSQLite","native","open","transaction","execute","executeAsync","ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","isNitroSQLiteNull","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,YAAI,EAAC,CAAC;AAEC,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzB,GAAGE,wBAAiB;EACpBC,MAAM,EAAED,wBAAiB;EACzB;EACA;EACAE,IAAI,EAAJA,aAAI;EACJ;EACAC,WAAW,EAAXA,wBAAW;EACXC,OAAO,EAAPA,gBAAO;EACPC,YAAY,EAAZA;AACF,CAAC;AAID,IAAIC,2BAA2B,GAAG,KAAK;AAChC,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AACO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEO,MAAMI,iBAAkC,GAAAX,OAAA,CAAAW,iBAAA,GAAG;EAAEC,iBAAiB,EAAE;AAAK,CAAC;AACtE,SAASA,iBAAiBA,CAACC,KAAU,EAA4B;EACtE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,mBAAmB,IAAIA,KAAK,EAAE;IAC7D,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=NitroSQLiteOnLoad.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteOnLoad.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ import { NitroModules } from 'react-native-nitro-modules';
4
+ const NitroSQLiteOnLoad = NitroModules.createHybridObject('NitroSQLiteOnLoad');
5
+ export const init = () => NitroSQLiteOnLoad.init();
6
+ //# sourceMappingURL=OnLoad.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NitroModules","NitroSQLiteOnLoad","createHybridObject","init"],"sourceRoot":"../../src","sources":["OnLoad.android.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,MAAMC,iBAAiB,GACrBD,YAAY,CAACE,kBAAkB,CAAwB,mBAAmB,CAAC;AAC7E,OAAO,MAAMC,IAAI,GAAGA,CAAA,KAAMF,iBAAiB,CAACE,IAAI,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ // NOOP on iOS
4
+ export const init = () => {};
5
+ //# sourceMappingURL=OnLoad.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["init"],"sourceRoot":"../../src","sources":["OnLoad.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC","ignoreList":[]}
@@ -3,16 +3,13 @@
3
3
  import { transaction } from "./operations/transaction.js";
4
4
  import { HybridNitroSQLite } from "./nitro.js";
5
5
  import { open } from "./operations/session.js";
6
- import NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad';
7
6
  import { execute, executeAsync } from "./operations/execute.js";
7
+ import { init } from './OnLoad';
8
8
  export { typeORMDriver } from "./typeORM.js";
9
- export const onInitialized = new Promise(resolve => {
10
- NitroSQLiteOnLoad.onReactApplicationContextReady(resolve);
11
- });
9
+ init();
12
10
  export const NitroSQLite = {
13
11
  ...HybridNitroSQLite,
14
12
  native: HybridNitroSQLite,
15
- onInitialized,
16
13
  // Overwrite native `open` function with session-based JS abstraction,
17
14
  // where the database name can be ommited once opened
18
15
  open,
@@ -1 +1 @@
1
- {"version":3,"names":["transaction","HybridNitroSQLite","open","NitroSQLiteOnLoad","execute","executeAsync","typeORMDriver","onInitialized","Promise","resolve","onReactApplicationContextReady","NitroSQLite","native","ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","isNitroSQLiteNull","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,6BAA0B;AACtD,SAASC,iBAAiB,QAAQ,YAAS;AAC3C,SAASC,IAAI,QAAQ,yBAAsB;AAC3C,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,SAASC,OAAO,EAAEC,YAAY,QAAQ,yBAAsB;AAG5D,SAASC,aAAa,QAAQ,cAAW;AAEzC,OAAO,MAAMC,aAAa,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAK;EAC1DN,iBAAiB,CAACO,8BAA8B,CAACD,OAAO,CAAC;AAC3D,CAAC,CAAC;AAEF,OAAO,MAAME,WAAW,GAAG;EACzB,GAAGV,iBAAiB;EACpBW,MAAM,EAAEX,iBAAiB;EACzBM,aAAa;EACb;EACA;EACAL,IAAI;EACJ;EACAF,WAAW;EACXI,OAAO;EACPC;AACF,CAAC;AAED,SAASH,IAAI,QAAQ,yBAAsB;AAE3C,IAAIW,2BAA2B,GAAG,KAAK;AACvC,OAAO,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AACA,OAAO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEA,OAAO,MAAMI,iBAAkC,GAAG;EAAEC,iBAAiB,EAAE;AAAK,CAAC;AAC7E,OAAO,SAASA,iBAAiBA,CAACC,KAAU,EAA4B;EACtE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,mBAAmB,IAAIA,KAAK,EAAE;IAC7D,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"names":["transaction","HybridNitroSQLite","open","execute","executeAsync","init","typeORMDriver","NitroSQLite","native","ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","isNitroSQLiteNull","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,6BAA0B;AACtD,SAASC,iBAAiB,QAAQ,YAAS;AAC3C,SAASC,IAAI,QAAQ,yBAAsB;AAC3C,SAASC,OAAO,EAAEC,YAAY,QAAQ,yBAAsB;AAE5D,SAASC,IAAI,QAAQ,UAAU;AAE/B,SAASC,aAAa,QAAQ,cAAW;AAEzCD,IAAI,CAAC,CAAC;AAEN,OAAO,MAAME,WAAW,GAAG;EACzB,GAAGN,iBAAiB;EACpBO,MAAM,EAAEP,iBAAiB;EACzB;EACA;EACAC,IAAI;EACJ;EACAF,WAAW;EACXG,OAAO;EACPC;AACF,CAAC;AAED,SAASF,IAAI,QAAQ,yBAAsB;AAE3C,IAAIO,2BAA2B,GAAG,KAAK;AACvC,OAAO,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AACA,OAAO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEA,OAAO,MAAMI,iBAAkC,GAAG;EAAEC,iBAAiB,EAAE;AAAK,CAAC;AAC7E,OAAO,SAASA,iBAAiBA,CAACC,KAAU,EAA4B;EACtE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,mBAAmB,IAAIA,KAAK,EAAE;IAC7D,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=NitroSQLiteOnLoad.nitro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteOnLoad.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare const init: () => void;
2
+ //# sourceMappingURL=OnLoad.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnLoad.android.d.ts","sourceRoot":"","sources":["../../../src/OnLoad.android.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,YAAiC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const init: () => void;
2
+ //# sourceMappingURL=OnLoad.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnLoad.d.ts","sourceRoot":"","sources":["../../../src/OnLoad.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,YAAW,CAAA"}
@@ -3,10 +3,8 @@ import { execute, executeAsync } from './operations/execute';
3
3
  import { SQLiteNullValue } from './types';
4
4
  export type * from './types';
5
5
  export { typeORMDriver } from './typeORM';
6
- export declare const onInitialized: Promise<void>;
7
6
  export declare const NitroSQLite: {
8
7
  native: import("./specs/NitroSQLite.nitro").NitroSQLite;
9
- onInitialized: Promise<void>;
10
8
  open: typeof open;
11
9
  transaction: (dbName: string, fn: (tx: import("./types").Transaction) => Promise<void> | void) => Promise<void>;
12
10
  execute: typeof execute;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEzC,eAAO,MAAM,aAAa,eAExB,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;CAWvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG3C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AACD,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe,CAKtE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAIzC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAUvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG3C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AACD,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe,CAKtE"}
@@ -0,0 +1,7 @@
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+ export interface NitroSQLiteOnLoad extends HybridObject<{
3
+ android: 'kotlin';
4
+ }> {
5
+ init(): void;
6
+ }
7
+ //# sourceMappingURL=NitroSQLiteOnLoad.nitro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroSQLiteOnLoad.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NitroSQLiteOnLoad.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IAC5E,IAAI,IAAI,IAAI,CAAA;CACb"}
@@ -0,0 +1,2 @@
1
+ export declare const init: () => void;
2
+ //# sourceMappingURL=OnLoad.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnLoad.android.d.ts","sourceRoot":"","sources":["../../../src/OnLoad.android.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,YAAiC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const init: () => void;
2
+ //# sourceMappingURL=OnLoad.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnLoad.d.ts","sourceRoot":"","sources":["../../../src/OnLoad.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,YAAW,CAAA"}
@@ -3,10 +3,8 @@ import { execute, executeAsync } from './operations/execute';
3
3
  import { SQLiteNullValue } from './types';
4
4
  export type * from './types';
5
5
  export { typeORMDriver } from './typeORM';
6
- export declare const onInitialized: Promise<void>;
7
6
  export declare const NitroSQLite: {
8
7
  native: import("./specs/NitroSQLite.nitro").NitroSQLite;
9
- onInitialized: Promise<void>;
10
8
  open: typeof open;
11
9
  transaction: (dbName: string, fn: (tx: import("./types").Transaction) => Promise<void> | void) => Promise<void>;
12
10
  execute: typeof execute;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEzC,eAAO,MAAM,aAAa,eAExB,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;CAWvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG3C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AACD,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe,CAKtE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAIzC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAUvB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG3C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AACD,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe,CAKtE"}
@@ -0,0 +1,7 @@
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+ export interface NitroSQLiteOnLoad extends HybridObject<{
3
+ android: 'kotlin';
4
+ }> {
5
+ init(): void;
6
+ }
7
+ //# sourceMappingURL=NitroSQLiteOnLoad.nitro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroSQLiteOnLoad.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NitroSQLiteOnLoad.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IAC5E,IAAI,IAAI,IAAI,CAAA;CACb"}
@@ -29,8 +29,9 @@ target_sources(
29
29
  # Shared Nitrogen C++ sources
30
30
  ../nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp
31
31
  ../nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp
32
+ ../nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp
32
33
  # Android-specific Nitrogen C++ sources
33
-
34
+ ../nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp
34
35
  )
35
36
 
36
37
  # Define a flag to check if we are building properly
@@ -15,7 +15,10 @@
15
15
  #include <fbjni/fbjni.h>
16
16
  #include <NitroModules/HybridObjectRegistry.hpp>
17
17
 
18
+ #include "JHybridNitroSQLiteOnLoadSpec.hpp"
18
19
  #include "HybridNitroSQLite.hpp"
20
+ #include <NitroModules/JNISharedPtr.hpp>
21
+ #include <NitroModules/DefaultConstructableObject.hpp>
19
22
 
20
23
  namespace margelo::nitro::rnnitrosqlite {
21
24
 
@@ -26,7 +29,7 @@ int initialize(JavaVM* vm) {
26
29
 
27
30
  return facebook::jni::initialize(vm, [] {
28
31
  // Register native JNI methods
29
-
32
+ margelo::nitro::rnnitrosqlite::JHybridNitroSQLiteOnLoadSpec::registerNatives();
30
33
 
31
34
  // Register Nitro Hybrid Objects
32
35
  HybridObjectRegistry::registerHybridObjectConstructor(
@@ -38,6 +41,15 @@ int initialize(JavaVM* vm) {
38
41
  return std::make_shared<HybridNitroSQLite>();
39
42
  }
40
43
  );
44
+ HybridObjectRegistry::registerHybridObjectConstructor(
45
+ "NitroSQLiteOnLoad",
46
+ []() -> std::shared_ptr<HybridObject> {
47
+ static DefaultConstructableObject<JHybridNitroSQLiteOnLoadSpec::javaobject> object("com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoad");
48
+ auto instance = object.create();
49
+ auto globalRef = jni::make_global(instance);
50
+ return JNISharedPtr::make_shared_from_jni<JHybridNitroSQLiteOnLoadSpec>(globalRef);
51
+ }
52
+ );
41
53
  });
42
54
  }
43
55
 
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// JHybridNitroSQLiteOnLoadSpec.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "JHybridNitroSQLiteOnLoadSpec.hpp"
9
+
10
+
11
+
12
+
13
+
14
+ namespace margelo::nitro::rnnitrosqlite {
15
+
16
+ jni::local_ref<JHybridNitroSQLiteOnLoadSpec::jhybriddata> JHybridNitroSQLiteOnLoadSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
17
+ return makeCxxInstance(jThis);
18
+ }
19
+
20
+ void JHybridNitroSQLiteOnLoadSpec::registerNatives() {
21
+ registerHybrid({
22
+ makeNativeMethod("initHybrid", JHybridNitroSQLiteOnLoadSpec::initHybrid),
23
+ });
24
+ }
25
+
26
+ size_t JHybridNitroSQLiteOnLoadSpec::getExternalMemorySize() noexcept {
27
+ static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
28
+ return method(_javaPart);
29
+ }
30
+
31
+ // Properties
32
+
33
+
34
+ // Methods
35
+ void JHybridNitroSQLiteOnLoadSpec::init() {
36
+ static const auto method = javaClassStatic()->getMethod<void()>("init");
37
+ method(_javaPart);
38
+ }
39
+
40
+ } // namespace margelo::nitro::rnnitrosqlite
@@ -0,0 +1,62 @@
1
+ ///
2
+ /// HybridNitroSQLiteOnLoadSpec.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <NitroModules/JHybridObject.hpp>
11
+ #include <fbjni/fbjni.h>
12
+ #include "HybridNitroSQLiteOnLoadSpec.hpp"
13
+
14
+
15
+
16
+
17
+ namespace margelo::nitro::rnnitrosqlite {
18
+
19
+ using namespace facebook;
20
+
21
+ class JHybridNitroSQLiteOnLoadSpec: public jni::HybridClass<JHybridNitroSQLiteOnLoadSpec, JHybridObject>,
22
+ public virtual HybridNitroSQLiteOnLoadSpec {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec;";
25
+ static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
26
+ static void registerNatives();
27
+
28
+ protected:
29
+ // C++ constructor (called from Java via `initHybrid()`)
30
+ explicit JHybridNitroSQLiteOnLoadSpec(jni::alias_ref<jhybridobject> jThis) :
31
+ HybridObject(HybridNitroSQLiteOnLoadSpec::TAG),
32
+ _javaPart(jni::make_global(jThis)) {}
33
+
34
+ public:
35
+ ~JHybridNitroSQLiteOnLoadSpec() override {
36
+ // Hermes GC can destroy JS objects on a non-JNI Thread.
37
+ jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
38
+ }
39
+
40
+ public:
41
+ size_t getExternalMemorySize() noexcept override;
42
+
43
+ public:
44
+ inline const jni::global_ref<JHybridNitroSQLiteOnLoadSpec::javaobject>& getJavaPart() const noexcept {
45
+ return _javaPart;
46
+ }
47
+
48
+ public:
49
+ // Properties
50
+
51
+
52
+ public:
53
+ // Methods
54
+ void init() override;
55
+
56
+ private:
57
+ friend HybridBase;
58
+ using HybridBase::HybridBase;
59
+ jni::global_ref<JHybridNitroSQLiteOnLoadSpec::javaobject> _javaPart;
60
+ };
61
+
62
+ } // namespace margelo::nitro::rnnitrosqlite
@@ -0,0 +1,18 @@
1
+ package com.margelo.nitro.rnnitrosqlite
2
+
3
+ import androidx.annotation.Keep
4
+ import com.facebook.proguard.annotations.DoNotStrip
5
+ import com.margelo.nitro.NitroModules
6
+ import com.margelo.rnnitrosqlite.DocPathSetter
7
+
8
+ @Keep
9
+ @DoNotStrip
10
+ class HybridNitroSQLiteOnLoad : HybridNitroSQLiteOnLoadSpec() {
11
+ @Keep
12
+ @DoNotStrip
13
+ override fun init() {
14
+ NitroModules.applicationContext?.let { context ->
15
+ DocPathSetter.setDocPath(context)
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,52 @@
1
+ ///
2
+ /// HybridNitroSQLiteOnLoadSpec.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.rnnitrosqlite
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import com.margelo.nitro.core.*
14
+
15
+ /**
16
+ * A Kotlin class representing the NitroSQLiteOnLoad HybridObject.
17
+ * Implement this abstract class to create Kotlin-based instances of NitroSQLiteOnLoad.
18
+ */
19
+ @DoNotStrip
20
+ @Keep
21
+ @Suppress(
22
+ "KotlinJniMissingFunction", "unused",
23
+ "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
24
+ "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
25
+ )
26
+ abstract class HybridNitroSQLiteOnLoadSpec: HybridObject() {
27
+ @DoNotStrip
28
+ private var mHybridData: HybridData = initHybrid()
29
+
30
+ init {
31
+ super.updateNative(mHybridData)
32
+ }
33
+
34
+ override fun updateNative(hybridData: HybridData) {
35
+ mHybridData = hybridData
36
+ super.updateNative(hybridData)
37
+ }
38
+
39
+ // Properties
40
+
41
+
42
+ // Methods
43
+ @DoNotStrip
44
+ @Keep
45
+ abstract fun init(): Unit
46
+
47
+ private external fun initHybrid(): HybridData
48
+
49
+ companion object {
50
+ private const val TAG = "HybridNitroSQLiteOnLoadSpec"
51
+ }
52
+ }
@@ -0,0 +1,21 @@
1
+ ///
2
+ /// HybridNitroSQLiteOnLoadSpec.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridNitroSQLiteOnLoadSpec.hpp"
9
+
10
+ namespace margelo::nitro::rnnitrosqlite {
11
+
12
+ void HybridNitroSQLiteOnLoadSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("init", &HybridNitroSQLiteOnLoadSpec::init);
18
+ });
19
+ }
20
+
21
+ } // namespace margelo::nitro::rnnitrosqlite
@@ -0,0 +1,62 @@
1
+ ///
2
+ /// HybridNitroSQLiteOnLoadSpec.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+
17
+
18
+
19
+
20
+ namespace margelo::nitro::rnnitrosqlite {
21
+
22
+ using namespace margelo::nitro;
23
+
24
+ /**
25
+ * An abstract base class for `NitroSQLiteOnLoad`
26
+ * Inherit this class to create instances of `HybridNitroSQLiteOnLoadSpec` in C++.
27
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
28
+ * @example
29
+ * ```cpp
30
+ * class HybridNitroSQLiteOnLoad: public HybridNitroSQLiteOnLoadSpec {
31
+ * public:
32
+ * HybridNitroSQLiteOnLoad(...): HybridObject(TAG) { ... }
33
+ * // ...
34
+ * };
35
+ * ```
36
+ */
37
+ class HybridNitroSQLiteOnLoadSpec: public virtual HybridObject {
38
+ public:
39
+ // Constructor
40
+ explicit HybridNitroSQLiteOnLoadSpec(): HybridObject(TAG) { }
41
+
42
+ // Destructor
43
+ ~HybridNitroSQLiteOnLoadSpec() override = default;
44
+
45
+ public:
46
+ // Properties
47
+
48
+
49
+ public:
50
+ // Methods
51
+ virtual void init() = 0;
52
+
53
+ protected:
54
+ // Hybrid Setup
55
+ void loadHybridMethods() override;
56
+
57
+ protected:
58
+ // Tag for logging
59
+ static constexpr auto TAG = "NitroSQLiteOnLoad";
60
+ };
61
+
62
+ } // namespace margelo::nitro::rnnitrosqlite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-sqlite",
3
- "version": "9.1.4",
3
+ "version": "9.1.5",
4
4
  "description": "Fast SQLite library for React Native built using Nitro Modules",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/commonjs/index",
@@ -69,12 +69,12 @@
69
69
  "typeorm": "^0.3.20"
70
70
  },
71
71
  "devDependencies": {
72
- "jest": "*",
73
- "nitro-codegen": "*",
74
- "react": "*",
75
- "react-native": "*",
72
+ "jest": "^29.7.0",
73
+ "nitro-codegen": "^0.24.1",
74
+ "react": "19.0.0",
75
+ "react-native": "0.78.0",
76
76
  "react-native-builder-bob": "^0.31.0",
77
- "react-native-nitro-modules": "*"
77
+ "react-native-nitro-modules": "0.24.1"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "react": ">=17.0.0",
@@ -84,14 +84,6 @@
84
84
  "resolutions": {
85
85
  "@types/react": "^18.2.44"
86
86
  },
87
- "codegenConfig": {
88
- "name": "RNNitroSQLite",
89
- "type": "modules",
90
- "jsSrcsDir": "src",
91
- "android": {
92
- "javaPackageName": "com.margelo.rnnitrosqlite"
93
- }
94
- },
95
87
  "jest": {
96
88
  "preset": "react-native",
97
89
  "modulePathIgnorePatterns": [
@@ -0,0 +1,6 @@
1
+ import { NitroModules } from 'react-native-nitro-modules'
2
+ import { NitroSQLiteOnLoad as NitroSQLiteOnLoadSpec } from './specs/NitroSQLiteOnLoad.nitro'
3
+
4
+ const NitroSQLiteOnLoad =
5
+ NitroModules.createHybridObject<NitroSQLiteOnLoadSpec>('NitroSQLiteOnLoad')
6
+ export const init = () => NitroSQLiteOnLoad.init()
package/src/OnLoad.ts ADDED
@@ -0,0 +1,2 @@
1
+ // NOOP on iOS
2
+ export const init = () => {}
package/src/index.ts CHANGED
@@ -1,20 +1,17 @@
1
1
  import { transaction } from './operations/transaction'
2
2
  import { HybridNitroSQLite } from './nitro'
3
3
  import { open } from './operations/session'
4
- import NitroSQLiteOnLoad from './specs/NativeNitroSQLiteOnLoad'
5
4
  import { execute, executeAsync } from './operations/execute'
6
5
  import { SQLiteNullValue } from './types'
6
+ import { init } from './OnLoad'
7
7
  export type * from './types'
8
8
  export { typeORMDriver } from './typeORM'
9
9
 
10
- export const onInitialized = new Promise<void>((resolve) => {
11
- NitroSQLiteOnLoad.onReactApplicationContextReady(resolve)
12
- })
10
+ init()
13
11
 
14
12
  export const NitroSQLite = {
15
13
  ...HybridNitroSQLite,
16
14
  native: HybridNitroSQLite,
17
- onInitialized,
18
15
  // Overwrite native `open` function with session-based JS abstraction,
19
16
  // where the database name can be ommited once opened
20
17
  open,
@@ -0,0 +1,5 @@
1
+ import type { HybridObject } from 'react-native-nitro-modules'
2
+
3
+ export interface NitroSQLiteOnLoad extends HybridObject<{ android: 'kotlin' }> {
4
+ init(): void
5
+ }
@@ -1,40 +0,0 @@
1
- package com.margelo.rnnitrosqlite
2
-
3
- import com.facebook.react.TurboReactPackage
4
- import com.facebook.react.bridge.NativeModule
5
- import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.module.model.ReactModuleInfo
7
- import com.facebook.react.module.model.ReactModuleInfoProvider
8
-
9
- class RNNitroSQLitePackage : TurboReactPackage() {
10
- override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
11
- return if (name == RNNitroSQLiteOnLoadModule.NAME) {
12
- RNNitroSQLiteOnLoadModule(reactContext)
13
- } else {
14
- null
15
- }
16
- }
17
-
18
- override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
19
- return ReactModuleInfoProvider {
20
- val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
21
- val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
22
- moduleInfos[RNNitroSQLiteOnLoadModule.NAME] = ReactModuleInfo(
23
- RNNitroSQLiteOnLoadModule.NAME,
24
- RNNitroSQLiteOnLoadModule.NAME,
25
- canOverrideExistingModule=false,
26
- needsEagerInit=true,
27
- hasConstants=true,
28
- isCxxModule=false,
29
- isTurboModule=isTurboModule
30
- )
31
- moduleInfos
32
- }
33
- }
34
-
35
- companion object {
36
- init {
37
- System.loadLibrary("RNNitroSQLite")
38
- }
39
- }
40
- }
@@ -1,41 +0,0 @@
1
- package com.margelo.rnnitrosqlite
2
-
3
- import com.facebook.react.bridge.Callback
4
- import com.facebook.react.bridge.ReactApplicationContext
5
- import com.margelo.rnnitrosqlite.NativeNitroSQLiteOnLoadSpec
6
-
7
- class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) :
8
- NativeNitroSQLiteOnLoadSpec(reactContext) {
9
- private var reactApplicationContextReadyCallback: Callback? = null
10
-
11
- init {
12
- Companion.reactContext = reactContext
13
- DocPathSetter.setDocPath(reactContext)
14
-
15
- if (reactApplicationContextReadyCallback != null) {
16
- reactApplicationContextReadyCallback!!.invoke()
17
- }
18
- }
19
-
20
- override fun getName(): String {
21
- return NAME
22
- }
23
-
24
- override fun onReactApplicationContextReady(callback: Callback) {
25
- if (reactContext != null) {
26
- callback.invoke()
27
- return
28
- }
29
-
30
- reactApplicationContextReadyCallback = callback
31
- }
32
-
33
- companion object {
34
- const val NAME: String = "RNNitroSQLiteOnLoad"
35
-
36
- var reactContext: ReactApplicationContext? = null
37
- private set
38
- var reactApplicationContextReadyCallback: Callback? = null
39
- private set
40
- }
41
- }
@@ -1,43 +0,0 @@
1
- package com.margelo.rnnitrosqlite
2
-
3
- import com.facebook.react.bridge.Callback
4
- import com.facebook.react.bridge.ReactApplicationContext
5
- import com.facebook.react.bridge.ReactContextBaseJavaModule
6
- import com.facebook.react.bridge.ReactMethod
7
-
8
- class RNNitroSQLiteOnLoadModule(reactContext: ReactApplicationContext) :
9
- ReactContextBaseJavaModule(reactContext) {
10
-
11
-
12
- init {
13
- Companion.reactContext = reactContext
14
- DocPathSetter.setDocPath(reactContext)
15
-
16
- if (reactApplicationContextReadyCallback != null) {
17
- reactApplicationContextReadyCallback!!.invoke()
18
- }
19
- }
20
-
21
- override fun getName(): String {
22
- return NAME
23
- }
24
-
25
- @ReactMethod
26
- fun onReactApplicationContextReady(callback: Callback) {
27
- if (reactContext != null) {
28
- callback.invoke()
29
- return
30
- }
31
-
32
- reactApplicationContextReadyCallback = callback
33
- }
34
-
35
- companion object {
36
- const val NAME: String = "RNNitroSQLiteOnLoad"
37
-
38
- var reactContext: ReactApplicationContext? = null
39
- private set
40
- var reactApplicationContextReadyCallback: Callback? = null
41
- private set
42
- }
43
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.noop = exports.default = void 0;
7
- const noop = exports.noop = {
8
- onReactApplicationContextReady: () => undefined
9
- };
10
- var _default = exports.default = noop;
11
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["noop","exports","onReactApplicationContextReady","undefined","_default","default"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ios.ts"],"mappings":";;;;;;AAEO,MAAMA,IAAkC,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAChDE,8BAA8B,EAAEA,CAAA,KAAMC;AACxC,CAAC;AAAA,IAAAC,QAAA,GAAAH,OAAA,CAAAI,OAAA,GAEcL,IAAI","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _reactNative = require("react-native");
8
- var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('RNNitroSQLiteOnLoad');
9
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoE,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMrDC,gCAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- export const noop = {
4
- onReactApplicationContextReady: () => undefined
5
- };
6
- export default noop;
7
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["noop","onReactApplicationContextReady","undefined"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ios.ts"],"mappings":";;AAEA,OAAO,MAAMA,IAAkC,GAAG;EAChDC,8BAA8B,EAAEA,CAAA,KAAMC;AACxC,CAAC;AAED,eAAeF,IAAI","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('RNNitroSQLiteOnLoad');
5
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeNitroSQLiteOnLoad.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- import { type TurboModule } from 'react-native';
2
- export interface Spec extends TurboModule {
3
- onReactApplicationContextReady(callback: () => void): void;
4
- }
5
- declare const _default: Spec;
6
- export default _default;
7
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeNitroSQLiteOnLoad.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeNitroSQLiteOnLoad.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAEpE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,8BAA8B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CAC3D;;AAED,wBAA4E"}
@@ -1,4 +0,0 @@
1
- import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeNitroSQLiteOnLoad';
2
- export declare const noop: AndroidOnLoadTurboModuleSpec;
3
- export default noop;
4
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeNitroSQLiteOnLoad.ios.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeNitroSQLiteOnLoad.ios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAErF,eAAO,MAAM,IAAI,EAAE,4BAElB,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -1,7 +0,0 @@
1
- import { type TurboModule } from 'react-native';
2
- export interface Spec extends TurboModule {
3
- onReactApplicationContextReady(callback: () => void): void;
4
- }
5
- declare const _default: Spec;
6
- export default _default;
7
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeNitroSQLiteOnLoad.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeNitroSQLiteOnLoad.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAEpE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,8BAA8B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CAC3D;;AAED,wBAA4E"}
@@ -1,4 +0,0 @@
1
- import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeNitroSQLiteOnLoad';
2
- export declare const noop: AndroidOnLoadTurboModuleSpec;
3
- export default noop;
4
- //# sourceMappingURL=NativeNitroSQLiteOnLoad.ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeNitroSQLiteOnLoad.ios.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeNitroSQLiteOnLoad.ios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAErF,eAAO,MAAM,IAAI,EAAE,4BAElB,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -1,7 +0,0 @@
1
- import type { Spec as AndroidOnLoadTurboModuleSpec } from './NativeNitroSQLiteOnLoad'
2
-
3
- export const noop: AndroidOnLoadTurboModuleSpec = {
4
- onReactApplicationContextReady: () => undefined,
5
- }
6
-
7
- export default noop
@@ -1,7 +0,0 @@
1
- import { TurboModuleRegistry, type TurboModule } from 'react-native'
2
-
3
- export interface Spec extends TurboModule {
4
- onReactApplicationContextReady(callback: () => void): void
5
- }
6
-
7
- export default TurboModuleRegistry.getEnforcing<Spec>('RNNitroSQLiteOnLoad')