What is the recommended way to have a staging and a production environment?
For the record, I'm using Cloudflare D1. I know how to set up the
wrangler.json
file such that based on the environment I use a different database (same binding, just different database IDs). How can I make it so the drizzle.config.ts
file uses a different .env
file based on the environment being used?3 Replies
Drizzle ORM - drizzle.config.ts
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Also you can use a tool such as https://www.npmjs.com/package/dotenv#-manage-multiple-environments
npm
dotenv
Loads environment variables from .env file. Latest version: 16.4.7, last published: 2 months ago. Start using dotenv in your project by running
npm i dotenv
. There are 52118 other projects in the npm registry using dotenv.And just run drizzle.config for different environment