pub struct CreateTable<M: Model> { /* private fields */ }Expand description
Builder for CREATE TABLE statements.
Implementations§
Source§impl<M: Model> CreateTable<M>
impl<M: Model> CreateTable<M>
Sourcepub fn if_not_exists(self) -> Self
pub fn if_not_exists(self) -> Self
Add IF NOT EXISTS clause.
Sourcepub fn build(&self) -> String
pub fn build(&self) -> String
Build the CREATE TABLE SQL.
§Inheritance Handling
- Single Table Inheritance (child): Returns empty string (child uses parent’s table)
- Joined Table Inheritance (child): Adds FK constraint to parent table
- Concrete Table Inheritance: Each model gets independent table (normal behavior)
Sourcepub fn should_skip_table_creation() -> bool
pub fn should_skip_table_creation() -> bool
Check if this model should skip table creation.
Returns true for single table inheritance child models, which share their parent’s table rather than having their own.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for CreateTable<M>
impl<M> RefUnwindSafe for CreateTable<M>where
M: RefUnwindSafe,
impl<M> Send for CreateTable<M>
impl<M> Sync for CreateTable<M>
impl<M> Unpin for CreateTable<M>where
M: Unpin,
impl<M> UnsafeUnpin for CreateTable<M>
impl<M> UnwindSafe for CreateTable<M>where
M: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).