Closed kevinzunigacuellar closed 5 days ago
Let's remove
dotenv
andnext/env
altogether, keep in the second check for the DB URL.
Thanks for the review Roy
Unfortunately, removing next/env
from the drizzle.config
file will cause an error because the Drizzle ORM CLI doesn’t rely on the Next.js server to run scripts, so these variables won't be available at runtime.
While it is possible to remove next/env
from schema.ts
, it’s a common practice to load environment variables at this point for scripts that run outside the Next.js server context.
Thanks for the support @royanger 🎉
Explanation
This PR removes the usage of
dotenv
from the neon guide. While a small change, it favors the use of framework-specific utility libraries and reduces unnecessary dependencies, thus simplifying the overall setup.Changes Made
dotenv
with@next/env
utility for loading environment variables.DATABASE_URL
indrizzle.config.ts
.