© 2026 Hedgehog Software, LLC

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

Is there a way I can use relational types?

I'm currently trying to make a helper function that essentially wraps a database call, but I can't seem to find nor hack myself into getting a type for the
with
with
parameter in the relational queries.

I've tried things like
  type T = NonNullable<Parameters<typeof db.query.projects.findFirst>[0]>["with"];
  type T = NonNullable<Parameters<typeof db.query.projects.findFirst>[0]>["with"];


but even that didnt work.

any pointers?
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

Generate relational select types
Drizzle TeamDTDrizzle Team / help
2y ago
Is there a better way to access enum types?
Drizzle TeamDTDrizzle Team / help
3y ago
types from nested relational queries
Drizzle TeamDTDrizzle Team / help
3y ago
is there a way to use Redis in drizzle
Drizzle TeamDTDrizzle Team / help
2y ago