pub struct Param(/* private fields */);Expand description
A query parameter value accepted by Query::param
and Exec::param.
Because ClickHouse parses parameters according to the type declared in the
SQL ({id:UInt64}), any compatible Rust representation works: an i64 in
range works for UInt8, and a string works for Decimal, IPv4, or
DateTime.
| Rust | Sent as |
|---|---|
integers, floats, bool | the number, true/false |
&str, String | the text |
Vec<u8>, &[u8] | the bytes, as a String |
uuid::Uuid | the hyphenated form |
chrono::DateTime<Utc>, chrono::NaiveDateTime (as UTC) | Unix seconds with a fraction, so no time zone applies |
chrono::NaiveDate | YYYY-MM-DD |
std::net::IpAddr and its variants | dotted / RFC 5952 text |
Option<T> | T, or NULL for None (declare the type Nullable(…)) |
Vec<T> (T not u8) | an array |
HashMap<K, V>, BTreeMap<K, V> | a map |
Value | the value as it is: the explicit form, for any type |
Use Value directly for ClickHouse types without a dedicated Rust type
here, such as exact decimals (Value::Decimal("12.30".into())) or tuples
(Value::Tuple(vec![1i64.into(), "a".into()])).
Implementations§
Trait Implementations§
impl ArrayElement for Param
Source§impl From<NaiveDateTime> for Param
impl From<NaiveDateTime> for Param
Source§fn from(v: NaiveDateTime) -> Self
fn from(v: NaiveDateTime) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Param
Auto Trait Implementations§
impl Forget for Param
impl Freeze for Paramwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<(Value, Value)>: Freeze,
impl Move for Param
impl RefUnwindSafe for Param
impl Send for Param
impl Sync for Param
impl Unpin for Param
impl UnsafeUnpin for Paramwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<(Value, Value)>: UnsafeUnpin,
impl UnwindSafe for Param
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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::RequestCreates a shared type from an unshared type.