Skip to content

Commit

Permalink
Update docs with new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgbutler committed May 1, 2024
1 parent 95713da commit 07cb132
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

This log will detail notable changes to MyBatis Dynamic SQL. Full details are available on the GitHub milestone pages.

## Release 1.5.1 - April 30, 2024
## Release 1.5.2 - Unreleased

This is a minor release with several enhancements.
This is a small maintenance release with improvements to the Kotlin DSL for CASE expressions.

**Important:** This is the last release that will be compatible with Java 8.

## Release 1.5.1 - April 30, 2024

This is a minor release with several enhancements.

GitHub milestone: [https://github.com/mybatis/mybatis-dynamic-sql/milestone/13?closed=1](https://github.com/mybatis/mybatis-dynamic-sql/milestone/13?closed=1)

### Case Expressions and Cast Function
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/docs/kotlinCaseExpressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ A simple case expression can be coded like the following in the Kotlin DSL:

```kotlin
select(case(id) {
`when`(1, 2, 3) { then(true) }
`when`(1, 2, 3) then true
`else`(false)
} `as` "small_id"
) {
Expand All @@ -91,7 +91,7 @@ you can write the query as follows:

```kotlin
select(case(id) {
`when`(1, 2, 3) { then(value(true)) }
`when`(1, 2, 3) then value(true)
`else`(value(false))
} `as` "small_id"
) {
Expand All @@ -111,7 +111,7 @@ expected data type. Here's an example of using the `cast` function:

```kotlin
select(case(id) {
`when`(1, 2, 3) { then(value(true)) }
`when`(1, 2, 3) then value(true)
`else`(cast { value(false) `as` "BOOLEAN" })
} `as` "small_id"
) {
Expand All @@ -134,8 +134,8 @@ A simple case expression can be coded like the following in the Kotlin DSL:

```kotlin
select(case(total_length) {
`when`(isLessThan(10)) { then("small") }
`when`(isGreaterThan(20)) { then("large") }
`when`(isLessThan(10)) then "small"
`when`(isGreaterThan(20)) then "large"
`else`("medium")
} `as` "tshirt_size"
) {
Expand All @@ -158,8 +158,8 @@ VARCHAR, you can use the `cast` function as follows:

```kotlin
select(case(total_length) {
`when`(isLessThan(10)) { then("small") }
`when`(isGreaterThan(20)) { then("large") }
`when`(isLessThan(10)) then "small"
`when`(isGreaterThan(20)) then "large"
`else`(cast { "medium" `as` "VARCHAR(6)" })
} `as` "tshirt_size"
) {
Expand Down

0 comments on commit 07cb132

Please sign in to comment.