pub struct Blueprint { /* private fields */ }Expand description
The columns, indexes and foreign keys of a table, in the order they were added.
Implementations§
Source§impl Blueprint
impl Blueprint
Sourcepub fn string(&mut self, name: &str) -> &mut Column
pub fn string(&mut self, name: &str) -> &mut Column
A VARCHAR(255); TEXT on SQLite. Change the length with .length(n).
Sourcepub fn big_integer(&mut self, name: &str) -> &mut Column
pub fn big_integer(&mut self, name: &str) -> &mut Column
A BIGINT column; INTEGER on SQLite, whose integers are 64-bit already.
Sourcepub fn boolean(&mut self, name: &str) -> &mut Column
pub fn boolean(&mut self, name: &str) -> &mut Column
A boolean: BOOLEAN on PostgreSQL, TINYINT(1) elsewhere.
Sourcepub fn date_time(&mut self, name: &str) -> &mut Column
pub fn date_time(&mut self, name: &str) -> &mut Column
A date and time without a time zone: DATETIME, or TIMESTAMP(0) on PostgreSQL.
Sourcepub fn timestamps(&mut self)
pub fn timestamps(&mut self)
Nullable created_at and updated_at columns.
Sourcepub fn unique<I, S>(&mut self, columns: I)
pub fn unique<I, S>(&mut self, columns: I)
A unique constraint over columns, named {table}_{columns}_unique.
Sourcepub fn index<I, S>(&mut self, columns: I)
pub fn index<I, S>(&mut self, columns: I)
A plain index over columns, named {table}_{columns}_index.
Sourcepub fn foreign(&mut self, column: &str) -> &mut ForeignKey
pub fn foreign(&mut self, column: &str) -> &mut ForeignKey
A foreign key on column, named {table}_{column}_foreign.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Blueprint
impl Freeze for Blueprint
impl Move for Blueprint
impl RefUnwindSafe for Blueprint
impl Send for Blueprint
impl Sync for Blueprint
impl Unpin for Blueprint
impl UnsafeUnpin for Blueprint
impl UnwindSafe for Blueprint
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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