pub struct CreateTable { /* private fields */ }Expand description
A CREATE TABLE statement.
Implementations§
Source§impl CreateTable
impl CreateTable
Sourcepub fn table(self, name: impl IntoIden) -> CreateTable
pub fn table(self, name: impl IntoIden) -> CreateTable
Sets the table name.
Sourcepub fn if_not_exists(self) -> CreateTable
pub fn if_not_exists(self) -> CreateTable
Sets IF NOT EXISTS.
Sourcepub fn col(self, column: ColumnDef) -> CreateTable
pub fn col(self, column: ColumnDef) -> CreateTable
Adds a column.
Sourcepub fn primary_key<C>(self, columns: impl IntoIterator<Item = C>) -> CreateTablewhere
C: IntoIden,
pub fn primary_key<C>(self, columns: impl IntoIterator<Item = C>) -> CreateTablewhere
C: IntoIden,
Adds a composite primary key.
Sourcepub fn unique<C>(self, columns: impl IntoIterator<Item = C>) -> CreateTablewhere
C: IntoIden,
pub fn unique<C>(self, columns: impl IntoIterator<Item = C>) -> CreateTablewhere
C: IntoIden,
Adds a table-level unique constraint.
Sourcepub fn check(self, expr: Expr) -> CreateTable
pub fn check(self, expr: Expr) -> CreateTable
Adds a table-level check constraint.
Sourcepub fn foreign_key(self, fk: ForeignKey) -> CreateTable
pub fn foreign_key(self, fk: ForeignKey) -> CreateTable
Adds a foreign key.
Sourcepub fn strict(self) -> CreateTable
pub fn strict(self) -> CreateTable
Makes the table STRICT, so the engine type-checks stored values
against the declared types.
Sourcepub fn without_rowid(self) -> CreateTable
pub fn without_rowid(self) -> CreateTable
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§fn clone(&self) -> CreateTable
fn clone(&self) -> CreateTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateTable
impl Debug for CreateTable
Source§impl Default for CreateTable
impl Default for CreateTable
Source§fn default() -> CreateTable
fn default() -> CreateTable
Returns the “default value” for a type. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more