parity
parity copied to clipboard
Allow additional psql argument
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 development bin 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
end
combined with PGPASSWORD env variable to run pg command lines non-interactively.
@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?
@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!