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 Kotlin CASE DSL #785

Merged
merged 5 commits into from
May 1, 2024

Conversation

jeffgbutler
Copy link
Member

This PR changes the "else" and "then" functions to infix. In addition, we simplify "then" functions in the simple CASE expression.

Previously...

select(case(id) {
    `when`(1, 2, 3) { then(true) }
    `else`(false)
  } `as` "small_id"
) {
    from(foo)
}

Now...

select(case(id) {
    `when`(1, 2, 3) then true
    `else`(false)
  } `as` "small_id"
) {
    from(foo)
}

Infix not as useful in this case because using it requires an explicit "this", but some might prefer that syntax.
@jeffgbutler jeffgbutler added this to the 1.5.2 milestone May 1, 2024
@coveralls
Copy link

coveralls commented May 1, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling 15d258e on jeffgbutler:improve-kotlin-case-dsl
into ecf4bc3 on mybatis:master.

@jeffgbutler jeffgbutler merged commit e8f1890 into mybatis:master May 1, 2024
5 of 6 checks passed
@jeffgbutler jeffgbutler deleted the improve-kotlin-case-dsl branch May 1, 2024 14:24
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