use surrealdb_types::{SqlFormat, ToSql};
use crate::expr::statements::alter::AlterKind;
use crate::expr::{Expr, Literal};
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub struct AlterIndexStatement {
pub name: Expr,
pub table: Expr,
pub if_exists: bool,
pub prepare_remove: bool,
pub comment: AlterKind<String>,
}
impl Default for AlterIndexStatement {
fn default() -> Self {
Self {
name: Expr::Literal(Literal::None),
table: Expr::Literal(Literal::None),
if_exists: false,
prepare_remove: false,
comment: AlterKind::None,
}
}
}
impl ToSql for AlterIndexStatement {
fn fmt_sql(&self, f: &mut String, fmt: SqlFormat) {
let stmt: crate::sql::statements::alter::AlterIndexStatement = self.clone().into();
stmt.fmt_sql(f, fmt);
}
}