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
24.47k stars 643 forks source link

[BUG]: drizzle-kit up tries to use aws-data-api driver with dialect 'postgresql' #3226

Open L-Mario564 opened 2 weeks ago

L-Mario564 commented 2 weeks ago

What version of drizzle-orm are you using?

?

What version of drizzle-kit are you using?

?

Describe the Bug

From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/592.

I am upgrading from drizzle-kit v0.20.14 to v0.25.0.

The commit (where the issue appears) is here: sisou/bun-drizzle-chain-mirror@2591878

When I try to generate a new migration with bun drizzle-kit generate it tells me the snapshots are outdated and I need to run drizzle-kit up. This is the output:

> bun drizzle-kit up             
No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/[...]/bun-drizzle-chain-mirror/drizzle.config.ts'
 Error  Please provide required params for AWS Data API driver:
    [x] database: undefined
    [✓] secretArn: 'postgresql'
error: "drizzle-kit" exited with code 1

For some reason it wants to use aws-data-api driver, but I don't think anything in the config file points to that:

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

export default {
  dialect: "postgresql",
  schema: "./db/schema.ts",
  dbCredentials: {
      url: process.env.DATABASE_URL!,
  },
  verbose: true,
  strict: true,
} satisfies Config;

DATABASE_URL is a postgres:// URL.

Expected behavior

No response

Environment & setup

No response

Dastari commented 9 hours ago

You can work around this by supply the "out" option to your drizzle.config

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

export default {
    out: "./drizzle",
    dialect: "postgresql",
    schema: "./db/schema.ts",
    dbCredentials: {
        url: process.env.DATABASE_URL!,
    },
    verbose: true,
    strict: true,
} satisfies Config;