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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb887e1c6ce5f0084f039ec0fd92717e861dc425bd40ce447c113726a7e16a30
4
- data.tar.gz: e13a2ea6cb4986e819d5653fa4dc714592c56faadd71b2826e457b7208dc8464
3
+ metadata.gz: '09f3ec19aa33a9c46efe7403e64d5a2eece5cb2e60ab2a7b1ffc2eda2b48f1c3'
4
+ data.tar.gz: da9f80ff35f651f107340f5c2a2c0438e57bbaca81341a93089777b3a04ab1bc
5
5
  SHA512:
6
- metadata.gz: e9964b5ed83c63bc41b79be3356ca96b448b460c380caf7e73431fc4a2009d7473483546bb3a1e90cfd106f878fe0b01a808eda60e38ffdcb1abba4e2a5ad61f
7
- data.tar.gz: 6e7c5ac77fc86253a8e83f1ce2e8acbc578a3799f3d768d8f5fae26181724b104635f35c5fb5ea2ada9fb044c1f0daabdddc5af3c7eb78661caa63e1e6b57022
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
@@ -441,7 +441,7 @@ Produces:
441
441
  ```sql
442
442
  delete
443
443
  from Users
444
- using accounts
444
+ using Accounts
445
445
  where users.account_id = accounts.id
446
446
  returning users.id;
447
447
  ```
@@ -118,8 +118,23 @@ module SqlBeautifier
118
118
  end
119
119
 
120
120
  def render_using
121
- formatted_using_text = "\n#{Util.keyword_padding('using')}#{@using_clause}"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SqlBeautifier
4
- VERSION = "0.10.5"
4
+ VERSION = "0.10.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql_beautifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kinnell Shah