summaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
commit3565aad630864ecdbe53fdaa501ea708555b3c7c (patch)
treec743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
parent1fdc150116cad39aae5c5da407c3312b47a59e3a (diff)
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp')
-rw-r--r--Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp b/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
index e6fd189..28020af 100644
--- a/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
+++ b/Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp
@@ -36,8 +36,22 @@ void FormatCreateTable::formatInternal()
withParDefRight();
- if (!createTable->withOutRowId.isNull())
+ markAndKeepIndent("tableOptions");
+ bool atLeastOneOption = false;
+ if (createTable->withOutRowId)
+ {
withKeyword("WITHOUT").withId("ROWID");
+ atLeastOneOption = true;
+ }
+
+ if (createTable->strict)
+ {
+ if (atLeastOneOption)
+ withListComma(FormatToken::NO_SPACE_BEFORE);
+
+ withId("STRICT");
+ //atLeastOneOption = true; // to uncomment if there are further options down below
+ }
}
withSemicolon();
@@ -206,12 +220,12 @@ void FormatCreateTableConstraint::formatInternal()
{
case SqliteCreateTable::Constraint::PRIMARY_KEY:
{
- withKeyword("PRIMARY").withKeyword("KEY").withParDefLeft().withStatementList(constr->indexedColumns).withParDefRight();
+ withKeyword("PRIMARY").withKeyword("KEY").withParDefLeft().withStatementList(constr->indexedColumns);
if (constr->autoincrKw)
withKeyword("AUTOINCREMENT");
- withConflict(constr->onConflict);
+ withParDefRight().withConflict(constr->onConflict);
break;
}
case SqliteCreateTable::Constraint::UNIQUE: