mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
* WIP rt refactors * refactor: break drivers out into separate crates also cleans up significant technical debt
27 lines
629 B
Rust
27 lines
629 B
Rust
use std::iter::{Extend, IntoIterator};
|
|
|
|
#[derive(Debug, Default)]
|
|
pub struct SqliteQueryResult {
|
|
pub(super) changes: u64,
|
|
pub(super) last_insert_rowid: i64,
|
|
}
|
|
|
|
impl SqliteQueryResult {
|
|
pub fn rows_affected(&self) -> u64 {
|
|
self.changes
|
|
}
|
|
|
|
pub fn last_insert_rowid(&self) -> i64 {
|
|
self.last_insert_rowid
|
|
}
|
|
}
|
|
|
|
impl Extend<SqliteQueryResult> for SqliteQueryResult {
|
|
fn extend<T: IntoIterator<Item = SqliteQueryResult>>(&mut self, iter: T) {
|
|
for elem in iter {
|
|
self.changes += elem.changes;
|
|
self.last_insert_rowid = elem.last_insert_rowid;
|
|
}
|
|
}
|
|
}
|