pub struct CreateTable { /* private fields */ }Expand description
A CREATE TABLE statement.
Implementations§
Source§impl CreateTable
impl CreateTable
Sourcepub fn if_not_exists(self) -> Self
pub fn if_not_exists(self) -> Self
Sets IF NOT EXISTS.
Sourcepub fn primary_key<C: IntoIden>(
self,
columns: impl IntoIterator<Item = C>,
) -> Self
pub fn primary_key<C: IntoIden>( self, columns: impl IntoIterator<Item = C>, ) -> Self
Adds a composite primary key.
Sourcepub fn unique<C: IntoIden>(self, columns: impl IntoIterator<Item = C>) -> Self
pub fn unique<C: IntoIden>(self, columns: impl IntoIterator<Item = C>) -> Self
Adds a table-level unique constraint.
Sourcepub fn foreign_key(self, fk: ForeignKey) -> Self
pub fn foreign_key(self, fk: ForeignKey) -> Self
Adds a foreign key.
Sourcepub fn strict(self) -> Self
pub fn strict(self) -> Self
Makes the table STRICT, so the engine type-checks stored values
against the declared types.
Sourcepub fn without_rowid(self) -> Self
pub fn without_rowid(self) -> Self
Makes the table WITHOUT ROWID — experimental in Turso.
Trait Implementations§
Source§impl Build for CreateTable
impl Build for CreateTable
Source§impl Clone for CreateTable
impl Clone for CreateTable
Source§impl Debug for CreateTable
impl Debug for CreateTable
Source§impl Default for CreateTable
impl Default for CreateTable
Source§impl PartialEq for CreateTable
impl PartialEq for CreateTable
impl StructuralPartialEq for CreateTable
Auto Trait Implementations§
impl Freeze for CreateTable
impl RefUnwindSafe for CreateTable
impl Send for CreateTable
impl Sync for CreateTable
impl Unpin for CreateTable
impl UnsafeUnpin for CreateTable
impl UnwindSafe for CreateTable
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