Insert and Select Schema - Force to overide type , because types of Serials, boolean are unknown
Hello it's more a question than an help because i have find the answer
In the previous version i didn't have the needs to override my Insert and Select Schema because it detected very well my types. (screenshot 1)
Now if i delete my override i have an error of mismatching type. ( screenshot 2)
If anyone have any idea on what has changed. Because i think it's a regression . My code was working and now he is not π
9 Replies
This doesn't appear to be an issue with Drizzle, but with your router
As the error says, the id property on
req.input
(which comes for your router) has the type of unknown
Yes i know it's clearly related to the understanding between the Zod schema and the router :
Screen 1 my schema
Screen 2 my Router describe the good Column
Screen 3 My Router using Input and Select Schema can't read any Serial or Boolean stuff from the schema .
Ps : My schema is stored in a private package in my monorepo but it doesn't seem to be a problem
And i think it's correlated with drizzle-zod because it's the createInsertSchema who can't read the serial and boolean
The z.Zod is undefined on Serial and Boolean
Hm, I see
Particularly weird is the id column being inferred as an enum
I think there may be an error in the column typings for Boolean and Serial since they donβt match the other column types, which seems to originate from a large refactor that significantly improved intellisense performance
I suggest filing an issue
Thanks for your answer i have created an issue
GitHub
[BUG]:Drizzle-zod:Boolean and Serial types from Schema are defined ...
What version of drizzle-orm are you using? 0.28.6 What version of drizzle-kit are you using? 0.19.13 Describe the Bug I've create a thread on Drizzle Discord in Help with details on it : https:...
holy moly no updates on this? really starting to get a bad taste with drizzle right now
even core features are buggy