Nested object in select query?
Drizzle-orm 0.29.3. My code is
There is an error near
Despite of the type error, the query result is correct, with all nesting. How to fix the type error? And is it possible?
Despite of the type error, the query result is correct, with all nesting. How to fix the type error? And is it possible?
10 Replies
is there a chance that your nested object names are colliding with one of the columns returned from
getTableColumns
such that it's causing a type conflict?I doubt, this could have anything to do with column conflicts
@francis do you have any issues with nested objects?
I don't use them. but you're right. I dunno what is happening here
Another clarification. The only first-level nested object has no type issues
@andreas_444 did you ever find a solution to this?
still no
A github issue here too - https://github.com/drizzle-team/drizzle-orm/issues/2050
GitHub
[BUG]: Nested object in select query · Issue #2050 · drizzle-team/d...
What version of drizzle-orm are you using? 0.29.3 What version of drizzle-kit are you using? 0.20.14 Describe the Bug My code is const feedbacks = await drizzleClient .select({ ...getTableColumns(f...
I have an example here: https://gist.github.com/rphlmr/de869cf24816d02068c3dd089b45ae82
Maybe not up to date.
An other gist here with community contributions : https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
Gist
Drizzle ORM, deep sub queries
Drizzle ORM, deep sub queries. GitHub Gist: instantly share code, notes, and snippets.
Look at jsonAggBuildObject