orez 0.2.26 → 0.2.27

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.
Files changed (103) hide show
  1. package/dist/cf-do/worker.d.ts.map +1 -1
  2. package/dist/cf-do/worker.js +9 -1
  3. package/dist/cf-do/worker.js.map +1 -1
  4. package/dist/pg-proxy-do-backend.d.ts +2 -0
  5. package/dist/pg-proxy-do-backend.d.ts.map +1 -1
  6. package/dist/pg-proxy-do-backend.js +49 -7
  7. package/dist/pg-proxy-do-backend.js.map +1 -1
  8. package/dist/pg-sqlite-compiler/catalog/seed.d.ts +67 -0
  9. package/dist/pg-sqlite-compiler/catalog/seed.d.ts.map +1 -0
  10. package/dist/pg-sqlite-compiler/catalog/seed.js +436 -0
  11. package/dist/pg-sqlite-compiler/catalog/seed.js.map +1 -0
  12. package/dist/pg-sqlite-compiler/index.d.ts +12 -0
  13. package/dist/pg-sqlite-compiler/index.d.ts.map +1 -0
  14. package/dist/pg-sqlite-compiler/index.js +59 -0
  15. package/dist/pg-sqlite-compiler/index.js.map +1 -0
  16. package/dist/pg-sqlite-compiler/passes/ast-utils.d.ts +48 -0
  17. package/dist/pg-sqlite-compiler/passes/ast-utils.d.ts.map +1 -0
  18. package/dist/pg-sqlite-compiler/passes/ast-utils.js +93 -0
  19. package/dist/pg-sqlite-compiler/passes/ast-utils.js.map +1 -0
  20. package/dist/pg-sqlite-compiler/passes/catalog.d.ts +34 -0
  21. package/dist/pg-sqlite-compiler/passes/catalog.d.ts.map +1 -0
  22. package/dist/pg-sqlite-compiler/passes/catalog.js +30 -0
  23. package/dist/pg-sqlite-compiler/passes/catalog.js.map +1 -0
  24. package/dist/pg-sqlite-compiler/passes/datetime.d.ts +21 -0
  25. package/dist/pg-sqlite-compiler/passes/datetime.d.ts.map +1 -0
  26. package/dist/pg-sqlite-compiler/passes/datetime.js +53 -0
  27. package/dist/pg-sqlite-compiler/passes/datetime.js.map +1 -0
  28. package/dist/pg-sqlite-compiler/passes/index.d.ts +21 -0
  29. package/dist/pg-sqlite-compiler/passes/index.d.ts.map +1 -0
  30. package/dist/pg-sqlite-compiler/passes/index.js +39 -0
  31. package/dist/pg-sqlite-compiler/passes/index.js.map +1 -0
  32. package/dist/pg-sqlite-compiler/passes/types.d.ts +41 -0
  33. package/dist/pg-sqlite-compiler/passes/types.d.ts.map +1 -0
  34. package/dist/pg-sqlite-compiler/passes/types.js +103 -0
  35. package/dist/pg-sqlite-compiler/passes/types.js.map +1 -0
  36. package/dist/pg-sqlite-compiler/test/oracle.d.ts +34 -0
  37. package/dist/pg-sqlite-compiler/test/oracle.d.ts.map +1 -0
  38. package/dist/pg-sqlite-compiler/test/oracle.js +204 -0
  39. package/dist/pg-sqlite-compiler/test/oracle.js.map +1 -0
  40. package/dist/pg-sqlite-compiler/types.d.ts +55 -0
  41. package/dist/pg-sqlite-compiler/types.d.ts.map +1 -0
  42. package/dist/pg-sqlite-compiler/types.js +2 -0
  43. package/dist/pg-sqlite-compiler/types.js.map +1 -0
  44. package/package.json +7 -2
  45. package/src/cf-do/.wrangler/cache/cf.json +1 -1
  46. package/src/cf-do/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-shm +0 -0
  47. package/src/cf-do/.wrangler/state/v3/cache/miniflare-CacheObject/metadata.sqlite-wal +0 -0
  48. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/metadata.sqlite-shm +0 -0
  49. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/metadata.sqlite-wal +0 -0
  50. package/src/cf-do/.wrangler/tmp/bundle-0z4CpE/middleware-insertion-facade.js +11 -0
  51. package/src/cf-do/.wrangler/tmp/bundle-0z4CpE/middleware-loader.entry.ts +134 -0
  52. package/src/cf-do/.wrangler/tmp/bundle-vYmw0E/middleware-insertion-facade.js +11 -0
  53. package/src/cf-do/.wrangler/tmp/bundle-vYmw0E/middleware-loader.entry.ts +134 -0
  54. package/src/cf-do/.wrangler/tmp/dev-cbILNo/worker.js +1059 -0
  55. package/src/cf-do/.wrangler/tmp/dev-cbILNo/worker.js.map +8 -0
  56. package/src/cf-do/.wrangler/tmp/dev-qbho19/worker.js +1059 -0
  57. package/src/cf-do/.wrangler/tmp/dev-qbho19/worker.js.map +8 -0
  58. package/src/cf-do/ARCHITECTURE.md +10 -0
  59. package/src/cf-do/CHAT_E2E.md +213 -0
  60. package/src/cf-do/worker.ts +11 -3
  61. package/src/cli.test.ts +3 -1
  62. package/src/pg-proxy-do-backend.ts +44 -10
  63. package/src/pg-sqlite-compiler/README.md +53 -0
  64. package/src/pg-sqlite-compiler/catalog/seed.ts +524 -0
  65. package/src/pg-sqlite-compiler/fixtures/pgsqlite/arithmetic.json +307 -0
  66. package/src/pg-sqlite-compiler/fixtures/pgsqlite/array.json +377 -0
  67. package/src/pg-sqlite-compiler/fixtures/pgsqlite/cast.json +12 -0
  68. package/src/pg-sqlite-compiler/fixtures/pgsqlite/catalog.json +447 -0
  69. package/src/pg-sqlite-compiler/fixtures/pgsqlite/create-table.json +32 -0
  70. package/src/pg-sqlite-compiler/fixtures/pgsqlite/datetime.json +397 -0
  71. package/src/pg-sqlite-compiler/fixtures/pgsqlite/enum.json +337 -0
  72. package/src/pg-sqlite-compiler/fixtures/pgsqlite/insert.json +337 -0
  73. package/src/pg-sqlite-compiler/fixtures/pgsqlite/json.json +537 -0
  74. package/src/pg-sqlite-compiler/fixtures/pgsqlite/misc.json +1837 -0
  75. package/src/pg-sqlite-compiler/index.ts +73 -0
  76. package/src/pg-sqlite-compiler/integration.test.ts +136 -0
  77. package/src/pg-sqlite-compiler/passes/ast-utils.ts +113 -0
  78. package/src/pg-sqlite-compiler/passes/catalog.ts +65 -0
  79. package/src/pg-sqlite-compiler/passes/datetime.ts +74 -0
  80. package/src/pg-sqlite-compiler/passes/index.ts +49 -0
  81. package/src/pg-sqlite-compiler/passes/types.ts +156 -0
  82. package/src/pg-sqlite-compiler/smoke.test.ts +69 -0
  83. package/src/pg-sqlite-compiler/test/catalog.test.ts +171 -0
  84. package/src/pg-sqlite-compiler/test/corpus.test.ts +161 -0
  85. package/src/pg-sqlite-compiler/test/datetime.oracle.test.ts +102 -0
  86. package/src/pg-sqlite-compiler/test/oracle.ts +237 -0
  87. package/src/pg-sqlite-compiler/test/types.test.ts +109 -0
  88. package/src/pg-sqlite-compiler/types.ts +63 -0
  89. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/0f0f3bdf0abda097eb6f1246db4657d9fc622081362d894d82c1a1ce067b05b6.sqlite +0 -0
  90. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/1ddd3a4a48a11b51658444f5458a1fb175194b1d5b6a5bda20ef3fe3205b900c.sqlite +0 -0
  91. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/3835f242df9728adba3d127a238793fd054ed3e51df3f60749ee744c469bf2a2.sqlite +0 -0
  92. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/4aa9c80eb716cf55b8995ccf7afab0b36c683e6da07d7c37a3f9c570136036df.sqlite +0 -0
  93. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/533e2fd1d6ea46e7a9a0017916ef341802d438d72583462755f2c1f8225e9bf2.sqlite +0 -0
  94. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/5ffa1aced1225ecaeac6366f7586aa3de92761cdff8711d81fbd81f248076abd.sqlite +0 -0
  95. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/686c3a9f0d7e59ed2ab607efd4b76d779c97cafeb3818380033bf7c7eb86c819.sqlite +0 -0
  96. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/6e8214e8dcfadd0deb52d64e5e9ca85c6b329ace11193909845995396914c473.sqlite +0 -0
  97. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/78d9ec9ff873d3fe3507ff53c2a6f6dfc408b4268eb0db3f2a146c0678965366.sqlite +0 -0
  98. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/7eff9f0ed7e27ad0d3f9d923de0682fab1928591172c1ba336c5f79a134a5d85.sqlite +0 -0
  99. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/836cda5b995b25867d722ed4f4c2292167e80351a3c6038db626648eb247dd8b.sqlite +0 -0
  100. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/91ef63b112209ab30172763acd8a0935106c248f7f1bcae5545ce37a9f201551.sqlite +0 -0
  101. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/a66ea4293a5f5938bc6d116edfa2522bb85bc37aea3541fbc09c3b613b9b32c0.sqlite +0 -0
  102. package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/ceb2ab26b80590840b65651deb6e948d3bf81565c6751f3a58752cf4bf4aecae.sqlite +0 -0
  103. /package/src/cf-do/.wrangler/state/v3/do/zero-do-ZeroDO/{204a39120310d37e972c5914cfd71ad55c151bdb9e8ed289a5f8c5b052dd60e4.sqlite → 0ffaabee41a60e04dd0eb7db3073f0a40139e6a97ccd26823967acb652b89a7b.sqlite} +0 -0
