using subquery with query builder
Hello ๐ Please help me ) I try to use subquery with query builder, but i get a type error in eq function. How can i fix it?
6 Replies
The type SubqueryWithSelection doesn't know anything about the id
Check what type is your SQ and copy it from there
Hello ๐ thank you for response )
SubqueryWithSelection<K, 'sq'> ( K extends ReturnType<typeof this.roleFind>['_']['selection'])
K extends selection type of role select knows about id. I think it is error of eq function argument type. Maybe i can use magic sql for this ? ๐I found solution with using magic sql ๐
please tell me how can i get subquery columns like
getTableColumns
for table ?Not implemented yet. The issue to track is https://github.com/drizzle-team/drizzle-orm/issues/1459
GitHub
[FEATURE]: Add
getSubqueryFields
helper to goodies ยท Issue #1459 ...Describe what you want The getTableColumns helper is really useful, but an equivalent lacks for subqueries. This can easily be implemented in userland, although it feels like the kind of helper tha...