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

[BUG]: running generate:sqlite with bun find no tables on my schema #1786

Closed brunoti closed 4 months ago

brunoti commented 10 months ago

What version of drizzle-orm are you using?

0.29.3

What version of drizzle-kit are you using?

0.20.10

Describe the Bug

When drizzle kit is run with Bun it can't find my tables.

Bun version: 1.0.21

I have started this new svelte kit project to try out drizzle.

Here is the repo: https://github.com/brunoti/habit-tracker

I'm using Turso. When running drizzle-kit with Bun I first got Bun is undefined then I used bun --bun and it simply can't find the tables. When run with pnpm the tables are found and the migration is generated.

Does anyone know why?

https://github.com/drizzle-team/drizzle-bun/assets/6011421/a17462b6-4647-4407-ba08-27e88e009c14

Expected behavior

Run the same way it does with node.

Environment & setup

image

PatNei commented 9 months ago

I have the same issue but the problem disappeared when i removed the --bun flag.

etienne-napoleone commented 7 months ago

EDIT: It works after installing node alongside

Having the same issue on macOs only. This is working on WSL (ubuntu).

❯ bun db:g                       
$ drizzle-kit generate:sqlite
drizzle-kit: v0.20.14
drizzle-orm: v0.30.8

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/.../drizzle.config.ts'
0 tables

No schema changes, nothing to migrate 😴
❯ bun run drizzle-kit --version
drizzle-kit: v0.20.14
drizzle-orm: v0.30.8

config:

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

export default {
  schema: "./db/schema.ts",
  out: "./db/migrations",
  driver: "better-sqlite",
  dbCredentials: {
    url: "./database.db",
  },
} satisfies Config;