cql3_parser/drop_trigger.rs
1use crate::common::FQName;
2use std::fmt::{Display, Formatter};
3
4/// The data for a `drop trigger` command
5#[derive(PartialEq, Debug, Clone)]
6pub struct DropTrigger {
7 /// the name of the trigger
8 pub name: FQName,
9 /// the table the trigger is associated with.
10 pub table: FQName,
11 /// only drop if the trigger exists
12 pub if_exists: bool,
13}
14
15impl Display for DropTrigger {
16 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
17 write!(
18 f,
19 "DROP TRIGGER{} {} ON {}",
20 if self.if_exists { " IF EXISTS" } else { "" },
21 self.name,
22 self.table
23 )
24 }
25}