@op-engineering/op-sqlite 15.1.3 โ 15.1.4
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/build.gradle +55 -56
- package/ios/OPSQLite.mm +10 -8
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/op-sqlite.podspec +17 -19
- package/package.json +2 -2
package/android/build.gradle
CHANGED
|
@@ -85,28 +85,27 @@ if(useSQLCipher) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if(useCRSQLite) {
|
|
88
|
-
println "[OP-SQLITE] using CR-SQLite
|
|
88
|
+
println "[OP-SQLITE] using CR-SQLite"
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
if(performanceMode) {
|
|
92
|
-
println "[OP-SQLITE] Performance mode enabled
|
|
92
|
+
println "[OP-SQLITE] Performance mode enabled"
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if(enableFTS5) {
|
|
96
|
-
println "[OP-SQLITE] FTS5 enabled
|
|
96
|
+
println "[OP-SQLITE] FTS5 enabled"
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
if(enableRtree) {
|
|
100
|
-
println "[OP-SQLITE] RTree enabled
|
|
100
|
+
println "[OP-SQLITE] RTree enabled"
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
if(useSqliteVec) {
|
|
104
|
-
|
|
104
|
+
println "[OP-SQLITE] Sqlite-vec enabled"
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
108
107
|
if (!tokenizers.isEmpty()) {
|
|
109
|
-
println "[OP-SQLITE] Tokenizers enabled
|
|
108
|
+
println "[OP-SQLITE] Tokenizers enabled. Detected tokenizers: " + tokenizers
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
android {
|
|
@@ -120,58 +119,58 @@ android {
|
|
|
120
119
|
|
|
121
120
|
externalNativeBuild {
|
|
122
121
|
cmake {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
122
|
+
if(useSQLCipher) {
|
|
123
|
+
cFlags += "-DOP_SQLITE_USE_SQLCIPHER=1"
|
|
124
|
+
cppFlags += "-DOP_SQLITE_USE_SQLCIPHER=1"
|
|
125
|
+
}
|
|
126
|
+
if(useLibsql) {
|
|
127
|
+
cFlags += "-DOP_SQLITE_USE_LIBSQL=1"
|
|
128
|
+
cppFlags += "-DOP_SQLITE_USE_LIBSQL=1"
|
|
129
|
+
}
|
|
130
|
+
if(useCRSQLite) {
|
|
131
|
+
cFlags += "-DOP_SQLITE_USE_CRSQLITE=1"
|
|
132
|
+
cppFlags += "-DOP_SQLITE_USE_CRSQLITE=1"
|
|
133
|
+
}
|
|
134
|
+
if(performanceMode) {
|
|
135
|
+
cFlags += ["-DSQLITE_DQS=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", "-DSQLITE_THREADSAFE=1"]
|
|
136
|
+
}
|
|
137
|
+
if(enableFTS5) {
|
|
138
|
+
cFlags += ["-DSQLITE_ENABLE_FTS5=1"]
|
|
139
|
+
}
|
|
140
|
+
if(enableRtree) {
|
|
141
|
+
cFlags += ["-DSQLITE_ENABLE_RTREE=1"]
|
|
142
|
+
}
|
|
143
|
+
if(useSqliteVec) {
|
|
144
|
+
cFlags += "-DOP_SQLITE_USE_SQLITE_VEC=1"
|
|
145
|
+
cppFlags += "-DOP_SQLITE_USE_SQLITE_VEC=1"
|
|
146
|
+
}
|
|
148
147
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
// This are zeroes because they will be passed as C flags, so they become falsy
|
|
149
|
+
def sourceFiles = 0
|
|
150
|
+
// def tokenizerInitStrings = 0
|
|
151
|
+
def tokenizersHeaderPath = 0
|
|
152
|
+
if (!tokenizers.isEmpty()) {
|
|
153
|
+
def sourceDir = isUserApp ? file("$rootDir/../../../c_sources") : file("$rootDir/../c_sources")
|
|
154
|
+
def destDir = file("$buildscript.sourceFile.parentFile/c_sources")
|
|
155
|
+
copy {
|
|
156
|
+
from sourceDir
|
|
157
|
+
into destDir
|
|
158
|
+
include "**/*.cpp", "**/*.h"
|
|
159
|
+
}
|
|
160
|
+
sourceFiles = fileTree(dir: destDir, include: ["**/*.cpp", "**/*.h"]).files.join(";")
|
|
161
|
+
tokenizersHeaderPath = "../c_sources/tokenizers.h"
|
|
160
162
|
}
|
|
161
|
-
sourceFiles = fileTree(dir: destDir, include: ["**/*.cpp", "**/*.h"]).files.join(";")
|
|
162
|
-
tokenizersHeaderPath = "../c_sources/tokenizers.h"
|
|
163
|
-
}
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
164
|
+
cppFlags "-O3 -frtti -fexceptions -Wall -fstack-protector-all"
|
|
165
|
+
arguments "-DANDROID_STL=c++_shared",
|
|
166
|
+
"-DSQLITE_FLAGS='$sqliteFlags'",
|
|
167
|
+
"-DUSE_SQLCIPHER=${useSQLCipher ? 1 : 0}",
|
|
168
|
+
"-DUSE_CRSQLITE=${useCRSQLite ? 1 : 0}",
|
|
169
|
+
"-DUSE_LIBSQL=${useLibsql ? 1 : 0}",
|
|
170
|
+
"-DUSE_SQLITE_VEC=${useSqliteVec ? 1 : 0}",
|
|
171
|
+
"-DUSER_DEFINED_SOURCE_FILES=${sourceFiles}",
|
|
172
|
+
"-DUSER_DEFINED_TOKENIZERS_HEADER_PATH='${tokenizersHeaderPath}'",
|
|
173
|
+
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
}
|
package/ios/OPSQLite.mm
CHANGED
|
@@ -72,22 +72,24 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
|
|
72
72
|
documentPath = [paths objectAtIndex:0];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
#ifdef OP_SQLITE_USE_CRSQLITE
|
|
75
76
|
NSBundle *crsqlite_bundle =
|
|
76
77
|
[NSBundle bundleWithIdentifier:@"io.vlcn.crsqlite"];
|
|
77
78
|
NSString *crsqlite_path = [crsqlite_bundle pathForResource:@"crsqlite"
|
|
78
79
|
ofType:@""];
|
|
80
|
+
#else
|
|
81
|
+
NSString *crsqlite_path = @"";
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
#ifdef OP_SQLITE_USE_SQLITE_VEC
|
|
79
86
|
NSBundle *libsqlitevec_bundle =
|
|
80
87
|
[NSBundle bundleWithIdentifier:@"com.ospfranco.sqlitevec"];
|
|
81
88
|
NSString *sqlite_vec_path = [libsqlitevec_bundle pathForResource:@"sqlitevec"
|
|
82
89
|
ofType:@""];
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (sqlite_vec_path == nil) {
|
|
89
|
-
sqlite_vec_path = @"";
|
|
90
|
-
}
|
|
90
|
+
#else
|
|
91
|
+
NSString *sqlite_vec_path = @"";
|
|
92
|
+
#endif
|
|
91
93
|
|
|
92
94
|
opsqlite::install(runtime, callInvoker, [documentPath UTF8String],
|
|
93
95
|
[crsqlite_path UTF8String], [sqlite_vec_path UTF8String]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,EAAE,EAEP,KAAK,aAAa,EAKnB,MAAM,SAAS,CAAC;AAEjB,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AA0BD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,EAAE,EAEP,KAAK,aAAa,EAKnB,MAAM,SAAS,CAAC;AAEjB,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AA0BD,eAAO,MAAM,QAAQ,EAAY,aAAa,CAAC;AA8T/C;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,EASH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAAG,EASvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,KAAG,EAYH,CAAC;AAEF,wBAAgB,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,MAKtE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAU,MAAM;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,KAAG,OAAO,CAAC,OAAO,CAElB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,MAE3D,CAAC;AAEF,eAAO,MAAM,WAAW,QAAO,OAE9B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,OAE3B,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,OAMhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAXO,OAWS,CAAC"}
|
package/op-sqlite.podspec
CHANGED
|
@@ -66,19 +66,19 @@ end
|
|
|
66
66
|
|
|
67
67
|
if phone_version then
|
|
68
68
|
if use_sqlcipher then
|
|
69
|
-
raise "SQLCipher is not supported with phone version"
|
|
69
|
+
raise "SQLCipher is not supported with phone version. It cannot load extensions."
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
if use_crsqlite then
|
|
73
|
-
raise "CRSQLite is not supported with phone version"
|
|
73
|
+
raise "CRSQLite is not supported with phone version. It cannot load extensions."
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
if rtree then
|
|
77
|
-
raise "RTree is not supported with phone version"
|
|
77
|
+
raise "RTree is not supported with phone version. It cannot load extensions."
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
if use_sqlite_vec then
|
|
81
|
-
raise "SQLite Vec is not supported with phone version"
|
|
81
|
+
raise "SQLite Vec is not supported with phone version. It cannot load extensions."
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
|
|
@@ -93,6 +93,8 @@ Pod::Spec.new do |s|
|
|
|
93
93
|
s.platforms = { :ios => min_ios_version_supported, :tvos => "13.0", :osx => "10.15", :visionos => "1.0" }
|
|
94
94
|
s.source = { :git => "https://github.com/op-engineering/op-sqlite.git", :tag => "#{s.version}" }
|
|
95
95
|
|
|
96
|
+
log_message.call("[OP-SQLITE] Configuration found at #{package_json_path}")
|
|
97
|
+
|
|
96
98
|
install_modules_dependencies(s)
|
|
97
99
|
|
|
98
100
|
# Base source files
|
|
@@ -114,41 +116,37 @@ Pod::Spec.new do |s|
|
|
|
114
116
|
|
|
115
117
|
# Assign the collected source files to `s.source_files`
|
|
116
118
|
s.source_files = source_files
|
|
117
|
-
|
|
119
|
+
|
|
118
120
|
xcconfig = {
|
|
119
|
-
:GCC_PREPROCESSOR_DEFINITIONS => "
|
|
120
|
-
:
|
|
121
|
-
:
|
|
121
|
+
:GCC_PREPROCESSOR_DEFINITIONS => "",
|
|
122
|
+
:CLANG_CXX_LANGUAGE_STANDARD => "c++20",
|
|
123
|
+
:GCC_OPTIMIZATION_LEVEL => "2",
|
|
122
124
|
}
|
|
123
|
-
|
|
124
|
-
log_message.call("[OP-SQLITE] Configuration found at #{package_json_path}")
|
|
125
125
|
|
|
126
126
|
exclude_files = []
|
|
127
127
|
|
|
128
128
|
if use_sqlcipher then
|
|
129
|
-
log_message.call("[OP-SQLITE] using SQLCipher
|
|
129
|
+
log_message.call("[OP-SQLITE] using SQLCipher")
|
|
130
130
|
exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h"]
|
|
131
131
|
xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_SQLCIPHER=1 HAVE_FULLFSYNC=1 SQLITE_HAS_CODEC SQLITE_TEMP_STORE=3 SQLITE_EXTRA_INIT=sqlcipher_extra_init SQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown"
|
|
132
132
|
s.dependency "OpenSSL-Universal"
|
|
133
133
|
elsif use_libsql then
|
|
134
|
-
log_message.call("[OP-SQLITE] using libsql
|
|
134
|
+
log_message.call("[OP-SQLITE] using libsql. Please contact turso (via Discord) for libsql issues")
|
|
135
135
|
exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/bridge.h", "cpp/bridge.cpp"]
|
|
136
136
|
else
|
|
137
|
-
log_message.call("[OP-SQLITE] using
|
|
137
|
+
log_message.call("[OP-SQLITE] using pure SQLite from CocoaPods with performance optimizations")
|
|
138
138
|
exclude_files += ["cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h"]
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
-
other_cflags = '-DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1'
|
|
142
|
-
optimizedCflags = '
|
|
141
|
+
other_cflags = '$(inherited) -DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1 -DHAVE_USLEEP=1 -DSQLITE_ENABLE_LOCKING_STYLE=0'
|
|
142
|
+
optimizedCflags = ' -DSQLITE_DQS=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 -DSQLITE_STRICT_SUBTYPE=1'
|
|
143
143
|
frameworks = []
|
|
144
144
|
|
|
145
145
|
if fts5 then
|
|
146
|
-
log_message.call("[OP-SQLITE] FTS5 enabled ๐")
|
|
147
146
|
xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " SQLITE_ENABLE_FTS5=1"
|
|
148
147
|
end
|
|
149
148
|
|
|
150
149
|
if rtree then
|
|
151
|
-
log_message.call("[OP-SQLITE] RTree enabled ๐ฒ")
|
|
152
150
|
xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " SQLITE_ENABLE_RTREE=1"
|
|
153
151
|
end
|
|
154
152
|
|
|
@@ -160,7 +158,7 @@ Pod::Spec.new do |s|
|
|
|
160
158
|
end
|
|
161
159
|
|
|
162
160
|
if performance_mode then
|
|
163
|
-
log_message.call("[OP-SQLITE] Performance mode enabled
|
|
161
|
+
log_message.call("[OP-SQLITE] Performance mode enabled")
|
|
164
162
|
other_cflags += optimizedCflags
|
|
165
163
|
end
|
|
166
164
|
|
|
@@ -186,7 +184,7 @@ Pod::Spec.new do |s|
|
|
|
186
184
|
end
|
|
187
185
|
|
|
188
186
|
if sqlite_flags != "" then
|
|
189
|
-
log_message.call("[OP-SQLITE]
|
|
187
|
+
log_message.call("[OP-SQLITE] Detected custom SQLite flags: #{sqlite_flags}")
|
|
190
188
|
other_cflags += " #{sqlite_flags}"
|
|
191
189
|
end
|
|
192
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@op-engineering/op-sqlite",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.4",
|
|
4
4
|
"description": "Fastest SQLite for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react": "19.1.1",
|
|
63
63
|
"react-native": "0.82.1",
|
|
64
64
|
"react-native-builder-bob": "^0.40.15",
|
|
65
|
-
"typescript": "5.
|
|
65
|
+
"typescript": "^5.9.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "*",
|