[WIP] Add DSL for datetime/duration #1635
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
This PR is intended to add a DSL for the various DateTime/Duration functions in Postgres. The intention is to allow you do things like
where
now()
translates to the postgresnow()
function and the5.minutes
translates to postgresInterval
type.Solution
TBD
Notes
Since
Encoder
/Decoder
forLocalDate
is already defined in the baseEncoders.scala
andDecoders.scala
JDBC files, we override it our custom Postgres datetimeEncoder
/Decoder
. While there is an argument that this is pointless and we should just not include the theseEncoder
's/Decoder
's which are already defined, the Postgres JDBC converters are both faster and is what is official supported for use when using Postgres JDBC.Also since we are adding capability for the datetime types provided by JSR-310 this effectively means that quill will only support JVM versions 1.8+ effective of this PR. I don't know how much of an issue this is, however note that JVM 1.6 is already out of EOL support from Oracle. The only area I could practically see this being a problem is if someone is using Quill on Android (is anyone doing this?)
Checklist
README.md
if applicable[WIP]
to the pull request title if it's work in progresssbt scalariformFormat test:scalariformFormat
to make sure that the source files are formatted@getquill/maintainers