brick
brick copied to clipboard
Getting right a query with OR and nested AND
Hey peepz, I am using brick + supabase and I am trying to get a query to work and I can't:
I have a query of the type
SELECT *
FROM entityA
WHERE columnA != 'valueA'
OR (columnA IS NULL AND columnB = false)
I tried the following
WherePhrase _getCondition() {
return WherePhrase([
const Or('columnA').isNot('valueA'),
const WherePhrase([
Where.exact('columnA', null),
Where.exact('columnB', false),
]),
]);
}
And some similar variations.
Anyone has suggestions?