Skip to content

Commit d81b9f5

Browse files
authored
Merge pull request #329 from domaframework/feature/sql-format-sub-group-spacing
Fix Value Group Format Rules for Bulk Update Queries
2 parents e4ca6d6 + 971f914 commit d81b9f5

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/SqlRightPatternBlock.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ open class SqlRightPatternBlock(
8282
val NEW_LINE_EXPECTED_TYPES =
8383
listOf(
8484
SqlUpdateColumnGroupBlock::class,
85-
SqlUpdateValueGroupBlock::class,
8685
SqlCreateTableColumnDefinitionGroupBlock::class,
8786
SqlColumnDefinitionRawGroupBlock::class,
8887
SqlUpdateSetGroupBlock::class,

src/test/kotlin/org/domaframework/doma/intellij/formatter/SqlFormatterTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class SqlFormatterTest : BasePlatformTestCase() {
114114
formatSqlFile("UpdateBindVariable.sql", "UpdateBindVariable$formatDataPrefix.sql")
115115
}
116116

117-
fun testUpdateTupleAssignmentFormatter() {
118-
formatSqlFile("UpdateTupleAssignment.sql", "UpdateTupleAssignment$formatDataPrefix.sql")
117+
fun testUpdateBulkAssignmentFormatter() {
118+
formatSqlFile("UpdateBulkAssignment.sql", "UpdateBulkAssignment$formatDataPrefix.sql")
119119
}
120120

121121
fun testDeleteFormatter() {

src/test/testData/sql/formatter/UpdateTupleAssignment.sql renamed to src/test/testData/sql/formatter/UpdateBulkAssignment.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ UPDATE /*# tableName */
44
, x3
55
/*%for entity : entities */
66
, /*# entity.itemIdentifier */
7-
/*%end*/) = ( /* @userId() */1
7+
/*%end*/)=(/* @userId() */1
88
, x
99
, x + 1
1010
/*%for entity : entities */

src/test/testData/sql/formatter/UpdateTupleAssignment_format.sql renamed to src/test/testData/sql/formatter/UpdateBulkAssignment_format.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ UPDATE /*# tableName */
1111
, x + 1
1212
/*%for entity : entities */
1313
, /* entity.value */'abc'
14-
/*%end*/
15-
)
14+
/*%end*/ )
1615
WHERE x = /* reportId */1

0 commit comments

Comments
 (0)