pub struct QuerySql {
pub stmt: Statement,
pub params: Vec<TypedValue>,
pub ret: Option<Vec<Type>>,
}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,
params: vec![],
ret: Some(vec![stmt::Type::String, stmt::Type::I64]),
};
let operation: Operation = op.into();
assert!(operation.is_query_sql());Fields§
§stmt: StatementThe SQL statement to execute. Scalar values that should be sent as
bind parameters have been replaced with Expr::Arg(n) where n is
the index into params.
params: Vec<TypedValue>Typed bind parameters extracted from the statement. Each entry
corresponds to an Expr::Arg(n) placeholder in the statement.
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).
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 UnsafeUnpin 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