Conversation
geoffharcourt
left a comment
There was a problem hiding this comment.
Looks great. One tiny change in the code, and could you put your PR description in the commit description along with a README change to show how someone could use this?
| PROTECTED_ENVIRONMENTS = %w(development production) | ||
|
|
||
| attr_accessor :app_argument, :environment, :subcommand, :arguments | ||
| attr_accessor :psql_argument |
There was a problem hiding this comment.
Can this join the above attr_accessors?
|
@geoffharcourt I'll update README. Did you mean I put the PR description into the next commit desc? I thought GitHub will automatically put the PR desc into the merge commit desc when we click merge button? |
geoffharcourt
left a comment
There was a problem hiding this comment.
Looks like there's some CI failures to resolve.
|
@elquimista I think it only does that with merge commits, which we haven't used on this project. With the "Rebase and Merge" button or "Squash and Merge" button the commit history is retained but not replaced with the PR. |
|
@geoffharcourt I'll do that then, no problem. Which one do we do exactly btw, Squash or Rebase? |
|
@elquimista sorry for the delay! I'll merge it with dispatch. Thanks for your contribution! |
Allows using parity with non-default pg config (non-socket, different host, different username, with password etc), e.g. in local docker container environment with pg as a linked service (specified in docker-compose.yml).
One can create a customized version of
developmentbin file and do the following:#!/usr/bin/env ruby $LOAD_PATH.unshift File.expand_path(File.join("..", "..", "lib"), __FILE__) require "parity" if ARGV.empty? puts Parity::Usage.new else + psql_arg = "-h postgres -U postgres" + exit Parity::Environment.new('development', ARGV, psql_argument: psql_arg).run - exit Parity::Environment.new('development', ARGV).run endcombined with
PGPASSWORDenv variable to run pg command lines non-interactively.