mirror of
https://github.com/valitydev/psql-migration.git
synced 2024-11-06 01:05:18 +00:00
Merge pull request #9 from vmalepati1/master
Add .env.template and strip newline characters from database URLs
This commit is contained in:
commit
71b7f65ce0
1
.env.template
Normal file
1
.env.template
Normal file
@ -0,0 +1 @@
|
||||
DATABASE_URL=postgresql://user:password@hostname/database
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,4 +18,5 @@ _build
|
||||
rebar3.crashdump
|
||||
.DS_Store
|
||||
.env*
|
||||
!.env.template
|
||||
.tool-versions
|
||||
|
@ -193,7 +193,7 @@ connection_opts(Args, {env, URLName}) ->
|
||||
DatabaseUrl -> connection_opts(Args, {url, DatabaseUrl})
|
||||
end;
|
||||
connection_opts(_Args, {url, DatabaseUrl}) ->
|
||||
case uri_string:parse(DatabaseUrl) of
|
||||
case uri_string:parse(string:trim(DatabaseUrl)) of
|
||||
{error, Error, Term} ->
|
||||
{error, {Error, Term}};
|
||||
Map = #{userinfo := UserPass, host := Host, path := Path} ->
|
||||
|
Loading…
Reference in New Issue
Block a user