Single Selects don't work with JSON fields
Running:
- [email protected] (using bun:sqlite)
- [email protected]
It seems like tables with a
text("name", { mode: "json" })
column can only be selected if more than one entry get's selected (e.g. DB.query.Table.findMany().sync()
or DB.select().from(Table).all()
)
If i use .get()
or .findFirst()
it gives me a error containing this
It looks like this originated from the utils.js file line 28 or relations.js line 296 (basically everytime it hits mapFromDriverValue)
This is because for example the code in utils.js
Results in rawValue being undefined
because row is something like
Or any other object containing id and other key value columns and the code tries to index this object3 Replies
I was able to temporary fix it by doing following:
utils.js
relations.js
I basically saw that the code tried to index the values so i just converted the single objects to its values so it could get indexed properly
GitHub
[BUG]: Single Selects don't work with JSON fields with bun:sqlite ·...
What version of drizzle-orm are you using? 0.29.3 What version of drizzle-kit are you using? 0.20.12 Describe the Bug It seems like tables with a text("name", { mode: "json" }) ...
@Andrew Sherman can u help here? I've the same error using [email protected] and [email protected]