pub struct Table {
pub name: Cow<'static, str>,
pub strict: bool,
pub without_rowid: bool,
}Expand description
Runtime table entity for serde serialization.
This type uses Cow<'static, str> to support both borrowed and owned strings,
making it suitable for JSON serialization/deserialization.
For compile-time definitions, use TableDef instead.
§Examples
§From TableDef
use drizzle_types::sqlite::ddl::{TableDef, Table};
const DEF: TableDef = TableDef::new("users").strict();
let table: Table = DEF.into_table();
assert_eq!(table.name(), "users");§Runtime construction
use drizzle_types::sqlite::ddl::Table;
let table = Table::new("dynamic_table");Fields§
§name: Cow<'static, str>Table name
strict: boolIs this a STRICT table?
without_rowid: boolIs this a WITHOUT ROWID 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
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 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