@@ -72,7 +72,7 @@ A simple case expression can be coded like the following in the Kotlin DSL:
72
72
73
73
``` kotlin
74
74
select(case(id) {
75
- `when `(1 , 2 , 3 ) { then( true ) }
75
+ `when `(1 , 2 , 3 ) then true
76
76
`else `(false )
77
77
} `as ` " small_id"
78
78
) {
@@ -91,7 +91,7 @@ you can write the query as follows:
91
91
92
92
``` kotlin
93
93
select(case(id) {
94
- `when `(1 , 2 , 3 ) { then( value(true )) }
94
+ `when `(1 , 2 , 3 ) then value(true )
95
95
`else `(value(false ))
96
96
} `as ` " small_id"
97
97
) {
@@ -111,7 +111,7 @@ expected data type. Here's an example of using the `cast` function:
111
111
112
112
``` kotlin
113
113
select(case(id) {
114
- `when `(1 , 2 , 3 ) { then( value(true )) }
114
+ `when `(1 , 2 , 3 ) then value(true )
115
115
`else `(cast { value(false ) `as ` " BOOLEAN" })
116
116
} `as ` " small_id"
117
117
) {
@@ -134,8 +134,8 @@ A simple case expression can be coded like the following in the Kotlin DSL:
134
134
135
135
``` kotlin
136
136
select(case(total_length) {
137
- `when `(isLessThan(10 )) { then( " small" ) }
138
- `when `(isGreaterThan(20 )) { then( " large" ) }
137
+ `when `(isLessThan(10 )) then " small"
138
+ `when `(isGreaterThan(20 )) then " large"
139
139
`else `(" medium" )
140
140
} `as ` " tshirt_size"
141
141
) {
@@ -158,8 +158,8 @@ VARCHAR, you can use the `cast` function as follows:
158
158
159
159
``` kotlin
160
160
select(case(total_length) {
161
- `when `(isLessThan(10 )) { then( " small" ) }
162
- `when `(isGreaterThan(20 )) { then( " large" ) }
161
+ `when `(isLessThan(10 )) then " small"
162
+ `when `(isGreaterThan(20 )) then " large"
163
163
`else `(cast { " medium" `as ` " VARCHAR(6)" })
164
164
} `as ` " tshirt_size"
165
165
) {
0 commit comments