|
15 | 15 | SELECT * FROM my_table WHERE 1 = 1;
|
16 | 16 | SQL
|
17 | 17 |
|
18 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
19 |
| -
|
20 |
| -
|
| 18 | + expect(formatter.format(source)).to eq(<<~SQL) |
21 | 19 | SELECT *
|
22 | 20 | FROM my_table
|
23 | 21 | WHERE 1 = 1;
|
|
29 | 27 | SELECT '1'::integer;
|
30 | 28 | SQL
|
31 | 29 |
|
32 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
33 |
| -
|
34 |
| -
|
| 30 | + expect(formatter.format(source)).to eq(<<~SQL) |
35 | 31 | SELECT '1'::int;
|
36 | 32 | SQL
|
37 | 33 | end
|
|
48 | 44 | WHERE bar > 10 OR bar < 5 OR (bar < 2 AND baz);
|
49 | 45 | SQL
|
50 | 46 |
|
51 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
52 |
| -
|
53 |
| -
|
| 47 | + expect(formatter.format(source)).to eq(<<~SQL) |
54 | 48 | SELECT sum(foo) AS column_a,
|
55 | 49 | CASE
|
56 | 50 | WHEN foo = 'a' THEN 1
|
|
71 | 65 | INSERT INTO schema_migrations (version) VALUES ('20250124155339'), ('20250134155339') , ('20250144155339');
|
72 | 66 | SQL
|
73 | 67 |
|
74 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
75 |
| -
|
76 |
| -
|
77 |
| -
|
| 68 | + expect(formatter.format(source)).to eq(<<~SQL) |
78 | 69 | INSERT INTO schema_migrations (version) VALUES
|
79 | 70 | ('20250124155339')
|
80 | 71 | , ('20250134155339')
|
|
89 | 80 |
|
90 | 81 | SQL
|
91 | 82 |
|
92 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
93 |
| -
|
94 |
| -
|
95 |
| -
|
| 83 | + expect(formatter.format(source)).to eq(<<~SQL) |
96 | 84 | INSERT INTO schema_migrations (version)
|
97 | 85 | SELECT foo
|
98 | 86 | FROM bar
|
|
107 | 95 | CREATE UNIQUE INDEX only_one_pending_per_comment_id ON public.my_table USING btree (comment_id) WHERE pending;
|
108 | 96 | SQL
|
109 | 97 |
|
110 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
111 |
| -
|
| 98 | + expect(formatter.format(source)).to eq(<<~SQL) |
112 | 99 | CREATE UNIQUE INDEX only_one_pending_per_comment_id ON public.my_table USING btree (comment_id) WHERE pending;
|
113 | 100 | SQL
|
114 | 101 | end
|
|
122 | 109 | );
|
123 | 110 | SQL
|
124 | 111 |
|
125 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
126 |
| -
|
127 |
| -
|
128 |
| -
|
| 112 | + expect(formatter.format(source)).to eq(<<~SQL) |
129 | 113 | -- Name: post_stats; Type: VIEW;
|
130 | 114 |
|
131 | 115 | CREATE VIEW public.post_stats AS
|
|
141 | 125 | );
|
142 | 126 | SQL
|
143 | 127 |
|
144 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
145 |
| -
|
146 |
| -
|
147 |
| -
|
| 128 | + expect(formatter.format(source)).to eq(<<~SQL) |
148 | 129 | -- Name: post_stats; Type: VIEW;
|
149 | 130 |
|
150 | 131 | CREATE VIEW public.post_stats AS
|
|
160 | 141 | SELECT * from my_cte;
|
161 | 142 | SQL
|
162 | 143 |
|
163 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
164 |
| -
|
165 |
| -
|
| 144 | + expect(formatter.format(source)).to eq(<<~SQL) |
166 | 145 | WITH my_cte AS (
|
167 | 146 | SELECT foo,
|
168 | 147 | baz
|
|
182 | 161 | );
|
183 | 162 | SQL
|
184 | 163 |
|
185 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
186 |
| -
|
187 |
| -
|
188 |
| -
|
| 164 | + expect(formatter.format(source)).to eq(<<~SQL) |
189 | 165 | -- Name: post_stats; Type: MATERIALIZED VIEW;
|
190 | 166 |
|
191 | 167 | CREATE MATERIALIZED VIEW public.post_stats AS
|
|
201 | 177 | ) WITH NO DATA;
|
202 | 178 | SQL
|
203 | 179 |
|
204 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
205 |
| -
|
206 |
| -
|
207 |
| -
|
| 180 | + expect(formatter.format(source)).to eq(<<~SQL) |
208 | 181 | -- Name: post_stats; Type: MATERIALIZED VIEW;
|
209 | 182 |
|
210 | 183 | CREATE MATERIALIZED VIEW public.post_stats AS
|
|
250 | 223 | ) main_status;
|
251 | 224 | SQL
|
252 | 225 |
|
253 |
| - expect(formatter.format(source)).to eq(<<~SQL.chomp) |
254 |
| -
|
255 |
| -
|
256 |
| -
|
| 226 | + expect(formatter.format(source)).to eq(<<~SQL) |
257 | 227 | -- Name: my_bigg_aggregated_view; Type: VIEW;
|
258 | 228 |
|
259 | 229 | CREATE VIEW public.my_bigg_aggregated_view AS
|
|
0 commit comments