diff --git a/c_sources/tokenizers.h b/c_sources/tokenizers.h index ccbf95be..2a41fbee 100644 --- a/c_sources/tokenizers.h +++ b/c_sources/tokenizers.h @@ -3,7 +3,7 @@ #define TOKENIZER_LIST opsqlite_wordtokenizer_init(db,&errMsg,nullptr);opsqlite_porter_init(db,&errMsg,nullptr); -#include "sqlite3.h" +#include namespace opsqlite { diff --git a/cpp/DBHostObject.h b/cpp/DBHostObject.h index 96cd32e3..2d1ea454 100644 --- a/cpp/DBHostObject.h +++ b/cpp/DBHostObject.h @@ -1,11 +1,11 @@ #pragma once #include "ThreadPool.h" -#include "sqlite3.h" #include "types.h" #include #include #include +#include #include #include diff --git a/cpp/PreparedStatementHostObject.cpp b/cpp/PreparedStatementHostObject.cpp index ffb7754f..43696af1 100644 --- a/cpp/PreparedStatementHostObject.cpp +++ b/cpp/PreparedStatementHostObject.cpp @@ -136,7 +136,7 @@ PreparedStatementHostObject::~PreparedStatementHostObject() { } #else if (_stmt != nullptr) { - sqlite3_finalize(_stmt); +// sqlite3_finalize(_stmt); _stmt = nullptr; } #endif diff --git a/cpp/bridge.cpp b/cpp/bridge.cpp index c657d822..c6f265d8 100644 --- a/cpp/bridge.cpp +++ b/cpp/bridge.cpp @@ -98,7 +98,9 @@ sqlite3 *opsqlite_open(std::string const &name, std::string const &path, opsqlite_execute(db, "PRAGMA key = '" + encryption_key + "'", nullptr); #endif +#ifndef OP_SQLITE_USE_PHONE_VERSION sqlite3_enable_load_extension(db, 1); +#endif #ifdef OP_SQLITE_USE_CRSQLITE const char *crsqliteEntryPoint = "sqlite3_crsqlite_init"; diff --git a/cpp/bridge.h b/cpp/bridge.h index cfcf3b56..f5ec490e 100644 --- a/cpp/bridge.h +++ b/cpp/bridge.h @@ -2,9 +2,9 @@ #include "DumbHostObject.h" #include "SmartHostObject.h" -#include "sqlite3.h" #include "types.h" #include "utils.h" +#include #include namespace opsqlite { diff --git a/example/c_sources/tokenizers.h b/example/c_sources/tokenizers.h index ccbf95be..2a41fbee 100644 --- a/example/c_sources/tokenizers.h +++ b/example/c_sources/tokenizers.h @@ -3,7 +3,7 @@ #define TOKENIZER_LIST opsqlite_wordtokenizer_init(db,&errMsg,nullptr);opsqlite_porter_init(db,&errMsg,nullptr); -#include "sqlite3.h" +#include namespace opsqlite { diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1ba74ee2..71fbf9c5 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1785,7 +1785,7 @@ SPEC CHECKSUMS: GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4 glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a hermes-engine: 06a9c6900587420b90accc394199527c64259db4 - op-sqlite: 9917e5a5747fc813e42487c0cbdd2d35eaa687bb + op-sqlite: 26d129a3be9edde9e3ba414ddcf97224df177d59 RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648 RCTDeprecation: fb7d408617e25d7f537940000d766d60149c5fea RCTRequired: 9aaf0ffcc1f41f0c671af863970ef25c422a9920 diff --git a/example/package.json b/example/package.json index 55309811..e4ebe338 100644 --- a/example/package.json +++ b/example/package.json @@ -73,8 +73,8 @@ "iosSqlite": false, "fts5": true, "rtree": true, - "libsql": false, "sqliteVec": true, + "libsql": false, "tokenizers": [ "wordtokenizer", "porter" diff --git a/generate_tokenizers_header_file.rb b/generate_tokenizers_header_file.rb index 9e34afd4..395f379a 100644 --- a/generate_tokenizers_header_file.rb +++ b/generate_tokenizers_header_file.rb @@ -12,7 +12,7 @@ def generate_tokenizers_header_file(names, file_path) file.puts file.puts "#define TOKENIZER_LIST #{tokenizer_list}" file.puts - file.puts "#include \"sqlite3.h\"" + file.puts "#include " file.puts file.puts "namespace opsqlite {" file.puts diff --git a/op-sqlite.podspec b/op-sqlite.podspec index 8dc38def..22f97bc5 100644 --- a/op-sqlite.podspec +++ b/op-sqlite.podspec @@ -105,18 +105,20 @@ Pod::Spec.new do |s| } log_message.call("[OP-SQLITE] Configuration:") + + exclude_files = [] if use_sqlcipher then log_message.call("[OP-SQLITE] using SQLCipher 🔒") - s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h" + exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h"] xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_SQLCIPHER=1 HAVE_FULLFSYNC=1 SQLITE_HAS_CODEC SQLITE_TEMP_STORE=2" s.dependency "OpenSSL-Universal" elsif use_libsql then log_message.call("[OP-SQLITE] using libsql 📘") - s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/bridge.h", "cpp/bridge.cpp" + exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/bridge.h", "cpp/bridge.cpp"] else log_message.call("[OP-SQLITE] using vanilla SQLite 📦") - s.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" + 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"] end s.dependency "React-callinvoker" @@ -144,7 +146,7 @@ Pod::Spec.new do |s| if phone_version then log_message.call("[OP-SQLITE] using iOS embedded SQLite 📱") xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_PHONE_VERSION=1" - s.exclude_files = "cpp/sqlite3.c", "cpp/sqlite3.h" + exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h"] s.library = "sqlite3" end @@ -191,4 +193,5 @@ Pod::Spec.new do |s| xcconfig[:OTHER_CFLAGS] = other_cflags s.pod_target_xcconfig = xcconfig s.vendored_frameworks = frameworks + s.exclude_files = exclude_files end