pub enum TableDisposition {
Subject,
Derived {
trigger_maintained: bool,
},
DerivedRowidMap,
Appended,
History,
ConsumerWatermark,
RefusedBySchema,
NamespaceScopedAggregate,
SubjectKeyed {
subject_column: &'static str,
},
}Expand description
What a move does with one namespace-bearing table.
This is the half of the design that cannot be derived, because it is a statement about meaning rather than about schema. The census answers which tables carry the column; only a reader of the code can say whether a row in one of them is a subject that moves, a projection that follows, an append-only record of something that already happened, or an aggregate that cannot be split. So the list is written down — and the guard is that a table the census finds and this function does not name is a REFUSAL, not a default.
Variants§
Subject
Rows the caller routes by subject class.
Derived
A projection rebuilt from its subject, never routed on its own.
Split two ways on purpose. fts_knowledge and fts_sections are
maintained by triggers that fire on UPDATE OF ... namespace
(sql/026-knowledge-fts-repair.sql:49 and
sql/002-narrow-fts-sections-update-trigger.sql:10), so writing the base
row carries them. Both live declarations are column-scoped, and
fts_sections_au reached that shape by being narrowed: sql/schema.sql
declares it AFTER UPDATE unconditioned and V2 drops and recreates it
over a named column list, to stop reindex-only updates from paying an
fts5 delete-and-reinsert. So this disposition depends on namespace
staying in that list, which a later narrowing could shorten without
touching anything here. fts_notes and fts_entities have no triggers at all —
their contents are written from Rust — so the move writes them itself, and
because fts5 refuses an UPDATE of an indexed column that write is a
delete followed by an insert.
DerivedRowidMap
The rowid map beside an fts5 table, keyed (namespace, subject_id).
Appended
Appended to, never rewritten: new entries land under the target namespace and the entries already there stay where they are, because they record writes that happened under the old name.
History
A record of what happened. Rewriting it would make the audit trail describe a past that did not occur.
ConsumerWatermark
Consumer bookkeeping whose ordering semantics an UPDATE violates.
RefusedBySchema
The schema itself refuses: sql/029-note-streams.sql installs four
triggers that abort any namespace change to a member note or its ledger.
NamespaceScopedAggregate
Keyed by (profile_id, namespace) with no subject, so a partitioning
move has no target to carry it to. Moves only when the request is total
and single-target; otherwise reported as left behind.
SubjectKeyed
Keyed by a subject the caller routes, so it follows that subject.
Trait Implementations§
Source§impl Clone for TableDisposition
impl Clone for TableDisposition
impl Copy for TableDisposition
Source§impl Debug for TableDisposition
impl Debug for TableDisposition
impl Eq for TableDisposition
Source§impl PartialEq for TableDisposition
impl PartialEq for TableDisposition
impl StructuralPartialEq for TableDisposition
Auto Trait Implementations§
impl Freeze for TableDisposition
impl RefUnwindSafe for TableDisposition
impl Send for TableDisposition
impl Sync for TableDisposition
impl Unpin for TableDisposition
impl UnsafeUnpin for TableDisposition
impl UnwindSafe for TableDisposition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more