mirror of
https://github.com/valitydev/psql-migration.git
synced 2024-11-06 01:05:18 +00:00
Handle query dynamically
This commit is contained in:
parent
025a372b71
commit
1211e93d03
@ -196,7 +196,7 @@ connection_opts(_Args, {url, DatabaseUrl}) ->
|
||||
case uri_string:parse(DatabaseUrl) of
|
||||
{error, Error, Term} ->
|
||||
{error, {Error, Term}};
|
||||
Map = #{userinfo := UserPass, host := Host, path := Path, query := Query} ->
|
||||
Map = #{userinfo := UserPass, host := Host, path := Path} ->
|
||||
{User, Pass} =
|
||||
case string:split(UserPass, ":") of
|
||||
[[]] -> {"postgres", ""};
|
||||
@ -213,7 +213,7 @@ connection_opts(_Args, {url, DatabaseUrl}) ->
|
||||
database => string:slice(Path, 1)
|
||||
},
|
||||
|
||||
case Query of
|
||||
case maps:get(query, Map, []) of
|
||||
[] ->
|
||||
{ok, ConnectionOpts};
|
||||
"?" ++ QueryString ->
|
||||
|
Loading…
Reference in New Issue
Block a user