Commit 923cf31b authored by louiz’'s avatar louiz’

Merge branch 'postgresql' into 'postgresql'

Some fixes for the postgresql branch

See merge request louiz/biboumi!19
parents 0168b96b e1c7a651
......@@ -37,7 +37,7 @@ void Database::open(const std::string& filename)
std::unique_ptr<DatabaseEngine> new_db;
static const auto psql_prefix = "postgresql://"s;
if (filename.substr(0, psql_prefix.size()) == psql_prefix)
new_db = PostgresqlEngine::open("dbname="s + filename.substr(psql_prefix.size()));
new_db = PostgresqlEngine::open(filename);
else
new_db = Sqlite3Engine::open(filename);
if (!new_db)
......@@ -242,7 +242,7 @@ std::vector<Database::RosterItem> Database::get_full_roster()
void Database::close()
{
Database::db.release();
Database::db = nullptr;
}
std::string Database::gen_uuid()
......
......@@ -20,6 +20,7 @@ class DatabaseEngine
public:
DatabaseEngine() = default;
virtual ~DatabaseEngine() = default;
DatabaseEngine(const DatabaseEngine&) = delete;
DatabaseEngine& operator=(const DatabaseEngine&) = delete;
......
......@@ -14,6 +14,7 @@ enum class StepResult
class Statement
{
public:
virtual ~Statement() = default;
virtual StepResult step() = 0;
virtual void bind(std::vector<std::string> params) = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment