aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp')
-rw-r--r--Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp b/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
index 28020af..1fefbdd 100644
--- a/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
+++ b/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
@@ -199,8 +199,26 @@ void FormatCreateTableColumnConstraint::formatInternal()
break;
}
case SqliteCreateTable::Column::Constraint::NULL_:
- case SqliteCreateTable::Column::Constraint::NAME_ONLY:
+ {
+ // Is the default and unofficial. Pass through
+ withKeyword("NULL");
+ break;
+ }
case SqliteCreateTable::Column::Constraint::DEFERRABLE_ONLY:
+ {
+ // Pass through
+ if (constr->deferrable == SqliteDeferrable::NOT_DEFERRABLE)
+ withKeyword("NOT");
+ withKeyword("DEFERRABLE");
+ if (constr->initially != SqliteInitially::null)
+ {
+ withKeyword("INITIALLY");
+ withKeyword(constr->initially == SqliteInitially::DEFERRED ? "DEFERRED" : "IMMEDIATE");
+ }
+ break;
+ }
+ case SqliteCreateTable::Column::Constraint::NAME_ONLY:
+ // The CONSTRAINT <name> clause has already been output
break;
}
}