pub struct InsertExecutor;Expand description
Executor for INSERT statements
Implementations§
Source§impl InsertExecutor
impl InsertExecutor
Sourcepub fn execute(
db: &mut Database,
stmt: &InsertStmt,
) -> Result<usize, ExecutorError>
pub fn execute( db: &mut Database, stmt: &InsertStmt, ) -> Result<usize, ExecutorError>
Execute an INSERT statement Returns number of rows inserted
Sourcepub fn execute_returning(
db: &mut Database,
stmt: &InsertStmt,
) -> Result<InsertOutcome, ExecutorError>
pub fn execute_returning( db: &mut Database, stmt: &InsertStmt, ) -> Result<InsertOutcome, ExecutorError>
Execute an INSERT statement, capturing RETURNING rows (SQLite 3.35.0+)
Returns an InsertOutcome carrying the number of affected rows, the
number of rows handled via the upsert ON CONFLICT DO UPDATE arm, and,
when the statement carries a RETURNING clause, the projected NEW rows
(values as actually inserted, including defaults, generated columns,
and auto INTEGER PRIMARY KEY). Rows skipped by OR IGNORE /
ON CONFLICT DO NOTHING are omitted; ON DUPLICATE KEY UPDATE
contributes the post-UPDATE row.
When the statement has no RETURNING clause returning is None.
Sourcepub fn execute_with_procedural_context(
db: &mut Database,
stmt: &InsertStmt,
procedural_context: &ExecutionContext,
) -> Result<usize, ExecutorError>
pub fn execute_with_procedural_context( db: &mut Database, stmt: &InsertStmt, procedural_context: &ExecutionContext, ) -> Result<usize, ExecutorError>
Execute an INSERT statement with procedural context Supports procedural variables in VALUES clause Returns number of rows inserted
Auto Trait Implementations§
impl Freeze for InsertExecutor
impl RefUnwindSafe for InsertExecutor
impl Send for InsertExecutor
impl Sync for InsertExecutor
impl Unpin for InsertExecutor
impl UnsafeUnpin for InsertExecutor
impl UnwindSafe for InsertExecutor
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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