clickhouse-arrow 0.2.1

ClickHouse Arrow Client for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{FromSql, Result, ToSql, Type, Uuid, Value, unexpected_type};

impl ToSql for Uuid {
    fn to_sql(self, _type_hint: Option<&Type>) -> Result<Value> { Ok(Value::Uuid(self)) }
}

impl FromSql for Uuid {
    fn from_sql(type_: &Type, value: Value) -> Result<Self> {
        if !matches!(type_, Type::Uuid) {
            return Err(unexpected_type(type_));
        }
        match value {
            Value::Uuid(x) => Ok(x),
            _ => Err(unexpected_type(type_)),
        }
    }
}