sql_beautifier 0.10.5 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/sql_beautifier/delete_query.rb +16 -1
- data/lib/sql_beautifier/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09f3ec19aa33a9c46efe7403e64d5a2eece5cb2e60ab2a7b1ffc2eda2b48f1c3'
|
|
4
|
+
data.tar.gz: da9f80ff35f651f107340f5c2a2c0438e57bbaca81341a93089777b3a04ab1bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba6bf5c1ef5fb8dc41befbe8fb72a638b64e348c5522aa27e9161b510d5ff47ef5c18f27940f52bb48a136efe7292665dc97080a3b4c982aa9071953a0bece05
|
|
7
|
+
data.tar.gz: 76509b388607858b9640dbaf253752f87bdc927d95c7a00f650d98891083a96bc085c94454e252d01d4c12dad77a6dede691bd76c115dd712ee90927e71ec0b6
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## [X.X.X] - YYYY-MM-DD
|
|
4
4
|
|
|
5
|
+
## [0.10.6] - 2026-04-09
|
|
6
|
+
|
|
7
|
+
- Apply table name formatting to `DELETE ... USING` clause table references — table names in the `USING` clause now follow the `table_name_format` setting (PascalCase by default), matching how table names are formatted in `FROM`, `INSERT INTO`, and CTE definitions
|
|
8
|
+
|
|
5
9
|
## [0.10.5] - 2026-04-08
|
|
6
10
|
|
|
7
11
|
- Change CTE formatting to use compact `with` prefix — `with` is no longer padded to the keyword column width; CTE body lines are indented by `indent_spaces` from column zero instead of from the keyword column, and the closing `)` sits at column zero; subsequent CTE definitions in multi-CTE queries also start at column zero
|
data/README.md
CHANGED
|
@@ -118,8 +118,23 @@ module SqlBeautifier
|
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
def render_using
|
|
121
|
-
|
|
121
|
+
formatted_clause = format_using_table_references(@using_clause)
|
|
122
|
+
formatted_using_text = "\n#{Util.keyword_padding('using')}#{formatted_clause}"
|
|
122
123
|
Query.format_subqueries_in_text(formatted_using_text, depth: @depth)
|
|
123
124
|
end
|
|
125
|
+
|
|
126
|
+
def format_using_table_references(clause_text)
|
|
127
|
+
segments = Tokenizer.split_by_top_level_commas(clause_text)
|
|
128
|
+
segments.map { |segment| format_table_name_in_reference(segment.strip) }.join(", ")
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def format_table_name_in_reference(reference_text)
|
|
132
|
+
return reference_text if reference_text.start_with?(Constants::OPEN_PARENTHESIS)
|
|
133
|
+
|
|
134
|
+
table_name = Util.first_word(reference_text)
|
|
135
|
+
return reference_text unless table_name
|
|
136
|
+
|
|
137
|
+
"#{Util.format_table_name(table_name)}#{reference_text[table_name.length..]}"
|
|
138
|
+
end
|
|
124
139
|
end
|
|
125
140
|
end
|