Skip to main content

max / makenotwork

server: correct enum VARIANTS doc to match drift-test coverage The VARIANTS doc no longer claims the enum-drift test covers every backing column; coverage is the test's explicit registry, not every enum automatically. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-05 15:50 UTC
Commit: 8d6f457628f68e22fe85b899b26401defae9ad49
Parent: f58201d
1 file changed, +9 insertions, -6 deletions
@@ -82,12 +82,15 @@ macro_rules! impl_str_enum {
82 82 }
83 83
84 84 impl $enum_name {
85 - /// Every wire/DB string this enum maps to. The single source of truth
86 - /// for the variant set; the enum-drift test asserts it equals the
87 - /// Postgres `CHECK (... IN (...))` list for each backing column, so a
88 - /// variant added here without widening the DB constraint (or vice
89 - /// versa) fails at test time instead of at the first read of a
90 - /// poisoned row.
85 + /// Every wire/DB string this enum maps to — the single source of
86 + /// truth for the variant set. For each enum *registered* in the
87 + /// enum-drift integration test (`tests/workflows/enum_drift.rs`),
88 + /// this set is asserted equal to the Postgres `CHECK (... IN (...))`
89 + /// list on its backing column, so a variant added here without
90 + /// widening the DB constraint (or vice versa) fails at test time
91 + /// rather than at the first read of a poisoned row. Coverage is that
92 + /// registry, not every enum automatically: add a `(enum, table,
93 + /// column)` row there when a new CHECK-constrained column lands.
91 94 pub const VARIANTS: &'static [&'static str] = &[$($str),+];
92 95 }
93 96 };