DT
Drizzle Teamโ€ข10mo ago
soft-atom

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?
No description
6 Replies
Angelelz
Angelelzโ€ข10mo ago
The type SubqueryWithSelection doesn't know anything about the id Check what type is your SQ and copy it from there
soft-atom
soft-atomโ€ข10mo ago
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 ? ๐Ÿ™‚
No description
soft-atom
soft-atomโ€ข10mo ago
No description
soft-atom
soft-atomโ€ข10mo ago
I found solution with using magic sql ๐Ÿ™‚
No description
soft-atom
soft-atomโ€ข10mo ago
please tell me how can i get subquery columns like getTableColumns for table ?
Angelelz
Angelelzโ€ข10mo ago
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...
Want results from more Discord servers?
Add your server