summaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatdroptable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatdroptable.cpp')
-rw-r--r--Plugins/SqlEnterpriseFormatter/formatdroptable.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatdroptable.cpp b/Plugins/SqlEnterpriseFormatter/formatdroptable.cpp
new file mode 100644
index 0000000..775adfe
--- /dev/null
+++ b/Plugins/SqlEnterpriseFormatter/formatdroptable.cpp
@@ -0,0 +1,21 @@
+#include "formatdroptable.h"
+#include "parser/ast/sqlitedroptable.h"
+
+FormatDropTable::FormatDropTable(SqliteDropTable* dropTable) :
+ dropTable(dropTable)
+{
+}
+
+void FormatDropTable::formatInternal()
+{
+ withKeyword("DROP").withKeyword("TABLE");
+
+ if (dropTable->ifExistsKw)
+ withKeyword("IF").withKeyword("EXISTS");
+
+ if (!dropTable->database.isNull())
+ withId(dropTable->database).withIdDot();
+
+ withId(dropTable->table).withSemicolon();
+
+}