-
-
Notifications
You must be signed in to change notification settings - Fork 788
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]: Wrong data type for postgres date colum #1407
Comments
I'm hitting this bug. I ended up doing:
|
I've had the same issue, specifying birthDate: date('birth_date', { mode: 'date' }), This doesn't change the behaviour, but fixes the incorrect type. Using |
@Angelelz this should be fixed as well right ? |
Give it a try in the beta tag and let me know |
Hi @Angelelz, |
Should be fixed in I plan to release it in version |
I tried it and it is fixed. |
Fixed in Please check release notes for more info |
What version of
drizzle-orm
are you using?0.27.2
What version of
drizzle-kit
are you using?0.19.9
Describe the Bug
Hey,
First of all, we'd like to express our enthusiasm for using Drizzle - it's an awesome tool. However, we have encountered a bug that requires attention.
We created a pgTable with a date column in TypeScript, as shown below:
The issue we've encountered is that TypeScript is reporting an unexpected data type. It expects a string but receives a date in the result. For instance:
Expected behavior
I would expect either a string like '2023-01-01' or the proper Date-type in the infered model
Environment & setup
We are using:
"node": "18.14.0",
"pnpm": "8.6.0",
"drizzle-orm": "0.27.2".
"drizzle-kit": "0.19.9"
The text was updated successfully, but these errors were encountered: