-
-
Notifications
You must be signed in to change notification settings - Fork 138
Switch to JSR 310 Date and Time API #233
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
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 jasync-sql/postgresql-async/src/test/java/com/github/aysnc/sql/db/integration/TimeAndDateSpec.kt Line 151 in 152cdef
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. |
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 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
@@ -66,8 +66,8 @@ open class ConnectionHelper : ContainerHelper() { | |||
"""CREATE TEMPORARY TABLE posts ( | |||
id INT NOT NULL AUTO_INCREMENT, | |||
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, |
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.
why was it changed?
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