supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
745 stars 184 forks source link

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

Open academix-admin opened 1 month ago

academix-admin commented 1 month ago

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>;