From b0184c088cc428b176e87c7d2a74aab3eb162a5f Mon Sep 17 00:00:00 2001 From: f4rkh4d Date: Sat, 9 May 2026 09:46:03 +0200 Subject: [PATCH] docs: remove dotenv from drizzle.config.ts examples drizzle-kit auto-loads .env since v0.20.0, so calling dotenv.config() inside drizzle.config.ts is no longer necessary. Removes the dotenv import and config() call from the drizzle.config.ts snippets in 6 tutorials. The src/db/index.ts blocks still call dotenv since application code legitimately needs it at runtime. Closes #5725 --- .../docs/tutorials/drizzle-with-db/drizzle-with-neon.mdx | 3 --- .../docs/tutorials/drizzle-with-db/drizzle-with-supabase.mdx | 3 --- .../docs/tutorials/drizzle-with-db/drizzle-with-turso.mdx | 3 --- .../docs/tutorials/drizzle-with-db/drizzle-with-vercel.mdx | 3 --- .../docs/tutorials/drizzle-with-db/drizzle-with-xata.mdx | 3 --- .../tutorials/drizzle-with-frameworks/drizzle-nextjs-neon.mdx | 3 --- 6 files changed, 18 deletions(-) diff --git a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-neon.mdx b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-neon.mdx index 3e5c05530..a1f852f06 100644 --- a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-neon.mdx +++ b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-neon.mdx @@ -109,11 +109,8 @@ export type SelectPost = typeof postsTable.$inferSelect; Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from "drizzle-kit"; -config({ path: '.env' }); - export default defineConfig({ schema: "./src/schema.ts", out: "./migrations", diff --git a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-supabase.mdx b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-supabase.mdx index ca068b7a0..565b6680f 100644 --- a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-supabase.mdx +++ b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-supabase.mdx @@ -108,11 +108,8 @@ export type SelectPost = typeof postsTable.$inferSelect; Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from 'drizzle-kit'; -config({ path: '.env' }); - export default defineConfig({ schema: './src/db/schema.ts', out: './supabase/migrations', diff --git a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-turso.mdx b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-turso.mdx index 5701f55cc..2bb814713 100644 --- a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-turso.mdx +++ b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-turso.mdx @@ -144,11 +144,8 @@ export type SelectPost = typeof postsTable.$inferSelect; Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from 'drizzle-kit'; -config({ path: '.env' }); - export default defineConfig({ schema: './src/db/schema.ts', out: './migrations', diff --git a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-vercel.mdx b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-vercel.mdx index 7a534f7ec..cfa64f9bf 100644 --- a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-vercel.mdx +++ b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-vercel.mdx @@ -106,11 +106,8 @@ export type SelectPost = typeof postsTable.$inferSelect; Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from 'drizzle-kit'; -config({ path: '.env.local' }); - export default defineConfig({ schema: './src/db/schema.ts', out: './migrations', diff --git a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-xata.mdx b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-xata.mdx index 55011b6aa..42482e7cc 100644 --- a/src/content/docs/tutorials/drizzle-with-db/drizzle-with-xata.mdx +++ b/src/content/docs/tutorials/drizzle-with-db/drizzle-with-xata.mdx @@ -125,11 +125,8 @@ export type SelectPost = typeof postsTable.$inferSelect; Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from 'drizzle-kit'; -config({ path: '.env' }); - export default defineConfig({ schema: './src/db/schema.ts', out: './migrations', diff --git a/src/content/docs/tutorials/drizzle-with-frameworks/drizzle-nextjs-neon.mdx b/src/content/docs/tutorials/drizzle-with-frameworks/drizzle-nextjs-neon.mdx index 878999602..183df6d48 100644 --- a/src/content/docs/tutorials/drizzle-with-frameworks/drizzle-nextjs-neon.mdx +++ b/src/content/docs/tutorials/drizzle-with-frameworks/drizzle-nextjs-neon.mdx @@ -102,11 +102,8 @@ Here we define the **`todo`** table with fields **`id`**, **`text`**, and **`don Create a `drizzle.config.ts` file in the root of your project and add the following content: ```typescript copy filename="drizzle.config.ts" -import { config } from 'dotenv'; import { defineConfig } from "drizzle-kit"; -config({ path: '.env' }); - export default defineConfig({ schema: "./src/db/schema.ts", out: "./migrations",