|
1 | 1 | #include "bridge.h" |
2 | 2 | #include "DumbHostObject.h" |
3 | 3 | #include "SmartHostObject.h" |
| 4 | +#include "libsql.h" |
4 | 5 | #include "logs.h" |
5 | 6 | #include "utils.h" |
6 | 7 | #include <filesystem> |
@@ -49,15 +50,20 @@ DB opsqlite_libsql_open_sync(std::string const &name, |
49 | 50 | libsql_connection_t c; |
50 | 51 | const char *err = nullptr; |
51 | 52 |
|
52 | | - libsql_config config = {.db_path = path.c_str(), |
53 | | - .primary_url = url.c_str(), |
54 | | - .auth_token = auth_token.c_str(), |
55 | | - .read_your_writes = '1', |
56 | | - .encryption_key = encryption_key.c_str(), |
57 | | - .remote_encryption_key = remote_encryption_key.c_str(), |
58 | | - .sync_interval = sync_interval, |
59 | | - .with_webpki = '1', |
60 | | - .offline = offline}; |
| 53 | + libsql_config config = { |
| 54 | + .db_path = path.c_str(), |
| 55 | + .primary_url = url.c_str(), |
| 56 | + .auth_token = auth_token.c_str(), |
| 57 | + .read_your_writes = '1', |
| 58 | + .encryption_key = |
| 59 | + encryption_key.empty() ? nullptr : encryption_key.c_str(), |
| 60 | + .remote_encryption_key = remote_encryption_key.empty() |
| 61 | + ? nullptr |
| 62 | + : remote_encryption_key.c_str(), |
| 63 | + .sync_interval = sync_interval, |
| 64 | + .with_webpki = '1', |
| 65 | + .offline = offline, |
| 66 | + }; |
61 | 67 |
|
62 | 68 | status = libsql_open_sync_with_config(config, &db, &err); |
63 | 69 | if (status != 0) { |
|
0 commit comments