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
A table definition that can be built in a const. Columns and
constraints are separate entities that name the table.
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
Creates a plain table in schema.
Sourcepub const fn tablespace(self, tablespace: &'static str) -> Self
pub const fn tablespace(self, tablespace: &'static str) -> Self
Sets the TABLESPACE.
Sourcepub const fn rls_enabled(self) -> Self
pub const fn rls_enabled(self) -> Self
Enables row-level security.
Sourcepub const fn into_table(self) -> Table
pub const fn into_table(self) -> Table
Converts to the runtime Table.
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