-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix sqlite timestamps #3694
Fix sqlite timestamps #3694
Conversation
81e0974
to
151eac8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR. I've left a bunch of questions and notes for minor improvements. Beside of that I want to clarify an important point: You consider that a minor change, as it does only strictly extend which time formats are parsed and does not error out on formats that worked before?
Additionally I would like to see a few tests for time<->chrono roundtrips just to make sure that they stay consistent in the future.
e9b36ea
to
6e1ce7c
Compare
@weiznich This is ready for another round of review, I changed a bit the encoding. I realized we didn't need the differentiation for I am still unsure how many digits we should really print, PG and Mysql cut at the microseconds but sqlite by default stops at the millisecond with The case for printing they all is quite simple, it's still respecting the RFC3339 and the user can decide to not pass us the microseconds/nanoseconds if they don't want them in the database but the inverse (stopping at X digits) means we decide what loss of information is acceptable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update and sorry for taking so long to do the review.
I think it's mostly fine now. I would like to change the comments to doc-comments as suggested my @Mingun
I also would like to actually check the values in the compatibility tests to ensure that we load the right thing there.
@weiznich Ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
…sing Fix sqlite timestamps
Fixes #3693
Fixes #3320
This is a big change in the way we store and parse timestamp in sqlite.
1970-01-01 00:00+01:00
is not the same time as1970-01-01 00:00Z
in my book. We still ignore the timezone if the user uses a "naive" datetime to read the data (I think that is fair, though we could verify with other ORM if they correct to UTC instead).