Closed scottt closed 11 months ago
@bplunkett-stripe , I've incorporated the comments in f3c5658 which makes pg-schema-diff
output:
2023/08/10 17:33:02 [WARNING] DSN flag not set. Using libpq environment variables and default values.
I've again manually tested pg-schema-diff
from the command line and the new warning and database connection works as expected.
Description
psql
and programs usinglibpq
allows users to use the environment variablesPGHOST
and friends to specify the connection information. This PR implements the same behavior forpg-schema-diff
by making the DSN flag non-mandatory.Motivation
pg-schema-diff
"just work" in our workflow.Implementation
pg-schema-diff's
(connFlags).parseConnConfig()
callspgx.ParseConfig()
, which callspgconn.ParseConfigWithOptions()
pgconn.ParseConfigWithOptions
already reads the Postgres environment variables.Testing