Enum InsertTarget
pub enum InsertTarget {
Scope(Box<Query>),
Model(ModelId),
Table(InsertTable),
}Variants§
Scope(Box<Query>)
Inserting into a scope implies that the inserted value should be included by the query after insertion. This could be a combination of setting default field values or validating existing ones.
Model(ModelId)
Insert a model
Table(InsertTable)
Insert into a table
Implementations§
§impl InsertTarget
impl InsertTarget
pub fn is_model(&self) -> bool
pub fn as_model_unwrap(&self) -> ModelId
pub fn is_table(&self) -> bool
pub fn as_table_unwrap(&self) -> &InsertTable
pub fn add_constraint(&mut self, expr: impl Into<Expr>)
Trait Implementations§
§impl Clone for InsertTarget
impl Clone for InsertTarget
§fn clone(&self) -> InsertTarget
fn clone(&self) -> InsertTarget
Returns a duplicate 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 more§impl Debug for InsertTarget
impl Debug for InsertTarget
§impl From<InsertTable> for InsertTarget
impl From<InsertTable> for InsertTarget
§fn from(value: InsertTable) -> InsertTarget
fn from(value: InsertTable) -> InsertTarget
Converts to this type from the input type.
§impl From<Query> for InsertTarget
impl From<Query> for InsertTarget
§fn from(value: Query) -> InsertTarget
fn from(value: Query) -> InsertTarget
Converts to this type from the input type.
§impl<'a, T> IntoExprTarget<'a, T> for &'a InsertTargetwhere
T: Resolve,
impl<'a, T> IntoExprTarget<'a, T> for &'a InsertTargetwhere
T: Resolve,
fn into_expr_target(self, schema: &'a T) -> ExprTarget<'a>
§impl PartialEq for InsertTarget
impl PartialEq for InsertTarget
impl StructuralPartialEq for InsertTarget
Auto Trait Implementations§
impl Freeze for InsertTarget
impl RefUnwindSafe for InsertTarget
impl Send for InsertTarget
impl Sync for InsertTarget
impl Unpin for InsertTarget
impl UnwindSafe for InsertTarget
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