drizzle-team / drizzle-team/drizzle-orm

[BUG]: retrieved JSONB value has wrong type

Open
#4,518 2 comments 3 reactions 0 assignees View on GitHub
bug bug/fixed-in-beta
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### 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.43.1

### What version of `drizzle-kit` are you using?

^0.31.1

### Other packages

_No response_

### Describe the Bug

I have a postgres JSONB column that I'm using to store strings and objects. If I store a string like "2" and I try to retrieve it using drizzle-orm (in my case I'm using `db.query.myTable.findFirst`), I get the number 2 back rather than the string "2".

I have verified using pgAdmin that the value stored in the database is a string of the form `"2"`.

I'm using bun 1.2.12, but I got the same issue with npm 11.3.0, so it doesn't appear to be runtime related.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.