pub struct Table {
pub schema: String,
pub name: String,
pub description: Option<String>,
pub is_view: bool,
pub insertable: bool,
pub updatable: bool,
pub deletable: bool,
pub pk_cols: Vec<String>,
pub columns: ColumnMap,
}Expand description
A database table or view.
Fields§
§schema: StringSchema name
name: StringTable/view name
description: Option<String>Description from comment
is_view: boolWhether this is a view (vs a table)
insertable: boolWhether INSERT is allowed
updatable: boolWhether UPDATE is allowed
deletable: boolWhether DELETE is allowed
pk_cols: Vec<String>Primary key column names
columns: ColumnMapColumns indexed by name
Implementations§
Source§impl Table
impl Table
Sourcepub fn get_column(&self, name: &str) -> Option<&Column>
pub fn get_column(&self, name: &str) -> Option<&Column>
Get a column by name.
Sourcepub fn has_column(&self, name: &str) -> bool
pub fn has_column(&self, name: &str) -> bool
Check if the table has a column.
Sourcepub fn qualified_identifier(&self) -> QualifiedIdentifier
pub fn qualified_identifier(&self) -> QualifiedIdentifier
Get the qualified identifier for this table.
Sourcepub fn column_names(&self) -> impl Iterator<Item = &str>
pub fn column_names(&self) -> impl Iterator<Item = &str>
Get column names in order.
Sourcepub fn is_readonly(&self) -> bool
pub fn is_readonly(&self) -> bool
Check if this is a read-only view.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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