diff options
| author | 2023-04-30 18:31:18 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:31:18 -0400 | |
| commit | 4de57f628bc74f00ba1885e91c84ea07c5405d8f (patch) | |
| tree | 5d91900751e826d491ff1b2ebc571a787e84f864 /Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp | |
| parent | 74d881cefa9097e58e129e37b9c44d680d8c7dfe (diff) | |
| parent | 3565aad630864ecdbe53fdaa501ea708555b3c7c (diff) | |
Update upstream source from tag 'upstream/3.4.4+dfsg'
Update to upstream version '3.4.4+dfsg'
with Debian dir 482614bd23f0ef52dabc9803477204ad88e917ed
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp')
| -rw-r--r-- | Plugins/SqlEnterpriseFormatter/formatcreatetable.cpp | 20 |
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: |
