From d4e6ba5794ef2c0082ce3540b4d8290c2a1a0a95 Mon Sep 17 00:00:00 2001 From: ospfranco Date: Thu, 30 May 2024 08:06:53 +0200 Subject: [PATCH] Fix sqlcipher compilation --- cpp/libsql/bridge.cpp | 12 ------------ example/ios/Podfile.lock | 6 +++++- example/package.json | 2 +- example/src/tests/queries.spec.ts | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cpp/libsql/bridge.cpp b/cpp/libsql/bridge.cpp index 9f29c87b..30b85332 100644 --- a/cpp/libsql/bridge.cpp +++ b/cpp/libsql/bridge.cpp @@ -42,15 +42,8 @@ std::string opsqlite_get_db_path(std::string const &db_name, return location + "/" + db_name; } -#ifdef OP_SQLITE_USE_SQLCIPHER -BridgeResult opsqlite_open(std::string const &dbName, - std::string const &last_path, - std::string const &crsqlitePath, - std::string const &encryptionKey) { -#else BridgeResult opsqlite_libsql_open(std::string const &name, std::string const &last_path) { -#endif std::string path = opsqlite_get_db_path(name, last_path); int status = 0; @@ -72,11 +65,6 @@ BridgeResult opsqlite_libsql_open(std::string const &name, db_map[name] = {.db = db, .c = c}; -#ifdef OP_SQLITE_USE_SQLCIPHER - opsqlite_execute(dbName, "PRAGMA key = '" + encryptionKey + "'", nullptr, - nullptr, nullptr); -#endif - return {.type = SQLiteOk, .affectedRows = 0}; } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index e45a54ce..ecd71612 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,9 +8,11 @@ PODS: - hermes-engine/Pre-built (= 0.74.0) - hermes-engine/Pre-built (0.74.0) - op-sqlite (6.0.3): + - OpenSSL-Universal - React - React-callinvoker - React-Core + - OpenSSL-Universal (3.1.5004) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -1234,6 +1236,7 @@ DEPENDENCIES: SPEC REPOS: trunk: + - OpenSSL-Universal - SocketRocket EXTERNAL SOURCES: @@ -1358,7 +1361,8 @@ SPEC CHECKSUMS: fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: 6eae7edb2f563ee41d7c1f91f4f2e57c26d8a5c3 - op-sqlite: ec06c8f35496c7021fa83bb65c2e7e7326fae2e7 + op-sqlite: 557247bb21ec97c23ff45a012cc1cbea2c42bcaf + OpenSSL-Universal: 0db2e81615ad95efc90ce13a638986858da38c0d RCT-Folly: 045d6ecaa59d826c5736dfba0b2f4083ff8d79df RCTDeprecation: 3ca8b6c36bfb302e1895b72cfe7db0de0c92cd47 RCTRequired: 9fc183af555fd0c89a366c34c1ae70b7e03b1dc5 diff --git a/example/package.json b/example/package.json index 0adcaa98..6d6e9e4a 100644 --- a/example/package.json +++ b/example/package.json @@ -56,7 +56,7 @@ "node": ">=18" }, "op-sqlite": { - "sqlcipher": false, + "sqlcipher": true, "crsqlite": false, "performanceMode": "1", "iosSqlite": false, diff --git a/example/src/tests/queries.spec.ts b/example/src/tests/queries.spec.ts index 6e016cca..5bbe69f9 100644 --- a/example/src/tests/queries.spec.ts +++ b/example/src/tests/queries.spec.ts @@ -477,7 +477,6 @@ export function queriesTests() { await new Promise(done => { setTimeout(() => done(), 50); }); - console.warn('mark1'); tx.execute('SELECT * FROM User;'); ranCallback = true; });