ClickHouse: support of create table query with primary key and parametrised table engine (#1289)

This commit is contained in:
Aleksei Piianin 2024-06-07 14:19:32 +02:00 committed by GitHub
parent 4b60866bc7
commit 3c33ac15bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 168 additions and 25 deletions

View file

@ -6315,6 +6315,29 @@ impl Display for MySQLColumnPosition {
}
}
/// Engine of DB. Some warehouse has parameters of engine, e.g. [clickhouse]
///
/// [clickhouse]: https://clickhouse.com/docs/en/engines/table-engines
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
pub struct TableEngine {
pub name: String,
pub parameters: Option<Vec<Ident>>,
}
impl Display for TableEngine {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.name)?;
if let Some(parameters) = self.parameters.as_ref() {
write!(f, "({})", display_comma_separated(parameters))?;
}
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;