drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[BUG]: Bun SQL Error on DB Push

Open bennajah opened this issue 1 month ago • 3 comments

Report hasn't been filed before.

  • [x] I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.44.7

What version of drizzle-kit are you using?

0.31.6

Other packages

@types/[email protected]

Describe the Bug

i follow Bun SQL documentation i have bun 1.3.1 package manager

with this packages

{
  "dependencies": {
    "drizzle-orm": "^0.44.7",
    "next": "^16.0.1",
    "react": "^19.2.0",
    "react-dom": "^19.2.0"
  },
  "devDependencies": {
    "@types/bun": "^1.3.1",
    "@types/node": "^24.9.2",
    "@types/react": "^19.2.2",
    "@types/react-dom": "^19.2.2",
    "dotenv": "^17.2.3",
    "drizzle-kit": "^0.31.6",
  }
}

and thisdb config

import "dotenv/config";
import { SQL } from "bun";
import { drizzle } from "drizzle-orm/bun-sql";
import { schema } from "./schema";

const client = new SQL(process.env.DATABASE_URL);
export const db = drizzle({ client, schema, casing: "snake_case" });

and when run bunx --bun drizzle-kit push

getting this error

$ drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\Users\benna\Projects\iptv\drizzle.config.ts'
To connect to Postgres database - please install either of 'pg', 'postgres', '@neondatabase/serverless' or '@vercel/postgres' drivers
error: script "db:push" exited with code 1

bennajah avatar Nov 01 '25 13:11 bennajah

Does issue presist if you replace you command with bun --bun run node_modules/drizzle-kit/bin push?

NotNullDev avatar Nov 01 '25 14:11 NotNullDev

Does issue presist if you replace you command with bun --bun run node_modules/drizzle-kit/bin push?

yes same issue

Image

bennajah avatar Nov 01 '25 19:11 bennajah

I'm assuming this happens because the migration engine isn't setup to use bun-sql and thus requires one of the listed drivers. I installed postgres (postgres-js) for migration but it's using bun-sql in the application.

MHarmony avatar Nov 06 '25 22:11 MHarmony