Skip to content
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

Improve Java time meta experience #1789

Merged
merged 4 commits into from
Jan 11, 2024
Merged

Conversation

guymers
Copy link
Contributor

@guymers guymers commented Dec 21, 2022

Provide Java time meta instances without requiring any imports. These instances follow the JDBC specification and map a single column type to a java.time class.

Any instances for ZonedDateTime have been removed. Storing one requires the LocalDateTime and ZoneId to be stored, it cannot safely be put into an OffsetDateTime.

Provide Java time meta instances without requiring any imports. These
instances follow the JDBC specification and map a single column type to
a java.time class.

The Postgres specific instances have been updated to match exactly what
the driver allows but the default instances should really be used
instead.

Any instances for `ZonedDateTime` have been removed. Storing one
requires the `LocalDateTime` and `ZoneId` to be stored, it cannot safely
be put into an `OffsetDateTime`.
Copy link
Contributor

@sideeffffect sideeffffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Nice work 🙇

@jatcwang
Copy link
Collaborator

Thanks for the PR. I'll need to double check that this works for MySQL too (though we don't official support it I'd like to avoid breaking any of their typecheck tests)

Specifically from my reading, in MySQL their TIMESTAMP type works equivalently to PostgreSQL's TIMESTAMPTZ when it comes to JDBC behaviour (Semantically a "instant in time" and supports mapping to OffsetDateTime in the JDBC driver)

@guymers
Copy link
Contributor Author

guymers commented Dec 25, 2022

Here's some MySQL time instances #1791.

Note that I have never used MySQL.

@jatcwang jatcwang added this to the 1.0 milestone Jan 7, 2024
# Conflicts:
#	modules/core/src/main/scala/doobie/package.scala
@jatcwang jatcwang merged commit 370c680 into typelevel:main Jan 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants