Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
louiz’
biboumi
Commits
4f7ad3f9
Commit
4f7ad3f9
authored
Nov 28, 2017
by
Jonas Schäfer
Committed by
louiz’
Dec 02, 2017
Browse files
Support for full postgresql URIs
(cf.
https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNSTRING
)
parent
0168b96b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/database/database.cpp
View file @
4f7ad3f9
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment