max / makenotwork
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 } => { |