-
Notifications
You must be signed in to change notification settings - Fork 0
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
postgres timestamp precision vs javascript timestamp precision #5
Comments
we can not use the "loss-of-information" option because for high speed writes we do need the so that option is out, leaving us with only:
|
i guess the other option is to require usage of a more precise date class:
and then the sql-dao-generator can just ban using |
would date-fns work with that option though? ^ |
looks like it would not: https://www.reddit.com/r/javascript/comments/ff76xr/askjs_are_there_any_js_datetime_formatting/ may need to create a library that lets javascript work with microsecond precision timestamps 🤔 maybe we can extend the normal Date fn w/ an added field of microseconds 🤔 or maybe we can wrap that rust package like that thread recommended |
🎉 - instead of making our own - we should be able to use |
node.js Date() -> precision of milliseconds
postgres timestamps -> precision of microseconds
and when we're saying "record.created_at <= ${record.createdAt.toISOString()}" we are loosing the extra precision
record.created_at <= record.createdAt
=>12:30:21.123456 <= 12:30:21.123000
=> falsethis is a non intuitive bug that will crop up over and over due to the difference in precision.
our options are to:
The text was updated successfully, but these errors were encountered: