Skip to content

Commit

Permalink
fix: expand connection environment variables support
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Mar 15, 2018
1 parent b6f54d8 commit e3bf47d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 47 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Connection options:
const opt = docopt(doc, { version: packagejson.version });

const options = {
database: opt['--db'] || process.env.PGDATABASE,
host: opt['--host'] || process.env.PGHOST || 'localhost',
port: opt['--port'] || process.env.PGPORT || 5432,
user: opt['--user'] || process.env.PGUSER,
password: opt['--password'] || process.env.PGPASSWORD,
database: opt['--db'] || process.env.PGDATABASE || process.env.POSTGRES_DB,
host: opt['--host'] || process.env.PGHOST || process.env.POSTGRES_HOST || 'localhost',
port: opt['--port'] || process.env.PGPORT || process.env.POSTGRES_PORT || 5432,
user: opt['--user'] || process.env.PGUSER || process.env.POSTGRES_USER,
password: opt['--password'] || process.env.PGPASSWORD || process.env.POSTGRES_PASSWORD,
migrationsSchema: opt['--migrations-schema'],
migrationsTable: opt['--migrations-table'],
migrationsDir: opt['--migrations-dir'],
Expand Down
93 changes: 51 additions & 42 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ acorn@^5.4.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298"

ajv-keywords@^1.0.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
ajv-keywords@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"

ajv@^4.7.0, ajv@^4.9.1:
ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"

ajv@^5.3.0:
ajv@^5.2.3, ajv@^5.3.0:
version "5.5.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
dependencies:
Expand Down Expand Up @@ -1168,7 +1168,7 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"

chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
Expand Down Expand Up @@ -1250,7 +1250,7 @@ class-utils@^0.3.4:
lazy-cache "^2.0.2"
static-extend "^0.1.1"

cli-color@~1.2.0:
cli-color@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-1.2.0.tgz#3a5ae74fd76b6267af666e69e2afbbd01def34d1"
dependencies:
Expand Down Expand Up @@ -1803,9 +1803,9 @@ doctrine@^2.1.0:
dependencies:
esutils "^2.0.2"

documentation@5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/documentation/-/documentation-5.4.0.tgz#49006a8ca444e835f03a990fe8c393e15cb4f853"
documentation@6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/documentation/-/documentation-6.1.0.tgz#fb884b18d7f4a718de67ad1da9e22a7d199f806d"
dependencies:
ansi-html "^0.0.7"
babel-core "^6.26.0"
Expand Down Expand Up @@ -1841,6 +1841,7 @@ documentation@5.4.0:
read-pkg-up "^3.0.0"
remark "^9.0.0"
remark-html "7.0.0"
remark-reference-links "^4.0.1"
remark-toc "^5.0.0"
remote-origin-url "0.4.0"
shelljs "^0.8.1"
Expand Down Expand Up @@ -2023,9 +2024,9 @@ eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"

eslint@4.18.1:
version "4.18.1"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.1.tgz#b9138440cb1e98b2f44a0d578c6ecf8eae6150b0"
eslint@4.18.2:
version "4.18.2"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45"
dependencies:
ajv "^5.3.0"
babel-code-frame "^6.22.0"
Expand Down Expand Up @@ -2062,7 +2063,7 @@ eslint@4.18.1:
semver "^5.3.0"
strip-ansi "^4.0.0"
strip-json-comments "~2.0.1"
table "^4.0.1"
table "4.0.2"
text-table "~0.2.0"

espree@^3.5.2:
Expand Down Expand Up @@ -3474,7 +3475,7 @@ lru-queue@0.1:
dependencies:
es5-ext "~0.10.2"

manakin@~0.5.1:
manakin@0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/manakin/-/manakin-0.5.1.tgz#c4a7116f6b00df3d5f1a37ad3ca515d22065a658"

Expand Down Expand Up @@ -4091,28 +4092,28 @@ pg-connection-string@0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7"

pg-minify@~0.5.4:
pg-minify@0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/pg-minify/-/pg-minify-0.5.4.tgz#89d5261cacfd44dd7927fa052222a404e9b2a3c9"

pg-monitor@0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/pg-monitor/-/pg-monitor-0.9.0.tgz#ae021850d245f6d2549002b1cf104414f527b3f6"
pg-monitor@0.9.2:
version "0.9.2"
resolved "https://registry.yarnpkg.com/pg-monitor/-/pg-monitor-0.9.2.tgz#2cf8e0883c3d0e29c68c45a112aebb43456f3079"
dependencies:
cli-color "~1.2.0"
cli-color "1.2.0"

pg-pool@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-2.0.3.tgz#c022032c8949f312a4f91fb6409ce04076be3257"

pg-promise@8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/pg-promise/-/pg-promise-8.1.1.tgz#c0e3757a859c83cdc1025f1d7a8f69575e2f645e"
pg-promise@8.2.2:
version "8.2.2"
resolved "https://registry.yarnpkg.com/pg-promise/-/pg-promise-8.2.2.tgz#079a71eb358ef7f27f78f4bc3653a1f4bb9266e6"
dependencies:
manakin "~0.5.1"
pg "~7.4.1"
pg-minify "~0.5.4"
spex "~2.0.2"
manakin "0.5.1"
pg "7.4.1"
pg-minify "0.5.4"
spex "2.0.2"

pg-types@~1.12.1:
version "1.12.1"
Expand All @@ -4123,7 +4124,7 @@ pg-types@~1.12.1:
postgres-date "~1.0.0"
postgres-interval "^1.1.0"

pg@~7.4.1:
pg@7.4.1:
version "7.4.1"
resolved "https://registry.yarnpkg.com/pg/-/pg-7.4.1.tgz#f3411c8ddf9f692322fe05e7017a1888e47f78f1"
dependencies:
Expand Down Expand Up @@ -4480,6 +4481,12 @@ remark-parse@^5.0.0:
vfile-location "^2.0.0"
xtend "^4.0.1"

remark-reference-links@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/remark-reference-links/-/remark-reference-links-4.0.1.tgz#021aed1c55c187d712b3c76d0057bf510d300ba7"
dependencies:
unist-util-visit "^1.0.0"

remark-slug@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-5.0.0.tgz#9de71fcdc2bfae33ebb4a41eb83035288a829980"
Expand Down Expand Up @@ -4779,9 +4786,11 @@ slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"

slice-ansi@0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
slice-ansi@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"
dependencies:
is-fullwidth-code-point "^2.0.0"

snapdragon-node@^2.0.1:
version "2.1.1"
Expand Down Expand Up @@ -4876,7 +4885,7 @@ spdx-license-ids@^1.0.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57"

spex@~2.0.2:
spex@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/spex/-/spex-2.0.2.tgz#e8c8d633a4c67af642dded701ec2350c9de964a0"

Expand Down Expand Up @@ -4969,7 +4978,7 @@ string-width@^1.0.0, string-width@^1.0.1, string-width@^1.0.2:
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"

string-width@^2.0.0, string-width@^2.1.0:
string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
dependencies:
Expand Down Expand Up @@ -5065,16 +5074,16 @@ supports-color@^5.2.0:
dependencies:
has-flag "^3.0.0"

table@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435"
table@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
dependencies:
ajv "^4.7.0"
ajv-keywords "^1.0.0"
chalk "^1.1.1"
lodash "^4.0.0"
slice-ansi "0.0.4"
string-width "^2.0.0"
ajv "^5.2.3"
ajv-keywords "^2.1.0"
chalk "^2.1.0"
lodash "^4.17.4"
slice-ansi "1.0.0"
string-width "^2.1.1"

tape@4.9.0:
version "4.9.0"
Expand Down

0 comments on commit e3bf47d

Please sign in to comment.