Properly clone the sqlite3 connection

This commit is contained in:
emeric
2023-11-01 23:53:44 +01:00
parent 100192b126
commit 88004c01f2
+8 -2
View File
@@ -40,13 +40,19 @@ namespace Database
prepare();
}
Connection(const Connection& other)
: Wt::Dbo::backend::Sqlite3{ other }
, _dbPath{ other._dbPath }
{
prepare();
}
private:
Connection(const Connection&) = delete;
Connection& operator=(const Connection&) = delete;
std::unique_ptr<SqlConnection> clone() const override
{
return std::make_unique<Connection>(_dbPath);
return std::make_unique<Connection>(*this);
}
void prepare()