-
-
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]: timestamp with mode string is returned as Date object instead of string #806
Comments
Hey @noskovvkirill new here wanted to start contributing, so wanted to pick this up! Also it would be fine if I asked for a little guidance if I ever get stuck? 😅 |
@frostzt sure! let me know how I can help |
@noskovvkirill, I've run into this issue too. Could you clarify the title and change it to: "[BUG]: timestamp with mode string is returned as Date object instead of string"? The current title makes it seem like it's only a TS issue. This is a runtime issue though. |
@bestickley good suggestion! I did that! |
I'm actually seeing the opposite of this!
^ this is returning an ISO string instead of a date object which doesn't match the expected I'm wondering if this has something to do with the Planetscale serverless driver... |
My temporary workaround is to use the connection library (postgre.js for me) to transform the dates. See example below of what I'm adding to my transform: {
value(value) {
if (value instanceof Date) {
return value.toISOString();
} else {
return value;
}
},
}, |
I have the exact same bug.... |
I have the same problem as well. The workaround from @bestickley is working, but a fix for this would be nice. |
I ran into this same issue - |
Should be fixed in I plan to release it in version |
Fixed in Please check release notes for more info |
What version of
drizzle-orm
are you using?0.27.0
What version of
drizzle-kit
are you using?0.19.2
Describe the Bug
timestamps aren't being inferred as string
Table Schema that we use
Query
Returns createdAt as a date object instead of string.
Expected behavior
Returns createdAt as string
Environment & setup
Vercel / Serverless function
The text was updated successfully, but these errors were encountered: