maybe I am blind, but I cannot create this where c...
# exposed
g
maybe I am blind, but I cannot create this where condition:
Copy code
WHERE id = <some value> AND (type = 0 OR type is null)
I tried:
Copy code
.select { id eq <some value> }
.andWhere { (type eq 0) or (type.isNull() }
However, the last statement gives an error:
Copy code
Type mismatch.
Required: Op<Boolean>
Found:    Unit
Can anyone help please? Thank you very much
d
Can you try
Copy code
.select { id eq <someValue> }
.andWhere { Op.Build { (type eq 0) or (type.isNull()) } }
?
g
Thank you, that worked. Interestingly, when I remove the
Op.build
again, the error was gone. Maybe, IntelliJ imported a wrong
or
function. Now the following code is fine:
Copy code
.select { id eq <somevalue> }
.andWhere { (type eq 0) or (type.isNull()) }
👍 2