jackc / tern

The SQL Fan's Migrator
MIT License
925 stars 68 forks source link

Feature Request: Parse entire DSN from environment variable #39

Closed mattrasband closed 2 years ago

mattrasband commented 2 years ago

A useful feature might be to allow parsing the DSN fully from the environment, as a decent number of services expose something like DATABASE_URL which is often in a url format. In those cases, it's more difficult to manually parse out the pieces into a config file.

jackc commented 2 years ago

I have no objection to this if someone wants to add this. But personally, I use PGSERVICE.

lukecyca commented 2 years ago

I worked around this by making my entire config file just:

[database]
conn_string = {{env "DATABASE_URI"}}