pub struct Statement {
pub query: String,
pub bindings: Vec<Value>,
pub read_only: bool,
pub named_bindings: Option<Array>,
/* private fields */
}Expand description
A compiled statement: the SQL (or MongoDB command JSON) with ?
placeholders and the values bound to them, in order.
PHP: Utopia\Query\Builder\Statement.
Fields§
§query: StringThe statement text.
bindings: Vec<Value>The values of the placeholders, in order.
read_only: boolWhether the statement only reads.
named_bindings: Option<Array>Named parameters (ClickHouse’s {name:Type} placeholders), if any.
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn new(query: impl Into<String>, bindings: Vec<Value>) -> Self
pub fn new(query: impl Into<String>, bindings: Vec<Value>) -> Self
A statement that is not read-only and has no executor.
PHP: new Statement($query, $bindings).
Sourcepub fn with_parts(
query: impl Into<String>,
bindings: Vec<Value>,
read_only: bool,
executor: Option<Executor>,
named_bindings: Option<Array>,
) -> Self
pub fn with_parts( query: impl Into<String>, bindings: Vec<Value>, read_only: bool, executor: Option<Executor>, named_bindings: Option<Array>, ) -> Self
Every part of a statement.
PHP: new Statement($query, $bindings, $readOnly, $executor, $namedBindings).
Sourcepub fn execute(&self) -> Result<Value>
pub fn execute(&self) -> Result<Value>
Runs the statement with its executor.
PHP: execute(), which throws BadMethodCallException (Error::NoExecutor) without one.
Sourcepub fn with_executor(&self, executor: Executor) -> Statement
pub fn with_executor(&self, executor: Executor) -> Statement
The same statement run by executor.
PHP: withExecutor().
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Statement
impl !UnwindSafe for Statement
impl Forget for Statement
impl Freeze for Statementwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value<Object>>: Freeze,
*const ArcInner<Repr<Object>> is !null: Freeze,
PhantomData<ArcInner<Repr<Object>>>: Freeze,
*const ArcInner<dyn Fn(&Statement) -> Result<Value<Object>, Error> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&Statement) -> Result<Value<Object>, Error> + Sync + Send>>: Freeze,
impl Move for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statementwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value<Object>>: UnsafeUnpin,
*const ArcInner<Repr<Object>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Repr<Object>>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&Statement) -> Result<Value<Object>, Error> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&Statement) -> Result<Value<Object>, Error> + Sync + Send>>: UnsafeUnpin,
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