pub struct RemoveFieldBuilder { /* private fields */ }Available on crate feature
db only.Expand description
A builder for removing a field from a model.
Typically, you shouldn’t need to use this directly. Instead, in most cases, this can be automatically generated by the Cot CLI.
§Examples
use cot::db::migrations::{Field, Operation};
use cot::db::{DatabaseField, Identifier};
const OPERATION: Operation = Operation::remove_field()
.table_name(Identifier::new("todoapp__my_model"))
.field(Field::new(
Identifier::new("name"),
<String as DatabaseField>::TYPE,
))
.build();
Implementations§
Source§impl RemoveFieldBuilder
impl RemoveFieldBuilder
Sourcepub const fn table_name(self, table_name: Identifier) -> Self
pub const fn table_name(self, table_name: Identifier) -> Self
Sets the name of the table to remove the field from.
§Cot CLI Usage
Typically, you shouldn’t need to use this directly. Instead, in most cases, this can be automatically generated by the Cot CLI.
§Examples
use cot::db::migrations::{Field, Operation};
use cot::db::{DatabaseField, Identifier};
const OPERATION: Operation = Operation::remove_field()
.table_name(Identifier::new("todoapp__my_model"))
.field(Field::new(
Identifier::new("name"),
<String as DatabaseField>::TYPE,
))
.build();
Sourcepub const fn field(self, field: Field) -> Self
pub const fn field(self, field: Field) -> Self
Sets the field that is to be removed from the model.
§Cot CLI Usage
Typically, you shouldn’t need to use this directly. Instead, in most cases, this can be automatically generated by the Cot CLI.
§Examples
use cot::db::migrations::{Field, Operation};
use cot::db::{DatabaseField, Identifier};
const OPERATION: Operation = Operation::remove_field()
.table_name(Identifier::new("todoapp__my_model"))
.field(Field::new(
Identifier::new("name"),
<String as DatabaseField>::TYPE,
))
.build();
Sourcepub const fn build(self) -> Operation
pub const fn build(self) -> Operation
Builds the operation.
§Cot CLI Usage
Typically, you shouldn’t need to use this directly. Instead, in most cases, this can be automatically generated by the Cot CLI.
§Examples
use cot::db::migrations::{Field, Operation};
use cot::db::{DatabaseField, Identifier};
const OPERATION: Operation = Operation::remove_field()
.table_name(Identifier::new("todoapp__my_model"))
.field(Field::new(
Identifier::new("name"),
<String as DatabaseField>::TYPE,
))
.build();
Trait Implementations§
Source§impl Clone for RemoveFieldBuilder
impl Clone for RemoveFieldBuilder
Source§fn clone(&self) -> RemoveFieldBuilder
fn clone(&self) -> RemoveFieldBuilder
Returns a copy of the value. Read more
1.0.0 · 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 RemoveFieldBuilder
impl Debug for RemoveFieldBuilder
Source§impl Default for RemoveFieldBuilder
impl Default for RemoveFieldBuilder
impl Copy for RemoveFieldBuilder
Auto Trait Implementations§
impl Freeze for RemoveFieldBuilder
impl RefUnwindSafe for RemoveFieldBuilder
impl Send for RemoveFieldBuilder
impl Sync for RemoveFieldBuilder
impl Unpin for RemoveFieldBuilder
impl UnwindSafe for RemoveFieldBuilder
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 moreSource§impl<T> IntoField<Auto<T>> for T
impl<T> IntoField<Auto<T>> for T
Source§fn into_field(self) -> Auto<T>
fn into_field(self) -> Auto<T>
Available on crate feature
db only.Converts the type to the field type.