cql3_parser/common_drop.rs
1use crate::common::FQName;
2
3/// the data for many `Drop` commands
4#[derive(PartialEq, Debug, Clone)]
5pub struct CommonDrop {
6 /// the name of the thing being dropped.
7 pub name: FQName,
8 /// only drop if th thing exists.
9 pub if_exists: bool,
10}
11
12impl CommonDrop {
13 pub fn get_text(&self, type_: &str) -> String {
14 format!(
15 "DROP {}{} {}",
16 type_,
17 if self.if_exists { " IF EXISTS" } else { "" },
18 self.name
19 )
20 }
21}