postgrest-js
postgrest-js copied to clipboard
!inner should make the relation non-nullable
Describe the bug
When a relation has the !inner
hint, the relationship can be considered to always exist due to the embedded resource being included as an inner join. Therefore, null
can be dropped from the result type union.
To Reproduce
const test = supabase().from("people").select("id, site:sites!inner(name)").then(r => r.data);
/* type:
{
id: string;
site: {
name: string | null;
} | null;
}
*/
Expected behavior
const test = supabase().from("people").select("id, site:sites!inner(name)").then(r => r.data);
/* type:
{
id: string;
site: {
name: string | null;
};
}
*/