pub struct FuncLastInsertId;Expand description
The LAST_INSERT_ID() function expression (MySQL-specific).
Returns the first automatically generated value that was set for an AUTO_INCREMENT column by the most recent INSERT statement. This is primarily used to retrieve auto-increment IDs after insertion on MySQL, which doesn’t support RETURNING clauses.
§Behavior
- Returns the first auto-increment ID from the most recent INSERT
- When multiple rows are inserted, returns the ID of the first row
- Subsequent row IDs can be calculated by adding row offsets (first_id + 1, first_id + 2, etc.)
- Returns 0 if no AUTO_INCREMENT value was generated
§MySQL Documentation
See: https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_last-insert-id
Trait Implementations§
Source§impl Clone for FuncLastInsertId
impl Clone for FuncLastInsertId
Source§fn clone(&self) -> FuncLastInsertId
fn clone(&self) -> FuncLastInsertId
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 moreSource§impl Debug for FuncLastInsertId
impl Debug for FuncLastInsertId
Source§impl Default for FuncLastInsertId
impl Default for FuncLastInsertId
Source§fn default() -> FuncLastInsertId
fn default() -> FuncLastInsertId
Returns the “default value” for a type. Read more
Source§impl From<FuncLastInsertId> for Expr
impl From<FuncLastInsertId> for Expr
Source§fn from(value: FuncLastInsertId) -> Self
fn from(value: FuncLastInsertId) -> Self
Converts to this type from the input type.
Source§impl From<FuncLastInsertId> for ExprFunc
impl From<FuncLastInsertId> for ExprFunc
Source§fn from(value: FuncLastInsertId) -> Self
fn from(value: FuncLastInsertId) -> Self
Converts to this type from the input type.
Source§impl PartialEq for FuncLastInsertId
impl PartialEq for FuncLastInsertId
impl StructuralPartialEq for FuncLastInsertId
Auto Trait Implementations§
impl Freeze for FuncLastInsertId
impl RefUnwindSafe for FuncLastInsertId
impl Send for FuncLastInsertId
impl Sync for FuncLastInsertId
impl Unpin for FuncLastInsertId
impl UnwindSafe for FuncLastInsertId
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