Skip to main content

max / makenotwork

Expose SyncTable::name and emitted_columns for manifest diffing Consumers migrating to SyncStore need to diff a declared SyncSchema against their existing column whitelist. GoingsOn's Groups p4 M1 uses this to assert its manifest reproduces the hand-written trigger columns exactly before any cutover. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-23 21:19 UTC
Commit: bb27bf4929c6bb775e04aed6a78fea7bdc6ed7f1
Parent: 24c51b5
1 file changed, +9 insertions, -2 deletions
@@ -87,6 +87,11 @@ pub struct SyncTable {
87 87 }
88 88
89 89 impl SyncTable {
90 + /// The table's name.
91 + pub fn name(&self) -> &'static str {
92 + self.name
93 + }
94 +
90 95 /// A table with the common defaults: single `id` primary key, cleartext
91 96 /// wire row-id, `Full` upsert, `Hard` delete, no preserved columns, no insert
92 97 /// defaults, closed referential integrity, no row exclusion.
@@ -184,8 +189,10 @@ impl SyncTable {
184 189
185 190 /// The columns emitted into `sync_changelog.data` for an INSERT/UPDATE:
186 191 /// every whitelisted column for `Full`, or the primary key plus the `set`
187 - /// columns (deduped, PK first) for `PartialUpdate`.
188 - pub(crate) fn emitted_columns(&self) -> Vec<&'static str> {
192 + /// columns (deduped, PK first) for `PartialUpdate`. Public so a consumer can
193 + /// diff a declared manifest against its own legacy column whitelist (the
194 + /// GoingsOn M1 migration check).
195 + pub fn emitted_columns(&self) -> Vec<&'static str> {
189 196 match &self.mode {
190 197 SyncMode::Full => self.columns.to_vec(),
191 198 SyncMode::PartialUpdate { set } => {