Drizzle Kit dotenv support #3405
Replies: 5 comments
-
Love it! Do we have a way to track when will this dotenv support land? |
Beta Was this translation helpful? Give feedback.
-
Why not use built-in Node.js features? |
Beta Was this translation helpful? Give feedback.
-
I'd advise against using |
Beta Was this translation helpful? Give feedback.
-
@AlexBlokh has the support been added? Because it doesn't seem to be working for me locally, even after adding @next/env. After adding @next/env, only .env, .env.local, .env.production and .env.production.local is detected. |
Beta Was this translation helpful? Give feedback.
-
Nice. It's working for me out of the box without a It'd be nice to update the Drizzle tutorials to reflect this 🙌 |
Beta Was this translation helpful? Give feedback.
-
As of now
drizzle-kit
config will be automatically supplied with.env
file via backed indotenv
package.In the next version kit will consume
.env*
files based onNODE_ENV
and will be compatible with Bun env consumption. Kit will not consume dotenv files when run in Bun, since Bun already does:we will read the following files automatically (listed in order of increasing precedence)
.env
.env.production
.env.development
.env.test
(depending on value ofNODE_ENV
).env.local
we will support variables expansion:
you will have an ability to provide custom env file or multiple files or tell Drizzle to not consume files automatically
drizzle-kit --env-file=.env.custom
drizzle-kit --env-file=.env.custom --env-file=.env.custom2
drizzle-kit --no-env
-> load custom/yourselfUPD 05.11.24:
pending Bun fix, for now we'll use
dotenvx
for every runtimeBeta Was this translation helpful? Give feedback.
All reactions