@op-engineering/op-sqlite 15.1.15 → 15.1.17
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/CMakeLists.txt +8 -6
- package/android/build.gradle +10 -9
- package/package.json +1 -1
package/android/CMakeLists.txt
CHANGED
|
@@ -11,12 +11,14 @@ if (USE_SQLCIPHER)
|
|
|
11
11
|
include_directories(../cpp/sqlcipher)
|
|
12
12
|
endif()
|
|
13
13
|
|
|
14
|
-
if (USE_LIBSQL)
|
|
14
|
+
if (USE_LIBSQL)
|
|
15
15
|
include_directories(src/main/jniLibs/include)
|
|
16
16
|
endif()
|
|
17
17
|
|
|
18
|
+
separate_arguments(SQLITE_FLAGS_LIST UNIX_COMMAND "${SQLITE_FLAGS}")
|
|
19
|
+
|
|
18
20
|
add_definitions(
|
|
19
|
-
|
|
21
|
+
${SQLITE_FLAGS_LIST}
|
|
20
22
|
)
|
|
21
23
|
|
|
22
24
|
add_library(
|
|
@@ -42,11 +44,11 @@ if (USE_SQLCIPHER)
|
|
|
42
44
|
-DSQLITE_EXTRA_INIT=sqlcipher_extra_init
|
|
43
45
|
-DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown
|
|
44
46
|
)
|
|
45
|
-
|
|
47
|
+
|
|
46
48
|
find_package(openssl REQUIRED CONFIG)
|
|
47
49
|
elseif (USE_LIBSQL)
|
|
48
50
|
target_sources(${PACKAGE_NAME} PRIVATE ../cpp/libsql/bridge.cpp)
|
|
49
|
-
|
|
51
|
+
|
|
50
52
|
add_definitions(
|
|
51
53
|
-DOP_SQLITE_USE_LIBSQL=1
|
|
52
54
|
)
|
|
@@ -89,7 +91,7 @@ if (USE_SQLCIPHER)
|
|
|
89
91
|
elseif (USE_LIBSQL)
|
|
90
92
|
cmake_path(SET LIBSQL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libsql_experimental.so NORMALIZE)
|
|
91
93
|
add_library(libsql_experimental SHARED IMPORTED)
|
|
92
|
-
set_target_properties(libsql_experimental PROPERTIES
|
|
94
|
+
set_target_properties(libsql_experimental PROPERTIES
|
|
93
95
|
IMPORTED_LOCATION ${LIBSQL_PATH}
|
|
94
96
|
IMPORTED_NO_SONAME TRUE
|
|
95
97
|
)
|
|
@@ -110,4 +112,4 @@ else ()
|
|
|
110
112
|
ReactAndroid::jsi
|
|
111
113
|
fbjni::fbjni
|
|
112
114
|
)
|
|
113
|
-
endif()
|
|
115
|
+
endif()
|
package/android/build.gradle
CHANGED
|
@@ -46,7 +46,7 @@ if (isUserApp) {
|
|
|
46
46
|
// Start from the root + 1 level up (to avoid detecting the op-sqlite/package.json) and traverse upwards to find the first package.json
|
|
47
47
|
File currentDir = new File("$rootDir/../")
|
|
48
48
|
packageJsonFile = null
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
// Try to find package.json by traversing upwards
|
|
51
51
|
while (currentDir != null) {
|
|
52
52
|
File potential = new File(currentDir, "package.json")
|
|
@@ -67,14 +67,14 @@ def opsqliteConfig = packageJson["op-sqlite"]
|
|
|
67
67
|
|
|
68
68
|
if(opsqliteConfig) {
|
|
69
69
|
println "[OP-SQLITE] Detected op-sqlite config from package.json at: " + packageJsonFile.absolutePath
|
|
70
|
-
useSQLCipher = opsqliteConfig["sqlcipher"]
|
|
71
|
-
useCRSQLite = opsqliteConfig["crsqlite"]
|
|
72
|
-
useSqliteVec = opsqliteConfig["sqliteVec"]
|
|
70
|
+
useSQLCipher = !!opsqliteConfig["sqlcipher"]
|
|
71
|
+
useCRSQLite = !!opsqliteConfig["crsqlite"]
|
|
72
|
+
useSqliteVec = !!opsqliteConfig["sqliteVec"]
|
|
73
73
|
performanceMode = opsqliteConfig["performanceMode"]
|
|
74
74
|
sqliteFlags = opsqliteConfig["sqliteFlags"] ? opsqliteConfig["sqliteFlags"] : ""
|
|
75
|
-
enableFTS5 = opsqliteConfig["fts5"]
|
|
76
|
-
useLibsql = opsqliteConfig["libsql"]
|
|
77
|
-
enableRtree = opsqliteConfig["rtree"]
|
|
75
|
+
enableFTS5 = !!opsqliteConfig["fts5"]
|
|
76
|
+
useLibsql = !!opsqliteConfig["libsql"]
|
|
77
|
+
enableRtree = !!opsqliteConfig["rtree"]
|
|
78
78
|
tokenizers = opsqliteConfig["tokenizers"] ? opsqliteConfig["tokenizers"] : []
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ if(useSQLCipher) {
|
|
|
82
82
|
println "[OP-SQLITE] using sqlcipher."
|
|
83
83
|
} else if(useLibsql) {
|
|
84
84
|
println "[OP-SQLITE] using libsql. Report any issues to Turso"
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
|
|
87
87
|
if(useCRSQLite) {
|
|
88
88
|
println "[OP-SQLITE] using CR-SQLite"
|
|
@@ -108,7 +108,7 @@ if(!tokenizers.isEmpty()) {
|
|
|
108
108
|
if(useLibsql) {
|
|
109
109
|
throw new GradleException("[OP-SQLITE] Error: libsql does not support tokenizers. Please disable tokenizers or do not enable libsql.")
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
println "[OP-SQLITE] Tokenizers enabled. Detected tokenizers: " + tokenizers
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -168,6 +168,7 @@ android {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
cppFlags "-O3 -frtti -fexceptions -Wall -fstack-protector-all"
|
|
171
|
+
|
|
171
172
|
arguments "-DANDROID_STL=c++_shared",
|
|
172
173
|
"-DSQLITE_FLAGS='$sqliteFlags'",
|
|
173
174
|
"-DUSE_SQLCIPHER=${useSQLCipher ? 1 : 0}",
|