SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0265 — Optional produce inputs travel in a ProduceOptions struct, not positional strings

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. Compaction added a second optional per-message input (CompactionKey) alongside the existing routing key, and positional optional strings do not scale or self-document at call sites.

Decision. ProduceOptions{RoutingKey, CompactionKey string} — a sparse struct threaded through ProduceAppendMessageappendMessage’s INSERT — matching the codebase’s existing *Config convention for optional parameters.

Consequences. Future optional produce inputs extend the struct without breaking call sites; zero-value fields mean “not set” (NULL compaction_key = not compacted). Rejected: positional string parameters — ambiguous at call sites and breaking on every addition.