clickhouse.rs icon indicating copy to clipboard operation
clickhouse.rs copied to clipboard

Support Nested more convenient

Open loyd opened this issue 2 years ago • 0 comments

Right now it can be done using separate arrays:

#[derive(Debug, Row, Serialize, Deserialize)]
struct MyRowOwned {
    no: u32,
    #[serde(rename = "nested.a")]
    a: Vec<f64>,
    #[serde(rename = "nested.b")]
    b: Vec<f64>,
}

However it can be more convenient to detect following pattern:

#[derive(Debug, Row, Serialize, Deserialize)]
struct MyRowOwned {
    no: u32,
    nested: Vec<Nested>,
}

#[derive(Debug, Row, Serialize, Deserialize)]
struct Nested {
    a: f64,
    b: f64,
}

loyd avatar May 11 '22 04:05 loyd