pub enum OpKey {
Module(String),
Scalar(String, String),
TupleType(String, String),
TupleTypeRebuild,
Table(String, String),
Function(String, String),
View(String, String),
ForeignKey(String, String),
}Expand description
Stable identity an emitted step is grouped by. Every DDL statement that answers the same logical question (e.g. every column/FK/trigger change to one table) shares one key and therefore one step.
Variants§
Module(String)
Scalar(String, String)
Covers enums, custom scalar domains, and sequence scalars — all three share one object identity (a scalar can only be one of them).
TupleType(String, String)
One tuple’s composite type, by (pg schema, type name) — created or
dropped on its own.
TupleTypeRebuild
Every composite type being replaced, as one step.
Unlike a create or a drop, replacing one is not an independent piece of work: each replacement type has to exist before any column moves to it, and every column has to have moved before any of the types they held can be dropped. Keyed without a name because the set is the unit — a type nested in another cannot have its own step ordered against the step of the type holding it.
Table(String, String)
Covers a concrete type’s own table plus everything folded into it: column/FK diffs, junction tables for its multi-/through-links, vector/search index columns, and constraint/deletion/signal/cache triggers — a user thinks of all of these as “altering type X”, not as separate objects.
Function(String, String)
View(String, String)
ForeignKey(String, String)
A table’s foreign keys, deliberately not folded into Table.
Steps render in insertion order and same-key ops merge into the step
that already exists, so an FK keyed by its own table would be emitted
inside that table’s CREATE TABLE step — before any table created
later. That made correctness depend on topo_sort_types finding a
perfect order, which it cannot when links form a cycle (a
self-referencing optional link is enough). Giving foreign keys their
own key puts every one of them after every table, so the order of the
table steps stops mattering.
Trait Implementations§
impl Eq for OpKey
impl StructuralPartialEq for OpKey
Auto Trait Implementations§
impl Freeze for OpKey
impl RefUnwindSafe for OpKey
impl Send for OpKey
impl Sync for OpKey
impl Unpin for OpKey
impl UnsafeUnpin for OpKey
impl UnwindSafe for OpKey
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.