How can I query data without having to map the values with JavaScript?
I only want to get the movie and actors, but I get repeated data:
Unless I map the values with JavaScript, or use the relational API:
1 Reply
the relational API is there for that very purpose. See docs on aggregating results, which notes that the regular ORM does not aggregate but you can do so yourself (in JavaScript) instead:
If you already have the details of the movie, you could simply select from schema.actor instead, which would give you a list without the repeated movie details.
Drizzle ORM - Joins
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.