We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a907165 commit f107b98Copy full SHA for f107b98
diesel/src/mysql/connection/stmt/mod.rs
@@ -160,6 +160,12 @@ impl<'a> StatementUse<'a> {
160
.map_err(|e| Error::DeserializationError(Box::new(e)))
161
}
162
163
+ /// SAFETY: This should only be called for INSERT queries.
164
+ pub(in crate::mysql::connection) unsafe fn insert_id(&self) -> u64 {
165
+ let insert_id = ffi::mysql_stmt_insert_id(self.inner.stmt.as_ptr());
166
+ insert_id as u64
167
+ }
168
+
169
/// This function should be called after `execute` only
170
/// otherwise it's not guaranteed to return a valid result
171
pub(in crate::mysql::connection) unsafe fn result_size(&mut self) -> QueryResult<usize> {
0 commit comments