DT
Drizzle Teamβ€’16mo ago
0xMazout

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 πŸ™‚
No description
No description
9 Replies
Luxaritas
Luxaritasβ€’16mo ago
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
0xMazout
0xMazoutOPβ€’16mo ago
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
No description
No description
No description
0xMazout
0xMazoutOPβ€’16mo ago
And i think it's correlated with drizzle-zod because it's the createInsertSchema who can't read the serial and boolean
0xMazout
0xMazoutOPβ€’16mo ago
The z.Zod is undefined on Serial and Boolean
No description
Luxaritas
Luxaritasβ€’16mo ago
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
0xMazout
0xMazoutOPβ€’15mo ago
Thanks for your answer i have created an issue
0xMazout
0xMazoutOPβ€’15mo ago
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:...
shreddish
shreddishβ€’11mo ago
holy moly no updates on this? really starting to get a bad taste with drizzle right now
Rakib
Rakibβ€’8mo ago
even core features are buggy
Want results from more Discord servers?
Add your server