Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: unexpected results using bun:sqlite #2273

Open
rev4324 opened this issue May 7, 2024 · 2 comments
Open

[BUG]: unexpected results using bun:sqlite #2273

rev4324 opened this issue May 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rev4324
Copy link

rev4324 commented May 7, 2024

What version of drizzle-orm are you using?

0.30.10

What version of drizzle-kit are you using?

No response

Describe the Bug

The same query yields different results using bun:sqlite compared to better-sqlite3 on Node. The bun:sqlite result is wrong - it has mismatched values and keys. The query uses two left joins.

Reproduction: https://github.com/rev4324/drizzle-repro

Expected behavior

Both drivers should yield the same results.

Environment & setup

I'm using macOS 14.4.1 (23E224) ARM64.

@rev4324 rev4324 added the bug Something isn't working label May 7, 2024
@Jarred-Sumner
Copy link

I suspect this is a bug in Bun. Can you file an issue in https://github.com/oven-sh/bun?

@rev4324
Copy link
Author

rev4324 commented May 11, 2024

I don't think this is a bug in Bun, since the problem is caused by joined table column names overriding the original table column names. JS objects can't have the same key twice so the behavior is the same in bun:sqlite and better-sqlite3 when used directly, without Drizzle - the columns are overridden.
Drizzle seems to mitigate this behavior in better-sqlite3 driver, but it doesn't do that in bun:sqlite one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants