@op-engineering/op-sqlite 15.0.7 → 15.1.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 (45) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/cpp-adapter.cpp +1 -1
  4. package/android/src/main/java/com/op/sqlite/OPSQLiteModule.kt +7 -9
  5. package/cpp/DBHostObject.cpp +469 -677
  6. package/cpp/DBHostObject.h +56 -58
  7. package/cpp/DumbHostObject.cpp +1 -1
  8. package/cpp/DumbHostObject.h +12 -13
  9. package/cpp/OPSqlite.cpp +207 -0
  10. package/cpp/OPThreadPool.cpp +79 -79
  11. package/cpp/OPThreadPool.h +28 -28
  12. package/cpp/PreparedStatementHostObject.cpp +87 -136
  13. package/cpp/PreparedStatementHostObject.h +16 -28
  14. package/cpp/SmartHostObject.cpp +1 -1
  15. package/cpp/SmartHostObject.h +6 -7
  16. package/cpp/bridge.cpp +639 -633
  17. package/cpp/bridge.h +2 -2
  18. package/cpp/libsql/LICENSE.txt +9 -0
  19. package/cpp/libsql/bridge.cpp +2 -2
  20. package/cpp/libsql/{bridge.h → bridge.hpp} +4 -4
  21. package/cpp/macros.hpp +21 -0
  22. package/cpp/sqlcipher/LICENSE.txt +24 -0
  23. package/cpp/types.hpp +42 -0
  24. package/cpp/utils.cpp +320 -255
  25. package/cpp/{utils.h → utils.hpp} +9 -1
  26. package/ios/OPSQLite.mm +104 -106
  27. package/lib/module/functions.js +40 -33
  28. package/lib/module/functions.js.map +1 -1
  29. package/lib/module/index.js +1 -1
  30. package/lib/module/index.js.map +1 -1
  31. package/lib/typescript/src/functions.d.ts +5 -1
  32. package/lib/typescript/src/functions.d.ts.map +1 -1
  33. package/lib/typescript/src/index.d.ts +1 -1
  34. package/lib/typescript/src/index.d.ts.map +1 -1
  35. package/lib/typescript/src/types.d.ts +5 -1
  36. package/lib/typescript/src/types.d.ts.map +1 -1
  37. package/op-sqlite.podspec +1 -1
  38. package/package.json +10 -8
  39. package/src/functions.ts +52 -43
  40. package/src/index.ts +1 -12
  41. package/src/types.ts +5 -1
  42. package/cpp/bindings.cpp +0 -202
  43. package/cpp/macros.h +0 -15
  44. package/cpp/types.h +0 -33
  45. /package/cpp/{bindings.h → OPSqlite.hpp} +0 -0
@@ -16,7 +16,7 @@ add_definitions(
16
16
  add_library(
17
17
  ${PACKAGE_NAME}
18
18
  SHARED
19
- ../cpp/bindings.cpp
19
+ ../cpp/OPSqlite.cpp
20
20
  ../cpp/utils.cpp
21
21
  ../cpp/OPThreadPool.cpp
22
22
  ../cpp/SmartHostObject.cpp
@@ -245,7 +245,7 @@ dependencies {
245
245
 
246
246
  tasks.register('prepareHeaders', Copy) {
247
247
  from('../cpp')
248
- include "**/*.h"
248
+ include "**/*.h", "**/*.hpp"
249
249
  into "${project.buildDir}/headers/op-sqlite/op-engineering_op-sqlite/"
250
250
  includeEmptyDirs = false
251
251
  }
@@ -1,4 +1,4 @@
1
- #include "bindings.h"
1
+ #include "OPSqlite.hpp"
2
2
  #include "logs.h"
3
3
  #include <ReactCommon/CallInvokerHolder.h>
4
4
  #include <fbjni/fbjni.h>
@@ -12,14 +12,13 @@ import java.io.InputStream
12
12
  import java.io.OutputStream
13
13
  import com.facebook.react.util.RNLog;
14
14
 
15
- //@ReactModule(name = OPSQLiteModule.NAME)
16
15
  internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextBaseJavaModule(context) {
17
16
  override fun getName(): String {
18
17
  return NAME
19
18
  }
20
19
 
21
- fun getTypedExportedConstants(): MutableMap<String, Any> {
22
- val constants: MutableMap<String, Any> = HashMap()
20
+ fun getTypedExportedConstants(): MutableMap<String, Any?> {
21
+ val constants: MutableMap<String, Any?> = HashMap()
23
22
  val context = reactApplicationContext
24
23
  val dbPath =
25
24
  context.getDatabasePath("defaultDatabase")
@@ -28,14 +27,14 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB
28
27
  constants["ANDROID_DATABASE_PATH"] = dbPath
29
28
  val filesPath = context.filesDir.absolutePath
30
29
  constants["ANDROID_FILES_PATH"] = filesPath
31
- val externalFilesDir = context.getExternalFilesDir(null)!!.absolutePath
32
- constants["ANDROID_EXTERNAL_FILES_PATH"] = externalFilesDir
33
- constants["IOS_DOCUMENT_PATH"] = ""
34
- constants["IOS_LIBRARY_PATH"] = ""
30
+ val externalFilesDir = context.getExternalFilesDir(null)
31
+ constants["ANDROID_EXTERNAL_FILES_PATH"] = externalFilesDir?.absolutePath
32
+ constants["IOS_DOCUMENT_PATH"] = null
33
+ constants["IOS_LIBRARY_PATH"] = null
35
34
  return constants
36
35
  }
37
36
 
38
- override fun getConstants(): MutableMap<String, Any>? {
37
+ override fun getConstants(): MutableMap<String, Any?> {
39
38
  return getTypedExportedConstants()
40
39
  }
41
40
 
@@ -53,7 +52,6 @@ internal class OPSQLiteModule(context: ReactApplicationContext?) : ReactContextB
53
52
  @ReactMethod(isBlockingSynchronousMethod = true)
54
53
  fun getDylibPath(bundleId: String, name: String): Boolean {
55
54
  throw Exception("Do not call getDylibPath on Android")
56
- return true
57
55
  }
58
56
 
59
57
  @ReactMethod