Type-safe subquery in "extras" of findMany query
Is this the right solution or is there a better way? Specifically, the
getSQL().as<Awaited<typeof subquery>>(…)
part for getting a type-safe subquery.
I'm expecting Drizzle to return an array of objects as the subquery
property of each result (executing the subquery once per result).1 Reply
In case you wonder why I'm not using
with
instead of extras
, it's because I have a many-to-many relationship with an orderBy
clause.