aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatrollback.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatrollback.cpp')
-rw-r--r--Plugins/SqlEnterpriseFormatter/formatrollback.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatrollback.cpp b/Plugins/SqlEnterpriseFormatter/formatrollback.cpp
new file mode 100644
index 0000000..c55f5cc
--- /dev/null
+++ b/Plugins/SqlEnterpriseFormatter/formatrollback.cpp
@@ -0,0 +1,24 @@
+#include "formatrollback.h"
+#include "parser/ast/sqliterollback.h"
+
+FormatRollback::FormatRollback(SqliteRollback* rollback) :
+ rollback(rollback)
+{
+}
+
+void FormatRollback::formatInternal()
+{
+ withKeyword("ROLLBACK");
+ if (rollback->transactionKw)
+ withKeyword("TRANSACTION");
+
+ if (!rollback->name.isNull())
+ {
+ withKeyword("TO");
+ if (rollback->savepointKw)
+ withKeyword("SAVEPOINT");
+
+ withId(rollback->name);
+ }
+ withSemicolon();
+}