@@ -11,7 +11,7 @@ A simple case expression checks the values of a single column. It looks like thi
11
11
12
12
``` sql
13
13
select case id
14
- when 1 , 2 , 3 then true
14
+ when 1 , 2 , 3 then true
15
15
else false
16
16
end as small_id
17
17
from foo
@@ -32,8 +32,8 @@ A searched case expression allows arbitrary logic, and it can check the values o
32
32
33
33
``` sql
34
34
select case
35
- when animal_name = ' Small brown bat' or animal_name = ' Large brown bat' then ' Bat'
36
- when animal_name = ' Artic fox' or animal_name = ' Red fox' then ' Fox'
35
+ when animal_name = ' Small brown bat' or animal_name = ' Large brown bat' then ' Bat'
36
+ when animal_name = ' Artic fox' or animal_name = ' Red fox' then ' Fox'
37
37
else ' Other'
38
38
end as animal_type
39
39
from foo
@@ -44,7 +44,7 @@ from foo
44
44
The library will always render the "when" part of a case expression using bind variables. Rendering of the "then" and
45
45
"else" parts of a case expression may or may not use bind variables depending on how you write the query. In general,
46
46
the library will render "then" and "else" as constants - meaning not using bind variables. If you wish to use bind
47
- variables for these parts of a case expressions, then you can use the ` value ` function to turn a constant into a
47
+ variables for these parts of a case expressions, then you can use the ` value ` function to turn a constant into a
48
48
bind variable. We will show examples of the different renderings in the following sections.
49
49
50
50
If you choose to use bind variables for all "then" and "else" values, it is highly likely that the database will
@@ -186,8 +186,8 @@ statement - so avoid the use of conditions like "isEqualToWhenPresent", etc.
186
186
The rendered SQL will be as follows (without the line breaks):
187
187
``` sql
188
188
select case
189
- when animal_name = ? or animal_name = ? then ' Bat'
190
- when animal_name = ? or animal_name = ? then ' Fox'
189
+ when animal_name = ? or animal_name = ? then ' Bat'
190
+ when animal_name = ? or animal_name = ? then ' Fox'
191
191
else ' Other'
192
192
end as animal_type
193
193
from foo
0 commit comments