drizzle-zod with custom types
I have defined opaque types in my application and have implemented those in the drizzle schema (awesome and easy to use!). The opaque types are defined using zods Brand feature i.e.
z.string().uuid().brand<"SomeId">();
I have that defined in the drizzle schema as someId: uuid("id").$type<SomeId>().notNull()
When I use drizzle-zod to create the schema and infer the type, it's coming back as a z.ZodString
rather than z.ZodBranded
.
Is this a bug, a feature that is in development, or simply not supported and I need to override these types?rphlmr ⚡•194d ago
I think the type generated is related to the scalar type of the column, so, string.
Maybe it could be a feature request.
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.4KMembers
View on DiscordWant results from more Discord servers?
More PostsUsing transactions in automated testing like JestI have a testing set-up as follows:
1. Start postgres container
2. Apply migrations to db
3. Jest tTypeScript complaining about using a spread operator in partial select queryTypeScript complaining about me using a spread operator in partial select query.
I have the followiUnable to read error message when inserting withdb.insert().values()Hey there, i am using visual studio code and am developing with nuxt3. I am trying to insert an objehow to add new driver to drizzle?what is the procedure of adding a new driver to drizzle orm?