[Q] Might it possible to rename columns?
ablearthy opened this issue · comments
Timur Aminev commented
Like that
#[derive(Row, Debug, Default)]
pub struct MyUserData {
#[serde(rename = "Id")]
id: Uuid,
#[serde(rename = "UserData")]
user_data: String,
#[serde(rename = "CreatedAt")]
created_at: DateTime,
}
Max Bruce commented
Yes.
Currently it's implemented as:
#[derive(Row, Debug, Default)]
pub struct MyUserData {
#[klickhouse(rename = "Id")]
id: Uuid,
#[klickhouse(rename = "UserData")]
user_data: String,
#[klickhouse(rename = "CreatedAt")]
created_at: DateTime,
}
It's implemented this way so that one can derive both serde and klickhouse without conflicts.
Will add to docs.