Bug report
Describe the bug
For nullable columns, even if the query includes a not null check (e.g. .not("column_name", "is", null)), the inferred return type for that column is still nullable.
To Reproduce
- Create a
blog_posts table with a nullable column, published_at.
create table blog_posts(
id uuid primary key default uuid_generate_v4(),
title text not null,
created_at timestamptz not null default now(),
published_at timestamptz
);
- Query this table to retrieve all published blog posts.
const { data } = await supabase
.from("blog_posts")
.select("*")
.not("published_at", "is", null);
- Observe that the
published_at field in data is still typed as nullable.
const data: {
id: string;
title: string;
created_at: string;
published_at: string | null; // <-- why is this nullable?
}[] | null
Expected behavior
Inferred type for published_at should not be nullable.
System information
- Version of supabase-js: 2.48.0
Bug report
Describe the bug
For nullable columns, even if the query includes a not null check (e.g.
.not("column_name", "is", null)), the inferred return type for that column is still nullable.To Reproduce
blog_poststable with a nullable column,published_at.published_atfield indatais still typed as nullable.Expected behavior
Inferred type for
published_atshould not be nullable.System information