Skip to content

Commit 3477400

Browse files
chore: update patch
1 parent af98bcd commit 3477400

File tree

5 files changed

+93
-91
lines changed

5 files changed

+93
-91
lines changed

.yarn/patches/@op-engineering-op-sqlite-npm-12.0.2-eb873cce05.patch renamed to .yarn/patches/@op-engineering-op-sqlite-npm-15.0.7-39fbf4933a.patch

Lines changed: 83 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
diff --git a/android/build.gradle b/android/build.gradle
2-
index 70ebca0eed3ccd79fe8b7d107d5d860bd6ca34db..5da86593b0ad638d0147719ce5a987ea6617e198 100644
2+
index d36fd855813e87b17da43156be64782b325b2733..751355645c0b6e28e2df01e9bdc32f545d8dc83c 100644
33
--- a/android/build.gradle
44
+++ b/android/build.gradle
55
@@ -1,5 +1,4 @@
66
import java.nio.file.Paths
77
-import groovy.json.JsonSlurper
88

99
buildscript {
10-
repositories {
11-
@@ -27,10 +26,10 @@ def isNewArchitectureEnabled() {
12-
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
10+
ext.getExtOrDefault = {name ->
11+
@@ -27,57 +26,16 @@ def getExtOrIntegerDefault(name) {
12+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["OPSQLite_" + name]).toInteger()
1313
}
1414

1515
-def useSQLCipher = false
@@ -21,22 +21,39 @@ index 70ebca0eed3ccd79fe8b7d107d5d860bd6ca34db..5da86593b0ad638d0147719ce5a987ea
2121
def sqliteFlags = ""
2222
def enableFTS5 = false
2323
def useSqliteVec = false
24-
@@ -38,28 +37,6 @@ def enableRtree = false
24+
def enableRtree = false
2525
def tokenizers = []
2626

27-
def isInsideNodeModules = rootDir.absolutePath.contains("node_modules")
28-
-def packageJson
27+
-// On the example app, the package.json is located at the root of the project
28+
-// On the user app, the package.json is located at the root of the node_modules directory
29+
-def isUserApp = rootDir.absolutePath.contains("node_modules")
30+
-def packageJsonFile
2931
-
30-
-if ( isInsideNodeModules ) {
31-
- def packageJsonFile = new File("$rootDir/../../../package.json")
32-
- packageJson = new JsonSlurper().parseText(packageJsonFile.text)
32+
-if (isUserApp) {
33+
- // Start from the root + 1 level up (to avoid detecting the op-sqlite/package.json) and traverse upwards to find the first package.json
34+
- File currentDir = new File("$rootDir/../")
35+
- packageJsonFile = null
36+
-
37+
- // Try to find package.json by traversing upwards
38+
- while (currentDir != null) {
39+
- File potential = new File(currentDir, "package.json")
40+
- if (potential.exists()) {
41+
- packageJsonFile = potential
42+
- break
43+
- }
44+
- currentDir = currentDir.parentFile
45+
- }
3346
-} else {
34-
- def packageJsonFile = new File("$rootDir/../package.json")
35-
- packageJson = new JsonSlurper().parseText(packageJsonFile.text)
47+
- packageJsonFile = new File("$rootDir/../package.json")
3648
-}
3749
-
50+
-
51+
-def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
52+
-
3853
-def opsqliteConfig = packageJson["op-sqlite"]
54+
-
3955
-if(opsqliteConfig) {
56+
- println "[OP-SQLITE] Detected op-sqlite config from package.json at: " + packageJsonFile.absolutePath
4057
- useSQLCipher = opsqliteConfig["sqlcipher"]
4158
- useCRSQLite = opsqliteConfig["crsqlite"]
4259
- useSqliteVec = opsqliteConfig["sqliteVec"]
@@ -47,11 +64,12 @@ index 70ebca0eed3ccd79fe8b7d107d5d860bd6ca34db..5da86593b0ad638d0147719ce5a987ea
4764
- enableRtree = opsqliteConfig["rtree"]
4865
- tokenizers = opsqliteConfig["tokenizers"] ? opsqliteConfig["tokenizers"] : []
4966
-}
50-
67+
-
5168
if(useSQLCipher) {
52-
println "[OP-SQLITE] using SQLCipher 🔒"
69+
println "[OP-SQLITE] using sqlcipher."
70+
} else if(useLibsql) {
5371
diff --git a/android/cpp-adapter.cpp b/android/cpp-adapter.cpp
54-
index 8feaf7719661ef248113f11b1643deedb4b510af..be0ade91b7f92281cdc4ebb941ed5e2a3770ea19 100644
72+
index 8feaf7719661ef248113f11b1643deedb4b510af..2393963bf982f80ccff2ed396f1538be7ee18fcb 100644
5573
--- a/android/cpp-adapter.cpp
5674
+++ b/android/cpp-adapter.cpp
5775
@@ -19,8 +19,8 @@ struct OPSQLiteBridge : jni::JavaClass<OPSQLiteBridge> {
@@ -61,7 +79,7 @@ index 8feaf7719661ef248113f11b1643deedb4b510af..be0ade91b7f92281cdc4ebb941ed5e2a
6179
- makeNativeMethod("clearStateNativeJsi",
6280
- OPSQLiteBridge::clearStateNativeJsi)});
6381
+ makeNativeMethod("clearStateNativeJsi", OPSQLiteBridge::clearStateNativeJsi),
64-
+ makeNativeMethod("deleteAllDBsJsi", OPSQLiteBridge::deleteAllDBsJsi)});
82+
+ makeNativeMethod("deleteAllDBsJsi", OPSQLiteBridge::deleteAllDBsJsi)});
6583
}
6684

6785
private:
@@ -71,58 +89,49 @@ index 8feaf7719661ef248113f11b1643deedb4b510af..be0ade91b7f92281cdc4ebb941ed5e2a
7189
}
7290
+
7391
+ static bool deleteAllDBsJsi(jni::alias_ref<jni::JObject> thiz) {
74-
+ return opsqlite::deleteAllDbs();
92+
+ return opsqlite::deleteAllDbs();
7593
+ }
7694
};
7795

7896
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *) {
7997
diff --git a/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt b/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt
80-
index 44f86df6a21a6f7272b2c79b196586ef8fec886b..624eef492321269ef62d3ba55338c95a6da8d503 100644
98+
index 44f86df6a21a6f7272b2c79b196586ef8fec886b..9d9f7100fd34361701b2addf09a4f36e33b35d56 100644
8199
--- a/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt
82100
+++ b/android/src/main/java/com/op/sqlite/OPSQLiteBridge.kt
83-
@@ -13,6 +13,8 @@ class OPSQLiteBridge {
101+
@@ -12,6 +12,7 @@ class OPSQLiteBridge {
102+
docPath: String
84103
)
85104
private external fun clearStateNativeJsi()
86-
87105
+ private external fun deleteAllDBsJsi(): Boolean
88-
+
106+
89107
fun install(context: ReactContext) {
90108
val jsContextPointer = context.javaScriptContextHolder!!.get()
91-
val jsCallInvokerHolder =
92-
@@ -31,6 +33,9 @@ class OPSQLiteBridge {
109+
@@ -31,6 +32,10 @@ class OPSQLiteBridge {
93110
clearStateNativeJsi()
94111
}
95112

96113
+ fun deleteAllDBs() {
97114
+ deleteAllDBsJsi()
98115
+ }
116+
+
99117
companion object {
100118
val instance = OPSQLiteBridge()
101119
}
102120
diff --git a/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt b/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt
103-
index fea0aa7fb0266f812370309393eccb6eafef0fd5..e169fea192761a619bac31df9bffb603eb2d65a1 100644
121+
index 688832fa2f9a7f91d16cd50495caa8c9f8873864..9ea814bfa63f27356e804b82e941b7121152db3a 100644
104122
--- a/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt
105123
+++ b/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt
106-
@@ -6,14 +6,15 @@ import com.facebook.react.bridge.ReactApplicationContext
107-
import com.facebook.react.bridge.ReactMethod
108-
import com.facebook.react.bridge.ReactContextBaseJavaModule
109-
import com.facebook.react.bridge.ReadableMap
110-
+import com.facebook.react.module.annotations.ReactModule
111-
import java.io.File
112-
import java.io.FileOutputStream
113-
import java.io.InputStream
114-
import java.io.OutputStream
124+
@@ -13,7 +13,7 @@ import java.io.OutputStream
115125
import com.facebook.react.util.RNLog;
116126

117-
-//@ReactModule(name = OPSQLiteModule.NAME)
127+
//@ReactModule(name = OPSQLiteModule.NAME)
118128
-internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextBaseJavaModule(context) {
119-
+@ReactModule(name = OPSQLiteModule.NAME)
120129
+class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextBaseJavaModule(context) {
121130
override fun getName(): String {
122131
return NAME
123132
}
124-
@@ -55,6 +56,16 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB
125-
throw Exception("Do not call getDylibPath on Android")
133+
@@ -56,6 +56,17 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB
134+
return true
126135
}
127136

128137
+ @ReactMethod(isBlockingSynchronousMethod = true)
@@ -134,15 +143,16 @@ index fea0aa7fb0266f812370309393eccb6eafef0fd5..e169fea192761a619bac31df9bffb603
134143
+ fun deleteAllDBs() {
135144
+ OPSQLiteBridge.instance.deleteAllDBs();
136145
+ }
146+
+
137147
+
138148
@ReactMethod
139149
fun moveAssetsDatabase(args: ReadableMap, promise: Promise) {
140150
val filename = args.getString("filename")!!
141151
diff --git a/cpp/DBHostObject.cpp b/cpp/DBHostObject.cpp
142-
index 33e8e25b1268534c93de89c0bebe759b99553c40..5843a46942ff8004ab3efe9517cdd72c41d67314 100644
152+
index 85710eea286d45685aa526ed3851e8f1e1411039..8cf10f21ba467dea430aab106d43dd4e2adeacd6 100644
143153
--- a/cpp/DBHostObject.cpp
144154
+++ b/cpp/DBHostObject.cpp
145-
@@ -847,6 +847,10 @@ void DBHostObject::invalidate() {
155+
@@ -889,6 +889,10 @@ void DBHostObject::invalidate() {
146156
#endif
147157
}
148158

@@ -154,10 +164,10 @@ index 33e8e25b1268534c93de89c0bebe759b99553c40..5843a46942ff8004ab3efe9517cdd72c
154164

155165
} // namespace opsqlite
156166
diff --git a/cpp/DBHostObject.h b/cpp/DBHostObject.h
157-
index b665ddd63162b74ea96ff7cc96a61b2099dc9803..26a561d245967fdc7e6c6a3408c9455e166bafdb 100644
167+
index cc174b7c8c5ce500a6ffe5dc6fe092d282d2554c..ff36f742a22b8a84f37d6dd28441dbe9d0c6c873 100644
158168
--- a/cpp/DBHostObject.h
159169
+++ b/cpp/DBHostObject.h
160-
@@ -67,6 +67,7 @@ class JSI_EXPORT DBHostObject : public jsi::HostObject {
170+
@@ -73,6 +73,7 @@ class JSI_EXPORT DBHostObject : public jsi::HostObject {
161171
void on_commit();
162172
void on_rollback();
163173
void invalidate();
@@ -166,7 +176,7 @@ index b665ddd63162b74ea96ff7cc96a61b2099dc9803..26a561d245967fdc7e6c6a3408c9455e
166176

167177
private:
168178
diff --git a/cpp/bindings.cpp b/cpp/bindings.cpp
169-
index 3af52b22a12ca4b07e4b019199cd969f3fac2f78..90e8dedf77c598eada71f0542c07773c6b27a82b 100644
179+
index 5e1c1de234e7bdb131769728fc862d389f9995a5..dc21c6503ffe18f3ae1cf99f327e8aa1fc587b71 100644
170180
--- a/cpp/bindings.cpp
171181
+++ b/cpp/bindings.cpp
172182
@@ -36,6 +36,13 @@ void invalidate() {
@@ -183,34 +193,18 @@ index 3af52b22a12ca4b07e4b019199cd969f3fac2f78..90e8dedf77c598eada71f0542c07773c
183193
void install(jsi::Runtime &rt,
184194
const std::shared_ptr<react::CallInvoker> &invoker,
185195
const char *base_path, const char *crsqlite_path,
186-
diff --git a/cpp/bindings.h b/cpp/bindings.h
187-
index 91511ab8dff0cbd34c6b8b844c1783c39d4317cb..cc73dfe4405d568cbfbbfa5a9c879a1d88f260bf 100644
188-
--- a/cpp/bindings.h
189-
+++ b/cpp/bindings.h
190-
@@ -14,6 +14,7 @@ void install(jsi::Runtime &rt,
191-
const char *base_path, const char *crsqlite_path,
192-
const char *sqlite_vec_path);
193-
void invalidate();
194-
+bool deleteAllDbs();
195-
void expoUpdatesWorkaround(const char *base_path);
196-
197-
} // namespace opsqlite
198196
diff --git a/op-sqlite.podspec b/op-sqlite.podspec
199-
index b8568b91ae3f578512a9687e71801182e3457b5e..f547bc0a63ba243b2b0bfaf51c3161f4ee04621b 100644
197+
index 375cc3ef0838a3cffb87ec970f636880a8676bb3..e6fce21630ed00aa863f2baae7b3d04de783dcb0 100644
200198
--- a/op-sqlite.podspec
201199
+++ b/op-sqlite.podspec
202-
@@ -11,20 +11,11 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
203-
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
204-
205-
parent_folder_name = File.basename(__dir__)
206-
-app_package = nil
207-
-# When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
208-
-if is_user_app
209-
- app_package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
210-
-# When running on the example app
211-
-else
212-
- app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json")))
213-
-end
200+
@@ -1,4 +1,3 @@
201+
-require "json"
202+
require_relative "./generate_tokenizers_header_file"
203+
204+
log_message = lambda do |message|
205+
@@ -39,11 +38,10 @@ else
206+
app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json")))
207+
end
214208

215209
-op_sqlite_config = app_package["op-sqlite"]
216210
-use_sqlcipher = false
@@ -222,7 +216,7 @@ index b8568b91ae3f578512a9687e71801182e3457b5e..f547bc0a63ba243b2b0bfaf51c3161f4
222216
phone_version = false
223217
sqlite_flags = ""
224218
fts5 = false
225-
@@ -32,19 +23,6 @@ rtree = false
219+
@@ -51,37 +49,6 @@ rtree = false
226220
use_sqlite_vec = false
227221
tokenizers = []
228222

@@ -239,6 +233,24 @@ index b8568b91ae3f578512a9687e71801182e3457b5e..f547bc0a63ba243b2b0bfaf51c3161f4
239233
- tokenizers = op_sqlite_config["tokenizers"] || []
240234
-end
241235
-
242-
if phone_version then
243-
if use_sqlcipher then
244-
raise "SQLCipher is not supported with phone version"
236+
-if phone_version then
237+
- if use_sqlcipher then
238+
- raise "SQLCipher is not supported with phone version"
239+
- end
240+
-
241+
- if use_crsqlite then
242+
- raise "CRSQLite is not supported with phone version"
243+
- end
244+
-
245+
- if rtree then
246+
- raise "RTree is not supported with phone version"
247+
- end
248+
-
249+
- if use_sqlite_vec then
250+
- raise "SQLite Vec is not supported with phone version"
251+
- end
252+
-end
253+
-
254+
Pod::Spec.new do |s|
255+
s.name = "op-sqlite"
256+
s.version = package["version"]

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"pod": "(cd ios && bundle install && bundle exec pod install)"
1212
},
1313
"dependencies": {
14-
"@op-engineering/op-sqlite": "12.0.2",
14+
"@op-engineering/op-sqlite": "15.0.7",
1515
"@react-native-async-storage/async-storage": "2.1.1",
1616
"react": "18.2.0",
1717
"react-native": "0.77.3",

mendix-native-0.0.1.tgz

-63.1 KB
Binary file not shown.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mendix-native",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Mendix native mobile package",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",
@@ -65,7 +65,7 @@
6565
"@eslint/eslintrc": "^3.3.0",
6666
"@eslint/js": "^9.22.0",
6767
"@evilmartians/lefthook": "^1.5.0",
68-
"@op-engineering/op-sqlite": "12.0.2",
68+
"@op-engineering/op-sqlite": "15.0.7",
6969
"@react-native-async-storage/async-storage": "2.1.1",
7070
"@react-native-community/cli": "16.0.2",
7171
"@react-native/babel-preset": "0.77.3",
@@ -169,6 +169,6 @@
169169
"version": "0.53.0"
170170
},
171171
"resolutions": {
172-
"@op-engineering/op-sqlite@12.0.2": "patch:@op-engineering/op-sqlite@npm%3A12.0.2#./.yarn/patches/@op-engineering-op-sqlite-npm-12.0.2-eb873cce05.patch"
172+
"@op-engineering/op-sqlite@15.0.7": "patch:@op-engineering/op-sqlite@npm%3A15.0.7#./.yarn/patches/@op-engineering-op-sqlite-npm-15.0.7-39fbf4933a.patch"
173173
}
174174
}

yarn.lock

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,23 +2484,13 @@ __metadata:
24842484
languageName: node
24852485
linkType: hard
24862486

2487-
"@op-engineering/op-sqlite@npm:12.0.2":
2488-
version: 12.0.2
2489-
resolution: "@op-engineering/op-sqlite@npm:12.0.2"
2487+
"@op-engineering/op-sqlite@npm:15.0.7":
2488+
version: 15.0.7
2489+
resolution: "@op-engineering/op-sqlite@npm:15.0.7"
24902490
peerDependencies:
24912491
react: "*"
24922492
react-native: "*"
2493-
checksum: 6941693a1c30802a9cdc15a9f0d97b26b2209c370a6052f3a9b4437261c9dfdf86e0e00a264423dce5780c109bbe4eb453365ca86c788c8b394eba6a7e8b6eca
2494-
languageName: node
2495-
linkType: hard
2496-
2497-
"@op-engineering/op-sqlite@patch:@op-engineering/op-sqlite@npm%3A12.0.2#./.yarn/patches/@op-engineering-op-sqlite-npm-12.0.2-eb873cce05.patch::locator=mendix-native%40workspace%3A.":
2498-
version: 12.0.2
2499-
resolution: "@op-engineering/op-sqlite@patch:@op-engineering/op-sqlite@npm%3A12.0.2#./.yarn/patches/@op-engineering-op-sqlite-npm-12.0.2-eb873cce05.patch::version=12.0.2&hash=7031f1&locator=mendix-native%40workspace%3A."
2500-
peerDependencies:
2501-
react: "*"
2502-
react-native: "*"
2503-
checksum: 2396f668acd18a26f0cd1606270809ba4130e89daeba8cca8a5a491a18c22670fced2a404c963714769b5ae0c9728cac4bfdd3744d9f872b9e2bb3af87bed287
2493+
checksum: 92de60d00eccc5d7beb774da5b91defdb788275fa30e6e1af86440679b0ba077ffe25737eea071033a2c3641f8d2d35640a0f6100849ef83ee85bf96b45c2c99
25042494
languageName: node
25052495
linkType: hard
25062496

@@ -8787,7 +8777,7 @@ __metadata:
87878777
"@babel/core": ^7.21.0
87888778
"@babel/preset-env": ^7.20.0
87898779
"@babel/runtime": ^7.20.0
8790-
"@op-engineering/op-sqlite": 12.0.2
8780+
"@op-engineering/op-sqlite": 15.0.7
87918781
"@react-native-async-storage/async-storage": 2.1.1
87928782
"@react-native-community/cli": 16.0.2
87938783
"@react-native-community/cli-platform-android": 16.0.2
@@ -8813,7 +8803,7 @@ __metadata:
88138803
"@eslint/eslintrc": ^3.3.0
88148804
"@eslint/js": ^9.22.0
88158805
"@evilmartians/lefthook": ^1.5.0
8816-
"@op-engineering/op-sqlite": 12.0.2
8806+
"@op-engineering/op-sqlite": 15.0.7
88178807
"@react-native-async-storage/async-storage": 2.1.1
88188808
"@react-native-community/cli": 16.0.2
88198809
"@react-native/babel-preset": 0.77.3

0 commit comments

Comments
 (0)