Skip to content

Conversation

waterkip
Copy link

This eases the whole connection URI setup for developers who make use of the
.pgpass file.

Signed-off-by: Wesley Schwengle [email protected]

@waterkip
Copy link
Author

waterkip commented May 28, 2022

Hi, I didn't wrote a test for it because I'm too dumb I guess to get a working developer environment. So I did tests with my own setup which work.

Test prerequisites:

  • A .pgpass file:
localhost:5432:*:yourdbuser:yourdbpassword
  • Have two databases, eg foo and bar

How to test:

  • invoke migra as usual, but without your username and password, in this case I assume your local user equals the postgres username:
   migra \
     postgresql://localhost/foo \
     postgresql://localhost/bar \
     --unsafe --ignore-extension-versions
  • This should yield a connection

  • invoke migra as usual, but a with username but without a password:

   migra \
     postgresql://yourdbuser@localhost/foo \
     postgresql://yourdbuser@localhost/bar \
     --unsafe --ignore-extension-versions
  • This should yield a connection

  • invoke migra as usual, but a with username but without a password and make sure you have a DB named the same as your user::

   migra \
     postgresql://yourdbuser@localhost/ \
     postgresql://yourdbuser@localhost/bar \
     --unsafe --ignore-extension-versions
  • This should yield a connection

When you remove the .pgpass file you should not get a connection and migra fails as it did in the past.

@waterkip waterkip force-pushed the pgpass-support branch 2 times, most recently from de72174 to d3e5134 Compare May 28, 2022 19:11
This eases the whole connection URI setup for developers who make use of the
.pgpass file.

Signed-off-by: Wesley Schwengle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant