~singpolyma/biboumi

923cf31ba62ebfd2369a9594a60020477730b649 — louiz’ 6 years ago 0168b96 + e1c7a65
Merge branch 'postgresql' into 'postgresql'

Some fixes for the postgresql branch

See merge request louiz/biboumi!19
3 files changed, 4 insertions(+), 2 deletions(-)

M src/database/database.cpp
M src/database/engine.hpp
M src/database/statement.hpp
M src/database/database.cpp => src/database/database.cpp +2 -2
@@ 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()

M src/database/engine.hpp => src/database/engine.hpp +1 -0
@@ 20,6 20,7 @@ class DatabaseEngine
 public:

  DatabaseEngine() = default;
  virtual ~DatabaseEngine() = default;

  DatabaseEngine(const DatabaseEngine&) = delete;
  DatabaseEngine& operator=(const DatabaseEngine&) = delete;

M src/database/statement.hpp => src/database/statement.hpp +1 -0
@@ 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;