stripe / pg-schema-diff

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

Connects to `database=postgres` regardless of `PGDATABASE` value #78

Closed sveinnfannar closed 6 months ago

sveinnfannar commented 8 months ago

Hi, this project looks very promising and by far the simplest one to use I've found. Great work!

I'm using aiven.io for postgres hosting and AFIK they don't grant access to the default postgres database. S when I run pg-schema-diff I get the following error: server error (FATAL: database "postgres" does not exist (SQLSTATE 3D000))

I've tried setting database in the DSN and the PGDATABASE env, but with no luck.

bplunkett-stripe commented 7 months ago

Well that's a problem! I put up a fix that allows the tooling to connect to a non-postgres database. Does aiven enable you to create other databases? If not, the tooling will still not work, and I can put up a subsequent fix that will spin up a local postgres instance to connect to if this fix does not work for you.

bplunkett-stripe commented 6 months ago

I'm going to close this because it's stale!