Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres: support a connection string DSN #435

Closed
wants to merge 3 commits into from

Commits on Apr 21, 2023

  1. Postgres: support a connection string DSN

    use DATABASE_DSN and DBMATE_DRIVER
    The format of DATABASE_DSN is defined under connection string here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
    
    The DATABASE_URL is problematic because it is parsed to a URL in Go. This requires encoding the password for the URL which does not necessarily get decoded properly.
    
    It is simpler to not alter the parameters to fit them into a url: that is what DATABASE_DSN does.
    Currently it will fail if a configuration parameter has a space. However, spaces are normally not used for any of the parameters. And that limitation can be fixed by taking on a DSN parser depdendency.
    gregwebs committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    603a581 View commit details
    Browse the repository at this point in the history
  2. fix error message formatting

    gregwebs committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    23915ee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    372d679 View commit details
    Browse the repository at this point in the history