@op-engineering/op-sqlite 6.0.6 → 6.0.8
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/android/jniLibs/arm64-v8a/libsql_experimental.a +0 -0
- package/android/jniLibs/armeabi-v7a/libsql_experimental.a +0 -0
- package/android/jniLibs/x86/libsql_experimental.a +0 -0
- package/android/jniLibs/x86_64/libsql_experimental.a +0 -0
- package/cpp/DBHostObject.cpp +10 -16
- package/cpp/DBHostObject.h +1 -1
- package/ios/crsqlite.xcframework/Info.plist +6 -0
- package/ios/crsqlite.xcframework/ios-arm64/crsqlite.framework/Info.plist +6 -0
- package/ios/crsqlite.xcframework/ios-arm64_x86_64-simulator/crsqlite.framework/Info.plist +6 -0
- package/ios/libsql.xcframework/Info.plist +5 -5
- package/ios/libsql.xcframework/ios-arm64/libsql_experimental.a +0 -0
- package/ios/libsql.xcframework/ios-arm64_x86_64-simulator/libsql_experimental.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp/DBHostObject.cpp
CHANGED
|
@@ -17,13 +17,14 @@ namespace react = facebook::react;
|
|
|
17
17
|
|
|
18
18
|
#ifndef OP_SQLITE_USE_LIBSQL
|
|
19
19
|
void DBHostObject::auto_register_update_hook() {
|
|
20
|
-
if (update_hook_callback == nullptr && reactive_queries.
|
|
21
|
-
|
|
20
|
+
if (update_hook_callback == nullptr && reactive_queries.empty() &&
|
|
21
|
+
is_update_hook_registered) {
|
|
22
22
|
opsqlite_deregister_update_hook(db_name);
|
|
23
|
+
is_update_hook_registered = false;
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
if (
|
|
27
|
+
if (is_update_hook_registered) {
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -52,7 +53,7 @@ void DBHostObject::auto_register_update_hook() {
|
|
|
52
53
|
res.setProperty(rt, "operation",
|
|
53
54
|
jsi::String::createFromUtf8(rt, operation));
|
|
54
55
|
res.setProperty(rt, "rowId", jsi::Value(rowId));
|
|
55
|
-
if (results->
|
|
56
|
+
if (!results->empty()) {
|
|
56
57
|
res.setProperty(
|
|
57
58
|
rt, "row",
|
|
58
59
|
jsi::Object::createFromHostObject(
|
|
@@ -65,7 +66,7 @@ void DBHostObject::auto_register_update_hook() {
|
|
|
65
66
|
|
|
66
67
|
for (const auto &query_ptr : reactive_queries) {
|
|
67
68
|
auto query = query_ptr.get();
|
|
68
|
-
if (query->discriminators.
|
|
69
|
+
if (query->discriminators.empty()) {
|
|
69
70
|
continue;
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -116,23 +117,16 @@ void DBHostObject::auto_register_update_hook() {
|
|
|
116
117
|
[this,
|
|
117
118
|
results = std::make_shared<std::vector<DumbHostObject>>(results),
|
|
118
119
|
callback = query->callback, metadata, status = std::move(status)] {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
callback->asObject(rt).asFunction(rt).call(rt, jsiResult);
|
|
123
|
-
} else {
|
|
124
|
-
auto errorCtr = rt.global().getPropertyAsFunction(rt, "Error");
|
|
125
|
-
auto error = errorCtr.callAsConstructor(
|
|
126
|
-
rt, jsi::String::createFromUtf8(rt, status.message));
|
|
127
|
-
callback->asObject(rt).asFunction(rt).call(rt, error);
|
|
128
|
-
}
|
|
120
|
+
auto jsiResult =
|
|
121
|
+
createResult(rt, status, results.get(), metadata);
|
|
122
|
+
callback->asObject(rt).asFunction(rt).call(rt, jsiResult);
|
|
129
123
|
});
|
|
130
124
|
}
|
|
131
125
|
}
|
|
132
126
|
};
|
|
133
127
|
|
|
134
128
|
opsqlite_register_update_hook(db_name, std::move(hook));
|
|
135
|
-
|
|
129
|
+
is_update_hook_registered = true;
|
|
136
130
|
}
|
|
137
131
|
#endif
|
|
138
132
|
|
package/cpp/DBHostObject.h
CHANGED
|
@@ -66,7 +66,7 @@ private:
|
|
|
66
66
|
std::shared_ptr<jsi::Value> rollback_hook_callback;
|
|
67
67
|
jsi::Runtime &rt;
|
|
68
68
|
std::vector<std::shared_ptr<ReactiveQuery>> reactive_queries;
|
|
69
|
-
bool
|
|
69
|
+
bool is_update_hook_registered = false;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
} // namespace opsqlite
|
|
@@ -36,5 +36,11 @@
|
|
|
36
36
|
<string>XFWK</string>
|
|
37
37
|
<key>XCFrameworkFormatVersion</key>
|
|
38
38
|
<string>1.0</string>
|
|
39
|
+
<key>CFBundleVersion</key>
|
|
40
|
+
<string>1.0.0</string>
|
|
41
|
+
<key>CFBundleShortVersionString</key>
|
|
42
|
+
<string>1.0.0</string>
|
|
43
|
+
<key>MinimumOSVersion</key>
|
|
44
|
+
<string>8.0</string>
|
|
39
45
|
</dict>
|
|
40
46
|
</plist>
|
|
@@ -14,5 +14,11 @@
|
|
|
14
14
|
<string>FMWK</string>
|
|
15
15
|
<key>CFBundleSignature</key>
|
|
16
16
|
<string>????</string>
|
|
17
|
+
<key>CFBundleVersion</key>
|
|
18
|
+
<string>1.0.0</string>
|
|
19
|
+
<key>CFBundleShortVersionString</key>
|
|
20
|
+
<string>1.0.0</string>
|
|
21
|
+
<key>MinimumOSVersion</key>
|
|
22
|
+
<string>8.0</string>
|
|
17
23
|
</dict>
|
|
18
24
|
</plist>
|
|
@@ -14,5 +14,11 @@
|
|
|
14
14
|
<string>FMWK</string>
|
|
15
15
|
<key>CFBundleSignature</key>
|
|
16
16
|
<string>????</string>
|
|
17
|
+
<key>CFBundleVersion</key>
|
|
18
|
+
<string>1.0.0</string>
|
|
19
|
+
<key>CFBundleShortVersionString</key>
|
|
20
|
+
<string>1.0.0</string>
|
|
21
|
+
<key>MinimumOSVersion</key>
|
|
22
|
+
<string>8.0</string>
|
|
17
23
|
</dict>
|
|
18
24
|
</plist>
|
|
@@ -10,18 +10,15 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libsql_experimental.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
-
<string>x86_64</string>
|
|
20
19
|
</array>
|
|
21
20
|
<key>SupportedPlatform</key>
|
|
22
21
|
<string>ios</string>
|
|
23
|
-
<key>SupportedPlatformVariant</key>
|
|
24
|
-
<string>simulator</string>
|
|
25
22
|
</dict>
|
|
26
23
|
<dict>
|
|
27
24
|
<key>BinaryPath</key>
|
|
@@ -29,15 +26,18 @@
|
|
|
29
26
|
<key>HeadersPath</key>
|
|
30
27
|
<string>Headers</string>
|
|
31
28
|
<key>LibraryIdentifier</key>
|
|
32
|
-
<string>ios-
|
|
29
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
33
30
|
<key>LibraryPath</key>
|
|
34
31
|
<string>libsql_experimental.a</string>
|
|
35
32
|
<key>SupportedArchitectures</key>
|
|
36
33
|
<array>
|
|
37
34
|
<string>arm64</string>
|
|
35
|
+
<string>x86_64</string>
|
|
38
36
|
</array>
|
|
39
37
|
<key>SupportedPlatform</key>
|
|
40
38
|
<string>ios</string>
|
|
39
|
+
<key>SupportedPlatformVariant</key>
|
|
40
|
+
<string>simulator</string>
|
|
41
41
|
</dict>
|
|
42
42
|
</array>
|
|
43
43
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|