stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
278 stars 20 forks source link

cmd: make dsn a non-mandatory flag to allow use of Postgres environment variables #54

Closed scottt closed 11 months ago

scottt commented 11 months ago

Description

psql and programs using libpq allows users to use the environment variables PGHOST and friends to specify the connection information. This PR implements the same behavior for pg-schema-diff by making the DSN flag non-mandatory.

Motivation

Implementation

Testing

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

scottt commented 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.