pub struct QuerySql {
pub stmt: Statement,
pub ret: Option<Vec<Type>>,
pub last_insert_id_hack: Option<u64>,
}Expand description
Executes a SQL statement against the database.
Only sent to SQL-capable drivers (those with Capability::sql
set to true). The statement is a fully lowered stmt::Statement that
the SQL serialization layer converts into a backend-specific SQL string.
§Examples
ⓘ
use toasty_core::driver::operation::{QuerySql, Operation};
let op = QuerySql {
stmt: sql_statement,
ret: Some(vec![stmt::Type::String, stmt::Type::I64]),
last_insert_id_hack: None,
};
let operation: Operation = op.into();
assert!(operation.is_query_sql());Fields§
§stmt: StatementThe SQL statement to execute.
ret: Option<Vec<Type>>The types of columns in the result set. When Some, the driver uses
these types to decode returned rows. When None, the statement does
not return rows (e.g., DELETE without RETURNING).
last_insert_id_hack: Option<u64>Temporary MySQL workaround for RETURNING from INSERT.
When set, the driver should fetch LAST_INSERT_ID() to simulate
RETURNING behavior for the specified number of inserted rows.
Non-MySQL drivers should assert this is None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuerySql
impl RefUnwindSafe for QuerySql
impl Send for QuerySql
impl Sync for QuerySql
impl Unpin for QuerySql
impl UnwindSafe for QuerySql
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more