-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support different encryption libraries #392
base: master
Are you sure you want to change the base?
Conversation
… that all imported libraries define the SQLite3_version variable
…o the test routines
Hi @jowr , I just want to be sure that the changes to
|
Actually, it is the other way round - Furthermore the user should set the options
That is correct. I use the alias target In case all implementations are disabled, the script tries to find the default |
thanks, yes that was a typo from my side.
as for the libraries, is it required to use the internal implementation or there is no issue if we use the system provided?, mainly because on meson the dependencies are handled differently so the implementation might be somewhat different if that is the case |
# Conflicts: # sqlite3/CMakeLists.txt # src/Database.cpp
Hi, @jowr. I am using SQLite3MultipleCiphers as well. So I want to notice that you have a memory leak with this impl of SQLiteCPP. You also need to apply this patch to fix it. SQLite3MultipleCiphers allocates additional stuff when you use encryption. diff --git a/src/Database.cpp b/src/Database.cpp
index 320695f..9d4f38d 100644
--- a/src/Database.cpp
+++ b/src/Database.cpp
@@ -14,7 +14,7 @@
#include <SQLiteCpp/Backup.h>
#include <SQLiteCpp/Exception.h>
#include <SQLiteCpp/Statement.h>
-
+#include <sqlite3mc.h>
#include <sqlite3.h>
#include <fstream>
#include <string.h>
@@ -90,6 +90,7 @@ void Database::Deleter::operator()(sqlite3* apSQLite)
// Only case of error is SQLITE_BUSY: "database is locked" (some statements are not finalized)
// Never throw an exception in a destructor :
SQLITECPP_ASSERT(SQLITE_OK == ret, "database is locked"); // See SQLITECPP_ENABLE_ASSERT_HANDLER
+ sqlite3_shutdown();
}
// Set a busy handler that sleeps for a specified amount of time when a table is locked. |
By default, SQLiteCpp support SQLCipher for encrypting a database and it is very difficult to integrate other SQLite3 libraries. The changes from this PR improve this situation and make it easier to integrate other SQLite3 implementations in the future.
The code has been tested with SQLite3MultipleCiphers which has to be built separately. It can be found afterwards by setting the
SQLITE3MULTIPLECIPHERS_DIR
variable in SQLiteCpp or within the project that includes SQLiteCpp.Please do not hesitate to ask for further changes.