@op-engineering/op-sqlite 2.0.15 → 2.0.16
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/cpp/bindings.cpp +16 -18
- package/op-sqlite.podspec +10 -8
- package/package.json +1 -1
package/cpp/bindings.cpp
CHANGED
|
@@ -283,7 +283,7 @@ void install(jsi::Runtime &rt,
|
|
|
283
283
|
return promise;
|
|
284
284
|
});
|
|
285
285
|
|
|
286
|
-
auto
|
|
286
|
+
auto execute_async = HOSTFN("executeAsync", 3) {
|
|
287
287
|
if (count < 3) {
|
|
288
288
|
throw std::runtime_error(
|
|
289
289
|
"[op-sqlite][executeAsync] Incorrect arguments for executeAsync");
|
|
@@ -351,9 +351,7 @@ void install(jsi::Runtime &rt,
|
|
|
351
351
|
return promise;
|
|
352
352
|
});
|
|
353
353
|
|
|
354
|
-
|
|
355
|
-
// Parameters can be: [[sql: string, arguments: any[] | arguments: any[][] ]]
|
|
356
|
-
auto executeBatch = HOSTFN("executeBatch", 2) {
|
|
354
|
+
auto execute_batch = HOSTFN("executeBatch", 2) {
|
|
357
355
|
if (sizeof(args) < 2) {
|
|
358
356
|
throw std::runtime_error(
|
|
359
357
|
"[op-sqlite][executeBatch] - Incorrect parameter count");
|
|
@@ -379,7 +377,7 @@ void install(jsi::Runtime &rt,
|
|
|
379
377
|
}
|
|
380
378
|
});
|
|
381
379
|
|
|
382
|
-
auto
|
|
380
|
+
auto execute_batch_async = HOSTFN("executeBatchAsync", 2) {
|
|
383
381
|
if (sizeof(args) < 2) {
|
|
384
382
|
throw std::runtime_error(
|
|
385
383
|
"[op-sqlite][executeAsyncBatch] Incorrect parameter count");
|
|
@@ -437,7 +435,7 @@ void install(jsi::Runtime &rt,
|
|
|
437
435
|
return promise;
|
|
438
436
|
});
|
|
439
437
|
|
|
440
|
-
auto
|
|
438
|
+
auto load_file = HOSTFN("loadFile", 2) {
|
|
441
439
|
if (sizeof(args) < 2) {
|
|
442
440
|
throw std::runtime_error(
|
|
443
441
|
"[op-sqlite][loadFileAsync] Incorrect parameter count");
|
|
@@ -480,7 +478,7 @@ void install(jsi::Runtime &rt,
|
|
|
480
478
|
return promise;
|
|
481
479
|
});
|
|
482
480
|
|
|
483
|
-
auto
|
|
481
|
+
auto update_hook = HOSTFN("updateHook", 2) {
|
|
484
482
|
if (sizeof(args) < 2) {
|
|
485
483
|
throw std::runtime_error("[op-sqlite][updateHook] Incorrect parameters: "
|
|
486
484
|
"dbName and callback needed");
|
|
@@ -538,7 +536,7 @@ void install(jsi::Runtime &rt,
|
|
|
538
536
|
return {};
|
|
539
537
|
});
|
|
540
538
|
|
|
541
|
-
auto
|
|
539
|
+
auto commit_hook = HOSTFN("commitHook", 2) {
|
|
542
540
|
if (sizeof(args) < 2) {
|
|
543
541
|
throw std::runtime_error("[op-sqlite][commitHook] Incorrect parameters: "
|
|
544
542
|
"dbName and callback needed");
|
|
@@ -563,7 +561,7 @@ void install(jsi::Runtime &rt,
|
|
|
563
561
|
return {};
|
|
564
562
|
});
|
|
565
563
|
|
|
566
|
-
auto
|
|
564
|
+
auto rollback_hook = HOSTFN("rollbackHook", 2) {
|
|
567
565
|
if (sizeof(args) < 2) {
|
|
568
566
|
throw std::runtime_error(
|
|
569
567
|
"[op-sqlite][rollbackHook] Incorrect parameters: "
|
|
@@ -589,7 +587,7 @@ void install(jsi::Runtime &rt,
|
|
|
589
587
|
return {};
|
|
590
588
|
});
|
|
591
589
|
|
|
592
|
-
auto
|
|
590
|
+
auto prepare_statement = HOSTFN("prepareStatement", 1) {
|
|
593
591
|
auto dbName = args[0].asString(rt).utf8(rt);
|
|
594
592
|
auto query = args[1].asString(rt).utf8(rt);
|
|
595
593
|
|
|
@@ -624,14 +622,14 @@ void install(jsi::Runtime &rt,
|
|
|
624
622
|
module.setProperty(rt, "detach", std::move(detach));
|
|
625
623
|
module.setProperty(rt, "delete", std::move(remove));
|
|
626
624
|
module.setProperty(rt, "execute", std::move(execute));
|
|
627
|
-
module.setProperty(rt, "executeAsync", std::move(
|
|
628
|
-
module.setProperty(rt, "executeBatch", std::move(
|
|
629
|
-
module.setProperty(rt, "executeBatchAsync", std::move(
|
|
630
|
-
module.setProperty(rt, "loadFile", std::move(
|
|
631
|
-
module.setProperty(rt, "updateHook", std::move(
|
|
632
|
-
module.setProperty(rt, "commitHook", std::move(
|
|
633
|
-
module.setProperty(rt, "rollbackHook", std::move(
|
|
634
|
-
module.setProperty(rt, "prepareStatement", std::move(
|
|
625
|
+
module.setProperty(rt, "executeAsync", std::move(execute_async));
|
|
626
|
+
module.setProperty(rt, "executeBatch", std::move(execute_batch));
|
|
627
|
+
module.setProperty(rt, "executeBatchAsync", std::move(execute_batch_async));
|
|
628
|
+
module.setProperty(rt, "loadFile", std::move(load_file));
|
|
629
|
+
module.setProperty(rt, "updateHook", std::move(update_hook));
|
|
630
|
+
module.setProperty(rt, "commitHook", std::move(commit_hook));
|
|
631
|
+
module.setProperty(rt, "rollbackHook", std::move(rollback_hook));
|
|
632
|
+
module.setProperty(rt, "prepareStatement", std::move(prepare_statement));
|
|
635
633
|
module.setProperty(rt, "loadExtension", std::move(load_extension));
|
|
636
634
|
module.setProperty(rt, "executeRawAsync", std::move(execute_raw_async));
|
|
637
635
|
|
package/op-sqlite.podspec
CHANGED
|
@@ -14,13 +14,6 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
|
|
15
15
|
s.platforms = { :ios => "13.0", :osx => "10.15" }
|
|
16
16
|
s.source = { :git => "https://github.com/op-engineering/op-sqlite.git", :tag => "#{s.version}" }
|
|
17
|
-
|
|
18
|
-
xcconfig = {
|
|
19
|
-
:GCC_PREPROCESSOR_DEFINITIONS => "HAVE_FULLFSYNC=1",
|
|
20
|
-
:WARNING_CFLAGS => "-Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations",
|
|
21
|
-
:USE_HEADERMAP => "No",
|
|
22
|
-
:CLANG_CXX_LANGUAGE_STANDARD => "c++17",
|
|
23
|
-
}
|
|
24
17
|
|
|
25
18
|
s.header_mappings_dir = "cpp"
|
|
26
19
|
s.source_files = "ios/**/*.{h,hpp,m,mm}", "cpp/**/*.{h,hpp,cpp,c}"
|
|
@@ -33,6 +26,15 @@ Pod::Spec.new do |s|
|
|
|
33
26
|
s.dependency "React-Core"
|
|
34
27
|
end
|
|
35
28
|
|
|
29
|
+
other_cflags = '-DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1'
|
|
30
|
+
|
|
31
|
+
xcconfig = {
|
|
32
|
+
:GCC_PREPROCESSOR_DEFINITIONS => "HAVE_FULLFSYNC=1",
|
|
33
|
+
:WARNING_CFLAGS => "-Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations",
|
|
34
|
+
:USE_HEADERMAP => "No",
|
|
35
|
+
:CLANG_CXX_LANGUAGE_STANDARD => "c++17",
|
|
36
|
+
}
|
|
37
|
+
|
|
36
38
|
if ENV['OP_SQLITE_USE_PHONE_VERSION'] == '1' then
|
|
37
39
|
puts "OP-SQLITE using iOS embedded SQLite! 📱\n"
|
|
38
40
|
s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h"
|
|
@@ -41,7 +43,7 @@ Pod::Spec.new do |s|
|
|
|
41
43
|
|
|
42
44
|
if ENV['OP_SQLITE_PERF'] == '1' then
|
|
43
45
|
puts "OP-SQLITE performance mode enabled! 🚀\n"
|
|
44
|
-
xcconfig[:OTHER_CFLAGS] = '$(inherited) -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1'
|
|
46
|
+
xcconfig[:OTHER_CFLAGS] = other_cflags + '$(inherited) -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1'
|
|
45
47
|
end
|
|
46
48
|
|
|
47
49
|
s.pod_target_xcconfig = xcconfig
|