Is this concat + string_agg with groupBy correct in Drizzle?
Hi everyone,
I’m working with Drizzle ORM (PostgreSQL) and trying to generate a
Here’s the code I’m using:
I have two main questions:
I’m working with Drizzle ORM (PostgreSQL) and trying to generate a
name field that combines the product name with all of its attribute values, like:"T-Shirt, Red, Large".Here’s the code I’m using:
I have two main questions:
- Is this usage of
sql<string>concat(..., string_agg(...))valid and safe in Drizzle? - Is the
.groupBy(productVariantTable.id)correct in this context? Do I need to group by more columns (likeproductTable.id) to avoid SQL errors?