© 2026 Hedgehog Software, LLC

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

create exportable types for frontend services

I feel like I'm missing something fundamental. I can create my Drizzle schema
user = mysqlTable('user', {id: ....});
user = mysqlTable('user', {id: ....});
and use them in my queries to get data back. I want to return my result set to the frontend as
{id: 1, ...}
{id: 1, ...}
and strongly type the API return value. I thought that doing
export type UserModel = InferModeltype<typeof user>
export type UserModel = InferModeltype<typeof user>
would do that, but I get a type that looks like
MySQLTableWithColumns....
MySQLTableWithColumns....
instead of simply
{id: number....}
{id: number....}
. What am I missing? I see how Drizzle keeps my queries type safe, but how can I leverage it to make sure consumers of my services use proper types? I feel like everyone is doing this, that it's super easy, and I'm just dumb right now.
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

how to use types on frontend
Drizzle TeamDTDrizzle Team / help
3y ago
How to use drizzle-zod types in the frontend
Drizzle TeamDTDrizzle Team / help
2mo ago
types for database/transaction
Drizzle TeamDTDrizzle Team / help
2y ago
Missing types for modules
Drizzle TeamDTDrizzle Team / help
3y ago