drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
23.84k stars 592 forks source link

[BUG]: Well when using the turso driver and Bun in windows the config file doesn't read the Environmental variable #2109

Open Endmostcamera32 opened 6 months ago

Endmostcamera32 commented 6 months ago

What version of drizzle-orm are you using?

0.30.7

What version of drizzle-kit are you using?

0.20.14

Describe the Bug

import type { Config } from "drizzle-kit";

// import dotenv from "dotenv";

// dotenv.config({
//   path: ".env.local",
// });

export default {
  schema: "./db/schema",
  out: "./db/migrations",
  driver: "turso",
  dbCredentials: {
    url: process.env.DATABASE_URL!,
    authToken: process.env.TURSO_AUTH_TOKEN,
  },
} satisfies Config;

Without the commented out part the url doesn't work I'm using Bun, so I shouldn't need to read Environmental variables Also the Bun thing works while making migrations, so it's only the push:sqlite, and drizzle-kit push:sqlite that doesn't work

Expected behavior

No response

Environment & setup

No response

elieven commented 1 week ago

Same when using znv. With env.ts file being correct and when being run logging the values correctly when normally run with bun. But when I run bun drizzle-kit push or something like it I get the znv error of:

Errors found while parsing environment:
  [TURSO_DATABASE_URL]:
    This field is required.
    (received undefined)

  [TURSO_AUTH_TOKEN]:
    This field is required.
    (received undefined)

This only happens when I run drizzle kit. The .env.local is there and works otherwise when just running it and logging the vlues.