Replies: 1 comment 3 replies
-
Next.js makes the environment variables in The most popular approach is to use a tool like dotenv, although lately, node in it's latest version seems to want to support this out of the box. Oh, bun supports it out of the box since v1. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently leveraging Drizzle-Kit to manage my database tables, specifically using
drizzle-kit push:pg
. However, in order to execute this command, it necessitates adrizzle.config.ts
file containing essential configurations like schema, output, and credentials.Traditionally, I rely on
.env
files for storing sensitive credentials. But when integrating with Next.js 14,drizzle-kit push:pg
seems unable to access the database URL stored within the .env file. It appears that the environment variable isn't being picked up.Considering security best practices and the risk associated with storing credentials directly in the
drizzle.config.ts
file, especially when dealing with version control (Git), I'm reluctant to include these sensitive details there. This approach also requires managing credentials in two separate places, which is far from ideal.Is there a recommended method or workaround to enable drizzle.config.ts to access the .env file for the database URL while utilizing Drizzle Kit in conjunction with Next.js 14? I'm aiming to maintain a secure approach to handling credentials without compromising on functionality. Any insights or alternative strategies would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions