Hey! I've got a small problem when trying to query for null values using brick with Supabase.
Summary
When querying for NULL values using Where('field', value: null), Brick generates invalid PostgREST syntax (eq.null) instead of the correct is.null syntax required by PostgREST. This will cause it to check for string equality instead of null value of the column.
Proposed Fix
Could we possibly do something like (In packages/brick_supabase/lib/src/query_supabase_transformer.dart line ~193)
String qk;
// Magic condition to convert null values
if (condition.value == null) {
qk = condition.compare == Compare.notEqual ? 'not.is.null' : 'is.null';
} else if (condition.compare == Compare.inIterable && condition.value is Iterable) {
qk = 'in.(${(condition.value as Iterable).join(',')})';
} else {
qk = '${_compareToSearchParam(condition.compare)}.${condition.value}';
}
return [
{
queryKey: qk,
},
Or maybe I have missed something and that's intended behaviour ?
Hey! I've got a small problem when trying to query for null values using brick with Supabase.
Summary
When querying for NULL values using
Where('field', value: null), Brick generates invalid PostgREST syntax (eq.null) instead of the correctis.nullsyntax required by PostgREST. This will cause it to check for string equality instead of null value of the column.Proposed Fix
Could we possibly do something like (In
packages/brick_supabase/lib/src/query_supabase_transformer.dartline ~193)Or maybe I have missed something and that's intended behaviour ?