© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
4 replies
scriptbytes

Partial Select - Child array

I have a one-many relationship of recipe->comments. How do I get it to return the comments as an array?

const test = await db
.select({
...getTableColumns(recipe),
comments: getTableColumns(comment), // This should be an array
})
.from(recipe)
.leftJoin(comment, eq(recipe.id, comment.recipeId));
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Help, Partial select with drizzle-zod
Drizzle TeamDTDrizzle Team / help
2y ago
json_arrayagg(json_array ...
Drizzle TeamDTDrizzle Team / help
2y ago
Use findMany or Select with Partial Types?
Drizzle TeamDTDrizzle Team / help
2y ago
Partial select with join throwing TS error
Drizzle TeamDTDrizzle Team / help
2y ago