Skip to content

Commit

Permalink
Merge branch 'main' into oscar/per-db-thread
Browse files Browse the repository at this point in the history
# Conflicts:
#	cpp/DBHostObject.h
#	cpp/bridge.cpp
#	cpp/bridge.h
  • Loading branch information
ospfranco committed Dec 17, 2024
2 parents 73075f2 + f630279 commit cbe1dc3
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion c_sources/tokenizers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define TOKENIZER_LIST opsqlite_wordtokenizer_init(db,&errMsg,nullptr);opsqlite_porter_init(db,&errMsg,nullptr);

#include "sqlite3.h"
#include <sqlite3.h>

namespace opsqlite {

Expand Down
2 changes: 1 addition & 1 deletion cpp/DBHostObject.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include "ThreadPool.h"
#include "sqlite3.h"
#include "types.h"
#include <ReactCommon/CallInvoker.h>
#include <jsi/jsi.h>
#include <set>
#include <sqlite3.h>
#include <unordered_map>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion cpp/PreparedStatementHostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ PreparedStatementHostObject::~PreparedStatementHostObject() {
}
#else
if (_stmt != nullptr) {
sqlite3_finalize(_stmt);
// sqlite3_finalize(_stmt);
_stmt = nullptr;
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions cpp/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion cpp/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include "DumbHostObject.h"
#include "SmartHostObject.h"
#include "sqlite3.h"
#include "types.h"
#include "utils.h"
#include <sqlite3.h>
#include <vector>

namespace opsqlite {
Expand Down
2 changes: 1 addition & 1 deletion example/c_sources/tokenizers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define TOKENIZER_LIST opsqlite_wordtokenizer_init(db,&errMsg,nullptr);opsqlite_porter_init(db,&errMsg,nullptr);

#include "sqlite3.h"
#include <sqlite3.h>

namespace opsqlite {

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"iosSqlite": false,
"fts5": true,
"rtree": true,
"libsql": false,
"sqliteVec": true,
"libsql": false,
"tokenizers": [
"wordtokenizer",
"porter"
Expand Down
2 changes: 1 addition & 1 deletion generate_tokenizers_header_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sqlite3.h>"
file.puts
file.puts "namespace opsqlite {"
file.puts
Expand Down
11 changes: 7 additions & 4 deletions op-sqlite.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit cbe1dc3

Please sign in to comment.