dbmate icon indicating copy to clipboard operation
dbmate copied to clipboard

Support env.local, et al. or support `--envfile` CLI option

Open hparra opened this issue 3 years ago • 5 comments

dbmate does not support additional .env files, e.g. .env.local or .env.development.local due to https://github.com/joho/godotenv/issues/10

Possible solutions of varying completeness:

  • Have loadDotEnv also load .env.local
  • Add --envfile option which specifies file for godotenv.Load()
  • Use a fork of godotenv which implements https://github.com/joho/godotenv/issues/10

hparra avatar Feb 22 '22 00:02 hparra

I also would like this issue supported

msdrigg avatar Apr 02 '22 14:04 msdrigg

Happy to accept a PR for this, I think it would only be a few lines of code

amacneil avatar Apr 02 '22 14:04 amacneil

I haven't written any go code, but if this is still sitting open in a week or two, I may give it a try.

Also, if anyone does write a pr, I would definitely prefer the solution of

Add --envfile option which specifies file for godotenv.Load()

msdrigg avatar Apr 03 '22 03:04 msdrigg

I'd love this too.

jahilliard avatar Apr 19 '22 19:04 jahilliard

Looks like something like godotenv.Load(".env.local") is supported.

jahilliard avatar Apr 19 '22 19:04 jahilliard