Skip to content

Commit

Permalink
use dotenv for loading env in drizzle config
Browse files Browse the repository at this point in the history
t3 env is validator not loader so was causing knip issues
  • Loading branch information
buckhalt committed Jun 5, 2024
1 parent 3cab7f4 commit 08dbcbf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// cannot use import aliases here with knip. see https://knip.dev/reference/known-issues#path-aliases-in-config-files
import { env } from "./env";
import { defineConfig } from "drizzle-kit";
import dotenv from "dotenv";
dotenv.config();

export default defineConfig({
schema: "./drizzle/schema.ts",
dialect: "postgresql",
out: "./drizzle", // where to output the migration files
dbCredentials: {
url: env.DATABASE_URL,
url: process.env.DATABASE_URL ?? "",
},
verbose: true,
strict: true,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"dependencies": {
"@t3-oss/env-nextjs": "^0.10.1",
"dotenv": "^16.4.5",
"drizzle-orm": "^0.31.1",
"knip": "^5.17.4",
"next": "14.2.3",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08dbcbf

Please sign in to comment.