react-native-nitro-sqlite 9.1.3 → 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.
- package/RNNitroSQLite.podspec +0 -1
- package/android/build.gradle +5 -7
- package/android/gradle.properties +2 -2
- package/android/src/main/kotlin/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt +27 -0
- package/cpp/operations.cpp +1 -1
- package/lib/commonjs/OnLoad.android.js +11 -0
- package/lib/commonjs/OnLoad.android.js.map +1 -0
- package/lib/commonjs/OnLoad.js +10 -0
- package/lib/commonjs/OnLoad.js.map +1 -0
- package/lib/commonjs/index.js +2 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NitroSQLiteOnLoad.nitro.js +6 -0
- package/lib/commonjs/specs/NitroSQLiteOnLoad.nitro.js.map +1 -0
- package/lib/module/OnLoad.android.js +6 -0
- package/lib/module/OnLoad.android.js.map +1 -0
- package/lib/module/OnLoad.js +5 -0
- package/lib/module/OnLoad.js.map +1 -0
- package/lib/module/index.js +2 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NitroSQLiteOnLoad.nitro.js +4 -0
- package/lib/module/specs/NitroSQLiteOnLoad.nitro.js.map +1 -0
- package/lib/typescript/commonjs/OnLoad.android.d.ts +2 -0
- package/lib/typescript/commonjs/OnLoad.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/OnLoad.d.ts +2 -0
- package/lib/typescript/commonjs/OnLoad.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +0 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/NitroSQLiteOnLoad.nitro.d.ts +7 -0
- package/lib/typescript/commonjs/specs/NitroSQLiteOnLoad.nitro.d.ts.map +1 -0
- package/lib/typescript/module/OnLoad.android.d.ts +2 -0
- package/lib/typescript/module/OnLoad.android.d.ts.map +1 -0
- package/lib/typescript/module/OnLoad.d.ts +2 -0
- package/lib/typescript/module/OnLoad.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +0 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/specs/NitroSQLiteOnLoad.nitro.d.ts +7 -0
- package/lib/typescript/module/specs/NitroSQLiteOnLoad.nitro.d.ts.map +1 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +21 -1
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +17 -1
- package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp +40 -0
- package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.hpp +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoad.kt +18 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/RNNitroSQLiteOnLoad.kt +35 -0
- package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +2 -0
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp +0 -1
- package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +2 -1
- package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +2 -1
- package/nitrogen/generated/shared/c++/ColumnType.hpp +1 -1
- package/nitrogen/generated/shared/c++/FileLoadResult.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/SQLiteNullValue.hpp +2 -1
- package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +2 -1
- package/package.json +8 -16
- package/src/OnLoad.android.ts +6 -0
- package/src/OnLoad.ts +2 -0
- package/src/index.ts +2 -5
- package/src/specs/NitroSQLiteOnLoad.nitro.ts +5 -0
- package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.kt +0 -40
- package/android/src/newarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +0 -41
- package/android/src/oldarch/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.kt +0 -43
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js +0 -11
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js.map +0 -1
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js +0 -9
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js.map +0 -1
- package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js +0 -7
- package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js.map +0 -1
- package/lib/module/specs/NativeNitroSQLiteOnLoad.js +0 -5
- package/lib/module/specs/NativeNitroSQLiteOnLoad.js.map +0 -1
- package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.d.ts +0 -7
- package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.ios.d.ts +0 -4
- package/lib/typescript/commonjs/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +0 -1
- package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts +0 -7
- package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.d.ts.map +0 -1
- package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts +0 -4
- package/lib/typescript/module/specs/NativeNitroSQLiteOnLoad.ios.d.ts.map +0 -1
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.kt +0 -1
- package/src/specs/NativeNitroSQLiteOnLoad.ios.ts +0 -7
- package/src/specs/NativeNitroSQLiteOnLoad.ts +0 -7
- /package/android/src/main/{java → kotlin}/com/margelo/rnnitrosqlite/DocPathSetter.kt +0 -0
package/RNNitroSQLite.podspec
CHANGED
|
@@ -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"
|
package/android/build.gradle
CHANGED
|
@@ -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
|
}
|
|
@@ -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
|
+
}
|
package/cpp/operations.cpp
CHANGED
|
@@ -181,7 +181,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str
|
|
|
181
181
|
const void* blob = sqlite3_column_blob(statement, i);
|
|
182
182
|
uint8_t* data = new uint8_t[blob_size];
|
|
183
183
|
memcpy(data, blob, blob_size);
|
|
184
|
-
row[column_name] = ArrayBuffer::
|
|
184
|
+
row[column_name] = ArrayBuffer::wrap(data, blob_size, [&data]() -> void { delete[] data; });
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case SQLITE_NULL:
|
|
@@ -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 @@
|
|
|
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":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -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
|
-
|
|
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","
|
|
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 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteOnLoad.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"names":["init"],"sourceRoot":"../../src","sources":["OnLoad.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -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
|
-
|
|
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,
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["transaction","HybridNitroSQLite","open","
|
|
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 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NitroSQLiteOnLoad.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -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 @@
|
|
|
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;
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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;
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
* linguist-generated
|
|
@@ -29,8 +29,28 @@ 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
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Define a flag to check if we are building properly
|
|
38
|
+
add_definitions(-DBUILDING_RNNITROSQLITE_WITH_GENERATED_CMAKE_PROJECT)
|
|
39
|
+
|
|
40
|
+
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
41
|
+
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
42
|
+
target_compile_definitions(
|
|
43
|
+
RNNitroSQLite PRIVATE
|
|
44
|
+
-DFOLLY_NO_CONFIG=1
|
|
45
|
+
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
46
|
+
-DFOLLY_USE_LIBCPP=1
|
|
47
|
+
-DFOLLY_CFG_NO_COROUTINES=1
|
|
48
|
+
-DFOLLY_MOBILE=1
|
|
49
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
50
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
51
|
+
# Once we target android-23 above, we can comment
|
|
52
|
+
# the following line. NDK uses GNU style stderror_r() after API 23.
|
|
53
|
+
-DFOLLY_HAVE_XSI_STRERROR_R=1
|
|
34
54
|
)
|
|
35
55
|
|
|
36
56
|
# Add all libraries required by the generated specs
|
|
@@ -5,13 +5,20 @@
|
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
+
#ifndef BUILDING_RNNITROSQLITE_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error RNNitroSQLiteOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
8
12
|
#include "RNNitroSQLiteOnLoad.hpp"
|
|
9
13
|
|
|
10
14
|
#include <jni.h>
|
|
11
15
|
#include <fbjni/fbjni.h>
|
|
12
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
13
17
|
|
|
18
|
+
#include "JHybridNitroSQLiteOnLoadSpec.hpp"
|
|
14
19
|
#include "HybridNitroSQLite.hpp"
|
|
20
|
+
#include <NitroModules/JNISharedPtr.hpp>
|
|
21
|
+
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
15
22
|
|
|
16
23
|
namespace margelo::nitro::rnnitrosqlite {
|
|
17
24
|
|
|
@@ -22,7 +29,7 @@ int initialize(JavaVM* vm) {
|
|
|
22
29
|
|
|
23
30
|
return facebook::jni::initialize(vm, [] {
|
|
24
31
|
// Register native JNI methods
|
|
25
|
-
|
|
32
|
+
margelo::nitro::rnnitrosqlite::JHybridNitroSQLiteOnLoadSpec::registerNatives();
|
|
26
33
|
|
|
27
34
|
// Register Nitro Hybrid Objects
|
|
28
35
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
@@ -34,6 +41,15 @@ int initialize(JavaVM* vm) {
|
|
|
34
41
|
return std::make_shared<HybridNitroSQLite>();
|
|
35
42
|
}
|
|
36
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
|
+
);
|
|
37
53
|
});
|
|
38
54
|
}
|
|
39
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
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoad.kt
ADDED
|
@@ -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
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/RNNitroSQLiteOnLoad.kt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLiteOnLoad.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 android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class RNNitroSQLiteOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "RNNitroSQLiteOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "RNNitroSQLite".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading RNNitroSQLite C++ library...")
|
|
25
|
+
System.loadLibrary("RNNitroSQLite")
|
|
26
|
+
Log.i(TAG, "Successfully loaded RNNitroSQLite C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load RNNitroSQLite C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -44,6 +44,8 @@ def add_nitrogen_files(spec)
|
|
|
44
44
|
spec.private_header_files = current_private_header_files + [
|
|
45
45
|
# iOS specific specs
|
|
46
46
|
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
47
49
|
]
|
|
48
50
|
|
|
49
51
|
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
// Common C++ types used in Swift
|
|
20
20
|
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
21
21
|
#include <NitroModules/AnyMapHolder.hpp>
|
|
22
|
-
#include <NitroModules/HybridContext.hpp>
|
|
23
22
|
#include <NitroModules/RuntimeError.hpp>
|
|
24
23
|
|
|
25
24
|
// Forward declarations of Swift defined types
|