Skip to content

Commit

Permalink
Fix sqlcipher compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed May 30, 2024
1 parent 4f71f96 commit d4e6ba5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
12 changes: 0 additions & 12 deletions cpp/libsql/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};
}

Expand Down
6 changes: 5 additions & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1234,6 +1236,7 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- OpenSSL-Universal
- SocketRocket

EXTERNAL SOURCES:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"node": ">=18"
},
"op-sqlite": {
"sqlcipher": false,
"sqlcipher": true,
"crsqlite": false,
"performanceMode": "1",
"iosSqlite": false,
Expand Down
1 change: 0 additions & 1 deletion example/src/tests/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ export function queriesTests() {
await new Promise<void>(done => {
setTimeout(() => done(), 50);
});
console.warn('mark1');
tx.execute('SELECT * FROM User;');
ranCallback = true;
});
Expand Down

0 comments on commit d4e6ba5

Please sign in to comment.