Open caiohportella opened 3 months ago
try console.log your env process.env.DB_URL if undefined configure you'r env
Hi, for some reason drizzle doesnt pick up env files named .env.local
, for example. Make sure your env file is named .env
.
If you still want to use .env.local
make sure you configure dotenv to use that. My config file looks like
"use server";
import type { Config } from "drizzle-kit";
import { config } from "dotenv";
config({ path: ".env.local" });
export default {
dialect: "postgresql",
schema: "./src/lib/db/schema.ts",
out: "./migrations",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
verbose: true,
strict: true,
} satisfies Config;
What version of
drizzle-orm
are you using?0.32.2
What version of
drizzle-kit
are you using?0.23.2
Describe the Bug
My config file is below, following the documentation on configuration:
When running
pnpm drizzle-kit push
, I get thrown the error at the terminal:Either connection "url" or "host", "database" are required for PostgreSQL database connection
.I wonder why, since the url is my correct URI String connection in my .env.
Expected behavior
No response
Environment & setup
No response