mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
chore(mysql): provide a trivial conversion from EOF to OK
This commit is contained in:
parent
5926dcaa69
commit
d04dc77b4f
@ -2,6 +2,7 @@ use bytes::{Buf, Bytes};
|
||||
use sqlx_core::io::Deserialize;
|
||||
use sqlx_core::Result;
|
||||
|
||||
use super::{Info, OkPacket};
|
||||
use crate::protocol::{Capabilities, Status};
|
||||
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
@ -29,3 +30,15 @@ impl Deserialize<'_, Capabilities> for EofPacket {
|
||||
Ok(Self { status, warnings })
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EofPacket> for OkPacket {
|
||||
fn from(eof: EofPacket) -> Self {
|
||||
Self {
|
||||
affected_rows: 0,
|
||||
info: Info::default(),
|
||||
last_insert_id: 0,
|
||||
status: eof.status,
|
||||
warnings: eof.warnings,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user