Closed samlevin closed 4 years ago
No; explicit always wins over implicit. If you provide a connection string explicitly via the Graphile Migrate config file then that will override the implicit and generic environmental variable DATABASE_URL
that may have come from anywhere and could relate to some other service such as PostGraphile or Graphile Worker or even a completely different project.
Perhaps there's an alternative way we can solve this; for example a .js
config file where you can set connectionString: process.env.DATABASE_URL || "fallback"
This'd be the place to apply that change:
I think read .gmrc
if present, otherwise try .gmrc.js
.
Hey Benjie. We've nearly completed our adoption of graphile-migrate and as a team, we're loving it. A lot of great philosophies at play. Awesome work all around.
Our development team has a 'zero config' dev environment philosophy where a lot of settings are hard-coded to repositories (with insecure defaults). We're trying to replicate this for graphile-migrate but the
migrate
command appears to be preferringconnectionString
- even thoughDATABASE_URL
exists.Thoughts? ENV var precedence is fairly typical in the config world. Am I right in assuming that migrate would/should follow suit?