teo_sql_connector/stmts/drop/
index.rs

1use crate::schema::dialect::SQLDialect;
2use crate::schema::value::encode::ToSQLString;
3
4pub(crate) struct SQLDropIndexOnStatement {
5    pub(crate) index: String,
6    pub(crate) table: String,
7}
8
9impl ToSQLString for SQLDropIndexOnStatement {
10    fn to_string(&self, _dialect: SQLDialect) -> String {
11        let index = &self.index;
12        let table = &self.table;
13        format!("DROP INDEX `{index}` on `{table}`")
14    }
15}
16
17pub(crate) struct SQLDropIndexStatement {
18    pub(crate) index: String
19}
20
21impl SQLDropIndexStatement {
22    pub fn on(&self, table: impl Into<String>) -> SQLDropIndexOnStatement {
23        SQLDropIndexOnStatement { index: self.index.clone(), table: table.into() }
24    }
25}