Skip to content

Getting right a query with OR and nested AND #658

@stefanorumi7

Description

@stefanorumi7

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions