sql-cli 1.66.0

SQL query tool for CSV/JSON with both interactive TUI and non-interactive CLI modes - perfect for exploration and automation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
# Changelog

All notable changes to SQL CLI will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.66.0] - 2025-11-02

### โœจ Major Features

#### **SELECT * EXCLUDE - DuckDB-Compatible Column Exclusion**
Implements DuckDB-style `SELECT * EXCLUDE (columns...)` syntax for cleaner queries when you want most columns but not all.

**New Syntax**:
```sql
-- Exclude sensitive columns
SELECT * EXCLUDE (password, ssn, credit_card) FROM users WHERE active = true;

-- Exclude multiple columns for cleaner output
SELECT * EXCLUDE (created_at, updated_at, deleted_at, internal_id) FROM products;

-- Works with all SQL clauses
SELECT * EXCLUDE (eccentricity, albedo)
FROM solar_system
WHERE type = 'Planet'
ORDER BY mean_distance_au;
```

**Benefits**:
- **Security** - Easy to exclude sensitive columns (passwords, SSNs, tokens)
- **Performance** - Skip large BLOB/TEXT columns when not needed
- **Maintainability** - New columns auto-included without query updates
- **Readability** - Clearer intent than listing 50+ columns manually

**Implementation**:
- Parser support for `* EXCLUDE (column_list)` syntax
- AST extension with `SelectItem::StarExclude` variant
- Query engine expansion at execution time (no transformer needed)
- Case-insensitive column matching
- Comprehensive example file: `examples/select_star_exclude.sql`
- Formal test with 16 query validations

#### **Comprehensive Line Geometry Toolkit**
Extended vector math with complete line analysis functions for collision detection, CAD, graphics, and geometric computations.

**New Functions**:
- **`LINE_INTERSECT(p1, p2, p3, p4)`** - Find exact intersection of two infinite 2D lines
  - Returns intersection point as vector, or NULL if parallel
  - Example: `LINE_INTERSECT(VEC(0,0), VEC(4,4), VEC(0,4), VEC(4,0))` โ†’ `(2,2)`

- **`SEGMENT_INTERSECT(p1, p2, p3, p4)`** - Check if bounded line segments intersect
  - Returns intersection point if segments cross, NULL otherwise
  - Crucial for collision detection - checks actual segment overlap, not extended lines

- **`CLOSEST_POINT_ON_LINE(point, line_point, line_dir)`** - Project point onto line
  - Returns closest point on line to given point
  - Works in 2D and 3D
  - Example: `CLOSEST_POINT_ON_LINE(VEC(2,2), VEC(0,0), VEC(1,0))` โ†’ `(2,0)`

- **`POINT_LINE_DISTANCE(point, line_point, line_dir)`** - Perpendicular distance
  - Calculate shortest distance from point to line
  - Works in 2D and 3D

- **`LINE_REFLECT_POINT(point, line_point, line_dir)`** - Mirror point across line
  - Reflect point across a line (mirror transformation)
  - Useful for graphics, physics, symmetry operations

**Use Cases**:
- **Collision Detection** - Check if moving objects intersect
- **Snap-to-Grid** - Find closest point on grid lines
- **CAD/Graphics** - Mirror images, project points
- **Mapping** - Calculate building-to-road distances

**Example File**: `examples/complete_line_analysis.sql` with 18+ demonstrations

#### **Enhanced Vector Mathematics**
Comprehensive vector operations for 2D/3D calculations.

**Existing Functions** (documented):
- `VEC(x, y)` or `VEC(x, y, z)` - Create 2D/3D vectors
- `VEC_DOT(v1, v2)` - Dot product
- `VEC_CROSS(v1, v2)` - Cross product
- `VEC_LENGTH(v)` - Magnitude/length
- `VEC_NORMALIZE(v)` - Unit vector
- `VEC_DISTANCE(v1, v2)` - Distance between points
- `VEC_ADD(v1, v2)` - Vector addition
- `VEC_SUB(v1, v2)` - Vector subtraction
- `VEC_SCALE(v, scalar)` - Scalar multiplication

### ๐Ÿ”ง Improvements

**PostgreSQL Compatibility (v1.65.0)**:
- **ILIKE operator** - Case-insensitive LIKE with transformer
  - `SELECT * FROM users WHERE email ILIKE '%@gmail.com'`
  - Rewrites to `UPPER(email) LIKE UPPER('%@gmail.com')`
  - Full pattern matching with `%` and `_` wildcards

**CI/CD Enhancements**:
- **Performance benchmarking** in GitHub Actions
- Tracks query performance trends across pushes
- Uploads benchmark results as artifacts (30-day retention)
- Non-blocking - doesn't fail builds

**Test Infrastructure**:
- **Fixed capture bug** in `test_examples.py`
- Line-by-line JSON parser now skips empty arrays
- Multi-statement script capture works correctly
- All 28 formal tests passing

### ๐Ÿ› Bug Fixes

- **REPLACE keyword conflict** - Removed REPLACE as keyword to avoid conflict with REPLACE() function
- **Temp table persistence** - Restored in `--execute-statement` mode
- **Test capture** - Fixed normalize_json for multi-statement output

### ๐Ÿ“š Documentation

- **Roadmap updated** - SELECT * EXCLUDE marked complete
- **Examples enhanced** - New geometry demonstrations
- **Function documentation** - Complete line analysis toolkit guide

### ๐ŸŽฏ Summary

**New in this release**:
- โœ… SELECT * EXCLUDE (DuckDB compatibility)
- โœ… 5 line geometry functions (CAD/graphics/collision detection)
- โœ… ILIKE operator (PostgreSQL compatibility)
- โœ… Performance benchmarking CI
- โœ… Test infrastructure improvements

**Total functions**: 100+ SQL functions including geometry, vector math, astronomy, chemistry, physics, and more!

---

## [1.64.0] - 2025-11-01

### โœจ Major Features

#### **Execution Mode Unification & Query Transformation Pipeline**
Complete unification of script mode (`-f`) and query mode (`-q`) execution paths, bringing sophisticated query transformation capabilities to both modes.

**Unified Execution Architecture**:
- **Single execution path** - Both `-f` scripts and `-q` queries now use the same underlying execution engine
- **Consistent transformer support** - All query transformations (WHERE, GROUP BY, HAVING, ORDER BY alias expansion) work in both modes
- **Dependency-aware execution** - `--execute-statement N` now applies full preprocessing pipeline
- **Shared infrastructure** - Eliminates code duplication and ensures feature parity

**Query Transformation Pipeline** (now available in both modes):
- **WHERE clause alias expansion** - Use SELECT aliases in WHERE: `SELECT value * 2 AS doubled FROM data WHERE doubled > 100`
- **GROUP BY alias expansion** - Reference SELECT aliases in GROUP BY: `SELECT region, SUM(sales) AS total FROM data GROUP BY region HAVING total > 1000`
- **HAVING auto-aliasing** - Automatic aliases for aggregate expressions in HAVING clause
- **ORDER BY expression support** - Complex expressions in ORDER BY automatically moved to SELECT with hidden columns

**New Debug Capabilities**:
- **`--show-transformations` flag** - See the complete transformation pipeline for any query
- **Nvim `\st` keymap** - Visualize transformations for query at cursor in Neovim plugin
- **`\sz` keymap** - Alternative transformations debug view
- **Detailed pipeline output** - Shows original SQL, intermediate steps, and final transformed query

**ORDER BY Expression Support**:
- **Complex expressions in ORDER BY** - Use any SQL expression in ORDER BY clause
- **Automatic SELECT injection** - Expressions automatically added to SELECT with hidden columns
- **Aggregate support** - ORDER BY can use aggregates: `ORDER BY SUM(value) DESC`
- **Works with transformers** - Integrates seamlessly with WHERE/GROUP BY alias expansion
- **Example**: `SELECT region FROM sales GROUP BY region ORDER BY SUM(amount) DESC`

**Technical Architecture**:
- **Three-phase execution** (Phases 0-2 complete):
  - Phase 0: Unified execution module foundation
  - Phase 1: Refactored `-q` mode to use unified path
  - Phase 2: Refactored `-f` mode to use unified path
  - Phase 3: Enabled full preprocessing pipeline in both modes
- **Transformer orchestration** - Coordinated pipeline of AST transformers
- **Preserved semantics** - All transformations maintain original query intent

#### **QUALIFY Clause Support**
Industry-standard window function filtering using QUALIFY clause (Snowflake, BigQuery, Teradata syntax).

**New Capability**:
```sql
-- Top 3 products per category by sales
SELECT category, product, sales,
       ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank
FROM products
QUALIFY rank <= 3;
```

**Benefits**:
- **Cleaner syntax** - No need for CTE wrapper around window functions
- **Better readability** - Filter intent clear and concise
- **Standard SQL** - Matches Snowflake/BigQuery syntax
- **Performance** - Efficient filtering after window function evaluation

**Full Window Function Support**:
- Works with ROW_NUMBER(), RANK(), DENSE_RANK()
- Supports LAG(), LEAD(), FIRST_VALUE(), LAST_VALUE()
- Compatible with all window functions (SUM, AVG, COUNT, etc.)
- Handles complex PARTITION BY and ORDER BY clauses

### ๐Ÿ”ง Improvements

**Examples Testing Framework**:
- **Python-based test runner** - Replaced bash scripts with robust Python framework
- **Formal testing** - JSON expectations for critical examples
- **Smoke testing** - 117+ examples validated for basic execution
- **Data file hint support** - Examples automatically find their data files
- **Clear output** - JSON validation failures clearly reported

**Neovim Plugin**:
- **Transformation debug keymaps** - `\st` and `\sz` for pipeline visualization
- **Better keymap organization** - Moved transformations to `\sz` to free up `\st`

**Documentation**:
- **UNION ALL examples** - Added comprehensive subquery examples
- **ORDER BY examples** - New example file for expression patterns
- **Roadmap updates** - Documented ORDER BY completion status

### ๐Ÿ› Bug Fixes

**Temp Table Persistence**:
- **Fixed `--execute-statement` mode** - Temp tables now properly persist across statement execution
- **Materialization** - Temp tables correctly materialized and registered
- **Dependency chain** - Multi-statement scripts with temp table dependencies work correctly

**Transformer Pipeline**:
- **Dependency-aware execution** - Transformers now enabled in `--execute-statement` mode
- **Qualified name resolution** - Fixed regression in table.column resolution after transformer changes
- **Correlated subquery detection** - Phase 1 analyzer for future optimization

**Testing**:
- **History file tests** - Ignored tests requiring persistent history file in CI
- **Test output** - Clear JSON validation messages in examples framework
- **CI pipeline** - Examples test suite integrated into continuous integration

### ๐Ÿ“š Documentation & Examples

**New Examples**:
- `examples/order_by_expressions.sql` - ORDER BY expression patterns
- `examples/union_all_subquery.sql` - UNION ALL with subqueries
- Time series generation examples - How to create temporal test data

**Updated Documentation**:
- `CLAUDE.md` - Examples test framework commands and usage
- Roadmap - ORDER BY expression support completion notes
- Test framework - Formal vs smoke test distinctions

