quill_sql/plan/logical_plan/
drop_index.rs

1#[derive(Debug, Clone)]
2pub struct DropIndex {
3    pub name: String,
4    pub schema: Option<String>,
5    pub catalog: Option<String>,
6    pub if_exists: bool,
7}
8
9impl std::fmt::Display for DropIndex {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        let qualified = match (&self.catalog, &self.schema) {
12            (Some(catalog), Some(schema)) => format!("{catalog}.{schema}.{}", self.name),
13            (None, Some(schema)) => format!("{schema}.{}", self.name),
14            _ => self.name.clone(),
15        };
16        if self.if_exists {
17            write!(f, "DropIndex IF EXISTS: {qualified}")
18        } else {
19            write!(f, "DropIndex: {qualified}")
20        }
21    }
22}