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

Support Datetime function CURRENT_TIMESTAMP #646

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

progress0407
Copy link
Contributor

Motivation

  • JDSL doesn't support CURRENT_TIMESTAMP in JPQL

Modifications

  • Writing currentTimestamp() in Jpql, Expressions
  • Creating a JpqlCurrentTimestampSerializer
  • Add JpqlCurrentTimestampSerializer to JpqlRenderContext
  • Write the respective test code
  • Change FQCN for non-conventional code (*.jpql.JpqlLocalDateTimeDslTest -> *.expression.LocalDateTimeDslTest)

Commit Convention Rule

Commit type Description
feat New Feature
fix Fix bug
docs Documentation only changed
ci Change CI configuration
refactor Not a bug fix or add feature, just refactoring code
test Add Test case or fix wrong test case
style Only change the code style(ex. white-space, formatting)
chore It refers to minor tasks such as library version upgrade, typo correction, etc.
  • If you want to add some more commit type please describe it on the Pull Request

Result

  • Now supports CURRENT_TIMESTAMP.

Closes

Copy link
Member

@shouwn shouwn left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@@ -745,6 +746,16 @@ open class Jpql : JpqlDsl {
return Expressions.currentTime()
}

/**
* Creates an expression that represents the current timestamp(datetime).
Copy link
Member

Choose a reason for hiding this comment

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

The datetime and timestamp may be different in different contexts. For example, to a MySQL user, datetime and timestamp will look like separate types.

I don't think the Kotlin JDSL needs to interpret them separately and guide the user to datetime.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't find any other issues, so I'll fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! Thanks, I also noticed that timestamp didn't seem to include time, so you're right!
Thanks for letting me know, that's helpful haha

@shouwn shouwn merged commit ffb8cf6 into line:develop Feb 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants