pub struct TableDef {
pub schema: &'static str,
pub name: &'static str,
pub is_unlogged: bool,
pub is_temporary: bool,
pub inherits: Option<&'static str>,
pub tablespace: Option<&'static str>,
pub is_rls_enabled: bool,
pub comment: Option<&'static str>,
}Expand description
Const-friendly table definition for compile-time schema definitions.
Fields§
§schema: &'static strSchema name
name: &'static strTable name
is_unlogged: boolCreate as an UNLOGGED table?
is_temporary: boolCreate as a TEMPORARY table?
inherits: Option<&'static str>Parent table for INHERITS clause.
tablespace: Option<&'static str>Tablespace for the table.
is_rls_enabled: boolIs Row-Level Security enabled?
comment: Option<&'static str>Table comment emitted through COMMENT ON TABLE.
Implementations§
Source§impl TableDef
impl TableDef
Sourcepub const fn new(schema: &'static str, name: &'static str) -> Self
pub const fn new(schema: &'static str, name: &'static str) -> Self
Create a new table definition
Sourcepub const fn tablespace(self, tablespace: &'static str) -> Self
pub const fn tablespace(self, tablespace: &'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
Sourcepub const fn into_table(self) -> Table
pub const fn into_table(self) -> Table
Convert to runtime Table type
Trait Implementations§
impl Copy for TableDef
impl Eq for TableDef
impl StructuralPartialEq for TableDef
Auto Trait Implementations§
impl Freeze for TableDef
impl RefUnwindSafe for TableDef
impl Send for TableDef
impl Sync for TableDef
impl Unpin for TableDef
impl UnsafeUnpin for TableDef
impl UnwindSafe for TableDef
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