is there any way to perform a query that returns 1 or 0, but parse it as boolean in the generated model ?
b
Benoit Quenaudon
09/10/2021, 4:31 PM
define the field as "INTEGER AS BOOL" and all the query will use booleans
m
myanmarking
09/11/2021, 8:25 AM
i’m not talking about table definition, that it works. I’m talking about the result of a query, not directly associated with the boolean column. And that result is an int, but i want to parses to think it as a boolean. The real question probably, you cannot use ‘AS BOOL’ in queries can you ?
myanmarking
09/11/2021, 8:26 AM
SELECT 1 AS BOOL (thats what i was asking). Because i know if you do ‘SELECT boolColumns FROM xxxx’ it works
a
Alex Nabrozidis
09/14/2021, 9:50 AM
does it work if you do
SELECT integerColumn = 1 FROM ...
?
Alex Nabrozidis
09/14/2021, 9:50 AM
I've used
COUNT(*) > 0
in the past and it worked as expected (returns a boolean)