### ๐ŸŽฏ Use Cases Enabled

**Complex Analytical Queries**:
```sql
-- Top regions by total sales (ORDER BY with aggregate)
SELECT region, SUM(amount) AS total
FROM sales
GROUP BY region
ORDER BY SUM(amount) DESC
LIMIT 5;

-- Filtered window functions with QUALIFY
SELECT salesperson, month, sales,
       ROW_NUMBER() OVER (PARTITION BY salesperson ORDER BY sales DESC) as rank
FROM monthly_sales
QUALIFY rank <= 3;

-- Multi-stage transformation pipeline (visible with --show-transformations)
SELECT region, value * 2 AS doubled
FROM data
WHERE doubled > 100
GROUP BY region
HAVING SUM(doubled) > 1000
ORDER BY SUM(doubled) DESC;
```

**Unified Workflow**:
- Write query in Neovim with `\st` to see transformations
- Test with `-q` mode: `sql-cli -q "SELECT ..." --show-transformations`
- Save to script file and run with `-f` mode (same execution path!)
- Use `--execute-statement N` with full transformer support

### ๐Ÿ”ง Technical Details

**Files Modified**:
- `src/main.rs` - Unified execution path integration
- `src/execution/mod.rs` - New unified execution module
- `src/query_plan/` - Transformer orchestration
- `tests/integration/test_examples.py` - Python examples framework
- `nvim-plugin/lua/sql-cli/` - Transformation debug keymaps

**Test Results**:
- โœ… 457 library tests passing
- โœ… 397 integration tests passing
- โœ… 119 example tests (2 formal, 117 smoke)

---

## [1.63.0] - 2025-10-25

### โœจ Major Features

#### **JOIN Expression Support (Phase 2) - LEFT Side Expressions**
Complete the JOIN expression support by enabling functions and expressions on the **LEFT side** of JOIN conditions! This mirrors Phase 1 functionality and enables expressions on **BOTH sides** simultaneously.

**Phase 2 Capabilities**:
- **LEFT-side TRIM()** - `JOIN table ON TRIM(table1.name) = table2.name`
- **LEFT-side UPPER()/LOWER()** - `JOIN table ON UPPER(table1.code) = table2.CODE`
- **LEFT-side SUBSTRING()** - `JOIN table ON SUBSTRING(table1.id, 0, 3) = table2.code`
- **LEFT-side nested functions** - `JOIN table ON UPPER(TRIM(table1.name)) = table2.name`
- **LEFT-side arithmetic** - `JOIN table ON table1.value / 10 = table2.bin_id`
- **String concatenation** - `JOIN table ON table1.prefix || '-' || table1.suffix = table2.code`

**BOTH Sides with Expressions** (Phase 1 + Phase 2 Combined!):
```sql
-- Normalize both sides for matching
SELECT *
FROM customers
JOIN accounts ON LOWER(TRIM(customers.email)) = LOWER(TRIM(accounts.email));
```

**Real-World Examples**:
```sql
-- Case-insensitive matching with left-side normalization
SELECT *
FROM products
JOIN inventory ON UPPER(products.code) = inventory.CODE;

-- Extract prefix from left side for matching
SELECT *
FROM orders
JOIN regions ON SUBSTRING(orders.order_id, 0, 3) = regions.code;

-- Multi-condition with left-side expression
SELECT *
FROM sales
JOIN pricing
    ON TRIM(sales.product) = pricing.product
    AND sales.region = pricing.region;
```

**Performance**:
- Smart algorithm selection: hash join when both sides are simple columns
- Nested loop with expression evaluation when either side has expressions
- Expression evaluation: ~2-3ms for typical datasets with expressions on both sides

**Files**:
- Example: `examples/join_left_expression_demo.sql` (8 working examples)
- Docs: `docs/JOIN_EXPRESSION_PHASE2_COMPLETE.md`
- Plan: `docs/JOIN_EXPRESSION_PHASE2_PLAN.md`

### ๐Ÿ”ง Technical Changes

**AST Structure**:
- Changed `SingleJoinCondition.left_column: String` โ†’ `left_expr: SqlExpression`
- Both sides now support full expression trees

**Parser**:
- Updated to parse left side as expression using `parse_additive()`
- Critical fix: use `parse_additive()` instead of `parse_expression()` to avoid consuming comparison operators

**Executor**:
- Updated algorithm selection to check both sides for complexity
- Both `nested_loop_join_inner_multi` and `nested_loop_join_left_multi` now evaluate left expressions
- Hash join only used when both sides are simple columns

**Test Results**:
- โœ… 457 library tests passing
- โœ… 397 integration tests passing
- โœ… All 8 demo examples working

### ๐Ÿ› Bug Fixes
- Fixed parser precedence issue where comparison operators were consumed too early

---

## [1.62.0] - 2025-10-22

### โœจ Major Features

#### **JOIN Expression Support (Phase 1)**
Enable functions and expressions on the **right side** of JOIN conditions - a game-changer for real-world data integration!

**Use Case**: Handle padded database exports, case-insensitive matching, and data normalization directly in JOIN conditions.

**New Capabilities**:
- **TRIM()** - Remove padding: `JOIN fund_data ON portfolio = TRIM(fund_data.Name)`
- **UPPER()/LOWER()** - Case-insensitive: `JOIN users ON id = UPPER(email)`
- **SUBSTRING()** - Partial matching: `JOIN codes ON id = SUBSTRING(code, 1, 10)`
- **CONCAT()** - Build keys: `JOIN data ON id = CONCAT(prefix, suffix)`
- **Nested functions** - Complex transforms: `JOIN data ON id = UPPER(TRIM(name))`
- **All SQL functions** - Works with any function in the registry

**Example** (your exact use case):
```sql
-- Load two CSV files and join with TRIM to handle padding
WITH
    WEB portfolios AS (URL 'file://data/portfolios.csv' FORMAT CSV),
    WEB fund_names AS (URL 'file://data/fund_names_padded.csv' FORMAT CSV)
SELECT
    portfolios.*,
    fund_names.fund_id,
    fund_names.manager
FROM portfolios
JOIN fund_names ON portfolios.portfolio = TRIM(fund_names.Name);
```

**Performance**:
- Smart algorithm selection: hash join for simple columns, nested loop for expressions
- Backward compatible: existing queries maintain performance
- Expression evaluation overhead: ~1-2ms for typical datasets

**Phase 1 Limitation**: Left side still requires simple column names. Use CTEs to pre-transform left side if needed.

**Files**:
- Example: `examples/join_two_files_with_trim.sql`
- Docs: `docs/JOIN_EXPRESSION_PHASE1_COMPLETE.md`
- Analysis: `docs/JOIN_EXPRESSION_SUPPORT_ANALYSIS.md`

#### **Scoped Star Expansion for JOINs**
SELECT specific table columns with `table.*` syntax in JOIN queries.

**New Capability**:
```sql
SELECT
    users.*,                    -- Expands to all users columns
    orders.order_id,            -- Just specific order columns
    orders.total
FROM users
JOIN orders ON users.id = orders.user_id;
```

**Benefits**:
- Avoid column name collisions in JOINs
- Clear, readable queries
- Select all from one table, specific from another
- Works with multiple JOINs

**Example**:
```sql
SELECT
    portfolios.*,               -- id, portfolio, value
    fund_names.fund_id,
    fund_names.manager
FROM portfolios
JOIN fund_names ON portfolios.portfolio = TRIM(fund_names.Name);
```

### ๐Ÿ”ง Technical Details

**Modified Components**:
- AST: `SingleJoinCondition.right_column` โ†’ `right_expr: SqlExpression`
- Parser: Parses right side as full SQL expression
- Executor: Expression evaluation in nested loop join algorithms
- Tests: 854 tests passing (457 lib + 397 integration)

**Backward Compatibility**: โœ… 100% - All existing JOIN queries continue to work unchanged

## [1.61.0] - 2025-10-18

### ๐ŸŽฏ Neovim Plugin UX Enhancements

This release focuses on improving the user experience of the Neovim plugin's table navigation and fuzzy filtering features, making it production-ready for analyzing large multi-table result sets.

### โœจ Improvements

#### **Smart Table Navigation**
- **Nearest table focus** - `\sTt` now jumps to the NEAREST table instead of always jumping to first table
  - Critical for workflows with 8+ result tables where cursor may be near table 5
  - Calculates distance above/below each table and selects minimum
- **Smooth navigation** - Eliminated cursor jumping during cell navigation in large tables (5k-10k rows, 40+ columns)
  - Replaced complex viewport management with simple `zz` centering
  - Predictable, smooth behavior when navigating cells with h/j/k/l
- **Fixed next/prev table jumps** - `\sTn`/`\sTp` no longer cause temporary cursor jumps to top of buffer
  - Same viewport fix applied to multi-table navigation

#### **Context-Aware Fuzzy Filtering**
- **Filters focused table** - Fuzzy filter (`/`) now filters the currently focused table, not always first table
  - Integrates with table navigation mode (`\sTt`)
  - Shows accurate row counts for the table you're viewing
  - Perfect for multi-table workflows

#### **Interactive Fuzzy Filter**
- **Lock mode** - Press Enter to lock filtered results while keeping them visible
  - Closes filter input window
  - Returns to normal mode (not insert mode)
  - Enables free navigation of filtered results
  - Shows: "Filter locked - 12/1000 rows visible (/ to reopen, ESC to clear)"
- **Navigate while filtering** - New keybindings for exploring results without closing filter
  - `Ctrl+j/k` - Scroll results up/down while typing filter pattern
  - `Ctrl+d/u` - Page down/up in results
  - See live updates as you refine your filter
- **Persistent ESC handler** - Press ESC in locked filter mode to restore full table
  - Buffer-local keymap that persists after filter window closes
  - Clean workflow: filter โ†’ lock โ†’ navigate โ†’ ESC to restore

### ๐Ÿ”ง Bug Fixes
- Fixed buffer entering insert mode after locking fuzzy filter
- Fixed ESC not clearing filter after lock mode enabled
- Fixed fuzzy filter always operating on first table in multi-table buffers

### ๐Ÿ“ Use Case
Perfect for FIX message log analysis with ~10k rows and 40 columns across multiple result tables:
- Navigate between 8+ tables with `\sTn`/`\sTp` (smooth, no jumps)
- Focus specific table with `\sTt` (finds nearest table)
- Filter 10k rows to 50 matches with `/` (filters current table)
- Lock filter with Enter and navigate freely
- ESC to restore full table, `/` to refine filter

## [1.60.0] - 2025-10-12

### ๐Ÿš€ Dependency-Aware Script Execution & Multi-Stage Analysis

This release introduces powerful dependency-aware script execution with comprehensive support for multi-stage SQL pipelines, mimicking real-world hedge fund trading workflows.

### โœจ New Features

#### **Dependency-Aware `--execute-statement` Feature**
- **Smart statement execution** - `--execute-statement N` analyzes dependencies and executes only required statements
- **Temp table tracking** - Automatically detects `SELECT ... INTO #table` and registers temp tables for subsequent queries
- **Minimal execution** - Only runs statements needed to produce target result (skips unrelated statements)
- **DUAL table fallback** - WEB CTEs work without CSV files, using DUAL table when no data file provided
- **Case-insensitive GO** - Script parser now handles `GO`, `go`, and `Go` separators

#### **Neovim Plugin `\sx` Enhancement**
- **Case-insensitive GO support** - `\sx` (execute at cursor) now works with both uppercase and lowercase GO
- **Correct statement counting** - Fixed bug where statement numbers were off by one
- **No data file errors fixed** - WEB CTEs no longer require CSV data files

#### **Comprehensive Hedge Fund Analysis Example**
- **8-stage analysis pipeline** (`examples/hedge_fund_execution_analysis.sql`)
  1. Parse FIX Messages - Fetch execution reports via HTTP
  2. Compute Timing Metrics - Rolling VWAP, cumulative volume, LAG analysis
  3. Fetch Trade Database - Query internal trade records
  4. Enrich Securities Master - Add instrument details (sector, ISIN)
  5. Join Full Dataset - Combine all data sources
  6. Execution Quality by Sector - Latency and volume analysis
  7. Symbol-Level VWAP - Top 10 by volume with rolling averages
  8. Latency Distribution - Bucket analysis of execution speeds

#### **Enhanced Flask Test Server**
- **`/securities` endpoint** - Securities master data (ticker, sector, exchange, ISIN)
- **`/fix_messages` endpoint** - Simulated FIX execution reports with timing/latency data
- **`/parent_orders` endpoint** - Parent/child order hierarchy (ready for future examples)

### ๐Ÿ”ง Technical Improvements

#### **Temp Table Registration**
- `execute_statement_with_temp_tables()` now properly registers temp tables after execution
- Uses `materialize_view()` to convert DataView to DataTable
- Made `materialize_view()` public in QueryEngine (was private)
- Temp tables accessible to all subsequent statements in execution chain

#### **WEB CTE Enhancements**
- Fixed "Column not found" errors - WEB CTEs must SELECT FROM the CTE name
- Added empty BODY '{}' support for endpoints that don't need parameters
- Proper error handling for HTTP endpoints

#### **GROUP BY with CASE Expressions**
- Fixed "must appear in GROUP BY clause" errors
- GROUP BY now supports full CASE expressions (not just column aliases)
- Repeated CASE expression in GROUP BY clause for proper aggregation

### ๐Ÿ“Š Performance

Multi-stage pipeline execution is extremely fast:
```
8 statements (5 dependencies analyzed, 3 skipped)
Total execution time: 105.96ms
โœ… All temp tables properly created and chained
```

### ๐Ÿ› Bug Fixes

**Nvim Plugin (`nvim-plugin/lua/sql-cli/executor.lua`)**:
- Fixed statement counting logic - was counting GOs before cursor instead of finding which block contains cursor
- Added case-insensitive GO matching with `.upper()` method
- Fixed "executing statement #1" when cursor was actually on statement #2

**Main CLI (`src/main.rs`)**:
- Fixed "no data file provided" error for WEB CTE queries
- Use DUAL table when no data file specified (lines 803-814)
- Fixed temp tables not being registered (lines 833-856)
- Capture `into_table` name and register after successful execution

**Query Engine (`src/data/query_engine.rs`)**:
- Made `materialize_view()` public (line 1073) for temp table creation

### ๐Ÿ“š Examples & Testing

**Usage**:
```bash
# Run complete analysis pipeline
./target/release/sql-cli -f examples/hedge_fund_execution_analysis.sql

# Execute specific stage with dependencies
./target/release/sql-cli -f examples/hedge_fund_execution_analysis.sql --execute-statement 8

# In Neovim: \sq (run all) or \sx (run statement at cursor)
```

**Features Demonstrated**:
- WEB CTEs for HTTP data fetching
- Multi-stage temp table pipeline (`#fix_messages` โ†’ `#enriched_fix` โ†’ `#full_dataset`)
- Window functions (LAG, AVG OVER, SUM OVER, ROW_NUMBER)
- Complex joins and aggregations
- CASE expressions in SELECT and GROUP BY
- Dependency analysis and optimal execution order

### ๐ŸŽ‰ User Feedback

Real user validation:
> "mind blowing! so i have a query file where end query has 5 intermediary steps, 5 dependencies... and the final query works!"

> "this is amazing"

The feature has been tested with real production queries involving complex multi-stage pipelines with temp table dependencies.

## [1.59.0] - 2025-10-11

### ๐Ÿš€ Critical Performance Fix & Infrastructure Improvements

This release fixes a severe performance regression introduced by the alias resolution feature and adds important SQL formatting and preprocessing improvements.

### โšก Performance Improvements

#### **WHERE Clause Evaluation Optimization - 23x Faster!**
- **Fixed critical regression** - `RecursiveWhereEvaluator` was being created inside the row loop instead of once before the loop
- **Impact on complex queries**:
  - 3-condition WHERE on 5,000 rows: **1277ms โ†’ 54ms** (23x speedup)
  - 2-condition WHERE on 5,000 rows: **46ms โ†’ unchanged**
  - Simple WHERE on 5,000 rows: **17ms โ†’ unchanged**
- **Root cause**: Alias resolution feature (v1.58.0) moved evaluator creation inside the loop, causing 5000+ unnecessary object instantiations
- **Solution**:
  - Added `with_both_contexts()` method to support both alias resolution AND regex caching
  - Moved evaluator creation outside the loop
  - Reuses single evaluator instance for all rows

### ๐Ÿ—๏ธ SQL Formatting & Preprocessing

#### **SELECT INTO Syntax Support**
- **Proper SQL Server syntax** - `SELECT col1, col2 INTO #temp FROM table WHERE ...`
- **AST-based formatting** - INTO clause now properly formatted in query output
- **Parser fix** - INTO recognized in correct position (after SELECT, before FROM)
- **Example formatting** works correctly: `examples/tmp_table.sql`

#### **AST-Based INTO Clause Removal**
- **New preprocessing module** - `IntoClauseRemover` follows CTEHoister pattern
- **Replaced regex hack** - Brittle regex removal replaced with proper AST manipulation
- **Recursive handling** - Removes INTO from all nested subqueries
- **Maintainable architecture** - Clean separation of parsing, preprocessing, and execution

#### **Comment-Aware Tokenization Foundation**
- **Dual-path lexer** - New `next_token_with_comments()` preserves comments, old `next_token()` skips them
- **Token types added** - `Token::LineComment` and `Token::BlockComment`
- **Backwards compatible** - Parser unchanged, uses comment-skipping path
- **Future-ready** - Foundation for Prettier/Rustfmt-style comment preservation in formatters

### ๐Ÿ”ง Technical Details

**Performance Fix Files**:
- `src/data/recursive_where_evaluator.rs` - Added `with_both_contexts()` method (lines 55-68)
- `src/data/query_engine.rs` - Moved evaluator creation outside loop (lines 1169-1174)

**Formatting Files**:
- `src/sql/parser/ast_formatter.rs` - Added INTO clause formatting
- `src/sql/recursive_parser.rs` - Fixed INTO parsing position
- `src/query_plan/into_clause_remover.rs` - New AST-based preprocessor
- `src/sql/parser/lexer.rs` - Added comment token support

### ๐Ÿ“Š Benchmark Results

Testing complex WHERE clause (3 conditions) on 5,000 rows:
```
Before fix:  1277.48ms  โŒ
After fix:   54.65ms    โœ…  (23x faster)
```

### ๐Ÿ› Bug Fixes
- Fixed SELECT INTO being dropped during formatting
- Fixed execution of SELECT INTO statements in scripts
- Fixed text_navigation.rs compilation after comment tokens added

### ๐Ÿ“š Documentation
- Updated `examples/tmp_table.sql` with correct SQL Server syntax
- Added `src/query_plan/into_clause_remover.rs` with comprehensive doc comments

## [1.58.0] - 2025-10-09

### ๐ŸŽฏ Qualified Column Names and Table Alias Support

This release brings comprehensive table alias support across all SQL clauses, enabling more readable and maintainable queries with qualified column references.

### โœจ New Features

#### **Qualified Column Names (table.column syntax)**
- **Table aliases now work throughout queries** - Use `t.column_name` syntax in WHERE, SELECT, ORDER BY, and GROUP BY clauses
  - Example: `SELECT t.id, t.amount FROM data t WHERE t.amount > 100 ORDER BY t.amount DESC`
  - Works with CTEs, nested queries, and complex multi-level aliases
  - Full support for method calls on qualified names: `WHERE t.classification.Contains('value')`

#### **Implementation Phases (All Complete)**
- **Phase 1-2**: ExecutionContext infrastructure and unified column resolution
- **Phase 3**: WHERE clause alias resolution - Qualified names in filtering conditions
- **Phase 4**: SELECT clause alias resolution - Qualified names in projections
- **Phase 5**: ORDER BY clause alias resolution - Qualified names in sorting
- **Phase 6**: GROUP BY clause - Already working with expression-based parsing

### ๐Ÿ—๏ธ Architecture Highlights

#### **Non-Breaking Design**
- All changes maintain backward compatibility
- Fallback behavior when ExecutionContext unavailable
- Unqualified column names continue to work as before

#### **ExecutionContext System**
- Tracks table alias mappings during query execution
- Resolves qualified names (table.column) to actual column indices
- Provides "did you mean?" suggestions using edit distance algorithm

#### **ArithmeticEvaluator Enhancement**
- Resolves table aliases in column references
- Tries qualified lookup first, falls back to unqualified
- Supports both qualified and unqualified names in same query

### ๐Ÿ“š Documentation & Examples

#### **New Example File: `examples/qualified_names.sql`**
- 7 comprehensive examples demonstrating alias support
- Basic CTE with aliases in WHERE/SELECT
- ORDER BY with qualified column names
- GROUP BY with qualified columns and aggregations
- Nested CTEs with multi-level aliases
- String method calls with qualified names
- Complex queries combining all clauses

### ๐Ÿ”ง Technical Implementation

**Key Files Modified:**
- `src/data/query_engine.rs` - ExecutionContext, resolve_column_index, apply_select_items integration
- `src/data/recursive_where_evaluator.rs` - WHERE clause alias resolution
- `src/data/arithmetic_evaluator.rs` - evaluate_column_ref with table_aliases
- `src/sql/recursive_parser.rs` - ORDER BY parser for qualified names

**Commit History:**
- `125679e` - Phase 1: ExecutionContext infrastructure
- `7771912` - Phase 2: Unified resolve_column helper
- `9a42c0b` - Phase 3: WHERE clause resolution
- `abd5b8d` - Phase 4: SELECT clause resolution
- `8000cad` - Phase 5: ORDER BY resolution
- `722ee33` - Documentation and examples

### ๐Ÿ“ Known Limitations
- HAVING clause currently requires unqualified column references
- Temp tables (#table) with aliases have limited support (investigation ongoing)

### ๐ŸŽ‰ Use Cases Enabled
```sql
-- Nested CTEs with aliases throughout
WITH base AS (
    SELECT value as id, value % 5 as bucket
    FROM RANGE(1, 25)
),
enriched AS (
    SELECT b.id, b.bucket, b.id * 10 as score
    FROM base b
    WHERE b.bucket IN (0, 1, 2)
)
SELECT e.bucket, COUNT(*), SUM(e.score)
FROM enriched e
GROUP BY e.bucket
ORDER BY e.bucket;
```

## [1.57.0] - 2025-10-06

### ๐Ÿ—“๏ธ Flexible Date Parsing & Nvim Plugin UX Improvements

This release introduces powerful date parsing functions with custom format support and improves the Nvim plugin user experience by removing unnecessary prompts.

### โœจ New Features

#### **Flexible Date Parsing Functions**
- **PARSE_DATETIME(date_string, format_string)** - Parse dates with custom chrono format strings
  - Supports European (DD/MM/YYYY), American (MM/DD/YYYY), ISO 8601, FIX Protocol formats
  - Text month names (Jan, January)
  - Millisecond precision support
  - Full chrono strftime format compatibility
  - Example: `SELECT PARSE_DATETIME('15/01/2024', '%d/%m/%Y')`

- **PARSE_DATETIME_UTC(date_string, [format_string])** - Parse datetime explicitly as UTC
  - 1 argument: auto-detects format (includes FIX Protocol)
  - 2 arguments: uses custom format string
  - Example: `SELECT PARSE_DATETIME_UTC('20240115-14:30:45.567')` (auto-detects FIX)

- **DATETIME(year, month, day, [hour], [minute], [second])** - Construct datetime from components
  - 3-6 arguments supported
  - All times interpreted as UTC
  - Handles leap years and month boundaries
  - Example: `SELECT DATETIME(2024, 1, 15, 14, 30, 45)`

#### **FIX Protocol Support**
- Verified compatibility with FIX timestamp format (YYYYMMDD-HH:MM:SS.sss)
- Millisecond precision maintained throughout parsing pipeline
- Works seamlessly with existing date functions (DATEDIFF, DATEADD, etc.)

### ๐Ÿ› ๏ธ Nvim Plugin UX Improvements

#### **Instant Query Execution**
- `\sx` (execute at cursor) now executes immediately without parameter prompts
- Removed debug notification that caused "Press ENTER" prompts
- Parameter resolution skipped for cursor-based execution for faster workflow
- Debug mode (`vim.g.sql_cli_debug = true`) still available when needed

### ๐Ÿ“š Documentation & Testing
- **New Examples**: `examples/parse_datetime.sql` - Comprehensive date parsing guide with format reference
- **Test Suite**: 18 new Python tests for date parsing functions (all passing)
- **Format Reference**: Inline chrono strftime format documentation
- Verified with real FIX timestamp data (`data/fix_timestamps.csv`)

### ๐Ÿ”ง Technical Details
- Built on existing chrono dependency (no new dependencies)
- Parser currently supports up to 6 function arguments (7th argument support planned)
- All datetime values stored with millisecond precision
- Consistent UTC interpretation across all new functions

## [1.56.0] - 2025-10-02

### ๐ŸŽฏ Smart Column Intelligence & Cardinality Analysis

This release brings intelligent column expansion and powerful data cardinality analysis to the Nvim plugin, making data exploration significantly faster.

### โœจ New Features

#### **Smart Star Expansion (`\sE`)**
- Execute queries with `LIMIT 1` to discover actual column names from CTEs and subqueries
- No longer limited to static CSV file hints - works with any query context
- Supports both array-of-objects and object-with-columns JSON formats
- Auto-inserts column hint comments for Nvim's built-in Ctrl+N completion
- Configurable via `smart_expansion.enabled` and `auto_insert_column_hints` settings
- Graceful fallback to static file hints when query execution isn't possible

#### **Distinct Values Analysis (`\srD`)**
- New `--distinct-column <column>` CLI flag for instant cardinality analysis
- Automatically detects and preserves WEB CTE context (HTTP data sources)
- Intelligent CTE extraction using parenthesis depth tracking
- Displays top 100 distinct values with counts in floating window
- Works seamlessly with CTEs, subqueries, files, and HTTP endpoints
- Proper handling of nested CTEs and complex query structures

### ๐Ÿ› ๏ธ Technical Improvements
- CTE-aware query rewriting in Rust with proper parenthesis tracking
- Simplified Nvim plugin to call CLI and parse CSV output
- Proper async handling with `vim.schedule()` for event context
- Clear separation: Rust handles heavy lifting, Lua orchestrates display
- Enhanced column state tracking across buffers

### ๐Ÿ“š Documentation
- Added comprehensive smart expansion guide: `SMART_EXPANSION_README.md`
- Design document for column completion: `NVIM_SMART_COLUMN_COMPLETION.md`
- Example queries showcasing smart expansion features

## [1.55.0] - 2025-09-27

### ๐ŸŽ‰ Windows Nvim Export Support & Performance Documentation

This release brings full Windows compatibility for the Nvim plugin's export features and showcases impressive performance benchmarks.

### โœจ New Features

#### **Windows Export Compatibility**
- Fixed TSV/CSV export clipboard handling on Windows (proper CRLF line endings)
- Browser HTML export now works on Windows (using rundll32 url.dll)
- Direct sql-cli calls for clean exports without table formatting artifacts
- Proper temp file handling for Windows (%TEMP% directory)
- Clear notifications showing export source and success status

#### **Performance Documentation**
- Added comprehensive PERFORMANCE.md with detailed benchmarks
- 100K row benchmarks added to test suite
- Results show:
  - Simple SELECT: 8ms at 100K rows
  - JOINs: Under 40ms for all types
  - GROUP BY: 433ms-2.49s (improved from 12s!)
  - Window functions: ~1.2s at 100K rows

### ๐Ÿ› Bug Fixes
- Fixed nil 'lines' error in table_nav.lua when using \se export
- Fixed export buffer detection (now checks output buffer correctly)
- HTML export now fetches data directly from sql-cli with proper CSV parsing
- Browser export on Windows no longer opens terminal window

### ๐Ÿ› ๏ธ Technical Improvements
- Refactored export.lua to call sql-cli directly for clean data
- Added proper CSV parsing for quoted fields with commas
- Improved error handling and debug messages for exports
- Export functions now work immediately after \sx query execution

## [1.54.0] - 2025-09-24

### ๐Ÿš€ Major Performance Improvements & JOIN Enhancements

This release delivers massive GROUP BY performance improvements and adds support for multiple JOIN conditions.

### โœจ New Features

#### **Multiple JOIN Conditions**
- Support for multiple conditions in JOIN clauses connected by AND
- Example: `INNER JOIN table ON a.id = b.id AND a.status = b.status`
- Works with all join types (INNER, LEFT, RIGHT)
- Supports mixed operators (equality and inequality)

#### **Enhanced Execution Plan**
- Added detailed phase breakdown for GROUP BY operations
- Shows timing for each phase: group building, aggregation, HAVING filter
- Use `--execution-plan` flag to see detailed performance metrics

### ๐ŸŽฏ Performance Improvements

#### **GROUP BY Optimization - 6x Faster!**
- **Fixed major inefficiency**: ArithmeticEvaluator was being created for every row
- **Results**:
  - 30,000 rows: 2,421ms โ†’ 402ms (6x faster)
  - 50,000 rows: 3,808ms โ†’ 633ms (6x faster)
  - Group building phase alone is 12x faster
- **Impact**: All GROUP BY queries will see significant performance gains

### ๐Ÿ› ๏ธ Technical Details
- Reused ArithmeticEvaluator instances instead of creating 30,000+ times
- Pre-allocated and reused vectors in hot paths
- Added GroupByPhaseInfo for detailed performance tracking

## [1.53.0] - 2025-09-23

### ๐ŸŽฏ String Utilities & Type Conversions

This release adds essential utility functions for character code operations, type conversions, and encoding/decoding capabilities.

### โœจ New Features

#### **Character Code Functions**
- **`ASCII(string)`** - Get ASCII/Unicode code point of first character (supports full Unicode)
- **`ORD(string)`** - Alias for ASCII function
- **`CHAR(code)`** - Convert Unicode code point to character (supports codes beyond ASCII 0-255)
- **`UNICODE(string)`** - Get all Unicode code points as comma-separated list

#### **Type Conversion Functions**
- **`TO_INT(value)`** - Convert string or float to integer (truncates decimals)
- **`TO_DECIMAL(value)`** - Convert string or integer to decimal/float
- **`TO_STRING(value)`** - Convert any value to string representation

#### **Encoding/Decoding Functions**
- **`ENCODE(string, format)`** - Encode string to base64 or hex format
- **`DECODE(string, format)`** - Decode base64 or hex encoded strings

### ๐Ÿ“Š Examples
```sql
-- Character codes
SELECT ASCII('โ‚ฌ');  -- Returns 8364
SELECT CHAR(8364);  -- Returns 'โ‚ฌ'
SELECT UNICODE('ABC');  -- Returns '65,66,67'

-- Type conversions
SELECT TO_INT('123.45');  -- Returns 123
SELECT TO_DECIMAL('123');  -- Returns 123.0

-- Encoding
SELECT ENCODE('Hello', 'base64');  -- Returns 'SGVsbG8='
SELECT DECODE('SGVsbG8=', 'base64');  -- Returns 'Hello'
```

## [1.52.0] - 2025-09-21

### ๐Ÿ”ข Arbitrary Precision Arithmetic & Bit Manipulation

This release adds comprehensive support for arbitrary precision integer arithmetic, bit manipulation operations, and base conversions using Rust's `num-bigint` library.

### โœจ New Features

#### **BigInt Arithmetic Functions**
- **`BIGINT(value)`** - Convert numbers or strings to arbitrary precision integers
- **`BIGADD(a, b)`** - Add two arbitrary precision integers
- **`BIGMUL(a, b)`** - Multiply large numbers (tested with 30-digit numbers)
- **`BIGPOW(base, exp)`** - Calculate powers like 2^256 or 99^99
- **`BIGFACT(n)`** - Calculate factorials up to 10000! (1000! has 2568 digits)

#### **Bit Manipulation Operations**
- **`BITAND(a, b)`** - Bitwise AND on arbitrary precision integers
- **`BITOR(a, b)`** - Bitwise OR operations
- **`BITXOR(a, b)`** - Bitwise XOR for large numbers
- **`BITSHIFT(n, shift)`** - Bit shifting left (positive) or right (negative)

#### **Base Conversion Functions**
- **`TO_BINARY(n)`** - Convert numbers to binary strings
- **`FROM_BINARY(s)`** - Parse binary strings to decimal
- **`TO_HEX(n)`** - Convert to hexadecimal representation
- **`FROM_HEX(s)`** - Parse hex strings (handles 0x prefix)

### ๐Ÿ“Š Example Calculations
```sql
-- Calculate 2^100
SELECT BIGPOW('2', 100);  -- 1267650600228229401496703205376

-- 100 factorial
SELECT BIGFACT(100);  -- 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

-- Convert 2^256 to binary
SELECT TO_BINARY(BITSHIFT('1', 256));  -- 1 followed by 256 zeros

-- Bit operations
SELECT BITXOR(FROM_BINARY('1010'), FROM_BINARY('1100'));  -- 6
```

### ๐Ÿ”ง Dependencies
- Added `num-bigint = "0.4"` for arbitrary precision arithmetic
- Added `num-traits = "0.2"` for numeric trait implementations

## [1.51.0] - 2025-09-21

### ๐ŸŽฏ Qualified Column Resolution & Scoping

This release fixes critical issues with qualified column name resolution throughout the query pipeline, ensuring proper column scoping in JOINs, CTEs, and generator functions.

### โœจ Major Fixes

#### **Qualified Column Name Resolution**
- **Fixed parser distinction** between method calls (`column.Method()`) and qualified columns (`table.column`)
- **Strict validation** of table prefixes - invalid prefixes like `wrongtable.column` now properly fail
- **Preserved qualified names through JOINs** - All columns maintain their source table information
- **Standard CTE column enrichment** - CTEs from generators (RANGE, TRIANGULAR, SQUARES) now support qualified references

#### **Column Scoping Improvements**
- **JOIN operations** - Columns from both tables preserve their qualified names (`messages.field_name`, `fields.number`)
- **WEB CTEs** - Proper column enrichment with table prefix (`messages.message_name`)
- **Standard CTEs** - Generator functions now support qualified references (`tri.value`, `data1.num`)
- **Materialized views** - Qualified names preserved through view materialization

### ๐Ÿ”ง Technical Improvements

#### **Parser Enhancements**
- Method call detection now checks for parentheses after dot notation
- `resolve_select_columns` validates qualified names instead of ignoring prefixes
- Proper SQL syntax enforcement (single quotes for strings, double quotes for identifiers)

#### **Debug Capabilities**
- Added column scoping debug output for JOIN operations
- Enhanced logging shows which columns have qualified names
- Better error messages for column resolution failures

### ๐Ÿ› Bug Fixes
- Fixed `Type.Contains("value")` being incorrectly parsed as qualified column
- Corrected SQL examples using wrong quote types for string literals
- Fixed qualified name resolution in simple SELECT queries

## [1.50.0] - 2025-09-21

### ๐Ÿš€ CTE Testing & SQL Enhancement Release

This release introduces powerful CTE (Common Table Expression) testing capabilities in the Neovim plugin, significant SQL formatter improvements, and enhanced parser features for better quoted identifier handling.

### โœจ New Features

#### **CTE Testing Framework (Neovim Plugin)**
- **Interactive CTE testing** - Test CTEs incrementally with `<leader>sC` keybinding
- **Query preview modal** - See exact SQL before execution with options to Execute/Yank/Cancel
- **Smart cursor detection** - Automatically detects which CTE the cursor is in
- **CLI-based parser** - Uses `--cte-info` flag for robust CTE structure analysis
- **CTE analysis popup** - View CTE dependencies and structure with `<leader>sA`
- **RANGE() query support** - Properly handles CTEs that use RANGE() without external data

#### **SQL Formatter Enhancements**
- **Quoted identifier preservation** - Maintains double quotes and brackets throughout AST
- **ColumnRef with QuoteStyle** - New AST structure preserves quote information
- **Improved reformatting** - WHERE clauses now preserve quoted column names
- **Better GO handling** - Case-insensitive terminator detection (GO/go/Go)

#### **Query Rewriter Framework**
- **Expression hoisting suggestions** - Analyzes queries for unsupported expressions
- **CTE transformation patterns** - Suggests moving complex expressions to CTEs
- **`--analyze-rewrite` flag** - New CLI flag for query rewrite analysis

#### **Parser Improvements**
- **CTE name handling** - Fixed parsing of CTE names with underscores (dates_1, inventory_2)
- **Comment handling** - Better handling of queries with leading comments
- **Query boundary detection** - Improved detection between CTEs and main SELECT

### ๐Ÿ”ง Technical Improvements

#### **AST Restructuring**
- **QuoteStyle enum** - Tracks None, DoubleQuotes, or Brackets
- **ColumnRef struct** - Replaces String for column references
- **Formatter updates** - All formatters updated to preserve quote styles
- **Parser updates** - Parser now captures and preserves quote information

#### **CTE Parser Enhancements**
- **JSON null handling** - Fixed Lua errors with null columns from CLI parser
- **Parenthesis tracking** - Accurate CTE boundary detection
- **WITH clause variations** - Handles WITH on same line as CTE or separate line
- **Main SELECT detection** - Stops at main SELECT to avoid including entire query

### ๐Ÿ› Bug Fixes

- **Fixed CTE test execution** - Corrected argument count in executor.execute_query call
- **Fixed DUAL table fallback** - RANGE queries no longer show "DUMMY X"
- **Fixed lowercase GO** - Terminator detection now case-insensitive
- **Fixed CTE name patterns** - Underscores in CTE names now properly recognized
- **Fixed query extraction** - Comments before WITH no longer included in test query
- **Fixed formatter jumping** - SELECT no longer jumps to previous GO line

### ๐Ÿ“š Documentation

- **CLAUDE.md updates** - Added agent delegation guidelines
- **Function roadmap** - Updated with completed and pending functions
- **Test examples** - Added complex CTE testing examples

## [1.49.0] - 2025-09-20

### ๐ŸŽฏ Aggregate Registry Migration & Developer Experience

This release continues the migration of aggregate functions to the new registry system, adds comprehensive benchmarking tools, and significantly improves the Neovim plugin experience with unified help system.

### โœจ New Features

#### **Unified Help System**
- **`--item-help` command** - Single CLI switch that checks functions, aggregates, and generators
- **Neovim K mapping** - Press K on any SQL function/aggregate/generator for instant help
- **Automatic type detection** - CLI automatically determines if item is a function, aggregate, or generator

#### **String Case Conversion Functions**
- **TO_SNAKE_CASE()** - Convert text to snake_case
- **TO_CAMEL_CASE()** - Convert text to camelCase
- **TO_PASCAL_CASE()** - Convert text to PascalCase
- **TO_KEBAB_CASE()** - Convert text to kebab-case
- **TO_CONSTANT_CASE()** - Convert text to CONSTANT_CASE
- **Intelligent word splitting** - Handles transitions between uppercase/lowercase/numbers correctly

#### **Performance Benchmarking Suite**
- **Python benchmark script** (`scripts/benchmark_all.py`) - Comprehensive performance testing
- **Scaling analysis** - Automatically determines O(1), O(n), O(n log n), O(nยฒ) complexity
- **Performance comparison** - Compare results against baseline for regression detection
- **LIKE operator optimization** - Documented 7-14ms performance for 25K rows
- **GROUP BY optimization** - Confirmed O(n) scaling, not O(nยฒ) as initially feared

### ๐Ÿ”ง Technical Improvements

#### **Aggregate Function Migration**
- **COUNT/COUNT_STAR migrated** - Moved from hardcoded to new registry system
- **Unified registry checking** - ArithmeticEvaluator now checks new registry for all aggregates
- **Sample vs Population variance** - VARIANCE now correctly returns sample variance (n-1 denominator)
- **Test suite updates** - Python tests updated to expect sample variance/stddev

### ๐Ÿ› Bug Fixes

- **Fixed case conversion tests** - Corrected expectations for word-splitting behavior
- **Fixed STDDEV/VARIANCE tests** - Updated to use sample variance calculations
- **Fixed Neovim K mapping** - Now properly bound and working for all item types
- **Fixed generator help** - No longer shows function error before checking generators

### ๐Ÿ“š Documentation

- **Performance metrics in README** - Added benchmarks showing exceptional LIKE performance
- **Migration documentation** - Updated docs for aggregate function migration process

## [1.48.0] - 2025-09-18

### ๐Ÿš€ Major Performance Improvements & Data Generation

This release delivers massive performance improvements to the LIKE operator and introduces powerful data generation and benchmarking capabilities for performance testing and development.

### โœจ New Features

#### **Data Generation System**
- **Virtual table generator** - Create tables with configurable rows/columns on the fly
- **GENERATE() function** - SQL function to create test data: `SELECT * FROM GENERATE(1000, 5)`
- **Multiple table types**:
  - Narrow tables (3 columns)
  - Wide tables (20 columns)
  - Very wide tables (50 columns)
  - Mixed data tables (various data types)
  - Aggregation-optimized tables
  - Window function test tables
- **Neovim plugin integration** - Generator discovery and help system

#### **Comprehensive Benchmarking System**
- **45+ benchmark queries** across 5 categories (basic, aggregation, sorting, window, complex)
- **Progressive benchmarking** - Test performance from 10K to 100K+ rows
- **Detailed metrics** - Parse time, execution time, rows/sec throughput
- **Multiple output formats** - CSV export and markdown reports
- **Category-specific testing** - Focus on specific query types

### ๐Ÿ”ง Performance Optimizations

#### **LIKE Operator Optimization - 900x+ Faster**
- **Before**: O(nยฒ) performance, 5.7 seconds for 20K rows
- **After**: O(n) linear performance, 7.5ms for 20K rows
- **How**: Introduced `EvaluationContext` with regex caching
- **Impact**: Interactive queries now possible on 100K+ row datasets
- Regex patterns compiled once and cached across all row evaluations
- Dramatic reduction in memory allocations

### ๐Ÿ› Bug Fixes
- Fixed test compilation issues with mutable evaluator references
- Resolved throughput calculation showing 0 rows/sec in metrics
- Fixed HAVING clause column resolution in benchmarks

### ๐Ÿ“Š Performance Baseline
With this release, we've established performance baselines:
- Simple SELECT: < 20ms for 100K rows โœ…
- LIKE patterns: < 20ms for 50K rows โœ… (was 14+ seconds)
- ORDER BY: < 30ms for 50K rows โœ…
- GROUP BY: ~3 seconds for 50K rows (next optimization target)

## [1.47.0] - 2025-09-14

### ๐ŸŽจ ASCII Chart Visualizations & Date Functions

This release brings powerful ASCII chart visualizations to the Neovim plugin and essential date extraction functions, making data analysis more visual and date handling much simpler.

### โœจ New Features

#### **ASCII Chart Visualizations for Neovim**
- **Bar charts** - Horizontal bar charts with customizable width and character styles
- **Pie charts** - ASCII pie charts with configurable radius (5-30, default 15)
- **Histograms** - Frequency distribution visualizations with binning support
- **Scatter plots** - 2D point plotting with density indicators
- **Sparklines** - Compact trend visualizations
- **Box plots** - Statistical summaries with quartiles and outliers

#### **Chart Integration & Commands**
- **Query-at-cursor visualization** - Instant charts with keybindings:
  - `<leader>sB` - Bar chart from query at cursor
  - `<leader>sP` - Pie chart from query at cursor
  - `<leader>sH` - Histogram from query at cursor
  - `<leader>sS` - Scatter plot from query at cursor
  - `<leader>sl` - Sparkline from query at cursor
- **Debug mode** - `:SqlChartDebug on/off` shows detailed parsing info
- **Configurable sizing** - `:SqlPieRadius <size>` to adjust pie chart size
- **Smart CSV parsing** - Handles quoted values and preserves text labels

#### **Essential Date Functions**
- **YEAR(date)** - Extract year as number (e.g., 2024)
- **MONTH(date)** - Extract month as number (1-12)
- **DAY(date)** - Extract day of month (1-31)
- These complement existing DAYOFWEEK(), DAYNAME(), MONTHNAME() functions

### ๐Ÿ”ง Improvements
- **Simplified date queries** - Replaced verbose CASE statements with clean function calls
- **Dollar sign handling** - Fixed parameter substitution issue (use `\$` to escape)
- **Enhanced debug output** - Debug info appears directly below charts for easy analysis
- **Better error messages** - Clear feedback when chart data requirements aren't met

### ๐Ÿ› Bug Fixes
- Fixed dollar signs in string literals being interpreted as parameters
- Resolved buffer modifiable errors when creating chart buffers
- Fixed CSV parsing to correctly preserve text labels vs numeric values
- Corrected DataValue type usage in new date functions

### ๐Ÿ“š Documentation
- Added comprehensive bar chart examples with escaped dollar signs
- Documented available date functions in examples
- Added debug workflow documentation for chart troubleshooting

## [1.46.0] - 2025-09-14

### ๐Ÿš€ Multi-Table Navigation & Web Data Integration

This release introduces powerful multi-table navigation in the Neovim plugin and comprehensive web data fetching capabilities, making it easier than ever to work with complex SQL scripts and remote data sources.

### โœจ New Features

#### **Enhanced Neovim Plugin - Multi-Table Navigation**
- **Multi-table result navigation** - Navigate between multiple query results from scripts with GO separators
- **Intuitive keybindings**:
  - `]t` and `[t` - Navigate to next/previous table
  - `<leader>s1`, `<leader>s2`, `<leader>s3` - Jump directly to specific tables
  - `<leader>sI` - Show current table info with position and row count
- **Smart table detection** - Automatically detects ASCII, box, and pipe table formats
- **Viewport centering** - Tables are automatically centered in view with context
- **Status line integration** - Shows current table position (e.g., "๐Ÿ“Š2/16")
- **Comprehensive debug tools** - `<leader>sI` provides detailed table registry with clipboard export

#### **Web Data Integration & Environment Variables**
- **WEB CTE with custom headers** - Fetch data from REST APIs with authentication
- **Environment variable injection** - Use `${VAR_NAME}` syntax in queries for dynamic values
- **Flexible header configuration** - Set custom HTTP headers for API authentication
- **Seamless data integration** - Web data treated as first-class tables in SQL queries

#### **JOIN & Query Enhancements**
- **Qualified column names** - Support for `table.column` syntax in SELECT and WHERE clauses
- **Multiple WEB CTE support** - Fetch from multiple endpoints in single query
- **Enhanced column resolution** - Intelligent handling of ambiguous column references
- **Improved parser robustness** - Better handling of complex JOIN conditions

#### **String Method Extensions**
- **TrimStart()** and **TrimEnd()** methods - Remove leading/trailing whitespace
- **Enhanced method chaining** - Support for `column.Method1().Method2()` patterns
- **Consistent string operations** - Unified string manipulation across all data types

### ๐Ÿ”ง Internal Improvements
- **Centralized navigation logic** - Eliminated code duplication in table navigation
- **Registry-based table detection** - Pre-processed table lookup for improved performance
- **State conflict resolution** - Fixed navigation jumping between single/multi-table modes
- **Enhanced AST formatting** - Better representation of complex query structures

### ๐Ÿ› Bug Fixes
- Fixed state conflicts between single-table and multi-table navigation modes
- Resolved cursor positioning issues when jumping between tables
- Fixed viewport scrolling to keep navigated tables visible
- Corrected column name resolution in complex JOIN scenarios

## [1.45.0] - 2025-09-13

### ๐Ÿš€ Enhanced CTE Support & Detailed Execution Plans

This release brings major improvements to CTE (Common Table Expression) handling and introduces comprehensive execution plan analysis for better query performance insights.

### โœจ New Features

#### **Advanced CTE Context Propagation**
- **Nested CTE support** - CTEs can now reference other CTEs within the same WITH clause
- **Subquery CTE access** - Subqueries can access CTEs defined in parent query scope
- **Complex analytical queries** - Enables sophisticated multi-level data transformations
- **Proper scope resolution** - CTE context correctly propagated through entire query tree

#### **Comprehensive Execution Plan Analysis**
- **Detailed step breakdown** with hierarchical tree visualization
- **CTE execution statistics**:
  - Processing time for each CTE
  - Result set size (rows and columns)
  - Source table and filter information
- **JOIN execution details**:
  - Join type and condition details
  - Left/right table row counts
  - Result set size and timing
- **Subquery tracking**:
  - Identifies and tracks subquery evaluation
  - Shows materialization of subquery results
- **Operation-level metrics**:
  - WHERE clause filtering (input โ†’ output rows)
  - GROUP BY aggregation statistics
  - ORDER BY sort timing
  - DISTINCT deduplication metrics
  - LIMIT/OFFSET row reduction
- **Visual execution tree** - Beautiful ASCII art visualization of query execution flow

#### **AST Formatter Enhancements**
- **Method call support** - Properly formats `Column.Method()` syntax (e.g., `Type.Contains('Noble')`)
- **Chained method calls** - Handles `column.Method1().Method2()` patterns
- **Preserves original syntax** - No more debug output for method expressions

### ๐Ÿ› Bug Fixes
- Fixed AST formatter outputting debug representations for MethodCall and ChainedMethodCall expressions
- Resolved CTE reference errors in complex nested queries
- Fixed subquery execution within CTE contexts

### ๐Ÿ“š Documentation
- Added `docs/CTE_LIMITATIONS.md` - Current CTE implementation limitations
- Added `docs/GROUP_BY_LIMITATIONS.md` - GROUP BY expression support status

### ๐Ÿ”ง Technical Improvements
- Refactored QueryEngine to support CTE context threading
- Enhanced SubqueryExecutor with CTE context awareness
- Improved execution plan builder with new step types (CTE, Subquery, Aggregate, Distinct)
- Better timing instrumentation throughout query execution pipeline

## [1.44.0] - 2025-09-13

### ๐Ÿš€ SQL Parser Modularization & Enhanced Nvim Plugin

This major release introduces a complete SQL parser refactoring for better maintainability, significant improvements to the Neovim plugin's query boundary detection, and new execution plan functionality.

### โœจ New Features

#### **SQL Parser Modularization (Phase 1)**
- **Modular parser architecture** - Refactored monolithic parser into specialized modules
- **Expression parser modules**:
  - `expressions/arithmetic.rs` - Arithmetic operations and math functions
  - `expressions/case.rs` - CASE/WHEN expressions
  - `expressions/comparison.rs` - Comparison operators and predicates  
  - `expressions/logical.rs` - AND, OR, NOT logical operations
- **Centralized type system** - Unified comparison logic with proper NULL handling
- **Improved maintainability** - Easier to extend and debug parser functionality
- **Enhanced error handling** - Better error messages and recovery

#### **Enhanced Neovim Plugin Query Detection**
- **Improved boundary detection** - Completely rewritten query-at-cursor logic
- **Consistent behavior** - All cursor functions now use same boundary detection:
  - `\sx` - Execute query at cursor
  - `\sX` - Execute query with detailed execution plan (NEW!)
  - `\sy` - Copy query to clipboard  
  - `\s/` - Smart comment toggle
  - `\s=` - Format query
  - `\sv` - Visual select query
  - `\sP` - Preview query in floating window
- **Smart terminator detection** - Properly handles `;` and `GO` statement separators
- **Multi-statement support** - Works with WITH, SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER
- **Enhanced navigation** - `]q` and `[q` now find any SQL statement type, not just SELECT

#### **Execution Plan Integration**
- **New `\sX` keymap** - Execute query with detailed timing breakdown
- **Performance insights**:
  - Parse time, data loading time, query execution time
  - Row processing statistics (loaded, filtered, returned)
  - Column counts and memory usage
  - Total execution time breakdown
- **Same boundary detection** - Uses identical query detection as `\sx`

#### **Smart Comment Toggle**
- **Documentation-aware** - Preserves documentation comments when toggling
- **Distinguishes comment types**:
  - Documentation comments (preserved): `-- This explains the query`
  - Commented-out SQL code (toggled): `-- SELECT * FROM table`
- **Consistent boundaries** - Comments exactly what `\sx` would execute

### ๐Ÿ› Bug Fixes & Improvements

#### **Parser Stability**
- **Fixed compilation errors** - Resolved all test suite compilation issues
- **Removed unused imports** - Clean codebase with proper dependency management
- **Better error recovery** - Parser handles malformed queries more gracefully
- **Type system consistency** - Unified comparison logic across all data types

#### **Date and Boolean Handling**
- **Enhanced date parsing** - Better support for various date formats
- **Boolean type improvements** - Consistent boolean literal handling
- **NULL comparison fixes** - Proper three-valued logic implementation

#### **Plugin Reliability**
- **Boundary detection edge cases** - Handles queries at start/end of file
- **Empty line handling** - Proper trimming of whitespace in query boundaries
- **Comment preservation** - Never damages documentation when toggling comments

### ๐Ÿ—๏ธ Internal Improvements

#### **Code Organization**
- **Modular parser structure** - Easier to maintain and extend
- **Centralized type system** - Single source of truth for data type handling
- **Consistent APIs** - Unified interfaces across parser modules
- **Better test coverage** - All 342 tests passing with improved reliability

#### **Performance**
- **Execution plan insights** - Detailed performance metrics for query optimization
- **Memory efficiency** - Better data structure reuse in joins and aggregations
- **Parsing performance** - Modular structure enables better optimization

### ๐Ÿ“š Examples & Documentation

#### **New SQL Examples**
- **Chemistry examples** - JOIN queries with periodic table data
- **Complex CTEs** - Multi-CTE queries with joins and aggregations  
- **Execution plan demos** - Example files showing performance analysis

#### **JOIN Implementation Examples**
- **Working JOIN examples** in `examples/chemistry.sql`:
  - CTE with aggregations joined back to main table
  - LEFT JOIN examples with NULL handling
  - Self-joins and complex conditions
- **Documented limitations** - Current JOIN implementation constraints
- **Performance insights** - Using `\sX` to analyze JOIN performance

## [1.43.0] - 2025-09-10

### ๐Ÿš€ Parser & Plugin Enhancements

This release introduces SQL JOIN parser support, significantly improves the Neovim plugin autocomplete, and fixes critical terminal handling issues.

### โœจ New Features

#### **SQL JOIN Parser Support**
- **Complete JOIN grammar implementation** - Parser now supports all standard SQL JOIN types
- **Supported JOIN types**: INNER, LEFT, RIGHT, FULL OUTER, CROSS
- **Table aliasing** - Full support for table aliases in FROM and JOIN clauses
- **Complex ON conditions** - Support for various comparison operators in JOIN conditions
- **CTE with JOINs** - CTEs can now be used in JOIN operations
- **Subquery JOINs** - Support for joining with subqueries
- Note: Parser only - execution implementation coming in future release

#### **Enhanced Neovim Plugin Autocomplete**
- **New `--schema-json` flag** - Clean JSON output for schema information without ANSI colors
- **Improved completion system** - Plugin now uses JSON parsing instead of regex for reliability
- **Better keybindings**:
  - `Alt+;` or `Alt+.` - Trigger column-specific completion
  - `Ctrl+Space` - General SQL completion
  - `Tab`/`Shift+Tab` - Navigate completion menu
  - `Enter` - Accept selected completion
  - `1-9` - Quick select numbered completion item
- **Smart schema detection** - Automatically loads schema from data file hints in SQL comments
- **Context-aware completions** - Shows columns, SQL functions, and keywords based on context

### ๐Ÿ› Bug Fixes & Improvements

#### **Terminal Corruption Fix**
- **Fixed terminal corruption on TUI crash** - Terminal now properly restores on errors
- **Added panic hook** - Automatically restores terminal state on panic
- **Enhanced error handling** - Terminal cleanup happens even when TUI fails to start
- **File validation timing** - Files are now validated before entering raw terminal mode
- Prevents the need to open new terminal when TUI fails with invalid file paths

#### **Parser Improvements**
- **Fixed function scope errors** in recursive_parser.rs
- **Added missing JOIN token patterns** in text navigation
- **Proper TableSource handling** for derived tables and subqueries
- **CROSS JOIN support** - Correctly handles CROSS JOIN without ON clause

### ๐Ÿ“š Examples

#### JOIN Parser Examples
```sql
-- Simple INNER JOIN
SELECT * FROM users JOIN orders ON users.id = orders.user_id;

-- LEFT JOIN with table aliases
SELECT * FROM users u LEFT JOIN orders o ON u.id = o.user_id;

-- Multiple JOINs
SELECT * FROM users 
JOIN orders ON users.id = orders.user_id
JOIN products ON orders.product_id = products.id;

-- JOIN with CTE
WITH active_users AS (SELECT * FROM users WHERE active = 1)
SELECT * FROM active_users JOIN orders ON active_users.id = orders.user_id;
```

#### Neovim Plugin Usage
```vim
" In your .vimrc or init.vim
" The plugin auto-detects data files from comments:
" -- #!data: data/sales.csv

" Then in insert mode:
" Type 'SELECT ' then press Alt+; to see column completions
" Use Tab to navigate, Enter to accept, or 1-9 for quick select
```

### ๐Ÿ”ง Technical Details
- JOIN AST structures: `JoinType`, `JoinOperator`, `JoinCondition`, `JoinClause`
- SelectStatement now includes `joins: Vec<JoinClause>` field
- Parser correctly handles table.column vs object.method() disambiguation in most cases
- Known limitation: WHERE clauses after JOINs may misinterpret table.column as method calls

## [1.42.0] - 2025-09-09

### ๐Ÿš€ Major Performance & Functionality Improvements

This release delivers critical performance optimizations, powerful new aggregate capabilities, and smarter script execution.

### โœจ New Features

#### **COUNT(DISTINCT) and DISTINCT Aggregates**
- **Full DISTINCT support** for all aggregate functions: COUNT, SUM, AVG, MIN, MAX
- **COUNT(DISTINCT column)** - Count unique values within groups
- Works seamlessly with GROUP BY clauses
- Example: `SELECT region, COUNT(DISTINCT customer_id) FROM sales GROUP BY region`

#### **GROUP_NUM() Function**
- **Value enumeration function** - Assigns unique sequential numbers (0-based) to distinct values
- Maintains consistency across entire query execution
- Alternative to JOINs for creating unique identifiers
- Example: `SELECT order_id, GROUP_NUM(order_id) as order_num FROM orders`

#### **Data File Hint System**
- **Script data hints** - Specify data file in SQL scripts with `-- #!data: path/to/file.csv`
- Supports relative paths (resolved from script location)
- Command-line arguments override script hints
- Examples:
  - `-- #!data: ../data/sales.csv`
  - `-- #!datafile: /absolute/path/to/data.csv`

### ๐Ÿ› Bug Fixes & Improvements

#### **Performance Optimization**
- **Fixed severe performance issue** with script execution on large files
- Scripts no longer clone entire DataTable for each GO block
- Creates Arc<DataTable> once and reuses for all statements
- Dramatic speedup on 50k+ row datasets

#### **DUAL Script Support**
- **Scripts using only DUAL now work** without requiring a data file
- Automatically detects when scripts use DUAL, RANGE(), or no FROM clause
- Only requires data file when script references actual tables
- Fixes issue with pure SQL calculation scripts like chemical_formulas.sql

### ๐Ÿ“š Examples
```sql
-- COUNT(DISTINCT) in action
SELECT 
    root_order_id,
    COUNT(DISTINCT security_id) as unique_securities,
    SUM(DISTINCT quantity) as unique_quantities
FROM trades
GROUP BY root_order_id;

-- GROUP_NUM for enumeration
SELECT 
    customer,
    GROUP_NUM(customer) as customer_num,
    total_sales
FROM sales_summary
ORDER BY customer_num;

-- Script with data hint
-- #!data: ../data/production.csv
SELECT * FROM production WHERE status = 'active';
```

### ๐Ÿ”ง Technical Details
- Added `distinct` flag to SqlExpression::FunctionCall in parser
- Implemented evaluate_aggregate_distinct() for efficient unique value tracking
- Global memoization for GROUP_NUM using lazy_static
- Smart script analysis to determine data file requirements

## [1.41.0] - 2025-09-08

### ๐Ÿš€ Major Enhancements

This release brings significant improvements to the SQL engine with new operators, window functions, and mathematical capabilities.

### โœจ New Features

#### **Operators & Expression Support**
- **Modulo operator (%)** - Now supports `value % 5` as an alias to `MOD(value, 5)`
- **OR operator in WHERE** - Fixed support for OR conditions like `WHERE (col = 'A' OR col = 'B')`
- **DISTINCT keyword** - Full support for `SELECT DISTINCT` to remove duplicate rows

#### **Window Functions**
- **SUM() window function** - Calculate sums over partitions: `SUM(amount) OVER (PARTITION BY category)`
- **COUNT() window function** - Enhanced with COUNT(*) support: `COUNT(*) OVER (PARTITION BY group)`
- **COUNT(column)** - Count non-null values in partitions

#### **Mathematical Functions**
- **SUM_N(n)** - Calculate triangular numbers (sum of first n natural numbers)
  - Formula: n * (n + 1) / 2
  - Example: `SUM_N(10)` returns 55

#### **RANGE Function & CTEs**
- **Comprehensive examples** - Added three new example files showcasing RANGE with CTEs:
  - `range_statistical_analysis.sql` - Statistical calculations
  - `range_test_data_generation.sql` - Mock data generation
  - `range_mathematical_sequences.sql` - Mathematical patterns

### ๐Ÿ› Bug Fixes
- Fixed OR operator not working in WHERE clauses with parentheses
- Fixed COUNT(*) not working as a window function (was parsed as StringLiteral instead of Column)
- Updated Python tests to match actual system capabilities

### ๐Ÿ“š Examples
```sql
-- Modulo operator
SELECT value, value % 3 AS remainder FROM RANGE(1, 10);

-- DISTINCT rows
SELECT DISTINCT category, status FROM products;

-- SUM window function with PARTITION BY
SELECT 
    region,
    sales_amount,
    SUM(sales_amount) OVER (PARTITION BY region) AS region_total
FROM sales_data;

-- Triangular numbers
SELECT n, SUM_N(n) AS triangular FROM RANGE(1, 10);
-- Returns: 1โ†’1, 2โ†’3, 3โ†’6, 4โ†’10, 5โ†’15, etc.
```

### ๐Ÿ”ง Known Limitations
- CASE WHEN doesn't support AND/OR operators (use mathematical workarounds)
- GROUP BY only supports column names, not expressions (use CTEs as workaround)
- Cross-joins with multiple RANGE CTEs have column resolution issues
- No ROWS BETWEEN support in window functions yet

## [1.40.0] - 2025-09-07

### ๐Ÿš€ Common Table Expressions (CTEs) Support

This release introduces full CTE (WITH clause) support, enabling powerful multi-stage queries and solving the "can't use alias in WHERE" limitation. CTEs can reference previous CTEs in the chain, unlocking advanced SQL patterns.

### โœจ New Features

#### **Common Table Expressions**
- **`WITH` clause** - Define named temporary result sets
- **CTE chaining** - Each CTE can reference ALL previous CTEs
- **Column aliasing** - Optional column list syntax `WITH cte_name (col1, col2) AS ...`
- **Window functions in CTEs** - Enables "top N per group" patterns
- **Materialized execution** - CTEs are evaluated once and cached

#### **NULL Handling Improvements**
- **NULL literal** - Proper NULL support in SQL expressions
- **IS NULL / IS NOT NULL** - Standard SQL null checking operators
- **CASE with NULL** - Correct NULL handling in CASE expressions
- **Arithmetic with NULL** - Operations with NULL correctly return NULL

#### **Function Registry Updates**
- **CONVERT()** - Moved from special handling to proper function registry
- **Physics constants** - Fixed function names (K, AVOGADRO, etc.)

### ๐Ÿ“š Examples
```sql
-- CTEs with chaining - each references the previous
WITH 
    filtered AS (SELECT * FROM data WHERE value > 100),
    aggregated AS (SELECT category, AVG(value) as avg_val FROM filtered GROUP BY category),
    top_categories AS (SELECT * FROM aggregated WHERE avg_val > 500)
SELECT * FROM top_categories ORDER BY avg_val DESC;

-- Top N per group using window functions in CTEs
WITH ranked AS (
    SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank
    FROM products
)
SELECT * FROM ranked WHERE rank <= 3;
```

### ๐Ÿ”ง Improvements
- **Subquery foundation** - CTE architecture enables future subquery support
- **Query optimization** - CTEs evaluated once, results cached
- **Examples** - Added comprehensive CTE cookbook and chaining examples

## [1.39.0] - 2025-09-06

### ๐ŸชŸ Window Functions, Hash Functions & Geometry Formulas

This release adds powerful SQL window functions for analytics, cryptographic hash functions for data integrity, and mathematical geometry formulas for calculations.

### โœจ New Features

#### **Window Functions**
- **`LAG(column, offset)`** - Access previous row values within partition
- **`LEAD(column, offset)`** - Access next row values within partition
- **`ROW_NUMBER()`** - Assign sequential numbers within partition
- **`FIRST_VALUE(column)`** - Get first value in partition
- **`LAST_VALUE(column)`** - Get last value in partition
- Full support for `OVER (PARTITION BY ... ORDER BY ...)` clause
- Enables ranking, running totals, and trend analysis

#### **Hash Functions**
- **`MD5(value)`** - Calculate MD5 hash (32 chars)
- **`SHA1(value)`** - Calculate SHA1 hash (40 chars)
- **`SHA256(value)`** - Calculate SHA256 hash (64 chars)
- **`SHA512(value)`** - Calculate SHA512 hash (128 chars)
- Auto-converts numbers to strings for hashing
- Returns NULL for NULL inputs

#### **Geometry Functions**
- **`PYTHAGORAS(a, b)`** - Calculate hypotenuse using Pythagorean theorem
- **`CIRCLE_AREA(radius)`** - Calculate area of circle (ฯ€rยฒ)
- **`CIRCLE_CIRCUMFERENCE(radius)`** - Calculate circumference (2ฯ€r)
- **`SPHERE_VOLUME(radius)`** - Calculate sphere volume (4/3ฯ€rยณ)
- **`SPHERE_SURFACE_AREA(radius)`** - Calculate sphere surface area (4ฯ€rยฒ)
- **`TRIANGLE_AREA(a, b, c)`** - Calculate triangle area using Heron's formula
- **`DISTANCE_2D(x1, y1, x2, y2)`** - Calculate 2D Euclidean distance

### ๐Ÿ”ง Improvements
- **NULL Arithmetic Handling** - Any arithmetic operation with NULL now correctly returns NULL
- **WindowContext** - Efficient partitioned data management for window functions
- **Test Coverage** - Comprehensive Python test suite for all new functions
- **Examples** - Added window function SQL examples and sales_data.csv sample

### ๐Ÿ“š Examples
```sql
-- Window functions for analytics
SELECT salesperson, month, sales_amount,
       LAG(sales_amount, 1) OVER (PARTITION BY salesperson ORDER BY month) as prev_month,
       ROW_NUMBER() OVER (PARTITION BY region ORDER BY sales_amount DESC) as rank
FROM sales_data;

-- Hash functions for data integrity
SELECT email, MD5(email) as email_hash, SHA256(password) as password_hash
FROM users;

-- Geometry calculations
SELECT PYTHAGORAS(3, 4) as hypotenuse,  -- Returns 5
       CIRCLE_AREA(10) as area,         -- Returns 314.159...
       TRIANGLE_AREA(3, 4, 5) as triangle_area;  -- Returns 6
```

## [1.38.0] - 2025-09-05

### ๐Ÿ”ข Prime Number Functions & Self-Documenting Registry

This release adds comprehensive prime number support with pre-computed tables for lightning-fast operations, plus a self-documenting function registry that automatically generates documentation.

### โœจ New Features

#### **Prime Number Functions**
- **`PRIME(n)`** - Returns the nth prime number (1-indexed)
  - Pre-computed 100,000 primes at compile time
  - O(1) access up to the 100,000th prime (1,299,709)
- **`IS_PRIME(n)`** - Tests if a number is prime
  - O(1) for numbers up to 1.3 million via HashSet lookup
  - Miller-Rabin algorithm for larger numbers
- **`PRIME_COUNT(n)`** - Returns count of primes โ‰ค n (ฯ€(n) function)
- **`NEXT_PRIME(n)`** - Returns smallest prime โ‰ฅ n
- **`PREV_PRIME(n)`** - Returns largest prime โ‰ค n

#### **Self-Documenting Function Registry**
- **`--list-functions`** - List all available SQL functions with descriptions
- **`--function-help <name>`** - Show detailed help for a specific function
- **`--generate-docs`** - Auto-generate markdown reference documentation
- All function metadata (description, arguments, examples) now in one place

#### **Prime Number Examples**
```sql
-- Get the 100th prime
SELECT PRIME(100);  -- Returns 541

-- Test primality
SELECT IS_PRIME(17), IS_PRIME(100);  -- true, false

-- Count primes up to 1000
SELECT PRIME_COUNT(1000);  -- Returns 168

-- Find twin primes (gap of 2)
SELECT n, PRIME(n), PRIME(n+1) 
FROM numbers WHERE PRIME(n+1) - PRIME(n) = 2;

-- Navigate primes
SELECT NEXT_PRIME(100), PREV_PRIME(100);  -- 101, 97
```

### ๐Ÿš€ Performance
- Pre-computed prime tables use only ~400KB memory
- Instant access to first 100,000 primes
- Efficient primality testing via compile-time generation

### ๐Ÿงช Testing
- Comprehensive Python test suite for prime functions
- Tests include twin primes, Goldbach's conjecture, Sophie Germain primes
- Prime analysis demonstration script

### ๐Ÿ“š Documentation  
- Auto-generated FUNCTION_REFERENCE.md from registry
- Function help available directly from CLI
- Examples embedded in function signatures

## [1.37.0] - 2025-09-04

### ๐ŸŽจ String Functions & Mathematical Constants

### โœจ New Features

#### **String Functions**
- **`MID(string, start, length)`** - Extract substring (1-indexed like SQL)
- **`UPPER(string)`** - Convert to uppercase
- **`LOWER(string)`** - Convert to lowercase  
- **`TRIM(string)`** - Remove leading/trailing whitespace

#### **Mathematical Constants**
- **`PI()`** - Returns ฯ€ (3.14159...)
- **`E()`** - Returns Euler's number (2.71828...)

## [1.36.0] - 2025-09-02

### ๐ŸŒŒ Astronomical Constants & Solar System Calculations

This release transforms SQL CLI into a powerful scientific calculator with comprehensive astronomical constants for astrophysics and solar system calculations.

### โœจ New Features

#### **Astronomical Constants**
- **Particle Radii** - `RE()`, `RP()`, `RN()` for electron, proton, and neutron radii
- **Solar System Masses** - All planets, Sun, and Moon masses in kg
  - `MASS_SUN()` - 1.989ร—10ยณโฐ kg
  - `MASS_EARTH()` - 5.972ร—10ยฒโด kg  
  - `MASS_MOON()` - 7.342ร—10ยฒยฒ kg
  - `MASS_MERCURY()` through `MASS_NEPTUNE()` for all planets
- **Orbital Distances** - Precise distances from Sun in meters
  - `DIST_MERCURY()` through `DIST_NEPTUNE()`
  - `AU()` - Astronomical Unit (1.496ร—10ยนยน m)
- **Distance Units** - `PARSEC()` and `LIGHTYEAR()` constants

#### **Scientific Calculations Now Possible**
```sql
-- Calculate Earth's surface gravity (9.82 m/sยฒ)
SELECT G() * MASS_EARTH() / POWER(6.371e6, 2) FROM DUAL;

-- Escape velocity from Moon
SELECT SQRT(2 * G() * MASS_MOON() / 1.737e6) FROM DUAL;

-- Schwarzschild radius of the Sun
SELECT 2 * G() * MASS_SUN() / (C() * C()) FROM DUAL;

-- Kepler's Third Law orbital periods
SELECT SQRT(4*PI()*PI()*POWER(DIST_MARS(),3)/(G()*MASS_SUN()))/(365.25*24*3600) FROM DUAL;
```

### ๐Ÿงช Testing
- Added comprehensive test suite with 21 tests for astronomical calculations
- Tests cover Kepler's laws, escape velocities, gravitational forces, and planetary densities
- All 243 Python tests passing

### ๐Ÿ“š Documentation
- Updated README with dedicated astronomical constants section
- Added examples for astrophysics calculations
- Documented all available constants with scientific notation

## [1.33.0] - 2025-08-31

### ๐Ÿ› Critical Bug Fixes
- **Fixed SQL Parser Method Call Handling** - Resolved parser failures with string methods containing spaces
  - Fixed issue where `name.Trim()` would fail if followed by spaces in SELECT clause
  - Parser now correctly handles whitespace after method calls like `IndexOf(' ')`
  - Ensures proper tokenization of method calls with arguments
- **Fixed TEXTJOIN Function** - Corrected argument handling to require ignore_empty flag
  - Syntax: `TEXTJOIN(delimiter, ignore_empty, value1, value2, ...)`
  - Fixed to properly handle 3+ arguments as required
- **Fixed Date Function Syntax** - Standardized date function argument order
  - DATEDIFF: `DATEDIFF('unit', date1, date2)` 
  - DATEADD: `DATEADD('unit', amount, date)`
  - Unit parameter must be a string literal

### โœ… Testing Improvements
- Added comprehensive test coverage for 40+ SQL functions
- Created `test_math_date_functions.py` with 23 test cases
- Updated `run_python_tests.sh` to include all test suites
- All 69 tests passing (66 pass, 3 skipped for unimplemented aggregates)

## [1.32.0] - 2025-08-31

### ๐ŸŽฏ Major Features
- **Non-Interactive Query Mode** - Execute SQL queries directly from command line for scripting and automation
  - Run queries with `-q "SELECT ..."` or from file with `-f query.sql`
  - Multiple output formats: CSV, JSON, TSV, and pretty tables
  - Output to file with `-O results.csv`
  - Perfect for data pipelines and batch processing
  - Ultra-fast execution with microsecond response times

### ๐Ÿš€ Features
- **Viewport Lock Mode** - Press Space to anchor scrolling position, data scrolls while cursor stays fixed
- **Dynamic Column Sizing** - Columns automatically adjust width based on visible viewport data
- **Compact Mode** - Press 'C' to reduce padding and fit more columns on screen
- **Auto-Execute for Files** - CSV/JSON files show data immediately on load with pre-filled query
- **Multi-Source Data Proxy** - Query SQL Server, APIs, and files seamlessly through unified interface
- **Visual Source Indicators** - Shows data source with colored icons (๐Ÿ“ฆ Cache, ๐Ÿ“ File, ๐ŸŒ API, ๐Ÿ—„๏ธ SQL)
- **Named Cache System** - Save queries with custom IDs like `:cache save trades_2024`
- **Rainbow Parentheses** - Visual matching for nested SQL queries
- **String.IsNullOrEmpty()** - LINQ-style null/empty checking in WHERE clauses
- **Schema-Aware History** - Command history with intelligent suggestions based on query context

### ๐Ÿ› Bug Fixes
- Fixed GitHub Actions deprecation warnings by updating to v4
- Fixed cache save to support named IDs
- Fixed formatting issues in CI/CD pipeline

### ๐Ÿ“š Documentation
- Comprehensive README with keyboard shortcuts
- Enhanced F1 help screen with all features
- Added MULTI_SOURCE_PROXY.md documentation
- Added tips section in help for feature discovery

### ๐Ÿ”ง Infrastructure
- Cross-platform CI/CD for Linux, Windows, macOS (x64 and ARM64)
- Automated release workflow with version bumping
- Pre-commit hooks for code formatting
- GitHub Actions permissions properly configured

## [1.0.0] - 2024-01-06

### Initial Release
- Full SQL parser with LINQ support
- Context-aware tab completion
- Professional TUI interface with split-view design
- Vim-like navigation and search
- Command history with search (Ctrl+R)
- CSV/JSON file support
- REST API integration
- Multi-line editor mode (F3)
- Export to CSV (Ctrl+S)
- Column sorting and filtering
- Cache management system

### Supported LINQ Methods
- String.Contains()
- String.StartsWith()
- String.EndsWith()
- String.IsNullOrEmpty()
- Property name normalization

### Platform Support
- Linux x64
- Windows x64
- macOS x64 (Intel)
- macOS ARM64 (Apple Silicon)