mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 16:44:07 +00:00
Implement AnyQueryResult for Sqlite and MySQL (#3608)
* impl AnyQueryResult for Sqlite and MySQL * fix MySQL AnyQueryResult * fix MySQL AnyQueryResult * fix manifest * rewrite `use` and address implementation concerns
This commit is contained in:
@@ -24,3 +24,17 @@ impl Extend<SqliteQueryResult> for SqliteQueryResult {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "any")]
|
||||
impl From<SqliteQueryResult> for sqlx_core::any::AnyQueryResult {
|
||||
fn from(done: SqliteQueryResult) -> Self {
|
||||
let last_insert_id = match done.last_insert_rowid() {
|
||||
0 => None,
|
||||
n => Some(n),
|
||||
};
|
||||
sqlx_core::any::AnyQueryResult {
|
||||
rows_affected: done.rows_affected(),
|
||||
last_insert_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user