Skip to content

fix(postgrest): unify insert/upsert signatures - #2297

Merged
mandarini merged 1 commit into
developfrom
fix/postgrest-collapse-insert-upsert-overloads
Apr 30, 2026
Merged

mandarini merged 1 commit into
developfrom
fix/postgrest-collapse-insert-upsert-overloads

Conversation

@mandarini

Copy link
Copy Markdown
Contributor

The two public overloads on insert() and upsert() forced TypeScript into overload resolution, which produces "No overload matches this call" on type mismatches and highlights the entire call site. Collapsing them into the implementation's unified signature lets TS report property-level errors (e.g. "Type 'string' is not assignable to type 'never'") that point at the actual bad field.

No runtime change, the implementation already accepted single | array. defaultToNull on single-row insert/upsert is now a typed no-op, matching existing runtime behavior.

Closes #1652

@mandarini
mandarini requested review from a team as code owners April 28, 2026 09:58
@github-actions github-actions Bot added the postgrest-js Related to the postgrest-js library. label Apr 28, 2026
@mandarini
mandarini requested a review from steve-chavez April 28, 2026 09:58
@pkg-pr-new

pkg-pr-new Bot commented Apr 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2297

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2297

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2297

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2297

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2297

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2297

commit: d5badbc

grdsdev
grdsdev previously approved these changes Apr 28, 2026
steve-chavez
steve-chavez previously approved these changes Apr 28, 2026
@mandarini
mandarini dismissed stale reviews from steve-chavez and grdsdev via d5badbc April 29, 2026 13:42
@mandarini
mandarini force-pushed the fix/postgrest-collapse-insert-upsert-overloads branch from d54d903 to d5badbc Compare April 29, 2026 13:42
@mandarini
mandarini merged commit f8d914e into develop Apr 30, 2026
24 checks passed
@mandarini
mandarini deleted the fix/postgrest-collapse-insert-upsert-overloads branch April 30, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

postgrest-js Related to the postgrest-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error reporting on insert/upsert calls

3 participants