@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.
Files changed (39) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +274 -0
  3. package/android/.project +17 -0
  4. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  5. package/android/CMakeLists.txt +57 -0
  6. package/android/build.gradle +127 -0
  7. package/android/cpp-adapter.cpp +42 -0
  8. package/android/gradle.properties +4 -0
  9. package/android/src/main/AndroidManifest.xml +4 -0
  10. package/android/src/main/java/com/op/sqlite/OPSQLiteBridge.java +29 -0
  11. package/android/src/main/java/com/op/sqlite/OPSQLiteModule.java +46 -0
  12. package/android/src/main/java/com/op/sqlite/OPSQLitePackage.java +26 -0
  13. package/cpp/DynamicHostObject.cpp +30 -0
  14. package/cpp/DynamicHostObject.h +30 -0
  15. package/cpp/ThreadPool.cpp +95 -0
  16. package/cpp/ThreadPool.h +46 -0
  17. package/cpp/bindings.cpp +430 -0
  18. package/cpp/bindings.h +13 -0
  19. package/cpp/bridge.cpp +502 -0
  20. package/cpp/bridge.h +34 -0
  21. package/cpp/logs.h +38 -0
  22. package/cpp/macros.h +16 -0
  23. package/cpp/sqlbatchexecutor.cpp +94 -0
  24. package/cpp/sqlbatchexecutor.h +28 -0
  25. package/cpp/sqlite3.c +252611 -0
  26. package/cpp/sqlite3.h +13257 -0
  27. package/cpp/utils.cpp +218 -0
  28. package/cpp/utils.h +55 -0
  29. package/ios/OPSQLite.h +8 -0
  30. package/ios/OPSQLite.mm +63 -0
  31. package/ios/OPSQLite.xcodeproj/project.pbxproj +275 -0
  32. package/lib/commonjs/index.js +190 -0
  33. package/lib/commonjs/index.js.map +1 -0
  34. package/lib/module/index.js +183 -0
  35. package/lib/module/index.js.map +1 -0
  36. package/lib/typescript/index.d.ts +108 -0
  37. package/op-sqlite.podspec +39 -0
  38. package/package.json +79 -0
  39. 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
+