Skip to content

Cross-table filtering in or() is not supported in query builder #1069

Open
@academix-admin

Description

@academix-admin

The current Supabase Dart/Flutter query builder does not support cross-table filtering inside an .or() clause when using joins. For example, in a query like:

Query: 1
.or('<tableA>.<columnA>.<eq>.<valueA>, <tableB>.<columnB>.<eq>.<valueB>')

Query: 2
.or(<columnA>.<eq>.<valueA>, <tableB>.<columnB>.<eq>.<valueB>',referencedTable: <tableA>)

Throws an Error: code: PGRST100

As supposed on sql query:
SELECT * FROM tableA AS a LEFT JOIN tableB AS b ON a.columnA1 = b.columnB1 WHERE a.columnA2 = <valueA> OR b.columnB2 = <valueB>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpostgrestThis issue or pull request is related to postgrest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions