Write pipeline for POST / PATCH / PUT / DELETE on a relation.
Mirrors PostgREST's mutation semantics:
POST—INSERT ... RETURNING, optionallyON CONFLICTfor upsert (Prefer: resolution=merge-duplicates|ignore-duplicates,?on_conflict=).PATCH—UPDATE ... WHERE <filters> RETURNING, honoring the request's column filters.DELETE—DELETE ... WHERE <filters> RETURNING.PUT— single-row upsert keyed by the request's PK filter (INSERT ... ON CONFLICT (<pk>) DO UPDATE).
Row values arrive as a JSON payload and are expanded into typed columns
through Postgres' jsonb_array_elements (one bound jsonb parameter), so a
string like "{1,2,3}" coerces to integer[] exactly as PostgREST does;
user data is never interpolated. The ?columns= param selects which payload
keys become target columns (others are ignored); Prefer: missing=default
fills the column DEFAULT for keys a row omits.
The Prefer: return= token selects the response shape; Preference-Applied
echoes the honored tokens in PostgREST's canonical order.
Summary
Functions
Handle a mutation request after media negotiation.