pub enum TableKind {
Table,
View,
UpdatableView,
}Expand description
What the catalog says a relation is. Three answers, because writability
and viewness are separate facts: a base table is always writable, a view
is writable only when the engine says so, and the engines disagree about
when that is (see TableKind::UpdatableView).
This is the catalog’s answer, not the generator’s decision. Whether a
model ends up with the Table surface is resolved from this plus the
configuration, in resolve.
Variants§
Table
A base table: gets the full Table surface when it has a primary key.
View
A view (or materialised view) the engine will not write through:
SELECT-only, unconditionally.
UpdatableView
A view the engine reports as writable — PostgreSQL’s auto-updatable
views and any view with the right INSTEAD OF triggers, MySQL’s
IS_UPDATABLE = 'YES', SQLite’s views carrying all three INSTEAD OF
triggers. Still keyless: a view has no primary key, so the write
surface needs a [tables.<name>] key before it can be generated.
Implementations§
Trait Implementations§
impl Copy for TableKind
impl Eq for TableKind
impl StructuralPartialEq for TableKind
Auto Trait Implementations§
impl Freeze for TableKind
impl RefUnwindSafe for TableKind
impl Send for TableKind
impl Sync for TableKind
impl Unpin for TableKind
impl UnsafeUnpin for TableKind
impl UnwindSafe for TableKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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> 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