mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 13:20:59 +00:00
+ handle normal errors separate from unexpected errors, an unexpected error causes the connection to close (in which case, if this was behind a pool, the pool would not allow this connection to be acquired again)
24 lines
545 B
Rust
24 lines
545 B
Rust
use crate::protocol::PrepareOk;
|
|
use crate::{MySqlColumn, MySqlTypeInfo};
|
|
|
|
#[derive(Debug)]
|
|
pub(crate) struct RawStatement {
|
|
id: u32,
|
|
pub(crate) columns: Vec<MySqlColumn>,
|
|
pub(crate) parameters: Vec<MySqlTypeInfo>,
|
|
}
|
|
|
|
impl RawStatement {
|
|
pub(crate) fn new(ok: &PrepareOk) -> Self {
|
|
Self {
|
|
id: ok.statement_id,
|
|
columns: Vec::with_capacity(ok.columns.into()),
|
|
parameters: Vec::with_capacity(ok.params.into()),
|
|
}
|
|
}
|
|
|
|
pub(crate) fn id(&self) -> u32 {
|
|
self.id
|
|
}
|
|
}
|