-
-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: drizzle-zod type doesn't return z.ZodDate for dataType date
#3740
Comments
I think this is correct, isnt it? I dont know exactly about MySQL but I know for example that in PostgreSQL a number will always be a string because this is the most accurate way to save decimals. I imagine a timestamp will also return a string and not an actual date object. |
You're partially correct, it is stored as a string in the database, however the You can also see this being done in the exact same way during runtime: column.ts#L92 |
@nemanjastanic Can you provide the full definition for the table alongside exactly how you've defined the schema? Unable to reproduce with the sample code you provided. |
Hey @L-Mario564, I just retried this, it seems it's caused by #3732. I missed this previously because I managed to suppress the error by adding Please feel free to close this issue if you want to consider it a duplicate! |
@nemanjastanic Will close this in favor of the one you mentioned. Thanks. |
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.38.0
What version of
drizzle-kit
are you using?0.30.0
Other packages
[email protected]
Describe the Bug
In the example above, the returned type for
createdAt
isz.ZodString
instead ofz.ZodDate
, regardless of thedataType
.I should mention that everything is correct during runtime, the issue is only in the types.
It used to work in [email protected]
The text was updated successfully, but these errors were encountered: