I re-issued this pull request as improvements were made to allow Expression in dateAdd and dateSub (to use columns or literal values) in the arithmetic.
Dependencies
This feature does require the GeneralFunctionExpression implementation from my previous pull request, though could be reworked easily as necessary. Merging this essentially means merging that request as well. I'm happy to resubmit this request later after the previous one is pulled if that makes the history cleaner / clearer.
Description
Adds support for the following MySQL specific functions:
date()
year()
month()
day()
dayOfMonth()
dayOfWeek()
weekDay()
dayOfYear()
dateAdd()
dateSub()
Most database have very similar functions that could be quickly implemented using this as an example. This does also include a basic implementation of MySQL's INTERVAL syntax and values, using Java's ChronoUnit to generically translate. There are additional, more unique definitions for these for combined units (ex: MINUTE_SECOND), that could be added in the future as well. See: MySQL Temporal Intervals
Note
I re-issued this pull request as improvements were made to allow Expression in dateAdd and dateSub (to use columns or literal values) in the arithmetic.
Dependencies
This feature does require the
GeneralFunctionExpression
implementation from my previous pull request, though could be reworked easily as necessary. Merging this essentially means merging that request as well. I'm happy to resubmit this request later after the previous one is pulled if that makes the history cleaner / clearer.Description
Adds support for the following MySQL specific functions:
Most database have very similar functions that could be quickly implemented using this as an example. This does also include a basic implementation of MySQL's
INTERVAL
syntax and values, using Java'sChronoUnit
to generically translate. There are additional, more unique definitions for these for combined units (ex: MINUTE_SECOND), that could be added in the future as well. See: MySQL Temporal Intervals