Closed xxRockOnxx closed 1 year ago
Do you have a repro case where it's not making columns optional? The typegen should be making Relation['Update']
columns optional, e.g.:
@soedirgo the typegen on my end was wrong. i had to update some columns/properties manually and made a mistake. closing this now.
on a related note, is there a way to have typgen make some columns as never
? e.g created_at
or user_id
just so we could avoid this kind of rookie mistake due to manual editing.
The types reflect the database, so if you make the column generated always, it'll be typed as never
. E.g.:
create table my_table (created_at timestamptz generated always as (now()) stored);
Bug report
Describe the bug
Context: https://github.com/supabase/postgrest-js/blob/v1.0.0/src/PostgrestQueryBuilder.ts#L248
When updating, it currently asks for the whole columns.
Looking at the source, there's a
PATCH
request which I assume updates only what's given to it.I could submit a PR adding
Partial<>
on it if it should be.To Reproduce
Expected behavior
Allow specific column to be updated
Screenshots
None
System information
Additional context
None