Switch to JSR 310 Date and Time API#233
Conversation
|
Getting following in CI build.. :/ |
|
Hi, thanks for the PR! |
|
I could try to have Joda Time supported as well. But the thing is, do we really want to continue supporting it? |
|
Bump version to 2.0.0 sounds reasonable to me. |
a6c447a to
6ea3c8f
Compare
|
Note that some tests are still failing on CI. |
|
I fixed most. Just having issues understanding logic behind can you help, @oshai ? |
I didn't wrote it originally, but from reading the code I think it checks the following:
There might be a problem either with the timezone or the millis if I have to guess. |
|
I noticed something, postgres is returning timestamps in UTC string, even when I insert it with non UTC offset. |
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
============================================
+ Coverage 80.03% 80.17% +0.14%
- Complexity 1074 1079 +5
============================================
Files 265 266 +1
Lines 3916 3919 +3
Branches 522 523 +1
============================================
+ Hits 3134 3142 +8
+ Misses 534 531 -3
+ Partials 248 246 -2
Continue to review full report at Codecov.
|
- Removes joda from encoding/decoding - Using Threeten for PeriodDuration
According to https://www.postgresql.org/docs/9.1/datatype-datetime.html 8.5.2. Date/Time Output: Conversion on test makes sense (to see it's the same date as inserted). It's just not clear how this was changed from pervious impl. I still need to review all changes, but it will take some time. |
oshai
left a comment
There was a problem hiding this comment.
Thanks again for the PR.
I left some comments in code and have some more general things:
- I saw that in some cases there is no test coverage: do you think it's an issue with the framework, or can you please add tests to cover those cases?
- I saw in many places move from millis to nano. Is it because java 8 uses nano and joda/db use millis?
About the migration to 2.x: I am thinking if we can add a suggestion to users how to do that more easily? Do you have any suggestion?
db-async-common/src/main/java/com/github/jasync/sql/db/column/LocalDateTimeEncoderDecoder.kt
Outdated
Show resolved
Hide resolved
mysql-async/src/main/java/com/github/jasync/sql/db/mysql/binary/encoder/DateTimeEncoder.kt
Show resolved
Hide resolved
| created_at_date DATE not null, | ||
| created_at_datetime DATETIME not null, | ||
| created_at_timestamp TIMESTAMP not null, | ||
| created_at_datetime DATETIME(6) not null, |
Can you point me to which cases are you talking about specifically?
Yes. Java uses nano, joda uses millis, db micro(at least in mysql) |
Look at LocalDateTimeEncoderDecoder:17 and see more examples in 'files changed' with the warning: |
|
@dragneelfps before merging there was still one answered question in the review about In addition, will you have some time to improve test coverage? |
|
Stale pull request message |
|
I will merge this PR soon. Will create 1.x branch before that. |
|
Thanks for the PR! |
Removes joda from encoding/decoding
common
mysql
postgres
continuation of #229