pub struct Table {
pub schema: Cow<'static, str>,
pub name: Cow<'static, str>,
pub is_unlogged: Option<bool>,
pub is_temporary: Option<bool>,
pub inherits: Option<Cow<'static, str>>,
pub tablespace: Option<Cow<'static, str>>,
pub is_rls_enabled: Option<bool>,
pub comment: Option<Cow<'static, str>>,
}Expand description
Runtime table entity for serde serialization.
Fields§
§schema: Cow<'static, str>Schema name
name: Cow<'static, str>Table name
is_unlogged: Option<bool>Create as an UNLOGGED table?
is_temporary: Option<bool>Create as a TEMPORARY table?
inherits: Option<Cow<'static, str>>Parent table for INHERITS clause.
tablespace: Option<Cow<'static, str>>Tablespace for the table.
is_rls_enabled: Option<bool>Is Row-Level Security enabled?
comment: Option<Cow<'static, str>>Table comment emitted through COMMENT ON TABLE.
Implementations§
Source§impl Table
impl Table
Sourcepub fn drop_table_sql(&self) -> String
pub fn drop_table_sql(&self) -> String
Generate DROP TABLE SQL
Sourcepub fn rename_table_sql(&self, new_name: &str) -> String
pub fn rename_table_sql(&self, new_name: &str) -> String
Generate RENAME TABLE SQL
Source§impl Table
impl Table
Sourcepub fn new(
schema: impl Into<Cow<'static, str>>,
name: impl Into<Cow<'static, str>>,
) -> Self
pub fn new( schema: impl Into<Cow<'static, str>>, name: impl Into<Cow<'static, str>>, ) -> Self
Create a new table (runtime)
Sourcepub fn tablespace(self, tablespace: impl Into<Cow<'static, str>>) -> Self
pub fn tablespace(self, tablespace: impl Into<Cow<'static, str>>) -> Self
Set table tablespace.
Sourcepub const fn rls_enabled(self) -> Self
pub const fn rls_enabled(self) -> Self
Set Row-Level Security enabled
Trait Implementations§
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin 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