drizzle-orm
drizzle-orm copied to clipboard
[BUG]: Migration runners not working using bun:sqlite
What version of drizzle-orm
are you using?
0.23.5
Describe the Bug
I have this connection file:
import { drizzle } from 'drizzle-orm/bun-sqlite';
import { Database } from 'bun:sqlite';
const sqlite = new Database('test.db');
const db = drizzle(sqlite);
export default db;
and this migration script:
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
import db from "./connection";
migrate(db, { migrationsFolder: "./db/migrations" });
using this drizzle.config.json:
{
"out": "./db/migrations",
"schema": "./db/schema.ts"
}
Here's what my directory structure looks like:
I'm using bun v0.5.9 and SQLite version 3.39.5 on macOS.
When I try bun run db/migrate.ts
, I get the following error:

It ends up creating test.db
along with the initial migrations table.
Want to chime in that I'm having the same problem.
I'm also having this issue.
Bump. I'm having the same issue regardless of the schema it errors, defiantly a universal bun.sh bug.
Specs: Windows: WSL Linux Bun Version: 0.6.3
Migration code:
Error:
Same issue here.
Bun version: 0.6.6
Drizzle-Orm version: 0.26.3
Bumping... This is really broken. Are there no unit tests to catch those kind of issues?
Fixed in PR @dankochetov will merge it soon
@AndriiSherman Thanks! There is another problem with queries that return empty results, I will open another issue
Seems like it was a bun.sh bug https://github.com/drizzle-team/drizzle-orm/pull/631#issuecomment-1577895541
Should be fixed in bun v0.6.8