How to get a plain row schema using drizzle-zod?
I am using these drizzle packages
I used drizzle kit to pull table schemas from a pg table
I want to get a plain schema that represents a row in this table
I tried this but cannot infer the type from this schema
The
amBrandSchema
seems to be of a type BuildSchema<"select",...>
I would let to get a zod schema that is an object that represents a row of the table
What am I doing wrong?2 Replies
Did you ever figure this out?
@elyptica
You can do this:
Docs: https://orm.drizzle.team/docs/latest-releases/drizzle-orm-v0283#-added-tableinferselect--table_inferselect-and-tableinferinsert--table_inferinsert-for-more-convenient-table-model-type-inference
Drizzle ORM - DrizzleORM v0.28.3 release
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.