From 4f7ad3f9855cf62649c40d912e6c3a6a2b777913 Mon Sep 17 00:00:00 2001 From: Jonas Wielicki Date: Tue, 28 Nov 2017 18:52:56 +0100 Subject: [PATCH] Support for full postgresql URIs (cf. https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNSTRING) --- src/database/database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/database.cpp b/src/database/database.cpp index b1a5ba5..19e9988 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -37,7 +37,7 @@ void Database::open(const std::string& filename) std::unique_ptr 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) -- 2.45.2