From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- .../SqlEnterpriseFormatter/formatcommittrans.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Plugins/SqlEnterpriseFormatter/formatcommittrans.cpp (limited to 'Plugins/SqlEnterpriseFormatter/formatcommittrans.cpp') diff --git a/Plugins/SqlEnterpriseFormatter/formatcommittrans.cpp b/Plugins/SqlEnterpriseFormatter/formatcommittrans.cpp new file mode 100644 index 0000000..7fdafa3 --- /dev/null +++ b/Plugins/SqlEnterpriseFormatter/formatcommittrans.cpp @@ -0,0 +1,24 @@ +#include "formatcommittrans.h" +#include "parser/ast/sqlitecommittrans.h" + +FormatCommitTrans::FormatCommitTrans(SqliteCommitTrans* ct) : + ct(ct) +{ +} + +void FormatCommitTrans::formatInternal() +{ + if (ct->endKw) + withKeyword("END"); + else + withKeyword("COMMIT"); + + if (ct->transactionKw) + { + withKeyword("TRANSACTION"); + if (!ct->name.isNull()) + withId(ct->name); + } + + withOperator(";"); +} -- cgit v1.2.3