#[derive(klickhouse::Row)]
struct User {
age: u8,
name: string
}
#[derive(klickhouse::Row)]
struct Row {
#[klickhouse(flatten)]
user: User,
credits: u32
}
let users: Vec<Row> = ch.query_collect("SELECT age, name, credits FROM ...").await?;
The commit also adds documentation on the derive macro, in particular::
The supported serde- and clickhouse-specific attributes
The issue on field ordering for type hints #34
This is stacked on PRs from #33 and #33 (tests and documentation). Only the last commit d58c63355c0bab01cbd6b9f9e520083a2b8be5cb is new. See only new changes.
Following issue https://github.com/Protryon/klickhouse/issues/30, this implements the serde-like
flatten
attribute on theRow
derive macro, allowing to compose rows as follows:The commit also adds documentation on the derive macro, in particular::
This is stacked on PRs from #33 and #33 (tests and documentation). Only the last commit d58c63355c0bab01cbd6b9f9e520083a2b8be5cb is new. See only new changes.