pub struct QueryParams { /* private fields */ }Expand description
Builder for mixed-type parameter maps.
An iterator of (name, value) pairs is enough when every value converts to
the same QueryParam type. Use this builder when the types differ, or when
you want to assemble the map incrementally. Binding the same name twice keeps
the later value.
§Examples
use chdb_rust::connection::Connection;
use chdb_rust::format::OutputFormat;
use chdb_rust::query_param::QueryParams;
let conn = Connection::open_in_memory()?;
let params = QueryParams::new()
.bind("x", 5_u64)
.bind("label", "ok");
let _ = conn.query_with_params(
"SELECT {x:UInt64} AS x, {label:String} AS label",
OutputFormat::CSV,
params,
)?;Implementations§
Source§impl QueryParams
impl QueryParams
Trait Implementations§
Source§impl Clone for QueryParams
impl Clone for QueryParams
Source§impl Debug for QueryParams
impl Debug for QueryParams
Source§impl Default for QueryParams
impl Default for QueryParams
Source§impl<K, V> From<Vec<(K, V)>> for QueryParams
Build a parameter map from an owned vector of pairs.
impl<K, V> From<Vec<(K, V)>> for QueryParams
Build a parameter map from an owned vector of pairs.
Source§impl<K, V, const N: usize> From<[(K, V); N]> for QueryParams
Build a parameter map from an array literal.
impl<K, V, const N: usize> From<[(K, V); N]> for QueryParams
Build a parameter map from an array literal.
Lets call sites pass [("x", 41_u64)] directly wherever a method takes
impl Into<QueryParams>, without naming the builder.
Source§impl IntoIterator for QueryParams
impl IntoIterator for QueryParams
Source§impl<'a> IntoIterator for &'a QueryParams
impl<'a> IntoIterator for &'a QueryParams
Source§type Item = (&'a str, &'a QueryParam)
type Item = (&'a str, &'a QueryParam)
The type of the elements being iterated over.
Source§type IntoIter = Map<Iter<'a, (String, QueryParam)>, fn(&'a (String, QueryParam)) -> (&'a str, &'a QueryParam)>
type IntoIter = Map<Iter<'a, (String, QueryParam)>, fn(&'a (String, QueryParam)) -> (&'a str, &'a QueryParam)>
Which kind of iterator are we turning this into?
Auto Trait Implementations§
impl Forget for QueryParams
impl Freeze for QueryParams
impl Move for QueryParams
impl RefUnwindSafe for QueryParams
impl Send for QueryParams
impl Sync for QueryParams
impl Unpin for QueryParams
impl UnsafeUnpin for QueryParams
impl UnwindSafe for QueryParams
Blanket Implementations§
impl<T> Allocation for T
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