Skip to content

StreamOperation

StreamOperation = "upsert" | "delete"

Defined in: packages/contracts/src/stream-envelope.ts:29

The engine’s complete shape-stream vocabulary — two verbs, not four.

insert/update are the input side: what the replication ingestor parses out of Postgres. They never reach a shape stream. Every row the engine emits goes out as upsert (output.rs translate_output/agg_envelope) and every eviction as key-only delete (translate_output/delete_envelopes) — the engine states the row’s new value rather than claiming anything about what preceded it, because a shape row can enter a subscriber’s view for reasons that are not a Postgres INSERT (a subquery flip, a scope grant, a backfill replay).

Listing the input verbs here as if they might arrive is what produced a dead "update" branch in the translator and a comment asserting upsert was backfill-only. Both were wrong.