Skip to content

Add date functions such as YEAR, MONTH, and DAY to Statement #360

@takapi327

Description

@takapi327

Is your feature request related to a problem? Please describe.

MySQL has many date-related date functions such as YEAR, MONTH, and DAY.

https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

If you use Query Builder, you cannot use these functions because they are not supported.

The functions will be supported sequentially to make them more user-friendly.

Describe the solution you'd like

The following implementation can be used with both SELECT and WHERE STATEMENT.

userTable.select { user =>
  YEAR(user.birthDate) *: MONTH(user.birthDate) *: DAY(user.birthDate)
}.where(user => YEAR(user.birthDate) === 7).statement
// SELECT YEAR(birth_date), MONTH(birth_date), DAY(birth_date) FROM user WHERE YEAR(birth_date) = 7

Metadata

Metadata

Assignees

Labels

project:queryBuilderAddition and modification of functionality to Query Builder projectsproject:schemaAddition and modification of functionality to Schema projectsproject:statementAddition and modification of functionality to Statement projects🚀 featureNew feature

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions