Joined table filter includes null values

encountering a super odd case here:

I'm trying to check an equality across a referenced table.

My TS code is as follows, and I'll provide the table definitions in a moment:

const { data: { user } } = await supabase.auth.getUser();

// ... various checks, user will always be defined from here on

const { data: access, error: getAccessError } = await supabase
  .from("access_control_list")
  .select("staff_id(linked_user_id), role_id(*)")
  .eq("staff_id.linked_user_id", user.id)
  .maybeSingle()


The above query will return results where staff_id.linked_user_id is null, not strictly equal to user.id. I have had to specifically add .not("staff_id", "is", null) to the query chain to make it return only where linked_user_id equals the user's ID
Was this page helpful?