pub struct Insert {
pub stmt: Statement,
pub params: Vec<TypedValue>,
pub ret: Option<Vec<Type>>,
}Expand description
Inserts one or more records into a table.
Contains a lowered stmt::Statement (always an insert statement) and an
optional return type describing the columns the driver should return after
the insert (e.g., auto-generated keys).
§Examples
ⓘ
use toasty_core::driver::operation::{Insert, Operation};
let op = Insert {
stmt: insert_statement,
ret: Some(vec![stmt::Type::I64]),
};
let operation: Operation = op.into();Fields§
§stmt: StatementThe insert statement to execute. Scalar values that should be sent as
bind parameters have been replaced with Expr::Arg(n) where n is
the index into params.
params: Vec<TypedValue>Typed bind parameters extracted from the statement.
ret: Option<Vec<Type>>The types of columns to return from the insert. When Some, the driver
should return the inserted row(s) projected to these types (e.g.,
auto-increment IDs). When None, no rows are returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Insert
impl RefUnwindSafe for Insert
impl Send for Insert
impl Sync for Insert
impl Unpin for Insert
impl UnsafeUnpin for Insert
impl UnwindSafe for Insert
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