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
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Moderately AI Inc.
//! Utility-statement AST nodes (ADR-0012): COPY, EXPLAIN, DESCRIBE, KILL, PRAGMA, ATTACH, DETACH, CHECKPOINT, LOAD, VACUUM, REINDEX.
use ;
use crateMeta;
use ThinVec;
/// A PostgreSQL `COPY` bulk data-transfer statement.
///
/// Moves rows between an external location and either a table or the result of a
/// query: `COPY {<table> [(cols)] | (<query>)} {FROM | TO} {'file' | STDIN | STDOUT
/// | PROGRAM 'cmd'} [ [WITH] (options) | <legacy options> ]`. The two row sources
/// ride [`source`](Self::source); the query source makes this node generic over the
/// extension `X`, since it embeds a [`Statement`].
///
/// One canonical shape: the legacy un-parenthesized option list and the
/// modern parenthesized list share one [`options`](Self::options) list, with the
/// [`parenthesized`](Self::parenthesized) surface tag recording which spelling was
/// written so the construct round-trips. `FROM`/`TO` is recorded by
/// [`direction`](Self::direction) (always `TO` for the query source, which
/// PostgreSQL forbids `FROM` on); the `STDIN`/`STDOUT` keyword that is only
/// semantically valid for one direction is preserved verbatim rather than gated
/// (PostgreSQL accepts either with either direction).
///
/// A handful of legacy table-only surfaces ride dedicated fields rather than the
/// generic option list: the very-old `opt_binary` prefix ([`binary`](Self::binary)),
/// the `[USING] DELIMITERS '<str>'` clause ([`delimiters`](Self::delimiters)), and
/// the `COPY <table> FROM '<file>' WHERE <predicate>` filter ([`filter`](Self::filter),
/// `FROM`-only — PostgreSQL rejects it on `COPY TO`). None are valid on the query
/// source, which the parser enforces.
/// The row source of a [`CopyStatement`]: a table (with an optional column list) or
/// a parenthesized query.
///
/// PostgreSQL's query source is a parenthesized `PreparableStmt` — a `SELECT`,
/// `INSERT`, `UPDATE`, `DELETE`, or `MERGE` (the parser gates the inner statement to
/// the kinds it models). It is only valid with `TO`, never `FROM`.
/// The SQL copy direction forms represented by the AST.
/// The external endpoint of a `COPY`: a file, the client stream, or a subprocess.
///
/// `STDIN`/`STDOUT` are split so each renders the exact keyword written.
/// PostgreSQL's grammar admits either with either direction (the `TO STDIN` /
/// `FROM STDOUT` mismatch is a later semantic check, not a parse error), so the
/// keyword the parser saw is recorded as-is rather than normalized by direction.
/// One option in a `COPY` option list, e.g. `FORMAT csv`, `DELIMITER ','`, a bare
/// `HEADER`, DuckDB's `ROW_GROUP_SIZE 100000`, or `FORCE_QUOTE (a, b)`.
///
/// The generic key/value escape hatch of the COPY option axis: PostgreSQL's generic
/// option grammar is `ColLabel copy_generic_opt_arg`, so the [`name`](Self::name)
/// admits any word (including keywords such as `NULL`) and the argument is optional.
/// This one `name` + optional [`CopyOptionValue`] shape is a deliberate reshape
/// (ADR-0011) of sqlparser-rs's fixed per-option enums (`CopyOption::Format(Ident)`,
/// `ForceQuote(Vec<Ident>)`, …): rather than enumerate PostgreSQL's known option
/// keywords as variants, every option — PostgreSQL, DuckDB, or an unknown dialect
/// word — rides the same generic pair, so a dialect's format/option vocabulary
/// (DuckDB `COPY … (FORMAT PARQUET, COMPRESSION 'zstd', PARTITION_BY (y, m))`) is
/// carried as typed data without a per-keyword variant. The value *shapes*
/// PostgreSQL's `copy_generic_opt_arg` admits are the [`CopyOptionValue`] axis.
/// The argument shapes a [`CopyOption`] can carry — the extensible axis of the COPY
/// option machinery.
///
/// Mirrors PostgreSQL's `copy_generic_opt_arg` alternatives (`opt_boolean_or_string`,
/// `NumericOnly`, `'*'`, and `'(' copy_generic_opt_arg_list ')'`), which pg_query
/// accepts under the plain `copy` gate, plus the legacy [`Force`](Self::Force)
/// compound. DuckDB's and the Snowflake-adjacent parity target's format/option values
/// are a subset of these same shapes, so no widening feature flag is needed. This
/// enum is the pre-staged extension point for the `COPY INTO` sibling: a keyed nested
/// option list (Snowflake `FILE_FORMAT = (TYPE = CSV …)`) becomes an *additive*
/// variant here (a `ThinVec<CopyOption>` payload), riding the same
/// [`CopyOption`]/[`CopyStatement`] machinery rather than reshaping it.
/// Which legacy `FORCE` option a [`CopyOptionValue::Force`] carries.
///
/// A tag (no `meta`): the sub-keyword's span is subsumed by the enclosing
/// [`CopyOptionValue::Force`], exactly as [`CopyDirection`]/[`ExplainFormat`] ride
/// their parent's span.
/// A Snowflake `COPY INTO` bulk load/unload statement.
///
/// Moves rows between a table and a location: `COPY INTO <target> FROM <source>
/// [<option> = <value> ...]`. Unlike PostgreSQL's [`CopyStatement`] — which is a
/// `{FROM | TO} <endpoint>` transfer with comma-separated options — the direction
/// is fixed (`INTO <target> FROM <source>`) and the load-vs-unload sense is carried
/// by *which side* is the table: a table [`target`](Self::target) with a location
/// [`source`](Self::source) loads, a location target with a table/query source
/// unloads. It is a sibling statement rather than a variant of [`CopyStatement`]
/// because the two share only the `COPY` keyword: the endpoint model, the option
/// spelling (`KEY = VALUE`, space-separated, with a nested
/// [`OptionList`](CopyOptionValue::OptionList) for `FILE_FORMAT`), and the clause set
/// (`FILES`, `PATTERN`, `VALIDATION_MODE`) are disjoint. This mirrors sqlparser-rs's
/// separate `CopyIntoSnowflake` node.
///
/// Every trailing clause — `FILE_FORMAT = (...)`, `FILES = (...)`, `PATTERN = '...'`,
/// `VALIDATION_MODE = ...`, and the copy options (`ON_ERROR = ...`, `FORCE = TRUE`, …)
/// — rides the one generic [`options`](Self::options) list as a [`CopyOption`] whose
/// value shape captures its argument, exactly the ADR-0011 reshape
/// [`CopyStatement`] uses for PostgreSQL/DuckDB options: no per-keyword field.
///
/// The `@<stage>` internal/named-stage source-target sigil is not modelled yet — it
/// needs a tokenizer stage-reference surface (Snowflake enables no `@` lexer path
/// today) — so [`CopyIntoTarget`]/[`CopyIntoSource`] carry the table and external
/// string-location forms (and the query source), with the stage sigil a tracked
/// follow-up.
/// The `INTO <target>` destination of a [`CopyIntoStatement`]: a table (loading) or
/// an external location string (unloading).
/// The `FROM <source>` origin of a [`CopyIntoStatement`]: a table, an external
/// location string, or a parenthesized transformation query.
/// A DuckDB `EXPORT DATABASE ['<db>' TO] '<path>' [<copy-options>]` statement: write
/// the catalogue as a directory of `CREATE`/`INSERT`/`COPY` scripts plus data files.
///
/// The two grammar forms (DuckDB `ExportStmt`) are `EXPORT DATABASE '<path>'
/// <copy_options>` and `EXPORT DATABASE <db> TO '<path>' <copy_options>` — the
/// named-database form threads the catalogue name through a *required* `TO` before the
/// path (`EXPORT DATABASE db '<path>'` without `TO` is a parser error, probed on
/// 1.5.4). The presence of [`database`](Self::database) therefore reconstructs the `TO`
/// on render — a `Some` is the `<db> TO '<path>'` spelling, a `None` the bare
/// `'<path>'` — so no separate `to` surface tag is carried.
///
/// The options reuse the PostgreSQL `COPY` option axis verbatim: DuckDB's grammar
/// gives `ExportStmt` the same `copy_options` production `COPY` uses (a legacy
/// space-separated `copy_opt_list` *or* a parenthesized generic list), so the
/// [`options`](Self::options) list is [`CopyOption`]s and [`parenthesized`](Self::parenthesized)
/// records which spelling was written — exactly [`CopyStatement`]'s pair. Unlike `COPY`
/// there is no leading `WITH` (`EXPORT DATABASE '<path>' WITH (...)` is a parser error,
/// probed on 1.5.4), so the parenthesized form renders bare `(...)`. Non-generic: the
/// path is a string literal and [`CopyOption`] carries no extension nodes, so — like
/// [`DetachStatement`] — this node needs no `X`. Gated together with its
/// [`ImportStatement`] inverse by
/// [`UtilitySyntax::export_import_database`](crate::dialect::UtilitySyntax).
/// A DuckDB `IMPORT DATABASE '<path>'` statement: replay the `CREATE`/`INSERT`/`COPY`
/// scripts an [`ExportStatement`] wrote to a directory, reconstructing the catalogue.
///
/// The other half of DuckDB's database export/import round-trip, sharing the
/// [`UtilitySyntax::export_import_database`](crate::dialect::UtilitySyntax) gate (one
/// dialect unit — a dialect that exports databases imports them). The grammar (DuckDB
/// `ImportStmt`) is exactly `IMPORT DATABASE '<path>'`: a single string path and no
/// options (`IMPORT DATABASE '<path>' (...)` is a parser error, probed on 1.5.4).
/// Non-generic, like [`DetachStatement`]: a path literal carries no expressions or
/// extension nodes.
/// An `EXPLAIN` statement: report the planner's query plan for an inner statement.
///
/// Covers both option spellings: the legacy `EXPLAIN [ANALYZE] [VERBOSE]
/// <statement>` keyword prefix and the modern parenthesized list `EXPLAIN ( option
/// [, ...] ) <statement>`. They share one [`options`](Self::options) list; the
/// [`parenthesized`](Self::parenthesized) surface tag records which
/// spelling was written so the construct round-trips, since the legacy prefix can
/// only carry [`Analyze`](ExplainOption::Analyze)/[`Verbose`](ExplainOption::Verbose).
///
/// MySQL spells the same query-plan statement `EXPLAIN`, `DESCRIBE`, or `DESC`
/// interchangeably ([`DESCRIBE SELECT 1`](ExplainKeyword) is `EXPLAIN SELECT 1`), so the
/// leading keyword rides the [`spelling`](Self::spelling) surface tag; PostgreSQL only
/// has `EXPLAIN`, so its parser always sets [`Explain`](ExplainKeyword::Explain). The
/// separate MySQL *table*-metadata overload (`DESCRIBE <table>`) is a different shape —
/// a table name rather than an inner statement — and rides its own
/// [`DescribeStatement`], not this node.
///
/// Which inner statements PostgreSQL actually allows after `EXPLAIN` (a query,
/// `INSERT`/`UPDATE`/`DELETE`, `CREATE TABLE AS`, …) is a semantic restriction left
/// to a later pass; the grammar accepts any [`Statement`].
/// One option of an [`ExplainStatement`].
///
/// `ANALYZE`/`VERBOSE` carry an optional boolean/word argument (`ANALYZE`,
/// `ANALYZE true`) that is always absent in the legacy keyword-prefix spelling;
/// `FORMAT` names an output format; any other PostgreSQL option (`COSTS`,
/// `BUFFERS`, `SETTINGS`, `WAL`, `TIMING`, `SUMMARY`, …) rides
/// [`Other`](Self::Other) with its optional argument.
/// The SQL explain format forms represented by the AST.
/// Which leading keyword spelled an EXPLAIN-family statement: the canonical `EXPLAIN`,
/// or MySQL's `DESCRIBE`/`DESC` synonyms.
///
/// A surface tag (no `meta`): the keyword's span is subsumed by the enclosing
/// [`ExplainStatement`]/[`DescribeStatement`], exactly as [`ExplainFormat`] rides its
/// parent's span. MySQL accepts all three spellings for both the query-plan form
/// ([`ExplainStatement`]) and the table-metadata form ([`DescribeStatement`]);
/// PostgreSQL has only `EXPLAIN`, so its parser produces only
/// [`Explain`](Self::Explain).
/// A MySQL `{DESCRIBE | DESC | EXPLAIN} <table> [<column> | '<pattern>']` table-metadata
/// statement (MySQL-specific; gated by
/// [`ShowSyntax::describe`](crate::dialect::UtilitySyntax)).
///
/// MySQL overloads the EXPLAIN-family keywords: followed by an explainable statement they
/// plan a query ([`ExplainStatement`]); followed by a table name they instead report that
/// table's column metadata (the `SHOW COLUMNS FROM <table>` information), which is this
/// node. All three keyword spellings reach both forms, so the leading keyword rides the
/// [`keyword`](Self::keyword) [`ExplainKeyword`] surface tag for round-trip fidelity, as
/// [`ExplainStatement`] carries it. The optional trailing argument narrows the output to
/// one column or a `LIKE`-pattern set ([`column`](Self::column)).
///
/// This form has no PostgreSQL analogue and carries a table name rather than an inner
/// [`Statement`], so it is a distinct node, not a spelling folded onto
/// [`ExplainStatement`]. Non-generic, like [`DetachStatement`]: a table name and an
/// optional column/pattern carry no expressions or extension nodes.
/// The optional trailing argument of a [`DescribeStatement`]: a single column name or a
/// `LIKE`-style wildcard pattern.
///
/// MySQL's `opt_describe_column` is `ident | text_string`: a bare identifier names one
/// column (`DESCRIBE t col`), a string is a pattern the column list is filtered against
/// (`DESCRIBE t 'a%'`). A dotted name, a `*`, and a second argument are all MySQL syntax
/// errors, so only these two shapes are modelled.
/// A MySQL `KILL [CONNECTION | QUERY] <id>` statement: terminate a server thread or the
/// statement it is running (MySQL-specific; gated by
/// [`UtilitySyntax::kill`](crate::dialect::UtilitySyntax)).
///
/// The optional [`CONNECTION`/`QUERY`](KillTarget) keyword selects whether the whole
/// connection or just its current query is killed; bare `KILL <id>` defaults to
/// `CONNECTION`, and the [`target`](Self::target) tag keeps the three spellings distinct
/// so they round-trip. The thread id is a full expression in MySQL's grammar
/// (`KILL @id`, `KILL 1 + 1`, and a string `KILL '5'` all prepare), so it rides an
/// [`Expr`], which makes this node generic over the extension `X`.
/// The optional scope keyword of a [`KillStatement`].
///
/// A surface tag (no `meta`), riding the parent's span like [`CopyDirection`].
/// A MySQL `INSTALL` server-administration statement (gated by
/// [`UtilitySyntax::plugin_component_statements`](crate::dialect::UtilitySyntax)) — one of the
/// two forms of `sql_yacc.yy` `install_stmt`. The inverse [`UninstallStatement`] shares the
/// same `plugin_component_statements` gate (an install/uninstall pair, like `ATTACH`/`DETACH`).
///
/// Generic over `X` because the `COMPONENT` form's optional `SET` tail carries [`Expr`]s.
/// MySQL grammar-accepts every well-formed shape but cannot *prepare* the `COMPONENT` forms
/// over the binary protocol (`ER_UNSUPPORTED_PS` 1295) — a bind-time verdict the parse layer
/// does not model; the `PLUGIN` form does prepare.
/// A MySQL `UNINSTALL` server-administration statement (gated by
/// [`UtilitySyntax::plugin_component_statements`](crate::dialect::UtilitySyntax)) — the
/// `sql_yacc.yy` `uninstall` rule, the inverse of [`InstallStatement`]. Neither form carries
/// an expression, so — unlike its install counterpart — this node is not generic (the
/// [`PragmaStatement`] precedent).
/// One assignment in an `INSTALL COMPONENT … SET` tail (`sql_yacc.yy` `install_set_value`):
/// `[GLOBAL | PERSIST] <name> {= | :=} <value>`. A strictly narrower grammar than the general
/// MySQL `SET` — the scope is only the `install_option_type` set (`GLOBAL`/`PERSIST`, default
/// `GLOBAL`; `SESSION`/`LOCAL`/`PERSIST_ONLY` and `@`/`@@` sigils are `ER_PARSE_ERROR` on
/// mysql:8), and the value is only `install_set_rvalue` (`ON` or an [`Expr`]; `DEFAULT` and the
/// other `SET` sentinels reject). The name and assignment operator do reuse the general `SET`
/// machinery (`lvalue_variable`, [`SetAssignment`]).
/// The scope keyword of an [`InstallComponentSetElement`] — the `install_option_type` set. A
/// surface tag (no `meta`), riding the parent's span like [`KillTarget`]. `None` at the parent
/// (not a variant here) is the implicit default, which MySQL resolves to `GLOBAL`.
/// The value of an [`InstallComponentSetElement`] — `sql_yacc.yy` `install_set_rvalue`, exactly
/// `ON` or an expression (the general `SET`'s `DEFAULT`/`ALL`/`BINARY`/`ROW`/`SYSTEM` sentinels
/// are not admitted here).
/// A MySQL `HANDLER` low-level cursor statement (gated by
/// [`UtilitySyntax::handler_statements`](crate::dialect::UtilitySyntax)) — direct,
/// index-level read access to a table's storage engine that bypasses the optimizer
/// (`sql_yacc.yy` `handler_stmt`).
///
/// One node covers the three verbs on a single opened table, distinguished by
/// [`operation`](Self::operation): `HANDLER <t> OPEN [[AS] alias]`, `HANDLER <t> READ …`,
/// and `HANDLER <t> CLOSE`. The table's name arity differs by verb and is a parse-time
/// constraint, not a field: `OPEN` takes a possibly schema-qualified `table_ident`
/// (`HANDLER db.t OPEN`), while `READ`/`CLOSE` take a bare unqualified `ident` (`HANDLER
/// db.t CLOSE` is `ER_PARSE_ERROR` on mysql:8), so the parser admits a dotted
/// [`table`](Self::table) only under `OPEN`. Generic over `X`: the `READ` key list and
/// `WHERE` filter carry [`Expr`]s.
///
/// MySQL grammar-accepts every well-formed shape but cannot *prepare* a `HANDLER` over the
/// binary protocol (`ER_UNSUPPORTED_PS` 1295; a bare-connection `HANDLER … OPEN` against no
/// default database is `ER_NO_DB_ERROR` 1046) — a bind-time verdict the parse layer does
/// not model.
/// The verb of a [`HandlerStatement`]: `OPEN`, `CLOSE`, or a `READ` with its selector and
/// shared `WHERE`/`LIMIT` tail.
/// The row-selection shape of a `HANDLER … READ` (`sql_yacc.yy` `handler_scan_function` /
/// `handler_rkey_function` / `handler_rkey_mode`), independent of the shared `WHERE`/`LIMIT`
/// tail carried by [`HandlerOperation::Read`].
/// The traversal direction of an indexless `HANDLER … READ { FIRST | NEXT }` scan
/// ([`HandlerReadSelector::Scan`]) — the narrow `handler_scan_function` set. A surface tag
/// (no `meta`), riding the parent's span like [`KillTarget`].
/// The traversal direction of an indexed `HANDLER … READ <index> { FIRST | NEXT | PREV |
/// LAST }` ([`HandlerReadSelector::Index`]) — the `handler_rkey_function` set, which adds
/// `PREV`/`LAST` over [`HandlerScanDirection`]. A surface tag (no `meta`).
/// The key comparison of a `HANDLER … READ <index> <op> (…)` seek
/// ([`HandlerReadSelector::Key`]) — `sql_yacc.yy` `handler_rkey_mode`. A surface tag (no
/// `meta`). The set is exactly `= >= <= > <`; `<>`/`!=` are `ER_PARSE_ERROR` on mysql:8.
/// A MySQL `CLONE` statement (gated by [`UtilitySyntax::clone`](crate::dialect::UtilitySyntax))
/// — provision a data directory from either the running server or a remote donor
/// (`sql_yacc.yy` `clone_stmt`).
///
/// The single `CLONE` leading keyword splits into two grammar-disjoint forms, so they ride the
/// axis as variants rather than one option-soup node: [`Local`](Self::Local) copies the current
/// instance's data into a new directory, and [`Instance`](Self::Instance) streams a remote
/// donor's data over the wire. Non-generic — every operand is an account name, a string
/// literal, or a port number, never an embedded expression.
///
/// Neither form is preparable over the binary protocol (live mysql:8.4.10: both are
/// `ER_UNSUPPORTED_PS` 1295, grammar-*positive* but PS-declined) — a bind-time verdict the
/// parse layer does not model.
/// The `DATA DIRECTORY [=] '<dir>'` target of a [`CloneStatement`] — mandatory in the `LOCAL`
/// form, optional in the `INSTANCE` form.
/// The `REQUIRE [NO] SSL` transport requirement of a `CLONE INSTANCE` statement (`sql_yacc.yy`
/// `opt_ssl`) — a surface tag (no `meta`), riding the parent's span like [`KillTarget`].
/// A MySQL `IMPORT TABLE FROM '<file>' [, '<file>' …]` statement (gated by
/// [`UtilitySyntax::import_table`](crate::dialect::UtilitySyntax)) — recreate tables from
/// serialized `.sdi` metadata files written by a discarded tablespace (`sql_yacc.yy`
/// `import_stmt`).
///
/// The operand is a non-empty comma-separated list of **string** literals
/// (`TEXT_STRING_sys_list`); a bare identifier is `ER_PARSE_ERROR` on mysql:8, so
/// [`files`](Self::files) is a [`Literal`] list, not a name list. Distinct from DuckDB's
/// `IMPORT DATABASE '<dir>'` ([`ImportStatement`]) — both spell the leading `IMPORT`, but the
/// second keyword (`TABLE` vs `DATABASE`) and their separate gates keep them apart. Not
/// preparable over the binary protocol (live mysql:8.4.10: `ER_UNSUPPORTED_PS` 1295).
/// A MySQL `HELP '<topic>'` statement (gated by
/// [`UtilitySyntax::help_statement`](crate::dialect::UtilitySyntax)) — look up a term in the
/// server's help tables (`sql_yacc.yy` `help`).
///
/// The operand is a single `ident_or_text` (`sql_yacc.yy`), so a bare identifier (`HELP
/// contents`) and a quoted string (`HELP 'contents'`) are both accepted and fold to one
/// [`Ident`] whose quote style round-trips from its span — exactly the [`AccountName`] name
/// treatment. Exactly one operand: a bare `HELP` and a two-operand `HELP 'a' 'b'` are both
/// `ER_PARSE_ERROR` on mysql:8. Not preparable over the binary protocol (live mysql:8.4.10:
/// `ER_UNSUPPORTED_PS` 1295).
/// A MySQL `BINLOG '<base64-event>'` statement (gated by
/// [`UtilitySyntax::binlog`](crate::dialect::UtilitySyntax)) — replay a base64-encoded binary
/// log event, the format `mysqlbinlog --base64-output` emits (`sql_yacc.yy`
/// `binlog_base64_event`).
///
/// The operand is a single string literal (`TEXT_STRING_sys`); a bare identifier is
/// `ER_PARSE_ERROR` on mysql:8. Unlike the other server-administration families, `BINLOG` **is**
/// preparable over the binary protocol (live mysql:8.4.10: `PREPARE` accepts a grammar-valid
/// payload; the base64 decode and event application happen only at *execution*, which the
/// parse/prepare layer never reaches), so the family evidence records a `Prepared` outcome, not
/// `ER_UNSUPPORTED_PS`.
/// A SQLite `PRAGMA [<schema> .] <name> [= <value> | (<value>)]` configuration
/// statement (SQLite-specific; gated by
/// [`UtilitySyntax::pragma`](crate::dialect::UtilitySyntax)).
///
/// One canonical shape covers all three surface forms: a bare read
/// (`PRAGMA user_version`) is `value: None`, and the assignment (`= <value>`) and
/// call (`(<value>)`) spellings share one [`value`](Self::value) slot with the
/// [`parenthesized`](Self::parenthesized) surface tag recording which was written —
/// the [`CopyStatement::parenthesized`] pattern, never a second node. The value
/// grammar is SQLite's `signed-number | name | string-literal`, exactly the shape
/// [`SetParameterValue`] models for `SET` (SQLite's `PRAGMA` is its session-config
/// surface), so that node is reused rather than minting a parallel one. A general
/// expression is *not* admitted (`PRAGMA cache_size = 1 + 2` is a SQLite syntax
/// error), which is why the slot is not an [`Expr`].
/// A SQLite `ATTACH [DATABASE] <expr> AS <schema>` statement (SQLite-specific;
/// gated — together with its [`DetachStatement`] inverse — by
/// [`UtilitySyntax::attach`](crate::dialect::UtilitySyntax)).
///
/// The database source is a full expression in SQLite's grammar (usually a string
/// literal, but `ATTACH 'a' || '.db' AS x` is legal), which makes this node generic
/// over the extension `X`. The optional `DATABASE` noise keyword is
/// round-trip-significant, so it rides the
/// [`database_keyword`](Self::database_keyword) surface tag. The schema
/// alias is modelled as an [`Ident`] — SQLite's grammar technically admits an
/// expression there too (`AS 'aux'`), a permissiveness we deliberately do not model.
/// A `DETACH [DATABASE] [IF EXISTS] <schema>` statement — the [`AttachStatement`]
/// inverse, sharing its [`UtilitySyntax::attach`](crate::dialect::UtilitySyntax)
/// gate (one dialect unit) and its `DATABASE` surface tag. Non-generic, like
/// [`CommentOnStatement`](super::CommentOnStatement): a schema name carries no
/// expressions or extension nodes.
///
/// The `IF EXISTS` guard is a DuckDB extension gated by
/// [`UtilitySyntax::detach_if_exists`](crate::dialect::UtilitySyntax) (SQLite's
/// `DETACH` has no such guard). DuckDB admits it only *after* the `DATABASE`
/// keyword — `DETACH DATABASE IF EXISTS x` parses but `DETACH IF EXISTS x` is a
/// parser error (probed on 1.5.4) — so [`if_exists`](Self::if_exists) is `true`
/// only alongside [`database_keyword`](Self::database_keyword).
/// A `[FORCE] CHECKPOINT [<database>]` write-ahead-log flush statement.
///
/// PostgreSQL has the bare `CHECKPOINT` (no operands, gated by
/// [`MaintenanceSyntax::checkpoint`](crate::dialect::UtilitySyntax)); DuckDB extends it
/// with an optional `FORCE` modifier and an optional single database name, both gated
/// by [`MaintenanceSyntax::checkpoint_database`](crate::dialect::UtilitySyntax). The
/// database is a single bare [`Ident`] — DuckDB rejects a dotted `CHECKPOINT a.b` and
/// a quoted-string operand at parse time (probed on 1.5.4). Non-generic, like
/// [`DetachStatement`]: no expressions or extension nodes.
/// A `LOAD <extension>` extension/shared-library load statement.
///
/// PostgreSQL loads a shared library by string path (`LOAD 'plpgsql'`); DuckDB loads
/// an extension by a string (`LOAD 'tpch'`, `LOAD 'path/e.duckdb_extension'`) *or* a
/// bare name (`LOAD tpch`). [`UtilitySyntax::load_extension`](crate::dialect::UtilitySyntax)
/// gates the string form (both dialects);
/// [`UtilitySyntax::load_bare_name`](crate::dialect::UtilitySyntax) admits the DuckDB
/// bare-identifier argument. Non-generic: the argument is a name or a string literal,
/// never a general expression (DuckDB rejects `LOAD 1 + 1`).
/// The argument of a [`LoadStatement`]: a bare extension name or a string path.
///
/// The two forms round-trip distinctly — `LOAD tpch` keeps its bare spelling and
/// `LOAD 'tpch'` its quoted one — so the parser records which was written rather than
/// canonicalizing to one.
/// A DuckDB `UPDATE EXTENSIONS [( <name>, ... )]` extension-refresh statement
/// (DuckDB-specific; gated by
/// [`UtilitySyntax::update_extensions`](crate::dialect::UtilitySyntax)).
///
/// Refreshes installed extensions from their repository; the optional parenthesized
/// list restricts the refresh to the named extensions, and its absence updates every
/// installed extension. Non-generic, like [`ReindexStatement`]: the operands are bare
/// extension names — DuckDB's `opt_column_list` (`ColId` list), a quoted or unquoted
/// identifier, never a string, dotted name, or general expression (all engine-probed
/// rejects on 1.5.4). `extensions` is empty for the bare `UPDATE EXTENSIONS`; when the
/// list is written it carries at least one name (`UPDATE EXTENSIONS ()` is a DuckDB
/// parser error), so an empty vector round-trips as the bare form unambiguously.
/// A `VACUUM …` database-maintenance statement — SQLite's `VACUUM [<schema>] [INTO
/// <expr>]` compaction *and* DuckDB's `VACUUM [ANALYZE] [<table> [(<col>, …)]]`
/// statistics/compaction, one node with each dialect's operands on their own gated
/// fields (the `DetachStatement`/`CheckpointStatement` precedent: extend the shared
/// node with dialect-gated fields rather than mint a dialect-named variant).
///
/// The three SQLite utility maintenance statements (`VACUUM`/`REINDEX`/`ANALYZE`) each
/// ride their own leading-keyword gate rather than one shared flag: they are
/// independent statements, not an inverse pair like `ATTACH`/`DETACH`, so they follow
/// the `copy`/`comment_on` precedent (separate flags even though every shipped dialect
/// toggles them together). The leading `VACUUM` is dispatched under
/// [`MaintenanceSyntax::vacuum`](crate::dialect::MaintenanceSyntax) (SQLite) *or*
/// [`MaintenanceSyntax::vacuum_analyze`](crate::dialect::MaintenanceSyntax) (DuckDB).
///
/// The two dialects' operands are disjoint and each rides its own gate, so at most one
/// dialect's fields are populated by a given parse — under every preset, *including*
/// the permissive union with both gates on. With both gates on the accepted language is
/// the exact union of the two grammars, not their cross product: engine-measured
/// (SQLite 3.x + DuckDB 1.5.4), every hybrid tail (`VACUUM ANALYZE … INTO`, a column
/// list or dotted name before `INTO`) is rejected by BOTH engines, so the parser admits
/// the `INTO` tail only on a SQLite-shaped prefix and a taken `INTO`'s single-part name
/// populates [`schema`](Self::schema), never [`table`](Self::table).
/// - **SQLite** ([`schema`](Self::schema) + [`into`](Self::into)): the grammar
/// (`parse.y`: `cmd ::= VACUUM nm INTO expr`) admits an optional single database name
/// — not a dotted [`ObjectName`], since `VACUUM main.t` is a SQLite syntax error — and
/// an optional `INTO <filename>` whose target is a full expression (`VACUUM INTO 'a' ||
/// '.db'` is legal), which makes this node generic over `X`.
/// - **DuckDB** ([`analyze`](Self::analyze) + [`table`](Self::table) +
/// [`columns`](Self::columns)): an optional `ANALYZE` option — the surviving VACUUM
/// option, spelled either bare (`VACUUM ANALYZE`) or as a parenthesized option list
/// (`VACUUM (ANALYZE)`), the two tracked distinctly on [`VacuumAnalyze`] for
/// round-trip fidelity — an optional *qualified* table (`VACUUM db.t` is legal, unlike
/// SQLite), and an optional parenthesized column list (present only alongside a table,
/// always non-empty — `VACUUM t ()` is a parser error). `ANALYZE` is the *only* option
/// the grammar admits at either layer: 1.5.4's parser rejects `NOWAIT`/`SKIP_TOAST`/any
/// unknown option and the boolean-argument form `(ANALYZE true)`, and its transform
/// throws `NotImplementedException` on `FULL`/`FREEZE`/`VERBOSE`/`disable_page_skipping`
/// — so those never parse and never prepare (engine-measured; see the parser's
/// `parse_vacuum_statement`).
///
/// The invariant is a *parser* guarantee, not a structural one: the representable
/// invalid states (both [`schema`](Self::schema) and [`table`](Self::table) populated,
/// [`columns`](Self::columns) without a table, an empty column list) are deliberately
/// unguarded against manual construction and serde deserialization. This crate has no
/// node-level structural-validation hook, and sibling nodes' shape claims (e.g.
/// [`AnalyzeStatement`]'s "always non-empty" column list) carry the same parse-output
/// scope; a bespoke debug assert on this one node would be an inconsistent one-off. The
/// renderer emits whatever is populated, in the fixed `ANALYZE`, name, columns, `INTO`
/// order.
/// How DuckDB's `ANALYZE` vacuum option was spelled — a round-trip spelling tag, like
/// [`TableKeyword`]. DuckDB 1.5.4 accepts the option two ways with identical meaning
/// (both set the engine's single analyze flag), so the distinction is purely syntactic
/// and exists only to render the input back verbatim.
///
/// `ANALYZE` is the sole option either spelling admits: the parenthesized list rejects
/// every other option keyword and the boolean-argument form (`(ANALYZE true)`) at the
/// parser, and `FULL`/`FREEZE`/`VERBOSE`/`disable_page_skipping` at the transform
/// (engine-measured on libduckdb 1.5.4). A list of repeated `ANALYZE`
/// (`VACUUM (ANALYZE, ANALYZE)`) is accepted and canonicalized to the single
/// [`Parenthesized`](Self::Parenthesized) form — the repeats are semantically
/// idempotent, so no count is preserved.
/// A SQLite `REINDEX [<collation> | [<schema> .] <table-or-index>]`
/// index-rebuild statement (SQLite-specific; gated by
/// [`MaintenanceSyntax::reindex`](crate::dialect::UtilitySyntax)).
///
/// The optional target is a possibly schema-qualified name (SQLite `REINDEX nm dbnm` —
/// a collation, table, or index name; the three are disambiguated by catalogue
/// lookup, not syntax, so one [`ObjectName`] slot covers all). Non-generic, like
/// [`DetachStatement`]: a name carries no expressions. `None` is the bare `REINDEX`
/// (rebuild everything).
/// An `ANALYZE …` statistics-gathering statement — SQLite's `ANALYZE [<schema> |
/// [<schema> .] <table-or-index>]` *and* DuckDB's `ANALYZE [<table> [(<col>, …)]]`,
/// gated by [`MaintenanceSyntax::analyze`](crate::dialect::MaintenanceSyntax).
///
/// Structurally the [`ReindexStatement`] shape — an optional possibly-qualified name
/// (SQLite `ANALYZE nm dbnm`; DuckDB `ANALYZE qualified_name`) shared on
/// [`target`](Self::target) — but a distinct statement with its own gate and node (the
/// `Vacuum`/`Reindex`/`Analyze` trio are three separate statements, not one parametric
/// family). `None` [`target`](Self::target) is the bare `ANALYZE` (analyze the whole
/// database).
///
/// DuckDB extends the target with an optional parenthesized column list
/// ([`columns`](Self::columns), gated by
/// [`MaintenanceSyntax::analyze_columns`](crate::dialect::MaintenanceSyntax)); DuckDB's
/// `VERBOSE` option never parses (1.5.4's transform throws
/// `NotImplementedException`), so no verbose surface is modelled.
/// A MySQL table-administration maintenance statement — one of the five admin-table
/// verbs `{ANALYZE | CHECK | CHECKSUM | OPTIMIZE | REPAIR} {TABLE | TABLES} <table-list>
/// [options]` (gated by
/// [`MaintenanceSyntax::table_maintenance`](crate::dialect::MaintenanceSyntax)).
///
/// The five verbs share one shape — a verb, an optional `NO_WRITE_TO_BINLOG | LOCAL`
/// binlog-suppression prefix (ANALYZE/OPTIMIZE/REPAIR only), the `TABLE`/`TABLES`
/// keyword, a comma-separated table list, and per-verb trailing options. That shared
/// spine (the [`table_keyword`](Self::table_keyword) synonym tag and the
/// [`tables`](Self::tables) list) is hoisted here once, and the verb rides the
/// [`kind`](Self::kind) axis carrying only what differs, rather than five bespoke
/// statement nodes. Non-generic: every operand is a name, keyword flag, column list, or
/// integer literal — no embedded expression.
/// The verb of a [`TableMaintenanceStatement`] and its per-verb options — the axis on
/// which the five MySQL admin-table verbs differ.
///
/// The `NO_WRITE_TO_BINLOG | LOCAL` prefix is carried only by the verbs whose grammar
/// admits it (`ANALYZE`/`OPTIMIZE`/`REPAIR`; `CHECK`/`CHECKSUM` have none). `CHECK` and
/// `REPAIR` take an order-preserving, repeatable option list (MySQL OR's the flags but
/// the written order/repeats round-trip from the [`ThinVec`]); `CHECKSUM` takes a single
/// mutually-exclusive option; `OPTIMIZE` takes none.
/// `TABLE` vs its interchangeable `TABLES` synonym in the admin-table verbs — a
/// round-trip spelling tag (MySQL's `table_or_tables`).
/// The MySQL `NO_WRITE_TO_BINLOG | LOCAL` binlog-suppression prefix on
/// `ANALYZE`/`OPTIMIZE`/`REPAIR TABLE`.
///
/// `LOCAL` is an exact synonym of `NO_WRITE_TO_BINLOG` (both set the same
/// don't-replicate flag), so the written spelling rides this tag for round-trip.
/// The `ANALYZE TABLE ... {UPDATE | DROP} HISTOGRAM ON <cols>` histogram-management tail.
///
/// Only one tail may appear. The 8.4 extensions to the `UPDATE` form — `{AUTO | MANUAL}
/// UPDATE` and `USING DATA '<json>'` — are deliberately not modelled here; the measured
/// grammar this node covers is `UPDATE HISTOGRAM ON <cols> [WITH <n> BUCKETS]` and `DROP
/// HISTOGRAM ON <cols>`.
/// A `CHECK TABLE` check-type option (`opt_mi_check_types`).
///
/// Grammatically repeatable and order-free (MySQL OR's the flags); the parser preserves
/// the written order and repeats in the option list.
/// A `CHECKSUM TABLE` option (`opt_checksum_type`) — single and mutually exclusive.
/// A `REPAIR TABLE` repair-type option (`mi_repair_type`).
///
/// Grammatically repeatable and order-free (MySQL OR's the flags); the parser preserves
/// the written order and repeats in the option list.
/// A MySQL `CACHE INDEX` statement — assign a table's indexes to a named key cache (gated by
/// [`UtilitySyntax::key_cache_statements`](crate::dialect::UtilitySyntax)).
///
/// The MyISAM-era key-cache management pair, with [`LoadIndexStatement`]. Two grammar arms
/// share the `<table> [<key-list>]` per-table shape but are mutually exclusive on the
/// partition axis (`sql_yacc.yy` `keycache_stmt`), so they ride the [`CacheIndexTargets`]
/// enum rather than an optional-partition field that could pair a partition with a table
/// list: `CACHE INDEX <t> [<keys>][, <t> [<keys>] ...] IN <cache>` (the multi-table
/// [`Tables`](CacheIndexTargets::Tables) arm, no partition) and `CACHE INDEX <t> PARTITION
/// (...) [<keys>] IN <cache>` (the single-table [`Partition`](CacheIndexTargets::Partition)
/// arm). Measured on mysql:8.4.10: a table list with a `PARTITION` clause, and a `PARTITION`
/// written after the key list, both `ER_PARSE_ERROR`. Carries no [`Expr`], so it is not
/// generic over `X`.
/// The table target(s) of a [`CacheIndexStatement`] — the list-vs-partition axis of MySQL's
/// `keycache_stmt`.
///
/// The two arms are mutually exclusive: the multi-table list carries no partition, and the
/// partitioned form is restricted to a single table. Modelling them as one enum keeps the
/// invalid "table list + partition" state unrepresentable.
/// One `<table> [{INDEX | KEY} (<keys>)]` assignment in a [`CacheIndexTargets::Tables`] list
/// (MySQL's `assign_to_keycache`).
/// A MySQL `LOAD INDEX INTO CACHE` statement — preload a table's index blocks into its key
/// cache (gated by
/// [`UtilitySyntax::key_cache_statements`](crate::dialect::UtilitySyntax)).
///
/// The preload half of the key-cache pair with [`CacheIndexStatement`]; it takes no `IN
/// <cache>` (the index is loaded into the table's already-assigned cache). Same list-vs-
/// partition exclusivity (`sql_yacc.yy` `preload_stmt`), plus a per-table `IGNORE LEAVES`
/// flag written *after* the key list — see [`LoadIndexTargets`]. Measured on mysql:8.4.10:
/// `IGNORE LEAVES` before the key list, a partition with a table list, and a trailing `IN
/// <cache>` all `ER_PARSE_ERROR`. Carries no [`Expr`], so it is not generic over `X`.
/// The table target(s) of a [`LoadIndexStatement`] — the list-vs-partition axis of MySQL's
/// `preload_stmt`, mirroring [`CacheIndexTargets`] with a per-table `IGNORE LEAVES` flag.
/// One `<table> [{INDEX | KEY} (<keys>)] [IGNORE LEAVES]` preload in a
/// [`LoadIndexTargets::Tables`] list (MySQL's `preload_keys`).
/// The optional `{INDEX | KEY} (<key>[, ...])` list shared by the key-cache statements
/// (MySQL's `opt_cache_key_list` in its non-empty form).
///
/// `INDEX` and `KEY` are exact synonyms — the written spelling rides
/// [`keyword`](Self::keyword) for round-trip. The parenthesized list may be empty
/// (`INDEX ()`); the parentheses are always written, so an empty [`keys`](Self::keys) is
/// distinct from the clause's absence (the enclosing `Option<CacheIndexKeyList>` being
/// `None`). Each key is an index name, or the `PRIMARY` keyword naming the primary key —
/// admitted here unquoted (`key_usage_element: ident | PRIMARY_SYM`) and preserved as an
/// unquoted [`Ident`] (a backtick-quoted `` `PRIMARY` `` round-trips as a quoted name).
/// The `INDEX` vs `KEY` spelling of a [`CacheIndexKeyList`] — exact synonyms, recorded so the
/// written keyword round-trips. A surface tag (no `meta`, like [`TableKeyword`]).
/// The destination key cache of a [`CacheIndexStatement`]'s `IN <cache>` clause (MySQL's
/// `key_cache_name`): a named cache or the `DEFAULT` server key cache.
/// The `PARTITION (ALL | <name>[, ...])` selection of a partitioned key-cache statement
/// (MySQL's `adm_partition` / `all_or_alt_part_name_list`): every partition, or a named set.
/// A MySQL standalone object-rename statement — `RENAME TABLE <a> TO <b>[, ...]` or
/// `RENAME USER <u> TO <v>[, ...]` (gated by
/// [`UtilitySyntax::rename_statement`](crate::dialect::UtilitySyntax)).
///
/// The two forms share the `RENAME <keyword> <old> TO <new>[, ...]` rename-list shape but
/// carry different element types — schema-qualifiable table names vs. MySQL account names
/// — so they ride the axis as distinct variants rather than one option-soup list. This is
/// the *standalone* `RENAME` statement; the `ALTER TABLE ... RENAME TO` sub-clause is a
/// separate construct.
/// One `<from> TO <to>` table-rename mapping in a `RENAME TABLE` statement.
/// One `<from> TO <to>` account-rename mapping in a `RENAME USER` statement.
/// A MySQL account name — the full `user` grammar axis: a named `<user>[@<host>]` account
/// or the `CURRENT_USER [()]` self-reference.
///
/// This is the shared account-reference node the whole MySQL user/role surface rides —
/// `RENAME USER`, `CREATE`/`ALTER`/`DROP USER`, `CREATE`/`DROP ROLE`, and (via the same
/// spellings) role lists. Each name part of a named account is a MySQL `ident_or_text` (a
/// bare/backtick identifier or a quoted `'…'`/`"…"` string), folded to an [`Ident`] whose
/// quote style round-trips from its span (`'u'@'localhost'`, `` u@`localhost` ``,
/// `u@localhost`). A bare user with no `@host` leaves [`host`](AccountName::Account::host)
/// `None` — the server reads that as `@'%'`, but the absent host is preserved as written
/// rather than materialised.
///
/// [`Definer`](super::Definer) is the parallel *minimal* account reference a routine header
/// carries (`DEFINER = <user>`); it mirrors this node's `Account`/`CurrentUser` split and is
/// slated to fold into this shared node once the routine/trigger/event landings that consume
/// it converge.
/// A MySQL `FLUSH [NO_WRITE_TO_BINLOG | LOCAL] <target>` server-administration statement
/// (gated by [`UtilitySyntax::flush`](crate::dialect::UtilitySyntax)).
///
/// `FLUSH` reloads or clears one of the server's internal caches or logs. The optional
/// `NO_WRITE_TO_BINLOG | LOCAL` prefix — shared with the admin-table verbs, so it reuses
/// [`NoWriteToBinlog`] — suppresses binary-log replication of the flush. *What* is flushed
/// rides the [`FlushTarget`] axis: MySQL's `flush_options` grammar splits into the
/// `{TABLE | TABLES} [<list>] [WITH READ LOCK | FOR EXPORT]` form and a comma-separated list
/// of keyword targets, and the two are mutually exclusive — `FLUSH TABLES, LOGS` and
/// `FLUSH LOGS, TABLES` are both `ER_PARSE_ERROR` on mysql:8.4.10, `TABLES` never joining the
/// list. Non-generic: every operand is a table name, keyword flag, or channel string — no
/// embedded expression.
/// What a [`FlushStatement`] flushes — MySQL's mutually-exclusive `flush_options` split.
///
/// The `{TABLE | TABLES}` form ([`Tables`](Self::Tables)) and the comma-separated keyword
/// list ([`Options`](Self::Options)) are distinct grammar alternatives, not two shapes of one
/// list: `TABLES` cannot appear inside the option list and the list members cannot follow
/// `TABLES` (both `ER_PARSE_ERROR` on mysql:8.4.10), so they ride the axis as two variants
/// rather than one option-soup list.
/// The trailing lock clause on the `FLUSH TABLES` form — MySQL's `opt_flush_lock`.
/// One keyword target in a [`FlushTarget::Options`] list — MySQL's `flush_option`.
///
/// Every member is a bare keyword or keyword pair except [`RelayLogs`](Self::RelayLogs),
/// which carries an optional `FOR CHANNEL '<name>'` qualifier. Measured against MySQL 8.4.10
/// (`sql_yacc.yy` `flush_option`): the pre-8.0 `QUERY CACHE`, `DES_KEY_FILE`, and `HOSTS`
/// targets are gone (all `ER_PARSE_ERROR`), and `USER_RESOURCES` is the sole accepted
/// spelling of the user-resource reset — bare `RESOURCES` is `ER_PARSE_ERROR` even though the
/// yacc token is *named* `RESOURCES`, because the lexer maps only the `USER_RESOURCES` keyword
/// text onto it. A spanned enum (each variant carries its own [`Meta`], like [`ShowTarget`]):
/// [`RelayLogs`](Self::RelayLogs) holds a spanned channel [`Literal`], so every sibling
/// records its own list-element span too.
/// A MySQL `PURGE BINARY LOGS {TO '<log>' | BEFORE <datetime>}` binary-log purge statement
/// (gated by [`UtilitySyntax::purge_binary_logs`](crate::dialect::UtilitySyntax)).
///
/// Deletes binary-log files up to a named file or a cutoff time. The `BINARY` keyword is
/// fixed: MySQL 8.4 removed the deprecated `MASTER` synonym (`PURGE MASTER LOGS` is
/// `ER_PARSE_ERROR` on mysql:8.4.10), so there is no spelling axis. Exactly one target clause
/// is required — a bare `PURGE BINARY LOGS` is `ER_PARSE_ERROR` — riding the [`PurgeTarget`]
/// axis. The `BEFORE` form takes a full datetime *expression* (`BEFORE NOW() - INTERVAL 3 DAY`
/// parses), which makes this node generic over the extension `X`.
/// The required target clause of a [`PurgeStatement`] — MySQL's `purge_option`.
/// A `USE <schema>` (MySQL) / `USE <catalog> [. <schema>]` (DuckDB) catalog/schema-switch
/// statement (gated by
/// [`UtilitySyntax::use_statement`](crate::dialect::UtilitySyntax)).
///
/// Sets the default catalog and schema for subsequent unqualified names — DuckDB's
/// engine implements it as a `SET schema`, MySQL's as `SQLCOM_CHANGE_DB`, but syntactically
/// it is its own statement. The name arity is dialect data gated by
/// [`UtilitySyntax::use_qualified_name`](crate::dialect::UtilitySyntax): DuckDB accepts
/// `USE db` and `USE db.schema` but rejects a three-part `USE a.b.c` at parse time
/// (`Expected "USE database" or "USE database.schema"`), while MySQL's `USE ident` takes a
/// single unqualified schema and `ER_PARSE_ERROR`s any dotted name (engine-measured on
/// mysql:8) — so this holds an [`ObjectName`] of one or two [`Ident`]s and the parser
/// enforces whichever bound the dialect does. Under
/// [`UtilitySyntax::use_string_literal_name`](crate::dialect::UtilitySyntax) DuckDB also
/// admits a single-part Sconst target (`USE 'n'` / `E'n'` / `$$n$$`), folded into a
/// single-quoted [`Ident`] so the quotes round-trip. Non-generic, like [`DetachStatement`]:
/// a qualified name carries no expressions or extension nodes.
/// A `PREPARE <name> [ ( <type> [, ...] ) ] AS <statement>` prepared-statement
/// definition (DuckDB; gated by
/// [`UtilitySyntax::prepared_statements`](crate::dialect::UtilitySyntax)).
///
/// Binds a session-scoped name to a parameterized statement (`PREPARE v1 AS SELECT
/// 'Test' LIMIT ?`). The body embeds a [`Statement`], which makes this node generic
/// over the extension `X`, and follows the [`ExplainStatement`] contract:
/// the grammar accepts *any* [`Statement`] and leaves the preparable-kind restriction
/// to a later pass — DuckDB rejects a non-preparable body at bind, not parse.
///
/// The prepared-statement name is a bare [`Ident`], not a dotted [`ObjectName`]: the
/// name lives in a flat session namespace, not the catalogue. DuckDB rejects the
/// PostgreSQL `PREPARE name ( <type> [, ...] ) AS ...` argument-type list ("Prepared
/// statement argument types are not supported, use CAST"), so
/// [`parameter_types`](Self::parameter_types) is gated by its own
/// [`prepare_typed_parameters`](crate::dialect::UtilitySyntax::prepare_typed_parameters)
/// flag, independent of the base `PREPARE`/`EXECUTE`/`DEALLOCATE` dispatch.
/// A MySQL `PREPARE <name> FROM {'<text>' | @<var>}` prepared-statement definition (gated by
/// [`UtilitySyntax::prepared_statements_from`](crate::dialect::UtilitySyntax)).
///
/// A *different shape on the same `PREPARE` keyword* from DuckDB/PostgreSQL's typed
/// [`PrepareStatement`]: MySQL binds the name to a statement *source* — an opaque string
/// literal or a user-variable reference read at prepare time (`sql_yacc.yy` `prepare_src`) —
/// **not** an inline-parsed [`Statement`], and takes neither the `AS` keyword nor a
/// parameter-type list. The source text is never re-parsed here (the placeholders `?` it
/// carries are a run-time protocol concern), so this node holds no expression or statement
/// children and is non-generic, like [`DeallocateStatement`]. The two `PREPARE` behaviours
/// never coexist in one preset (each arms at most one gate), the split mirroring the
/// [`DoStatement`]/[`DoExpressionsStatement`] `DO`-keyword split.
///
/// MySQL grammar-accepts every well-formed source shape but cannot *prepare* the outer
/// `PREPARE` itself over the binary protocol (`ER_UNSUPPORTED_PS` 1295) — a bind-time
/// verdict the parse layer does not model, exactly the [`PrepareStatement`]
/// "grammar accepts, bind restricts" contract.
/// The source of a MySQL [`PrepareFromStatement`] — `sql_yacc.yy` `prepare_src`, either an
/// inline string literal or a user-variable reference. A spanned enum node: each arm
/// round-trips its own spelling, so the two are recorded as written rather than folded to a
/// single string.
/// An `EXECUTE <name> [ ( <arg> [, ...] ) ]` prepared-statement invocation (DuckDB;
/// gated by [`UtilitySyntax::prepared_statements`](crate::dialect::UtilitySyntax)).
///
/// Runs a [`PrepareStatement`]-bound name, supplying its parameters positionally
/// (`EXECUTE v1(1)`). The arguments are full expressions, which makes this node generic
/// over the extension `X`. A bare `EXECUTE v1` (no argument list) leaves
/// [`args`](Self::args) empty; DuckDB rejects an empty `EXECUTE v1()` as a syntax error,
/// so an empty list unambiguously means "no parentheses written" and needs no separate
/// surface tag — one shape covers the absent-list form, and the parser refuses the empty
/// `()` that would otherwise collide with it.
/// A MySQL `EXECUTE <name> [USING @<var> [, ...]]` prepared-statement invocation (gated by
/// [`UtilitySyntax::prepared_statements_from`](crate::dialect::UtilitySyntax)).
///
/// A *different argument surface on the same `EXECUTE` keyword* from DuckDB's parenthesized
/// positional-expression [`ExecuteStatement`]: MySQL supplies parameters through a `USING`
/// clause whose members are strictly *user-variable references* (`sql_yacc.yy`
/// `execute_var_list` → `execute_var_ident: '@' ident_or_text`), never arbitrary
/// expressions — `EXECUTE s USING 1` and `EXECUTE s USING @@sys` are both `ER_PARSE_ERROR`
/// on mysql:8, and there is no `EXECUTE s(...)` parenthesized form. So this node holds a
/// list of variable-name [`Ident`]s, not [`Expr`]s, and is non-generic. A bare `EXECUTE s`
/// (no `USING`) leaves [`using`](Self::using) empty; MySQL has no empty-`USING` spelling, so
/// an empty list unambiguously means the clause was absent.
///
/// Like [`PrepareFromStatement`], the statement grammar-parses but cannot be prepared over
/// the binary protocol (`ER_UNSUPPORTED_PS` 1295) — a bind verdict the parse layer leaves
/// untouched.
/// A `CALL <name> [ ( [ <arg> [, ...] ] ) ]` routine invocation (DuckDB, MySQL; gated by
/// [`UtilitySyntax::call`](crate::dialect::UtilitySyntax)).
///
/// Invokes a table function or stored procedure as a top-level statement
/// (`CALL pragma_table_info('t')`, `CALL my_proc(1, 2)`). The arguments are full
/// expressions, which makes this node generic over the extension `X`.
///
/// The parenthesized argument list is *mandatory* for DuckDB — it rejects a bare
/// `CALL pragma_version` (syntax error) but accepts an empty `CALL pragma_version()` — and
/// *optional* for MySQL, whose grammar (`CALL_SYM sp_name opt_paren_expr_list`) admits a
/// bare `CALL my_proc` with no argument list at all (verified on mysql:8.4.10 — the bare
/// form resolves to ER_SP_DOES_NOT_EXIST, a grammar-positive binding reject). The
/// [`parenthesized`](Self::parenthesized) surface flag distinguishes the two written forms
/// so the source round-trips: `false` is the MySQL bare form (`CALL p`, always empty
/// [`args`](Self::args)), `true` is the parenthesized form (`CALL p()` / `CALL p(1, 2)`,
/// which is the only DuckDB shape). The bare form is gated by
/// [`UtilitySyntax::call_bare_name`](crate::dialect::UtilitySyntax).
/// A `{DEALLOCATE | DROP} [PREPARE] <name>` prepared-statement release (DuckDB, gated by
/// [`UtilitySyntax::prepared_statements`](crate::dialect::UtilitySyntax); MySQL, gated by
/// [`UtilitySyntax::prepared_statements_from`](crate::dialect::UtilitySyntax)).
///
/// Frees a [`PrepareStatement`]/[`PrepareFromStatement`]-bound name. Non-generic, like
/// [`DetachStatement`]: a name plus two surface flags carries no expressions or extension
/// nodes. Neither dialect has a `DEALLOCATE ALL` (DuckDB rejects it: "DEALLOCATE requires a
/// name"; MySQL's grammar takes a single `ident`), so the target is always a single
/// [`Ident`], never an all-marker.
///
/// The `PREPARE` keyword's role differs by dialect and is a parse-time constraint, not a
/// node field: DuckDB's `DEALLOCATE [PREPARE] name` makes it optional (round-tripped by
/// [`prepare_keyword`](Self::prepare_keyword)), while MySQL's `deallocate_or_drop PREPARE
/// ident` makes it *mandatory* (a bare `DEALLOCATE name` is `ER_PARSE_ERROR` on mysql:8),
/// so the MySQL parser always sets the flag. The leading-verb spelling
/// ([`keyword`](Self::keyword)) is MySQL's `deallocate_or_drop` synonym choice; DuckDB has
/// only the `DEALLOCATE` spelling.
/// The leading verb of a [`DeallocateStatement`] — MySQL's `deallocate_or_drop` synonym
/// choice. A round-trip surface tag: `DROP PREPARE name` and `DEALLOCATE PREPARE name` are
/// the same statement on mysql:8, differing only in this spelling.
/// A PostgreSQL `DO [LANGUAGE <lang>] '<body>'` anonymous code block (gated by
/// [`UtilitySyntax::do_statement`](crate::dialect::UtilitySyntax)).
///
/// Runs an inline procedural-language block without defining a routine. The body is an
/// opaque source string in the target language ([`LiteralKind::String`](crate::ast::LiteralKind)
/// — dollar-quoted in practice), never re-parsed here: like
/// [`FunctionOption::As`](crate::ast::FunctionOption) the body's grammar is the target
/// language, not SQL, so the PL text is not smuggled into the AST.
///
/// The shape mirrors [`CreateFunction`](crate::ast::CreateFunction)'s option cluster
/// rather than a fixed `{ language, body }` pair, because PostgreSQL's raw grammar is the
/// same free option list: `DO dostmt_opt_list`, where `dostmt_opt_list` is a *non-empty*
/// sequence of items each either an `Sconst` body or `LANGUAGE <word>`, in any order and
/// with no arity limit. The parser (`makeDefElem("as"/"language", …)`) accepts a repeated
/// or missing body and a repeated language — `DO LANGUAGE plpgsql` (language, no body),
/// `DO $$a$$ $$b$$` (two bodies), and `DO 'x' LANGUAGE a LANGUAGE b` (two languages) all
/// parse — and defers the "exactly one body, at most one language" check to execution
/// (`ExecuteDoStmt`), exactly as the [`PrepareStatement`] "grammar accepts any statement,
/// bind restricts the kind" contract defers its own semantic check. Modelling the list
/// faithfully is what keeps raw-parse accept/reject parity with libpg_query; collapsing it
/// to a single body/language pair would over-reject those three forms. The list is
/// non-empty (a bare `DO` is a syntax error), which the parser enforces.
/// One item of a [`DoStatement`]'s `dostmt_opt_list` — a body string or a `LANGUAGE`
/// clause. The two forms and their source order round-trip, so the parser records each as
/// written rather than folding them into a canonical `{ language, body }` pair.
/// A routine `LANGUAGE <name>` operand (PostgreSQL's `NonReservedWord_or_Sconst`): a bare
/// non-reserved word or a string constant. Shared by the two positions that spell it the same
/// way — the [`DoStatement`] `DO … LANGUAGE <name>` argument and the `CREATE FUNCTION`
/// [`FunctionOption::Language`](crate::ast::FunctionOption) clause. PostgreSQL folds both
/// spellings to the same language name internally, but the surface form is kept distinct so it
/// round-trips — the same `NonReservedWord_or_Sconst` shape as
/// [`ExtensionVersion`](crate::ast::ExtensionVersion).
///
/// The string arm admits only an `Sconst` (a plain, `E'...'`, `U&'...'`, or dollar-quoted
/// constant); a bit-string (`b'...'`/`x'...'`) or national (`N'...'`) constant is not an
/// `Sconst`, so — like the code-block body — it is the syntax error PostgreSQL reports. The
/// string spelling is a PostgreSQL surface: MySQL's routine `LANGUAGE` admits only the bare
/// word `SQL` (`LANGUAGE 'SQL'` is `ER_PARSE_ERROR` on mysql:8), so the parser gates the string
/// arm on [`IndexAlterSyntax::routine_language_string`](crate::dialect::IndexAlterSyntax::routine_language_string).
/// A MySQL `DO <expr> [, <expr> ...]` evaluate-and-discard statement (gated by
/// [`UtilitySyntax::do_expression_list`](crate::dialect::UtilitySyntax)).
///
/// A *different behaviour on the same `DO` keyword* from PostgreSQL's anonymous code block
/// ([`DoStatement`]): MySQL's `DO` evaluates a list of expressions purely for their side
/// effects and throws the results away (`DO SLEEP(1)`, `DO @x := 1`), whereas PostgreSQL's
/// `DO` runs an opaque procedural-language body string. The two never coexist in one dialect
/// (each preset arms exactly one gate), the split mirroring the transaction-`BEGIN`
/// vs compound-block-`BEGIN` dialect-gated arms.
///
/// The grammar is literally `DO select_item_list` (mysql `sql_yacc.yy` `do_stmt`), so the
/// items are [`SelectItem`]s, not bare [`Expr`]s: MySQL grammar-accepts a select alias
/// (`DO 1 AS x` PREPAREs) and a wildcard (`DO *`, `DO t.*`) here exactly as in a projection.
/// Reusing the projection-item node keeps raw-parse acceptance aligned with the engine; the
/// wildcard forms bind-reject (`DO *` is `ER_NO_TABLES_USED`), but that is a resolver verdict
/// the parse layer does not model, not a syntax reject. The list is non-empty (a bare `DO` is
/// `ER_PARSE_ERROR`), which the parser enforces.
/// A MySQL `LOCK {TABLES | TABLE} <tbl> [[AS] <alias>] <lock-kind> [, ...]` explicit
/// table-locking statement (gated by
/// [`UtilitySyntax::lock_tables`](crate::dialect::UtilitySyntax)).
///
/// This is *one of two distinct behaviours a dialect can attach to the leading `LOCK`
/// keyword*, the split modelled the [`DoExpressionsStatement`] / [`DoStatement`] way (a
/// behaviour-named gate per reading, never both armed in one preset). MySQL's `LOCK TABLES`
/// names a per-table lock **kind** (`READ`, `READ LOCAL`, `WRITE`) on each table in a list —
/// the shape captured here. PostgreSQL's `LOCK TABLE`, by contrast, takes a single
/// statement-level lock **mode** clause (`IN ACCESS SHARE MODE`, `NOWAIT`, …) over a relation
/// list; that reading is not implemented, but when it is it takes its own node behind its own
/// `LOCK`-keyword gate, so the two never collide. The `MySql`/`Lenient` presets arm
/// [`lock_tables`](crate::dialect::UtilitySyntax::lock_tables); every other preset leaves the
/// leading `LOCK` keyword undispatched (an unknown statement).
///
/// The grammar is `LOCK table_or_tables table_lock_list` (mysql `sql_yacc.yy` `lock` /
/// `table_lock_list`), so the `TABLES` (plural) and `TABLE` (singular) spellings are
/// interchangeable and preserved on [`plural`](Self::plural) to round-trip. Each
/// [`TableLock`] carries a mandatory lock kind — a bare `LOCK TABLES t1` with no kind is
/// `ER_PARSE_ERROR` (engine-measured on mysql:8.4.10), which the parser enforces. The list is
/// non-empty. Non-generic, like [`UseStatement`]: a table lock carries no expressions or
/// extension nodes.
/// One entry of a MySQL [`LockTablesStatement`] table list: a table name, an optional alias,
/// and its mandatory [`TableLockKind`] (`table_ident opt_table_alias lock_option` in mysql
/// `sql_yacc.yy` `table_lock`). The alias is a single identifier (`opt_as ident`); whether it
/// was written with the `AS` keyword is not modelled because MySQL discards it, so the
/// renderer emits the canonical `AS`-less spelling.
/// The lock kind a MySQL [`TableLock`] acquires (`lock_option` in mysql `sql_yacc.yy`). Only
/// these three spellings are grammar-valid on mysql:8.4.10 — the historical (pre-8.0)
/// `LOW_PRIORITY WRITE` modifier is `ER_PARSE_ERROR` there (engine-measured), so it is
/// deliberately not a variant.
/// A MySQL `UNLOCK {TABLES | TABLE}` statement releasing all table locks held by the session
/// (gated by [`UtilitySyntax::lock_tables`](crate::dialect::UtilitySyntax), the release
/// counterpart of [`LockTablesStatement`]).
///
/// Carries no table list — MySQL's `UNLOCK` releases everything the session holds — only the
/// `TABLES`/`TABLE` spelling, preserved on [`plural`](Self::plural) to round-trip
/// (`unlock: UNLOCK_SYM table_or_tables` in mysql `sql_yacc.yy`).
/// A MySQL instance-wide backup lock statement — `LOCK INSTANCE FOR BACKUP` (acquire) or
/// `UNLOCK INSTANCE` (release) — gated by
/// [`UtilitySyntax::lock_instance`](crate::dialect::UtilitySyntax).
///
/// One node for the pair, distinguished by [`acquire`](Self::acquire), because neither side
/// carries any other payload (mysql `sql_yacc.yy` `lock`/`unlock`: both alternatives build a
/// bare `Sql_cmd_{lock,unlock}_instance`): a two-struct split would add an empty node for the
/// release half. Distinct from [`LockTablesStatement`]/[`UnlockTablesStatement`], which take a
/// per-table lock-kind list — the instance lock is a single server-wide DDL-blocking lock
/// with fixed spelling on both sides, so there is nothing else to model. Both spellings are
/// grammar-positive on mysql:8.4.10 (`ER_UNSUPPORTED_PS` under the PREPARE oracle — parsed,
/// then declined by the PREPARE protocol, never `ER_PARSE_ERROR`).
/// A MySQL `LOAD {DATA | XML} … INFILE … INTO TABLE …` bulk-import statement (gated by
/// [`UtilitySyntax::load_data`](crate::dialect::UtilitySyntax)).
///
/// One node covers both the `DATA` (delimited text) and `XML` readings, distinguished by
/// [`format`](Self::format): the mysql `sql_yacc.yy` `load_stmt` rule is a *single*
/// `data_or_xml` production whose whole clause train is grammatically shared, so at the parse
/// layer the two forms differ only in the `DATA`/`XML` keyword. The clauses MySQL restricts to
/// one reading (`FIELDS`/`LINES` are meaningless under `XML`, `ROWS IDENTIFIED BY` under
/// `DATA`) are *semantic* restrictions the server enforces only after it has parsed the whole
/// statement and resolved the table — every clause parses under either format (engine-measured
/// on mysql:8.4.10: a `LOAD XML … FIELDS TERMINATED BY ','` reaches `ER_NO_SUCH_TABLE` 1146,
/// not `ER_PARSE_ERROR` 1064), so this node does not gate them by format and the parse layer
/// leaves that binding verdict untouched (the [`PrepareStatement`] "grammar accepts, bind
/// restricts" contract).
///
/// The clause train is strictly *order-sensitive* (engine-measured: any out-of-order clause is
/// `ER_PARSE_ERROR` 1064), so the node's field order is the grammar's canonical order and the
/// renderer emits that order. The optional clauses are `None`/empty when absent. Generic over
/// the extension `X` because the [`set`](Self::set) assignments carry full expressions.
///
/// Scope boundary: the MySQL 8.4 secondary-engine bulk-load extension clauses on the same
/// `load_stmt` rule — the `FROM` keyword, `URL`/`S3` source types, `COUNT n`,
/// `IN PRIMARY KEY ORDER`, `COMPRESSION`, `PARALLEL`, `MEMORY`, and `ALGORITHM = BULK` — are a
/// distinct cloud-bulk-load feature family and are intentionally not modelled here (they take
/// their own follow-up; see the ticket close note). This node is the classic documented
/// `LOAD DATA` / `LOAD XML` surface.
/// Whether a [`LoadDataStatement`] reads delimited text (`LOAD DATA`) or XML (`LOAD XML`) —
/// the mysql `sql_yacc.yy` `data_or_xml` production.
/// The optional table-lock concurrency modifier of a [`LoadDataStatement`] (mysql
/// `sql_yacc.yy` `load_data_lock`). The default (no keyword) is a plain write lock and is
/// modelled as `None` on the statement, so this enum carries only the two written spellings.
/// The optional duplicate-key handling of a [`LoadDataStatement`] (mysql `sql_yacc.yy`
/// `opt_duplicate` / `duplicate`). The default (no keyword) errors on a duplicate and is
/// modelled as `None`, so this enum carries only the two written spellings. `REPLACE` and
/// `IGNORE` are mutually exclusive — writing both is `ER_PARSE_ERROR` (engine-measured).
/// The `{FIELDS | COLUMNS} …` field-format clause of a [`LoadDataStatement`] (mysql
/// `sql_yacc.yy` `opt_field_term` / `field_term_list`).
///
/// The `FIELDS` and `COLUMNS` keywords are interchangeable synonyms; the written spelling
/// rides [`spelling`](Self::spelling) so it round-trips. At least one of the three sub-clauses
/// is present — a bare `FIELDS` with no sub-clause is `ER_PARSE_ERROR` (engine-measured), which
/// the parser enforces. Each sub-clause may appear in any order and the parser folds it onto
/// the matching field (a repeat is last-wins, mirroring the grammar's `merge_field_separators`);
/// the renderer emits the canonical `TERMINATED` / `[OPTIONALLY] ENCLOSED` / `ESCAPED` order.
/// The interchangeable keyword spelling of a [`LoadDataFields`] clause (mysql `sql_yacc.yy`:
/// `opt_field_term` spells the same clause `COLUMNS`, while the documented form is `FIELDS`).
/// The `[OPTIONALLY] ENCLOSED BY '<char>'` sub-clause of a [`LoadDataFields`] clause (mysql
/// `sql_yacc.yy` `field_term`: the `ENCLOSED BY` and `OPTIONALLY ENCLOSED BY` alternatives).
/// Bundling the `OPTIONALLY` modifier with its value makes an `OPTIONALLY` with no `ENCLOSED
/// BY` unrepresentable.
/// The `LINES …` line-format clause of a [`LoadDataStatement`] (mysql `sql_yacc.yy`
/// `opt_line_term` / `line_term_list`).
///
/// At least one of the two sub-clauses is present — a bare `LINES` with no sub-clause is
/// `ER_PARSE_ERROR` (engine-measured), which the parser enforces. Each sub-clause may appear in
/// any order (a repeat is last-wins, mirroring `merge_line_separators`); the renderer emits the
/// canonical `STARTING` / `TERMINATED` order.
/// The `IGNORE <n> {LINES | ROWS}` header-skip clause of a [`LoadDataStatement`] (mysql
/// `sql_yacc.yy` `opt_ignore_lines` / `lines_or_rows`). The `LINES` and `ROWS` keywords are
/// interchangeable; the written spelling rides [`unit`](Self::unit) so it round-trips.
/// The interchangeable unit keyword of a [`LoadDataIgnoreRows`] clause (mysql `sql_yacc.yy`
/// `lines_or_rows`).
/// One entry of a [`LoadDataStatement`] target list (mysql `sql_yacc.yy` `field_or_var`): a
/// destination column name, or a user variable (`@name`) that captures the raw field value for
/// use in the `SET` clause. A spanned enum so each spelling round-trips its own form and a
/// column is never confused with a variable.
/// A typed `SHOW TABLES` utility statement (MySQL/DuckDB; gated by
/// [`ShowSyntax::show_tables`](crate::dialect::UtilitySyntax)).
///
/// Distinct from the generic session `SHOW <var>`
/// ([`SessionStatement::Show`](crate::ast::SessionStatement)), which reads one
/// configuration parameter, and from the parenthesized `(SHOW <name>)` table source
/// ([`TableFactor::ShowRef`](crate::ast::TableFactor)), which only appears inside a
/// `FROM (…)` and produces a relation. `SHOW TABLES` is a top-level catalogue-listing
/// *statement*, so it is its own node — the MECE split spelled out on
/// [`show_tables`](crate::dialect::ShowSyntax::show_tables).
///
/// This is the opener of the typed-`SHOW` family (`SHOW COLUMNS`, `SHOW CREATE TABLE`,
/// `SHOW FUNCTIONS` join it): the listed thing rides the [`ShowTarget`] axis. That axis
/// is an enum with *per-variant* fields — the [`SessionStatement`](crate::ast::SessionStatement)
/// / [`ShowRefTarget`](crate::ast::ShowRefTarget) idiom, **not** a flat `kind` tag like
/// [`ApplyKind`](crate::ast::ApplyKind): the `SHOW` subforms carry genuinely different
/// payloads (`TABLES` takes a `FROM`/filter, `CREATE TABLE` a table name, `FUNCTIONS` a
/// scope keyword, schema qualifier, and name-or-regex filter), so a shared tag would
/// force an option-soup lowest common denominator. A sibling is then a new [`ShowTarget`]
/// variant plus its own gate, leaving the existing variants untouched.
/// What a [`ShowStatement`] lists — the extensible axis of the typed-`SHOW` family.
///
/// The cross-dialect subforms [`Tables`](Self::Tables), [`Columns`](Self::Columns),
/// [`Functions`](Self::Functions), and [`RoutineStatus`](Self::RoutineStatus) each carry a
/// genuinely distinct payload (see [`ShowStatement`] for why this is a per-variant enum
/// rather than a flat `kind` tag). The MySQL server-administration / catalogue family folds
/// its ~40 near-identical sub-commands onto data axes instead: [`Listing`](Self::Listing)
/// and [`Bare`](Self::Bare) carry a sub-command discriminator, [`Create`](Self::Create) a
/// [`ShowCreateKind`], and [`Index`](Self::Index), [`Engine`](Self::Engine),
/// [`ReplicaStatus`](Self::ReplicaStatus), [`Diagnostics`](Self::Diagnostics), and
/// [`RoutineCode`](Self::RoutineCode) the handful with their own operands. The account /
/// diagnostics remainder rides its own operand-bearing variants: [`Grants`](Self::Grants) and
/// [`CreateUser`](Self::CreateUser) (the shared [`AccountName`] `user` grammar),
/// [`Profile`](Self::Profile) (a resource-type list plus `FOR QUERY` / `LIMIT`), and
/// [`LogEvents`](Self::LogEvents) (the `BINLOG` / `RELAYLOG` event dump).
/// Which stored-routine kind a [`ShowTarget::RoutineStatus`] listing named: `FUNCTION` or
/// `PROCEDURE` (MySQL `SHOW {FUNCTION | PROCEDURE} STATUS`).
///
/// A surface tag (no `meta`, like [`ShowColumnsSpelling`]): the keyword's span is subsumed
/// by the enclosing [`ShowStatement`]. Recorded only so the written object keyword
/// round-trips.
/// The optional scope keyword before `FUNCTIONS` in a [`ShowTarget::Functions`] listing:
/// `USER`, `SYSTEM`, or `ALL` (Spark / Databricks).
///
/// A surface tag (no `meta`, like [`ShowColumnsSpelling`]): the keyword's span is subsumed
/// by the enclosing [`ShowStatement`]. Recorded only so the written scope round-trips.
/// The optional trailing narrowing of a [`ShowTarget::Functions`] listing:
/// `[LIKE] {<function_name> | '<regex_pattern>'}` (Spark / Databricks).
///
/// A distinct type from [`ShowFilter`] because that models MySQL's mutually-exclusive
/// `LIKE '<pat>' | WHERE <expr>` (a mandatory keyword, no bare-name form, and a `WHERE`
/// predicate `SHOW FUNCTIONS` does not accept). Here the `LIKE` keyword is *optional* and
/// the operand is either a bare (optionally qualified) function name or a quoted regex
/// string; [`like`](Self::Name::like) records whether the keyword was written so the
/// statement round-trips.
/// Which keyword named a [`ShowTarget::Columns`] listing: `COLUMNS` or its exact `FIELDS`
/// synonym (MySQL).
///
/// A surface tag (no `meta`, like [`ShowFromKeyword`]): the keyword's span is subsumed by
/// the enclosing [`ShowStatement`]. Recorded only so the written spelling round-trips.
/// A `{FROM | IN} <name>` object qualifier in the typed-`SHOW` family.
///
/// Used for the [`ShowTarget::Tables`] database qualifier and for both the mandatory
/// table and optional database qualifiers of [`ShowTarget::Columns`], so [`name`](Self::name)
/// is a generic [`ObjectName`] rather than a database- or table-specific field. MySQL
/// accepts either keyword interchangeably; DuckDB accepts only `FROM`. The
/// [`keyword`](Self::keyword) surface tag records which was written so the statement
/// round-trips.
/// Which keyword introduced a [`ShowFrom`]: `FROM` or its `IN` synonym.
///
/// A surface tag (no `meta`): the keyword's span is subsumed by the enclosing
/// [`ShowFrom`], as [`ExplainKeyword`] rides its parent's span.
/// The optional trailing narrowing of a [`ShowTarget::Tables`] or [`ShowTarget::Columns`]:
/// a `LIKE` name pattern or a `WHERE` predicate (MySQL).
///
/// The two are mutually exclusive in the grammar. `LIKE` takes a string pattern
/// ([`Literal`]); `WHERE` takes a general predicate ([`Expr`]) over the result columns,
/// which is why this enum — and thus [`ShowTarget`]/[`ShowStatement`] — is generic over
/// the extension `X`.
/// Which object kind a [`ShowTarget::Create`] recreates: `TABLE`, `VIEW`, `DATABASE`,
/// `EVENT`, `PROCEDURE`, `FUNCTION`, or `TRIGGER` (MySQL `SHOW CREATE <kind> <name>`).
///
/// A surface tag (no `meta`, like [`ShowRoutineKind`]): the keyword's span is subsumed by
/// the enclosing [`ShowStatement`]. `USER` is absent — its operand is a user specification,
/// not an [`ObjectName`], so `SHOW CREATE USER` rides its own
/// [`ShowTarget::CreateUser`] variant over the shared [`AccountName`] grammar.
/// Which catalogue/server listing a [`ShowTarget::Listing`] named, plus that sub-command's
/// own small *scalar* payload (MySQL). Every member admits the shared `[LIKE | WHERE]` tail
/// and the optional `{FROM | IN} <db>` qualifier carried by the enclosing
/// [`ShowTarget::Listing`].
///
/// A surface discriminator (no `meta`, `Copy` like [`ShowScope`]): the `{FROM | IN}`
/// qualifier — the only spanned payload — lives on the enclosing variant, leaving this enum
/// a pure keyword tag plus scalar flags whose spans are subsumed by the [`ShowStatement`].
/// The optional `GLOBAL`/`SESSION`/`LOCAL` scope keyword on `SHOW … STATUS` / `SHOW …
/// VARIABLES` (MySQL `opt_var_type`).
///
/// A surface tag (no `meta`): the keyword's span is subsumed by the enclosing
/// [`ShowStatement`]. `LOCAL` is an exact synonym of `SESSION` in MySQL, kept distinct here
/// only so the written spelling round-trips.
/// A MySQL `SHOW` sub-command taking no filter and no name operand; the discriminant of
/// [`ShowTarget::Bare`]. The only payloads are single leading-keyword flags.
///
/// A surface tag (no `meta`): each keyword's span is subsumed by the enclosing
/// [`ShowStatement`].
/// Which keyword named a [`ShowTarget::Index`] listing: `INDEX`, `INDEXES`, or `KEYS`
/// (MySQL `keys_or_index`).
///
/// A surface tag (no `meta`, like [`ShowColumnsSpelling`]): the three are exact synonyms,
/// recorded only so the written spelling round-trips.
/// Which per-engine report a [`ShowTarget::Engine`] dump requested: `STATUS`, `MUTEX`, or
/// `LOGS` (MySQL).
///
/// A surface tag (no `meta`): the keyword's span is subsumed by the enclosing
/// [`ShowStatement`].
/// Which diagnostics list a [`ShowTarget::Diagnostics`] readout named: `WARNINGS` or
/// `ERRORS` (MySQL).
///
/// A surface tag (no `meta`): the keyword's span is subsumed by the enclosing
/// [`ShowStatement`].
/// One resource-type selector in a [`ShowTarget::Profile`] `profile_defs` list (MySQL).
///
/// A surface tag (no `meta`, `Copy` like [`ShowScope`]): every member is a pure keyword or
/// keyword pair with no operand, so the list's span is subsumed by the enclosing
/// [`ShowStatement`]. MySQL folds duplicates into a bitmask at bind time; the parser keeps
/// the written list order and multiplicity so the statement round-trips.
/// The shared `LIMIT` narrowing on the MySQL `SHOW` family — MySQL's `opt_limit_clause`
/// (`SHOW {WARNINGS | ERRORS}`, `SHOW PROFILE`, `SHOW {BINLOG | RELAYLOG} EVENTS`).
///
/// Models all three surface forms of `limit_options`:
///
/// * `LIMIT <row_count>` — no offset ([`offset`](Self::offset) `None`).
/// * `LIMIT <offset>, <row_count>` — the comma form, offset written first
/// ([`offset_keyword`](Self::offset_keyword) `false`).
/// * `LIMIT <row_count> OFFSET <offset>` — the `OFFSET`-keyword form
/// ([`offset_keyword`](Self::offset_keyword) `true`).
///
/// The two offset spellings are semantically identical (`LIMIT 2, 5` == `LIMIT 5 OFFSET 2`);
/// [`offset_keyword`](Self::offset_keyword) records which was written so the statement
/// round-trips, and is always `false` when [`offset`](Self::offset) is `None`. Both operands
/// are integer [`Literal`]s (MySQL's `limit_option` also admits a `?` param-marker or a
/// user-variable, deferred — the whole `SHOW` family parses only integer limits today).