Support for full postgresql URIs

(cf. https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNSTRING)
This commit is contained in:
Jonas Wielicki
2017-12-02 20:08:50 +01:00
committed by louiz’
parent 0168b96b79
commit 4f7ad3f985
+1 -1
View File
@@ -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)