Replies: 1 comment
-
Yes, all data is stringified to JSON to save into postgres. I don't work with zod very much, but it sounds like z.coerce.date() or z.string().datetime() might be fine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @timgit ,
I'm sending an event with a date into its data, but when retrieved I get them stringified.
I do understand it's stringified into the database due to JSON not having a "Date" type. But did I miss something so your library parses the event data dates since "Date" is kind of a primitive type?
If not, what do you suggest (I'm using
zod
to validate the data so I plan to go withz.coerce.date()
instead ofz.date()
to force conversion)? Maybe a documentation warning is worth it?Thank you,
Beta Was this translation helpful? Give feedback.
All reactions