@@ -0,0 +1,307 @@
1
+ {
2
+ "source": "erans/pgsqlite tests/",
3
+ "bucket": "arithmetic",
4
+ "count": 60,
5
+ "cases": [
6
+ {
7
+ "name": "arithmetic_null_test-1",
8
+ "sql": "SELECT val1 + val2 AS sum_result FROM null_data WHERE id = 1",
9
+ "source": "arithmetic_null_test.rs"
10
+ },
11
+ {
12
+ "name": "arithmetic_null_test-2",
13
+ "sql": "SELECT val1 + val2 AS sum_result FROM null_data WHERE id = 2",
14
+ "source": "arithmetic_null_test.rs"
15
+ },
16
+ {
17
+ "name": "arithmetic_null_test-3",
18
+ "sql": "SELECT val1 + val2 AS sum_result FROM null_data WHERE id = 3",
19
+ "source": "arithmetic_null_test.rs"
20
+ },
21
+ {
22
+ "name": "arithmetic_null_test-4",
23
+ "sql": "SELECT val1 + val2 AS sum_result FROM null_data WHERE id = 4",
24
+ "source": "arithmetic_null_test.rs"
25
+ },
26
+ {
27
+ "name": "arithmetic_null_test-5",
28
+ "sql": "SELECT amount * 1.1 AS with_tax FROM nullable WHERE id = 1",
29
+ "source": "arithmetic_null_test.rs"
30
+ },
31
+ {
32
+ "name": "arithmetic_null_test-6",
33
+ "sql": "SELECT amount * 1.1 AS with_tax FROM nullable WHERE id = 2",
34
+ "source": "arithmetic_null_test.rs"
35
+ },
36
+ {
37
+ "name": "arithmetic_null_test-7",
38
+ "sql": "SELECT (a + b) * c AS result FROM complex_null WHERE id = 1",
39
+ "source": "arithmetic_null_test.rs"
40
+ },
41
+ {
42
+ "name": "arithmetic_null_test-8",
43
+ "sql": "SELECT (a + b) * c AS result FROM complex_null WHERE id = 2",
44
+ "source": "arithmetic_null_test.rs"
45
+ },
46
+ {
47
+ "name": "arithmetic_null_test-9",
48
+ "sql": "SELECT (a + b) * c AS result FROM complex_null WHERE id = 3",
49
+ "source": "arithmetic_null_test.rs"
50
+ },
51
+ {
52
+ "name": "arithmetic_null_test-10",
53
+ "sql": "SELECT price * 1.0 * (1.0 - COALESCE(discount, 0.0)) AS final_price FROM defaults WHERE id = 1",
54
+ "source": "arithmetic_null_test.rs"
55
+ },
56
+ {
57
+ "name": "arithmetic_null_test-11",
58
+ "sql": "SELECT price * 1.0 * (1.0 - COALESCE(discount, 0.0)) AS final_price FROM defaults WHERE id = 2",
59
+ "source": "arithmetic_null_test.rs"
60
+ },
61
+ {
62
+ "name": "arithmetic_null_test-12",
63
+ "sql": "SELECT base_val + 10.0 AS total FROM param_null WHERE id = 1",
64
+ "source": "arithmetic_null_test.rs"
65
+ },
66
+ {
67
+ "name": "arithmetic_null_test-13",
68
+ "sql": "SELECT base_val + 10.0 AS total FROM param_null WHERE id = 2",
69
+ "source": "arithmetic_null_test.rs"
70
+ },
71
+ {
72
+ "name": "arithmetic_null_test-14",
73
+ "sql": "SELECT CAST(50.0 + NULL AS REAL) AS total",
74
+ "source": "arithmetic_null_test.rs"
75
+ },
76
+ {
77
+ "name": "arithmetic_complex_test-1",
78
+ "sql": "SELECT ((a + b) * c) / d AS complex_result FROM calc_data WHERE id = 1",
79
+ "source": "arithmetic_complex_test.rs"
80
+ },
81
+ {
82
+ "name": "arithmetic_complex_test-2",
83
+ "sql": "SELECT CAST((a + (b * c)) AS REAL) / CAST(d AS REAL) AS different_grouping FROM calc_data WHERE id = 1",
84
+ "source": "arithmetic_complex_test.rs"
85
+ },
86
+ {
87
+ "name": "arithmetic_complex_test-3",
88
+ "sql": "SELECT a * (b + (c * d)) AS deeply_nested FROM calc_data WHERE id = 1",
89
+ "source": "arithmetic_complex_test.rs"
90
+ },
91
+ {
92
+ "name": "arithmetic_complex_test-4",
93
+ "sql": "SELECT quantity * price * (1 - discount) * (1 + tax_rate) AS total_amount FROM sales WHERE id = 1",
94
+ "source": "arithmetic_complex_test.rs"
95
+ },
96
+ {
97
+ "name": "arithmetic_complex_test-5",
98
+ "sql": "SELECT quantity * price AS subtotal, quantity * price * (1 - discount) AS discounted, quantity * price * (1 - discount) * (1 + tax_rate) AS final_total FROM sales WHERE id = 1",
99
+ "source": "arithmetic_complex_test.rs"
100
+ },
101
+ {
102
+ "name": "arithmetic_complex_test-6",
103
+ "sql": "SELECT ROUND(value * 2, 2) AS rounded_double FROM measurements WHERE id = 1",
104
+ "source": "arithmetic_complex_test.rs"
105
+ },
106
+ {
107
+ "name": "arithmetic_complex_test-7",
108
+ "sql": "SELECT ABS(value) * 10.0 AS abs_times_ten FROM measurements WHERE id = 2",
109
+ "source": "arithmetic_complex_test.rs"
110
+ },
111
+ {
112
+ "name": "arithmetic_complex_test-8",
113
+ "sql": "SELECT sqrt(value) + 10 AS sqrt_plus_ten FROM measurements WHERE id = 3",
114
+ "source": "arithmetic_complex_test.rs"
115
+ },
116
+ {
117
+ "name": "arithmetic_complex_test-9",
118
+ "sql": "SELECT int_col + real_col AS int_plus_real FROM mixed WHERE id = 1",
119
+ "source": "arithmetic_complex_test.rs"
120
+ },
121
+ {
122
+ "name": "arithmetic_complex_test-10",
123
+ "sql": "SELECT int_col * decimal_col AS int_times_decimal FROM mixed WHERE id = 1",
124
+ "source": "arithmetic_complex_test.rs"
125
+ },
126
+ {
127
+ "name": "arithmetic_complex_test-11",
128
+ "sql": "SELECT decimal_col / int_col AS decimal_div_int FROM mixed WHERE id = 1",
129
+ "source": "arithmetic_complex_test.rs"
130
+ },
131
+ {
132
+ "name": "arithmetic_complex_test-12",
133
+ "sql": "SELECT v1 + v2 * v3 - CAST(v4 AS REAL) / CAST(v5 AS REAL) + v1 * v2 + v3 * v4 - v5 AS long_expr FROM nums WHERE id = 1",
134
+ "source": "arithmetic_complex_test.rs"
135
+ },
136
+ {
137
+ "name": "arithmetic_complex_test-13",
138
+ "sql": "SELECT ((((v1 + 1) * 2) - 3) / CAST(4 AS REAL)) * 5 AS chained FROM nums WHERE id = 1",
139
+ "source": "arithmetic_complex_test.rs"
140
+ },
141
+ {
142
+ "name": "arithmetic_complex_test-14",
143
+ "sql": "SELECT amount * 1.0 * CASE \n WHEN status = 'premium' THEN 1.5 \n WHEN status = 'standard' THEN 1.2 \n ELSE 1.0 \n END AS adjusted_amount \n FROM conditions \n ORDER BY id",
144
+ "source": "arithmetic_complex_test.rs"
145
+ },
146
+ {
147
+ "name": "arithmetic_edge_cases_test-1",
148
+ "sql": "SELECT numerator / denominator AS result FROM test_div WHERE id = 1",
149
+ "source": "arithmetic_edge_cases_test.rs"
150
+ },
151
+ {
152
+ "name": "arithmetic_edge_cases_test-2",
153
+ "sql": "SELECT numerator / denominator AS result FROM test_div WHERE id = 2",
154
+ "source": "arithmetic_edge_cases_test.rs"
155
+ },
156
+ {
157
+ "name": "arithmetic_edge_cases_test-3",
158
+ "sql": "SELECT big_val * 1000 AS huge FROM large_nums WHERE id = 1",
159
+ "source": "arithmetic_edge_cases_test.rs"
160
+ },
161
+ {
162
+ "name": "arithmetic_edge_cases_test-4",
163
+ "sql": "SELECT big_val / 1000 AS tiny FROM large_nums WHERE id = 2",
164
+ "source": "arithmetic_edge_cases_test.rs"
165
+ },
166
+ {
167
+ "name": "arithmetic_edge_cases_test-5",
168
+ "sql": "SELECT val + 100 AS result FROM negatives WHERE id = 1",
169
+ "source": "arithmetic_edge_cases_test.rs"
170
+ },
171
+ {
172
+ "name": "arithmetic_edge_cases_test-6",
173
+ "sql": "SELECT val * -2 AS result FROM negatives WHERE id = 2",
174
+ "source": "arithmetic_edge_cases_test.rs"
175
+ },
176
+ {
177
+ "name": "arithmetic_edge_cases_test-7",
178
+ "sql": "SELECT price * 1.1 AS TotalPrice FROM items WHERE id = 1",
179
+ "source": "arithmetic_edge_cases_test.rs"
180
+ },
181
+ {
182
+ "name": "arithmetic_edge_cases_test-8",
183
+ "sql": "SELECT price * 1.2 as finalprice FROM items WHERE id = 1",
184
+ "source": "arithmetic_edge_cases_test.rs"
185
+ },
186
+ {
187
+ "name": "arithmetic_edge_cases_test-9",
188
+ "sql": "SELECT price * 1.3 As MixedCase FROM items WHERE id = 1",
189
+ "source": "arithmetic_edge_cases_test.rs"
190
+ },
191
+ {
192
+ "name": "arithmetic_edge_cases_test-10",
193
+ "sql": "SELECT int_val * real_val AS simple_mult FROM mixed_types WHERE id = 1",
194
+ "source": "arithmetic_edge_cases_test.rs"
195
+ },
196
+ {
197
+ "name": "arithmetic_edge_cases_test-11",
198
+ "sql": "SELECT CAST(text_val AS REAL) + 10 AS text_math FROM mixed_types WHERE id = 1",
199
+ "source": "arithmetic_edge_cases_test.rs"
200
+ },
201
+ {
202
+ "name": "arithmetic_edge_cases_test-12",
203
+ "sql": "SELECT a + b AS addition FROM calc WHERE id = 1",
204
+ "source": "arithmetic_edge_cases_test.rs"
205
+ },
206
+ {
207
+ "name": "arithmetic_edge_cases_test-13",
208
+ "sql": "SELECT a - b AS subtraction FROM calc WHERE id = 1",
209
+ "source": "arithmetic_edge_cases_test.rs"
210
+ },
211
+ {
212
+ "name": "arithmetic_edge_cases_test-14",
213
+ "sql": "SELECT a * b AS multiplication FROM calc WHERE id = 1",
214
+ "source": "arithmetic_edge_cases_test.rs"
215
+ },
216
+ {
217
+ "name": "arithmetic_edge_cases_test-15",
218
+ "sql": "SELECT a / b AS division FROM calc WHERE id = 1",
219
+ "source": "arithmetic_edge_cases_test.rs"
220
+ },
221
+ {
222
+ "name": "arithmetic_edge_cases_test-16",
223
+ "sql": "SELECT CAST(a AS INTEGER) % CAST(c AS INTEGER) AS modulo FROM calc WHERE id = 1",
224
+ "source": "arithmetic_edge_cases_test.rs"
225
+ },
226
+ {
227
+ "name": "arithmetic_edge_cases_test-17",
228
+ "sql": "SELECT a.val + b.val AS sum_result FROM precision_test a, precision_test b WHERE a.id = 1 AND b.id = 2",
229
+ "source": "arithmetic_edge_cases_test.rs"
230
+ },
231
+ {
232
+ "name": "arithmetic_subquery_test-1",
233
+ "sql": "SELECT name, (SELECT SUM(amount * (1.0 - c.discount)) FROM orders o WHERE o.customer_id = c.id) AS total_after_discount \n FROM customers c \n ORDER BY id",
234
+ "source": "arithmetic_subquery_test.rs"
235
+ },
236
+ {
237
+ "name": "arithmetic_subquery_test-2",
238
+ "sql": "SELECT customer_id, avg_amount * 1.1 AS projected_avg \n FROM (SELECT customer_id, AVG(amount) AS avg_amount FROM orders GROUP BY customer_id) t\n ORDER BY customer_id",
239
+ "source": "arithmetic_subquery_test.rs"
240
+ },
241
+ {
242
+ "name": "arithmetic_subquery_test-3",
243
+ "sql": "WITH product_totals AS (\n SELECT product, \n SUM(quantity) AS total_quantity,\n SUM(quantity * unit_price) AS total_revenue\n FROM sales\n GROUP BY product\n )\n SELECT product, \n total_revenue / total_quantity AS avg_price_per_unit,\n total_revenue * 1.2 AS projected_revenue\n FROM product_totals\n ORDER BY product",
244
+ "source": "arithmetic_subquery_test.rs"
245
+ },
246
+ {
247
+ "name": "arithmetic_subquery_test-4",
248
+ "sql": "WITH RECURSIVE factorial AS (\n SELECT 1 AS n, 1.0 AS fact\n UNION ALL\n SELECT n + 1, fact * (n + 1)\n FROM factorial\n WHERE n < 5\n )\n SELECT n, fact AS factorial_value\n FROM factorial\n ORDER BY n",
249
+ "source": "arithmetic_subquery_test.rs"
250
+ },
251
+ {
252
+ "name": "arithmetic_subquery_test-5",
253
+ "sql": "SELECT p.name, r.name AS region, \n price_with_tax, \n price_with_tax + r.shipping_cost AS final_price\n FROM products p\n CROSS JOIN regions r\n JOIN (\n SELECT p2.id AS product_id, r2.id AS region_id,\n p2.base_price * (1 + r2.tax_rate) AS price_with_tax\n FROM products p2\n CROSS JOIN regions r2\n ) calc ON calc.product_id = p.id AND calc.region_id = r.id\n ORDER BY p.id, r.id",
254
+ "source": "arithmetic_subquery_test.rs"
255
+ },
256
+ {
257
+ "name": "arithmetic_subquery_test-6",
258
+ "sql": "SELECT category,\n avg_value,\n avg_value * 2 AS double_avg,\n (SELECT (t2.avg_value - t1.avg_value) * 100 / t1.avg_value\n FROM (SELECT AVG(value) AS avg_value FROM metrics) t2) AS pct_diff_from_overall\n FROM (SELECT category, AVG(value) AS avg_value FROM metrics GROUP BY category) t1\n ORDER BY category",
259
+ "source": "arithmetic_subquery_test.rs"
260
+ },
261
+ {
262
+ "name": "arithmetic_aliasing_test-1",
263
+ "sql": "SELECT price * 1.1 AS price_with_markup FROM products WHERE id = 1",
264
+ "source": "arithmetic_aliasing_test.rs"
265
+ },
266
+ {
267
+ "name": "arithmetic_aliasing_test-2",
268
+ "sql": "SELECT price * quantity AS total, price * tax_rate AS tax_amount FROM products WHERE id = 1",
269
+ "source": "arithmetic_aliasing_test.rs"
270
+ },
271
+ {
272
+ "name": "arithmetic_aliasing_test-3",
273
+ "sql": "SELECT price + 10 adjusted_price FROM products WHERE id = 1",
274
+ "source": "arithmetic_aliasing_test.rs"
275
+ },
276
+ {
277
+ "name": "arithmetic_aliasing_test-4",
278
+ "sql": "SELECT cost * markup AS selling_price FROM items WHERE id = $1",
279
+ "source": "arithmetic_aliasing_test.rs"
280
+ },
281
+ {
282
+ "name": "arithmetic_aliasing_test-5",
283
+ "sql": "SELECT cost * markup + 5 AS final_price FROM items WHERE id = $1",
284
+ "source": "arithmetic_aliasing_test.rs"
285
+ },
286
+ {
287
+ "name": "arithmetic_aliasing_test-6",
288
+ "sql": "SELECT amount * 1.1 AS total_with_tax, created_at AT TIME ZONE 'UTC' AS utc_time FROM orders WHERE id = 1",
289
+ "source": "arithmetic_aliasing_test.rs"
290
+ },
291
+ {
292
+ "name": "arithmetic_aliasing_test-7",
293
+ "sql": "SELECT num * 2.0 AS result FROM test_values WHERE id = 1",
294
+ "source": "arithmetic_aliasing_test.rs"
295
+ },
296
+ {
297
+ "name": "arithmetic_aliasing_test-8",
298
+ "sql": "SELECT quantity * price AS total_value FROM inventory WHERE id = 1",
299
+ "source": "arithmetic_aliasing_test.rs"
300
+ },
301
+ {
302
+ "name": "arithmetic_aliasing_test-9",
303
+ "sql": "SELECT CAST(price AS REAL) / quantity AS unit_price FROM inventory WHERE id = 1",
304
+ "source": "arithmetic_aliasing_test.rs"
305
+ }
306
+ ]
307
+ }