Properly clone the sqlite3 connection
This commit is contained in:
@@ -40,13 +40,19 @@ namespace Database
|
|||||||
prepare();
|
prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connection(const Connection& other)
|
||||||
|
: Wt::Dbo::backend::Sqlite3{ other }
|
||||||
|
, _dbPath{ other._dbPath }
|
||||||
|
{
|
||||||
|
prepare();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Connection(const Connection&) = delete;
|
|
||||||
Connection& operator=(const Connection&) = delete;
|
Connection& operator=(const Connection&) = delete;
|
||||||
|
|
||||||
std::unique_ptr<SqlConnection> clone() const override
|
std::unique_ptr<SqlConnection> clone() const override
|
||||||
{
|
{
|
||||||
return std::make_unique<Connection>(_dbPath);
|
return std::make_unique<Connection>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare()
|
void prepare()
|
||||||
|
|||||||
Reference in New Issue
Block a user