postgrest-js
postgrest-js copied to clipboard
Seems like the types for many to many relationships are not working in v2
Consider following generated types:
export interface Database {
public: {
Tables: {
users_skills: {
Row: {
user_id: string;
skill_id: number;
};
};
users: {
Row: {
id: string;
created_at: string;
name: string | null;
};
};
skills: {
Row: {
id: number;
created_at: string;
name: string;
};
};
};
};
}
when I try to supabase.from("users").select("*,skills(*)")
I get
{
id: string;
created_at: string;
name: string | null;
} & {
skills: unknown;
}
I tried some things from the postgrest docs but nothing is working. Am I doing something wrong or is this inference not ready yet?
Hey there, typings for embedded tables is still a WIP, but we have a PR that allows you to override the return type.
Thanks @soedirgo. I'll be waiting then :)