@op-engineering/op-sqlite 1.0.0
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/LICENSE +7 -0
- package/README.md +274 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/CMakeLists.txt +57 -0
- package/android/build.gradle +127 -0
- package/android/cpp-adapter.cpp +42 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/op/sqlite/OPSQLiteBridge.java +29 -0
- package/android/src/main/java/com/op/sqlite/OPSQLiteModule.java +46 -0
- package/android/src/main/java/com/op/sqlite/OPSQLitePackage.java +26 -0
- package/cpp/DynamicHostObject.cpp +30 -0
- package/cpp/DynamicHostObject.h +30 -0
- package/cpp/ThreadPool.cpp +95 -0
- package/cpp/ThreadPool.h +46 -0
- package/cpp/bindings.cpp +430 -0
- package/cpp/bindings.h +13 -0
- package/cpp/bridge.cpp +502 -0
- package/cpp/bridge.h +34 -0
- package/cpp/logs.h +38 -0
- package/cpp/macros.h +16 -0
- package/cpp/sqlbatchexecutor.cpp +94 -0
- package/cpp/sqlbatchexecutor.h +28 -0
- package/cpp/sqlite3.c +252611 -0
- package/cpp/sqlite3.h +13257 -0
- package/cpp/utils.cpp +218 -0
- package/cpp/utils.h +55 -0
- package/ios/OPSQLite.h +8 -0
- package/ios/OPSQLite.mm +63 -0
- package/ios/OPSQLite.xcodeproj/project.pbxproj +275 -0
- package/lib/commonjs/index.js +190 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +183 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +108 -0
- package/op-sqlite.podspec +39 -0
- package/package.json +79 -0
- package/src/index.ts +374 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL Batch execution implementation using default sqliteBridge implementation
|
|
3
|
+
*/
|
|
4
|
+
#include "utils.h"
|
|
5
|
+
#include "bridge.h"
|
|
6
|
+
|
|
7
|
+
namespace osp {
|
|
8
|
+
|
|
9
|
+
namespace jsi = facebook::jsi;
|
|
10
|
+
|
|
11
|
+
struct BatchArguments {
|
|
12
|
+
std::string sql;
|
|
13
|
+
std::shared_ptr<std::vector<std::any>> params;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Local Helper method to translate JSI objects BatchArguments data structure
|
|
18
|
+
* MUST be called in the JavaScript Thread
|
|
19
|
+
*/
|
|
20
|
+
void toBatchArguments(jsi::Runtime &rt, jsi::Array const &batchParams, std::vector<BatchArguments> *commands);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Execute a batch of commands in a exclusive transaction
|
|
24
|
+
*/
|
|
25
|
+
BatchResult sqliteExecuteBatch(std::string dbName, std::vector<BatchArguments> *commands);
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|