pub struct Query { /* private fields */ }Expand description
Query object
Implementations§
source§impl Query
impl Query
sourcepub fn with_params(self, params: HashMap<String, Value>) -> Self
pub fn with_params(self, params: HashMap<String, Value>) -> Self
Set query parameters
parameters is data, sent to YDB in binary form
Example with macros:
let query = Query::new("
DECLARE $val AS Int64;
SELECT $val AS res
").with_params(ydb_params!("$val" => 123 as i64));Example full:
let mut params: HashMap::<String,Value> = HashMap::new();
params.insert("$val".to_string(), Value::from(123 as i64));
let query = Query::new("
DECLARE $val AS Int64;
SELECT $val AS res
").with_params(params);Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request