parity icon indicating copy to clipboard operation
parity copied to clipboard

Allow additional psql argument

Open elquimista opened this issue 6 years ago • 4 comments

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.

elquimista avatar Oct 23 '19 09:10 elquimista

@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 avatar Jan 15 '20 02:01 elquimista

@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 avatar Jan 15 '20 02:01 geoffharcourt

@geoffharcourt I'll do that then, no problem. Which one do we do exactly btw, Squash or Rebase?

elquimista avatar Jan 15 '20 02:01 elquimista

@elquimista sorry for the delay! I'll merge it with dispatch. Thanks for your contribution!

geoffharcourt avatar Jun 24 '20 02:06 geoffharcourt