zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
¸ý°d‚Žã@sÔUdZddlmZddlmZddlZddlmZddlZddl    Z    ddl    m
Z
ddl    m Z ddl    m Z dd    l    m Z dd
l    mZdd l    mZdd l    mZdd l    mZddl    mZddl    mZddl    mZddl    mZddl    mZddl    mZddl    mZddl    mZddl    mZddlmZddlmZddlmZddlm Z ddlm!Z!ddl"m#Z#ddl"m$Z$ddl"m%Z%dd l"m&Z&dd!l"m'Z'dd"l"m(Z(dd#l"m)Z)dd$l"m*Z*dd%lm+Z+dd&l,m-Z-dd'l,m.Z.dd(l,m/Z/dd)l,m0Z0dd*l,m1Z1dd+l2m3Z3dd,l m4Z4dd-l!m5Z5dd.l!m6Z6d/d0lm7Z7d/d1lm8Z8d/d2lm9Z9d/d3lm:Z:d/d4l:m;Z;d/d5l<m=Z=d/d6l<m>Z>d/d7l<m?Z?d/d8l<m@Z@d/d9l<mAZAe    jr’dd:lBmCZCdd;lBmDZDdd<lBmEZEdd=lBmFZFdd>lBmGZGdd?l"mHZHdd@lImJZJddAl,mKZKddBlLmMZMddCl mNZNddDl!mOZOddEl!mPZPd/dFlQmRZRd/dGlQmSZSd/dHlTmUZUd/dIlTmVZVd/dJlTmWZWd/dKlXmYZYd/dLlZm[Z[d/dMl\m]Z]edNdOdPZ^edQdRdPZ_edSdTdPZ`edUZaeeebe$fZcedVebe1e/e
fZdGdWdX„dXeƒZeeejfZfdYegdZ<eejhZhd[egd\<eejiZid]egd^<d_d`d_daœdbdc„Zjdddededddfœdgdh„Zke9jlGdidR„dRe*e!jmƒƒZnGdjdk„dkƒZoGdldm„dmenƒZpGdndT„dTe(epe3e9jqdTƒZrGdodp„dpe(ene.e^ƒZsdºddqdrœd`dsdtdudvdwœdxdy„ZtGdzd{„d{e(enƒZuerd|d}d~œdd€„Zvd|dd~œd‚dƒ„Zwd|d„d~œd…d†„Zxne yd‡¡Zve ydˆ¡Zwe yd‰¡ZxGdŠd‹„d‹e)enƒZzGdŒd„dezeƒZ{GdŽd„de{ƒZ|Gdd‘„d‘e{ƒZ}ed’Z~Gd“d”„d”e{ƒZGd•d–„d–e?ƒZ€Gd—d˜„d˜e{ƒZGd™dš„dšƒZ‚Gd›dœ„dœepe‚ezƒZe9jlGddV„dVe*ƒƒZƒGdždŸ„dŸeƒƒZ„Gd d¡„d¡e(eoenƒZ…Gd¢d£„d£ƒZ†Gd¤d¥„d¥e†e…ƒZ‡Gd¦d§„d§e‡ƒZˆGd¨d©„d©e‡ƒZ‰Gdªd«„d«e‡ƒZŠGd¬d­„d­e‡ƒZ‹Gd®d¯„d¯e(e†eoenƒZŒe: d°d±i¡ZŽd²egd³<Gd´dµ„dµepƒZGd¶d·„d·eƒenƒZGd¸d¹„d¹e‚eƒenƒZ‘dS)»a/The schema module provides the building blocks for database metadata.
 
Each element within this module describes a database entity which can be
created and dropped, or is otherwise part of such an entity.  Examples include
tables, columns, sequences, and indexes.
 
All entities are subclasses of :class:`~sqlalchemy.schema.SchemaItem`, and as
defined in this module they are intended to be agnostic of any vendor-specific
constructs.
 
A collection of entities are grouped into a unit called
:class:`~sqlalchemy.schema.MetaData`. MetaData serves as a logical grouping of
schema elements, and can also be associated with an actual database connection
such that operations involving the contained elements can contact the database
as needed.
 
Two of the elements here also build upon their "syntactic" counterparts, which
are defined in :class:`~sqlalchemy.sql.expression.`, specifically
:class:`~sqlalchemy.schema.Table` and :class:`~sqlalchemy.schema.Column`.
Since these objects are part of the SQL expression language, they are usable
as components in SQL expressions.
 
é)Ú annotations)ÚABCN)ÚEnum)ÚAny)ÚCallable)Úcast)Ú
Collection)ÚDict)ÚIterable)ÚIterator)ÚList)ÚNoReturn)ÚOptional)Úoverload)ÚSequence)ÚSet)ÚTuple)Ú TYPE_CHECKING)ÚTypeVar)ÚUnioné)Ú    coercions)Úddl)Úroles)Útype_api)Úvisitors)Ú_DefaultDescriptionTuple)Ú    _NoneName)Ú_SentinelColumnCharacterization)Ú _SentinelDefaultCharacterization)ÚDedupeColumnCollection)Ú DialectKWArgs)Ú
Executable)ÚSchemaEventTarget)Ú_document_text_coercion)Ú ClauseElement)Ú ColumnClause)Ú ColumnElement)Ú quoted_name)Ú
TextClause)Ú TableClause)Ú to_instance)ÚExternallyTraversible)ÚInternalTraversalé)Úevent)Úexc)Ú
inspection)Úutil)Ú HasMemoized)ÚFinal)ÚLiteral)ÚProtocol)ÚSelf)Ú    TypeGuard)Ú_AutoIncrementType)Ú_DDLColumnArgument)Ú    _InfoType)Ú_TextCoercedExpressionArgument)Ú_TypeEngineArgument)ÚReadOnlyColumnCollection)Ú DDLCompiler)Ú BindParameter)ÚFunction)Ú
TypeEngine)Ú_TraverseInternalsType)Úanon_map)Ú
Connection)ÚEngine)Ú_CoreMultiExecuteParams)ÚCoreExecuteOptionsParameter)ÚExecutionContext)ÚMockConnection)Ú_ReflectionInfo)Ú
FromClauseÚ_Tr)ÚboundÚ_SIÚ
SchemaItemÚ_TABÚTable)rFrErJÚ FetchedValuec@seZdZdZdZdZdS)Ú SchemaConstrr.éN)Ú__name__Ú
__module__Ú __qualname__Ú RETAIN_SCHEMAÚ BLANK_SCHEMAÚNULL_UNSPECIFIED©r\r\úLd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/sql/schema.pyrT~srTz)Final[Literal[SchemaConst.RETAIN_SCHEMA]]rYz(Final[Literal[SchemaConst.BLANK_SCHEMA]]rZz,Final[Literal[SchemaConst.NULL_UNSPECIFIED]]r[Ústrú Optional[str]©ÚnameÚschemaÚreturncCs|dkr |S|d|SdS)NÚ.r\)rarbr\r\r]Ú_get_table_key¬sreúColumnElement[Any]úOptional[Table])Ú
expressionÚ source_tableÚ target_tablerccsL|dks|dkr|S|‰|‰ddddœ‡‡fdd„ }tttt |i|¡ƒS)Nr,rzOptional[ExternallyTraversible])ÚelementÚkwrccs4t|tƒr,|jˆkr,|jˆjkr,ˆj|jSdSdS©N)Ú
isinstanceÚColumnÚtableÚkeyÚc)rkrl©Zfixed_source_tableZfixed_target_tabler\r]ÚreplaceÀsÿþ
ý z!_copy_expression.<locals>.replace)rr'rrZreplacement_traverse)rhrirjrtr\rsr]Ú_copy_expressionµs  þruc@s`eZdZdZdZdZddddœdd„Zd    d
œd d „Zej    d d
œdd„ƒZ
dddœdd„Z dZ dS)rPz3Base class for items that define a database schema.Ú schema_itemÚdefaultrÚNone©Úargsrlrcc Os`|D]V}|dk    rz
|j}Wn2tk
rL}zt d|¡|‚W5d}~XYqX||f|ŽqdS)z7Initialize the list of child items for this SchemaItem.NzJ'SchemaItem' object, such as a 'Column' or a 'Constraint' expected, got %r)Ú_set_parent_with_dispatchÚAttributeErrorr0Ú ArgumentError)ÚselfrzrlÚitemZspwdÚerrr\r\r]Ú _init_itemsÚs
ÿÿýzSchemaItem._init_itemsr^©rccCstj|dgdS)NÚinfo)Z
omit_kwarg©r2Z generic_repr©r~r\r\r]Ú__repr__èszSchemaItem.__repr__r;cCsiS)aZInfo dictionary associated with the object, allowing user-defined
        data to be associated with this :class:`.SchemaItem`.
 
        The dictionary is automatically generated when first accessed.
        It can also be specified in the constructor of some objects,
        such as :class:`_schema.Table` and :class:`_schema.Column`.
 
        r\r…r\r\r]rƒës
zSchemaItem.inforO)rvrccCs(d|jkr|j ¡|_|j |j¡|S)Nrƒ)Ú__dict__rƒÚcopyÚdispatchÚ_update)r~rvr\r\r]Ú_schema_item_copy÷s
 zSchemaItem._schema_item_copyTN) rVrWrXÚ__doc__Ú__visit_name__Zcreate_drop_stringify_dialectrr†r2Úmemoized_propertyrƒr‹Z_use_schema_mapr\r\r\r]rPÒs c@s4eZdZUdZdZded<d ddddd    œd
d „ZdS) ÚHasConditionalDDLzÎdefine a class that includes the :meth:`.HasConditionalDDL.ddl_if`
    method, allowing for conditional rendering of DDL.
 
    Currently applies to constraints and indexes.
 
    .. versionadded:: 2.0
 
 
    NzOptional[ddl.DDLIf]Ú_ddl_ifr_zOptional[ddl.DDLIfCallable]ú Optional[Any]r7)ÚdialectÚ    callable_ÚstaterccCst |||¡|_|S)aðapply a conditional DDL rule to this schema item.
 
        These rules work in a similar manner to the
        :meth:`.ExecutableDDLElement.execute_if` callable, with the added
        feature that the criteria may be checked within the DDL compilation
        phase for a construct such as :class:`.CreateTable`.
        :meth:`.HasConditionalDDL.ddl_if` currently applies towards the
        :class:`.Index` construct as well as all :class:`.Constraint`
        constructs.
 
        :param dialect: string name of a dialect, or a tuple of string names
         to indicate multiple dialect types.
 
        :param callable\_: a callable that is constructed using the same form
         as that described in
         :paramref:`.ExecutableDDLElement.execute_if.callable_`.
 
        :param state: any arbitrary object that will be passed to the
         callable, if present.
 
        .. versionadded:: 2.0
 
        .. seealso::
 
            :ref:`schema_ddl_ddl_if` - background and usage examples
 
 
        )rZDDLIfr)r~r’r“r”r\r\r]Úddl_if s"zHasConditionalDDL.ddl_if)NNN)rVrWrXrŒrÚ__annotations__r•r\r\r\r]rs
 
ürc@seZdZUdZded<dS)Ú HasSchemaAttrz1schema item that includes a top-level schema namer_rbN)rVrWrXrŒr–r\r\r\r]r—3s
r—cseZdZUdZdZer>ejddœdd„ƒZejddœdd    „ƒZ    d
e
d <d e
d <de
d<de
d<e j de jfgZ de
d<er¸ejddœdd„ƒZejddœdd„ƒZejddœdd„ƒZddddœd d!„Zejsîejd"d#d$d$d$d%œd&d'„ƒZed$d$d$d%œd(d)„ƒZd*d*d*d*d+d,d,d+d*d+d*d*d*d*d*d+d-œd.d/d0d1d2d2d3d4d4d4d4d5d4d6d7d8d9d:d4d$d;d<œ‡fd=d>„Zd‚d/d@d5dAd4d:dBd;dCœdDdE„ZedFdœdGdH„ƒZedIdœdJdK„ƒZd$d$d;dLœdMdN„Zd$d;dOœdPdQ„Zd;dœdRdS„Zd;dœdTdU„Z ejdVdœdWdX„ƒZ!ej"dYdœdZd[„ƒZ#edVdœd\d]„ƒZ$ed.dœd^d_„ƒZ%d.dœd`da„Z&d.dœdbdc„Z'dd;ddœdedf„Z(dƒdgd4d;dhœdidj„Z)dkd;dlœdmdn„Z*dod$d;dpœdqdr„Z+d„dsd4d;dtœdudv„Z,d…dsd4d;dtœdwdx„Z-e .dydz¡e/d*d*fd/d{d|d6dd}œd~d„ƒZ0e/d*d*fd/d{d|d6dd}œd€d„Z1‡Z2S)†rRaRepresent a table in a database.
 
    e.g.::
 
        mytable = Table(
            "mytable", metadata,
            Column('mytable_id', Integer, primary_key=True),
            Column('value', String(50))
        )
 
    The :class:`_schema.Table`
    object constructs a unique instance of itself based
    on its name and optional schema name within the given
    :class:`_schema.MetaData` object. Calling the :class:`_schema.Table`
    constructor with the same name and same :class:`_schema.MetaData` argument
    a second time will return the *same* :class:`_schema.Table`
    object - in this way
    the :class:`_schema.Table` constructor acts as a registry function.
 
    .. seealso::
 
        :ref:`metadata_describing` - Introduction to database metadata
 
    rpÚPrimaryKeyConstraintr‚cCsdSrmr\r…r\r\r]Ú primary_keyYszTable.primary_keyúSet[ForeignKey]cCsdSrmr\r…r\r\r]Ú foreign_keys]szTable.foreign_keysú#DedupeColumnCollection[Column[Any]]Ú_columnsúOptional[Column[Any]]Ú_sentinel_columnúSet[Constraint]Ú constraintsz
Set[Index]ÚindexesrbrCÚ_traverse_internalsú*ReadOnlyColumnCollection[str, Column[Any]]cCsdSrmr\r…r\r\r]Úcolumns’sz Table.columnscCsdSrmr\r…r\r\r]Úexported_columns–szTable.exported_columnscCsdSrmr\r…r\r\r]rrœszTable.crDzList[BindParameter[Any]]zTuple[Any, ...])rDÚ
bindparamsrccCs|jr|f|jS|fSdSrm)Z _annotationsZ_annotations_cache_key)r~rDr§r\r\r]Ú_gen_cache_key s zTable._gen_cache_key)ú1.4z8Deprecated alias of :paramref:`_schema.Table.must_exist`)Ú    mustexistrrycOs |j||ŽSrm)Ú_new)Úclsrzrlr\r\r]Ú__new__¬sz Table.__new__c Os¸|s|st |¡Sz$|d|d|dd…}}}Wntk
rRtdƒ‚YnX| dd¡}|dkrp|j}n |tkr|d}| dd¡}| dd¡}|rª|rªd    }t |¡‚|     d
|     d d¡¡}    t
||ƒ}
|
|j kr|sò|sòt |ƒròt  d |
¡‚|j |
} |r| j||Ž| S|    r&t  d |
¡‚t |¡} | j | |¡| ||| ¡z0| j||f|žddi|—Ž| j | |¡| WStk
r²t ¡| ||¡W5QRXYnXdS)Nrrr.zJTable() takes at least two positional-only arguments 'name' and 'metadata'rbÚ keep_existingFÚextend_existingz9keep_existing and extend_existing are mutually exclusive.Ú
must_existrªz–Table '%s' is already defined for this MetaData instance.  Specify 'extend_existing=True' to redefine options and columns on an existing Table object.zTable '%s' not definedÚ_no_init)Úobjectr­Ú
IndexErrorÚ    TypeErrorÚgetrbrZr0r}ÚpopreÚtablesÚboolÚInvalidRequestErrorÚ_init_existingr‰Zbefore_parent_attachÚ
_add_tableÚ__init__Úafter_parent_attachÚ    Exceptionr2Z safe_reraiseÚ _remove_table) r¬rzrlraÚmetadatarbr®r¯Úmsgr°rqrpr\r\r]r«µsV
$ÿ
 
 
 üÿ
 
 
z
Table._newNTF)rbÚquoteÚ quote_schemaÚ autoload_withÚautoload_replacer®r¯Ú resolve_fksÚinclude_columnsÚimplicit_returningÚcommentrƒÚ    listenersÚprefixesÚ
_extend_onr±r^ÚMetaDatarPú7Optional[Union[str, Literal[SchemaConst.BLANK_SCHEMA]]]úOptional[bool]z#Optional[Union[Engine, Connection]]r¸zOptional[Collection[str]]r_zOptional[Dict[Any, Any]]z:Optional[_typing_Sequence[Tuple[str, Callable[..., Any]]]]úOptional[_typing_Sequence[str]]zOptional[Set[Table]]rx)rarÀrzrbrÂrÃrÄrÅr®r¯rÆrÇrÈrÉrƒrÊrËrÌr±rlrccsf|rdStƒ t||ƒ¡||_|dkr2|j|_n.|tkrBd|_n|}t|tƒsTt‚t||ƒ|_d|_    t
ƒ|_ t
ƒ|_ t dd |¡t
ƒ|_t
ƒ|_|jdk    r´d|j|jf|_n|j|_| |_| dd¡}| |_|dk    râ||_|dk    r|D]\}}t |||¡qð|r|ng|_|jf|Ž|dk    rD|j||| |||
d|j||    pX|pX|idœŽdS)a‚6Constructor for :class:`_schema.Table`.
 
 
        :param name: The name of this table as represented in the database.
 
            The table name, along with the value of the ``schema`` parameter,
            forms a key which uniquely identifies this :class:`_schema.Table`
            within
            the owning :class:`_schema.MetaData` collection.
            Additional calls to :class:`_schema.Table` with the same name,
            metadata,
            and schema name will return the same :class:`_schema.Table` object.
 
            Names which contain no upper case characters
            will be treated as case insensitive names, and will not be quoted
            unless they are a reserved word or contain special characters.
            A name with any number of upper case characters is considered
            to be case sensitive, and will be sent as quoted.
 
            To enable unconditional quoting for the table name, specify the flag
            ``quote=True`` to the constructor, or use the :class:`.quoted_name`
            construct to specify the name.
 
        :param metadata: a :class:`_schema.MetaData`
            object which will contain this
            table.  The metadata is used as a point of association of this table
            with other tables which are referenced via foreign key.  It also
            may be used to associate this table with a particular
            :class:`.Connection` or :class:`.Engine`.
 
        :param \*args: Additional positional arguments are used primarily
            to add the list of :class:`_schema.Column`
            objects contained within this
            table. Similar to the style of a CREATE TABLE statement, other
            :class:`.SchemaItem` constructs may be added here, including
            :class:`.PrimaryKeyConstraint`, and
            :class:`_schema.ForeignKeyConstraint`.
 
        :param autoload_replace: Defaults to ``True``; when using
            :paramref:`_schema.Table.autoload_with`
            in conjunction with :paramref:`_schema.Table.extend_existing`,
            indicates
            that :class:`_schema.Column` objects present in the already-existing
            :class:`_schema.Table`
            object should be replaced with columns of the same
            name retrieved from the autoload process.   When ``False``, columns
            already present under existing names will be omitted from the
            reflection process.
 
            Note that this setting does not impact :class:`_schema.Column` objects
            specified programmatically within the call to :class:`_schema.Table`
            that
            also is autoloading; those :class:`_schema.Column` objects will always
            replace existing columns of the same name when
            :paramref:`_schema.Table.extend_existing` is ``True``.
 
            .. seealso::
 
                :paramref:`_schema.Table.autoload_with`
 
                :paramref:`_schema.Table.extend_existing`
 
        :param autoload_with: An :class:`_engine.Engine` or
            :class:`_engine.Connection` object,
            or a :class:`_reflection.Inspector` object as returned by
            :func:`_sa.inspect`
            against one, with which this :class:`_schema.Table`
            object will be reflected.
            When set to a non-None value, the autoload process will take place
            for this table against the given engine or connection.
 
            .. seealso::
 
                :ref:`metadata_reflection_toplevel`
 
                :meth:`_events.DDLEvents.column_reflect`
 
                :ref:`metadata_reflection_dbagnostic_types`
 
        :param extend_existing: When ``True``, indicates that if this
            :class:`_schema.Table` is already present in the given
            :class:`_schema.MetaData`,
            apply further arguments within the constructor to the existing
            :class:`_schema.Table`.
 
            If :paramref:`_schema.Table.extend_existing` or
            :paramref:`_schema.Table.keep_existing` are not set,
            and the given name
            of the new :class:`_schema.Table` refers to a :class:`_schema.Table`
            that is
            already present in the target :class:`_schema.MetaData` collection,
            and
            this :class:`_schema.Table`
            specifies additional columns or other constructs
            or flags that modify the table's state, an
            error is raised.  The purpose of these two mutually-exclusive flags
            is to specify what action should be taken when a
            :class:`_schema.Table`
            is specified that matches an existing :class:`_schema.Table`,
            yet specifies
            additional constructs.
 
            :paramref:`_schema.Table.extend_existing`
            will also work in conjunction
            with :paramref:`_schema.Table.autoload_with` to run a new reflection
            operation against the database, even if a :class:`_schema.Table`
            of the same name is already present in the target
            :class:`_schema.MetaData`; newly reflected :class:`_schema.Column`
            objects
            and other options will be added into the state of the
            :class:`_schema.Table`, potentially overwriting existing columns
            and options of the same name.
 
            As is always the case with :paramref:`_schema.Table.autoload_with`,
            :class:`_schema.Column` objects can be specified in the same
            :class:`_schema.Table`
            constructor, which will take precedence.  Below, the existing
            table ``mytable`` will be augmented with :class:`_schema.Column`
            objects
            both reflected from the database, as well as the given
            :class:`_schema.Column`
            named "y"::
 
                Table("mytable", metadata,
                            Column('y', Integer),
                            extend_existing=True,
                            autoload_with=engine
                        )
 
            .. seealso::
 
                :paramref:`_schema.Table.autoload_with`
 
                :paramref:`_schema.Table.autoload_replace`
 
                :paramref:`_schema.Table.keep_existing`
 
 
        :param implicit_returning: True by default - indicates that
            RETURNING can be used, typically by the ORM, in order to fetch
            server-generated values such as primary key values and
            server side defaults, on those backends which support RETURNING.
 
            In modern SQLAlchemy there is generally no reason to alter this
            setting, except for some backend specific cases
            (see :ref:`mssql_triggers` in the SQL Server dialect documentation
            for one such example).
 
        :param include_columns: A list of strings indicating a subset of
            columns to be loaded via the ``autoload`` operation; table columns who
            aren't present in this list will not be represented on the resulting
            ``Table`` object. Defaults to ``None`` which indicates all columns
            should be reflected.
 
        :param resolve_fks: Whether or not to reflect :class:`_schema.Table`
            objects
            related to this one via :class:`_schema.ForeignKey` objects, when
            :paramref:`_schema.Table.autoload_with` is
            specified.   Defaults to True.  Set to False to disable reflection of
            related tables as :class:`_schema.ForeignKey`
            objects are encountered; may be
            used either to save on SQL calls or to avoid issues with related tables
            that can't be accessed. Note that if a related table is already present
            in the :class:`_schema.MetaData` collection, or becomes present later,
            a
            :class:`_schema.ForeignKey` object associated with this
            :class:`_schema.Table` will
            resolve to that table normally.
 
            .. versionadded:: 1.3
 
            .. seealso::
 
                :paramref:`.MetaData.reflect.resolve_fks`
 
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param keep_existing: When ``True``, indicates that if this Table
            is already present in the given :class:`_schema.MetaData`, ignore
            further arguments within the constructor to the existing
            :class:`_schema.Table`, and return the :class:`_schema.Table`
            object as
            originally created. This is to allow a function that wishes
            to define a new :class:`_schema.Table` on first call, but on
            subsequent calls will return the same :class:`_schema.Table`,
            without any of the declarations (particularly constraints)
            being applied a second time.
 
            If :paramref:`_schema.Table.extend_existing` or
            :paramref:`_schema.Table.keep_existing` are not set,
            and the given name
            of the new :class:`_schema.Table` refers to a :class:`_schema.Table`
            that is
            already present in the target :class:`_schema.MetaData` collection,
            and
            this :class:`_schema.Table`
            specifies additional columns or other constructs
            or flags that modify the table's state, an
            error is raised.  The purpose of these two mutually-exclusive flags
            is to specify what action should be taken when a
            :class:`_schema.Table`
            is specified that matches an existing :class:`_schema.Table`,
            yet specifies
            additional constructs.
 
            .. seealso::
 
                :paramref:`_schema.Table.extend_existing`
 
        :param listeners: A list of tuples of the form ``(<eventname>, <fn>)``
            which will be passed to :func:`.event.listen` upon construction.
            This alternate hook to :func:`.event.listen` allows the establishment
            of a listener function specific to this :class:`_schema.Table` before
            the "autoload" process begins.  Historically this has been intended
            for use with the :meth:`.DDLEvents.column_reflect` event, however
            note that this event hook may now be associated with the
            :class:`_schema.MetaData` object directly::
 
                def listen_for_reflect(table, column_info):
                    "handle the column reflection event"
                    # ...
 
                t = Table(
                    'sometable',
                    autoload_with=engine,
                    listeners=[
                        ('column_reflect', listen_for_reflect)
                    ])
 
            .. seealso::
 
                :meth:`_events.DDLEvents.column_reflect`
 
        :param must_exist: When ``True``, indicates that this Table must already
            be present in the given :class:`_schema.MetaData` collection, else
            an exception is raised.
 
        :param prefixes:
            A list of strings to insert after CREATE in the CREATE TABLE
            statement.  They will be separated by spaces.
 
        :param quote: Force quoting of this table's name on or off, corresponding
            to ``True`` or ``False``.  When left at its default of ``None``,
            the column identifier will be quoted according to whether the name is
            case sensitive (identifiers with at least one upper case character are
            treated as case sensitive), or if it's a reserved word.  This flag
            is only needed to force quoting of a reserved word which is not known
            by the SQLAlchemy dialect.
 
            .. note:: setting this flag to ``False`` will not provide
              case-insensitive behavior for table reflection; table reflection
              will always search for a mixed-case name in a case sensitive
              fashion.  Case insensitive names are specified in SQLAlchemy only
              by stating the name with all lower case characters.
 
        :param quote_schema: same as 'quote' but applies to the schema identifier.
 
        :param schema: The schema name for this table, which is required if
            the table resides in a schema other than the default selected schema
            for the engine's database connection.  Defaults to ``None``.
 
            If the owning :class:`_schema.MetaData` of this :class:`_schema.Table`
            specifies its
            own :paramref:`_schema.MetaData.schema` parameter,
            then that schema name will
            be applied to this :class:`_schema.Table`
            if the schema parameter here is set
            to ``None``.  To set a blank schema name on a :class:`_schema.Table`
            that
            would otherwise use the schema set on the owning
            :class:`_schema.MetaData`,
            specify the special symbol :attr:`.BLANK_SCHEMA`.
 
            The quoting rules for the schema name are the same as those for the
            ``name`` parameter, in that quoting is applied for reserved words or
            case-sensitive names; to enable unconditional quoting for the schema
            name, specify the flag ``quote_schema=True`` to the constructor, or use
            the :class:`.quoted_name` construct to specify the name.
 
        :param comment: Optional string that will render an SQL comment on table
            creation.
 
            .. versionadded:: 1.2 Added the :paramref:`_schema.Table.comment`
                parameter
                to :class:`_schema.Table`.
 
        :param \**kw: Additional keyword arguments not mentioned above are
            dialect specific, and passed in the form ``<dialectname>_<argname>``.
            See the documentation regarding an individual dialect at
            :ref:`dialect_toplevel` for detail on documented arguments.
 
        NT)Ú_implicit_generatedú%s.%sÚ _reflect_info)rÌrÓrÆ©Úallow_replacementsÚ    all_names)Úsuperr¼r(rÀrbrZrnr^ÚAssertionErrorrŸÚsetr¢r¡r˜r{r›Ú_extra_dependenciesraÚfullnamerÈr¶rÉrƒr/ÚlistenÚ    _prefixesÚ _extra_kwargsÚ    _autoloadr)r~rarÀrbrÂrÃrÄrÅr®r¯rÆrÇrÈrÉrƒrÊrËrÌr±rzrlrÓÚevtÚfn©Ú    __class__r\r]r¼ìsjD
 ÿþ
 
 
ú ÿûzTable.__init__r\úUnion[Engine, Connection]zCollection[str]z_ReflectionInfo | None)rÀrÄrÇÚexclude_columnsrÆrÌrÓrcc
    Cs8t |¡}| ¡}    |    j||||||dW5QRXdS)N©rÌrÓ)r1ÚinspectÚ_inspection_contextZ reflect_table)
r~rÀrÄrÇrårÆrÌrÓÚinspZ    conn_inspr\r\r]rßus
 
 
úzTable._autoloadzList[Constraint]cCst|jdd„dS)zTReturn the set of constraints as a list, sorted by creation
        order.
 
        cSs|jSrm)Ú_creation_order)rrr\r\r]Ú<lambda>‘óz+Table._sorted_constraints.<locals>.<lambda>©rq)Úsortedr¡r…r\r\r]Ú_sorted_constraintsŠszTable._sorted_constraintszSet[ForeignKeyConstraint]cCsdd„|jDƒS)aŒ:class:`_schema.ForeignKeyConstraint` objects referred to by this
        :class:`_schema.Table`.
 
        This list is produced from the collection of
        :class:`_schema.ForeignKey`
        objects currently associated.
 
 
        .. seealso::
 
            :attr:`_schema.Table.constraints`
 
            :attr:`_schema.Table.foreign_keys`
 
            :attr:`_schema.Table.indexes`
 
        cSsh|]}|jdk    r|j’qSrm)Ú
constraint)Ú.0Úfkcr\r\r]Ú    <setcomp>¦s
þz0Table.foreign_key_constraints.<locals>.<setcomp>)r›r…r\r\r]Úforeign_key_constraints“sþzTable.foreign_key_constraints)rzÚkwargsrcc    Os| dd¡}| d|dk    ¡}| dd¡}| dd¡}| dd¡}| dd¡}| dd    ¡}    | d
d    ¡}
|    slt‚|
rtt‚|r”||jkr”t d |j|f¡‚| d d¡} | dk    rÊ|jD]} | j| kr®|j | ¡q®| d d¡} dD]}||krÚt d¡‚qÚ| d|j    ¡|_    | d|j
¡|_
| d|j ¡|_ |r^|s@dd„|jDƒ}nd}|j |j || || ||ddd„|jDƒ}|jf|Ž|j|d|dœŽdS)NrÄÚautoloadrÅTrbrÌrÓr¯Fr®z7Can't change schema of existing table from '%s' to '%s'rÇrÆ)rÂrÃz2Can't redefine 'quote' or 'quote_schema' argumentsrÉrÈrƒcSsg|]
}|j‘qSr\©ra©rñrrr\r\r]Ú
<listcomp>Ýsz(Table._init_existing.<locals>.<listcomp>r\ræcSsi|] }|j|“qSr\r÷rør\r\r]Ú
<dictcomp>êsz(Table._init_existing.<locals>.<dictcomp>rÔ)r¶rØrbr0r}rrrarÚremoverÉrÈrƒrßrÀrÞr)r~rzrõrÄrörÅrbrÌrÓr¯r®rÇrrrÆrqrårÖr\r\r]rº¬s`       þ 
 
 ÿÿù
 zTable._init_existing©rõrccKs| |¡dSrm©Ú_validate_dialect_kwargs©r~rõr\r\r]rÞîszTable._extra_kwargscCsdSrmr\r…r\r\r]Ú_init_collectionsñszTable._init_collectionscCsdSrmr\r…r\r\r]Ú_reset_exportedôszTable._reset_exportedúOptional[Column[int]]cCs|jjSrm)r™Ú_autoincrement_columnr…r\r\r]r÷szTable._autoincrement_columnrc    Csðd}d}d}|j}|dk    r$|f}d}|j}|rH||krH|dk    sBt‚d}n|dkrb|dk    rb|f}d}tj}|r€|d}|jr®|jjr¦|r”t d¡‚q¬|r d}d}d}ntj    }nÒ|j
dkrâ|j dkrâ|j rÚt d|›d¡‚tj }nž|j
dk    rR|j
jrþtj}nRt|j
ƒr@|j
jr8|r&t d¡‚n|r4d}d}d}tj}n|j
jr€tj}n.|j dk    r€|rzt d|d›d    ¡‚tj}|dkrâ|jrâ|dks t‚|jD]*}|j dk    sÈ|j
r¦|j
js¦qâq¦t|jƒ}tj}t||||ƒS)
adetermine a candidate column (or columns, in case of a client
        generated composite primary key) which can be used as an
        "insert sentinel" for an INSERT statement.
 
        The returned structure, :class:`_SentinelColumnCharacterization`,
        includes all the details needed by :class:`.Dialect` and
        :class:`.SQLCompiler` to determine if these column(s) can be used
        as an INSERT..RETURNING sentinel for a particular database
        dialect.
 
        .. versionadded:: 2.0.10
 
        FNTrzQCan't use IDENTITY default with negative increment as an explicit sentinel columnzColumn z® has been marked as a sentinel column with no default generation function; it at least needs to be marked nullable=False assuming user-populated sentinel values will be used.zQCan't use SEQUENCE default with negative increment as an explicit sentinel columnzn can't be a sentinel column because it uses an explicit server side default that's not the Identity() default.)rŸrrØrÚUNKNOWNÚidentityÚ_increment_is_negativer0r¹ZIDENTITYrwÚserver_defaultÚnullableÚNONEÚ is_sentinelZSENTINEL_DEFAULTÚdefault_is_sequenceZSEQUENCEÚ is_callableZ
CLIENTSIDEZ
SERVERSIDEr™Útupler)    r~Zsentinel_is_explicitZsentinel_is_autoincZ the_sentinelZexplicit_sentinel_colZ autoinc_colZdefault_characterizationZthe_sentinel_zeroZ_pkcr\r\r]Ú _sentinel_column_characteristicsûs¦  ÿÿÿþ
ÿÿ ÿ 
ÿÿ
ÿ ÿÿ
 ÿÿ
 
ÿüz&Table._sentinel_column_characteristicscCs|jS)aÍReturns the :class:`.Column` object which currently represents
        the "auto increment" column, if any, else returns None.
 
        This is based on the rules for :class:`.Column` as defined by the
        :paramref:`.Column.autoincrement` parameter, which generally means the
        column within a single integer column primary key constraint that is
        not constrained by a foreign key.   If the table does not have such
        a primary key constraint, then there's no "autoincrement" column.
        A :class:`.Table` may have only one column defined as the
        "autoincrement" column.
 
        .. versionadded:: 2.0.4
 
        .. seealso::
 
            :paramref:`.Column.autoincrement`
 
        )rr…r\r\r]Úautoincrement_columnszTable.autoincrement_columncCst|j|jƒS)aƒReturn the 'key' for this :class:`_schema.Table`.
 
        This value is used as the dictionary key within the
        :attr:`_schema.MetaData.tables` collection.   It is typically the same
        as that of :attr:`_schema.Table.name` for a table with no
        :attr:`_schema.Table.schema`
        set; otherwise it is typically of the form
        ``schemaname.tablename``.
 
        )rerarbr…r\r\r]rq—s z    Table.keycsDdd tˆjƒgtˆjƒgdd„ˆjDƒ‡fdd„dDƒ¡S)Nz    Table(%s)ú, cSsg|] }t|ƒ‘qSr\©Úrepr©rñÚxr\r\r]rù©sz"Table.__repr__.<locals>.<listcomp>cs"g|]}d|ttˆ|ƒƒf‘qS©z%s=%s©rÚgetattr©rñÚkr…r\r]rùªs©rb)ÚjoinrrarÀr¥r…r\r…r]r†¥s
 
ÿþýÿzTable.__repr__cCst|j|jƒSrm)reÚ descriptionrbr…r\r\r]Ú__str__­sz Table.__str__©rprccCs|j |¡dS)a©Add a 'dependency' for this Table.
 
        This is another Table object which must be created
        first before this one can, or dropped after this one.
 
        Usually, dependencies between tables are determined via
        ForeignKey objects.   However, for other situations that
        create dependencies outside of foreign keys (rules, inheriting),
        this method can manually establish such a link.
 
        N)rÚÚadd©r~rpr\r\r]Úadd_is_dependent_on°s zTable.add_is_dependent_onzColumnClause[Any])ÚcolumnÚreplace_existingrcc
Csbz |j||dd„|jDƒdWn<tjk
r\}zt |jd›d¡|‚W5d}~XYnXdS)a·Append a :class:`_schema.Column` to this :class:`_schema.Table`.
 
        The "key" of the newly added :class:`_schema.Column`, i.e. the
        value of its ``.key`` attribute, will then be available
        in the ``.c`` collection of this :class:`_schema.Table`, and the
        column definition will be included in any CREATE TABLE, SELECT,
        UPDATE, etc. statements generated from this :class:`_schema.Table`
        construct.
 
        Note that this does **not** change the definition of the table
        as it exists within any underlying database, assuming that
        table has already been created in the database.   Relational
        databases support the addition of columns to existing tables
        using the SQL ALTER command, which would need to be
        emitted for an already-existing table that doesn't contain
        the newly added column.
 
        :param replace_existing: When ``True``, allows replacing existing
            columns. When ``False``, the default, an warning will be raised
            if a column with the same ``.key`` already exists. A future
            version of sqlalchemy will instead rise a warning.
 
            .. versionadded:: 1.4.0
        cSsi|] }|j|“qSr\r÷rør\r\r]rúÞsz'Table.append_column.<locals>.<dictcomp>rÔrzV Specify replace_existing=True to Table.append_column() to replace an existing column.N)r{rrr0ÚDuplicateColumnErrorrz)r~r"r#Úder\r\r]Ú append_column¾sý
ÿüzTable.append_columnzUnion[Index, Constraint])rðrccCs| |¡dS)aôAppend a :class:`_schema.Constraint` to this
        :class:`_schema.Table`.
 
        This has the effect of the constraint being included in any
        future CREATE TABLE statement, assuming specific DDL creation
        events have not been associated with the given
        :class:`_schema.Constraint` object.
 
        Note that this does **not** produce the constraint within the
        relational database automatically, for a table that already exists
        in the database.   To add a constraint to an
        existing relational database table, the SQL ALTER command must
        be used.  SQLAlchemy also provides the
        :class:`.AddConstraint` construct which can produce this SQL when
        invoked as an executable clause.
 
        N©r{)r~rðr\r\r]Úappend_constraintçszTable.append_constraintr#©ÚparentrlrccKs.|}t|tƒst‚| |j|j|¡||_dSrm)rnrÍrØr»rarbrÀ)r~r*rlrÀr\r\r]Ú _set_parentüszTable._set_parentÚ_CreateDropBind©ÚbindÚ
checkfirstrccCs|jtj||ddS)zòIssue a ``CREATE`` statement for this
        :class:`_schema.Table`, using the given
        :class:`.Connection` or :class:`.Engine`
        for connectivity.
 
        .. seealso::
 
            :meth:`_schema.MetaData.create_all`.
 
        ©r/N©Ú_run_ddl_visitorrZSchemaGenerator©r~r.r/r\r\r]Úcreates z Table.createcCs|jtj||ddS)zæIssue a ``DROP`` statement for this
        :class:`_schema.Table`, using the given
        :class:`.Connection` or :class:`.Engine` for connectivity.
 
        .. seealso::
 
            :meth:`_schema.MetaData.drop_all`.
 
        r0N©r2rZ SchemaDropperr3r\r\r]Údrops
z
Table.dropr©zP:meth:`_schema.Table.tometadata` is renamed to :meth:`_schema.Table.to_metadata`z.Union[str, Literal[SchemaConst.RETAIN_SCHEMA]]z^Optional[Callable[[Table, Optional[str], ForeignKeyConstraint, Optional[str]], Optional[str]]])rÀrbÚreferred_schema_fnrarccCs|j||||dS)zÄReturn a copy of this :class:`_schema.Table`
        associated with a different
        :class:`_schema.MetaData`.
 
        See :meth:`_schema.Table.to_metadata` for a full description.
 
        )rbr7ra)Ú to_metadata)r~rÀrbr7rar\r\r]Ú
tometadatas üzTable.tometadatac st|dkrˆj}|tkrˆj}n|dkr.|j}n|}t||ƒ}||jkr`t dˆj¡|j|Sg}ˆjD]}|     |j
|d¡qjt ||f|ž|ˆj dœˆj —މˆjD]t}    t|    tƒrø|    j}
|rÐ|ˆ||    |
ƒ} n|
ˆjkrÞ|nd} ˆ |    j
| ˆd¡q¨|    js¨|    jrq¨ˆ |    j
|ˆd¡q¨ˆjD]D} | jr4q$t| jf‡‡fdd„| jDƒž| jˆdœ| j —ސq$ˆ ˆ¡S)    aq Return a copy of this :class:`_schema.Table` associated with a
        different :class:`_schema.MetaData`.
 
        E.g.::
 
            m1 = MetaData()
 
            user = Table('user', m1, Column('id', Integer, primary_key=True))
 
            m2 = MetaData()
            user_copy = user.to_metadata(m2)
 
        .. versionchanged:: 1.4  The :meth:`_schema.Table.to_metadata` function
           was renamed from :meth:`_schema.Table.tometadata`.
 
 
        :param metadata: Target :class:`_schema.MetaData` object,
         into which the
         new :class:`_schema.Table` object will be created.
 
        :param schema: optional string name indicating the target schema.
         Defaults to the special symbol :attr:`.RETAIN_SCHEMA` which indicates
         that no change to the schema name should be made in the new
         :class:`_schema.Table`.  If set to a string name, the new
         :class:`_schema.Table`
         will have this new name as the ``.schema``.  If set to ``None``, the
         schema will be set to that of the schema set on the target
         :class:`_schema.MetaData`, which is typically ``None`` as well,
         unless
         set explicitly::
 
            m2 = MetaData(schema='newschema')
 
            # user_copy_one will have "newschema" as the schema name
            user_copy_one = user.to_metadata(m2, schema=None)
 
            m3 = MetaData()  # schema defaults to None
 
            # user_copy_two will have None as the schema name
            user_copy_two = user.to_metadata(m3, schema=None)
 
        :param referred_schema_fn: optional callable which can be supplied
         in order to provide for the schema name that should be assigned
         to the referenced table of a :class:`_schema.ForeignKeyConstraint`.
         The callable accepts this parent :class:`_schema.Table`, the
         target schema that we are changing to, the
         :class:`_schema.ForeignKeyConstraint` object, and the existing
         "target schema" of that constraint.  The function should return the
         string schema name that should be applied.    To reset the schema
         to "none", return the symbol :data:`.BLANK_SCHEMA`.  To effect no
         change, return ``None`` or :data:`.RETAIN_SCHEMA`.
 
         .. versionchanged:: 1.4.33  The ``referred_schema_fn`` function
            may return the :data:`.BLANK_SCHEMA` or :data:`.RETAIN_SCHEMA`
            symbols.
 
         E.g.::
 
                def referred_schema_fn(table, to_schema,
                                                constraint, referred_schema):
                    if referred_schema == 'base_tables':
                        return referred_schema
                    else:
                        return to_schema
 
                new_table = table.to_metadata(m2, schema="alt_schema",
                                        referred_schema_fn=referred_schema_fn)
 
        :param name: optional string name indicating the target table name.
         If not specified or None, the table name is retained.  This allows
         a :class:`_schema.Table` to be copied to the same
         :class:`_schema.MetaData` target
         with a new name.
 
        NzBTable '%s' already exists within the given MetaData - not copying.r)rbrÉ©rbrjcsg|]}t|ˆˆƒ‘qSr\)ru©rñÚexprr r\r]rùÓsÿz%Table.to_metadata.<locals>.<listcomp>)ÚuniqueÚ_table)rarYrbrer·r2Úwarnrr¥ÚappendÚ_copyrRrÉrõr¡rnÚForeignKeyConstraintÚ_referred_schemar(Ú _type_boundÚ _column_flagr¢ÚIndexÚ_table_bound_expressionsr=r‹) r~rÀrbr7raZ actual_schemarqrzÚcolÚconstZreferred_schemaZfk_constraint_schemaÚindexr\r r]r8;sŽW
 
ÿÿ
 
þûüú
 
ÿÿýÿÿ ÿ
ÿ þýùø
 
zTable.to_metadata)r\TNN)F)F)F)3rVrWrXrŒrrr2Zro_non_memoized_propertyr™r›r–r*r£r-Z    dp_stringr¥r¦rrr¨ÚtypingZdeprecated_paramsr­Ú classmethodr«r¼rßÚpropertyrïrôrºrÞrrrÚro_memoized_propertyrrrqr†rr!r&r(r+r4r6Ú
deprecatedrYr9r8Ú __classcell__r\r\râr]rR9sº
 
ÿÿ
ÿ;è>øB ÿ) þööcsüeZdZUdZdZdZded<ded<d^ddd    ddddddejdd
dddd
dd
d
dd œd d dddddddddddddddddddddddœ‡fdd„Z    ded<ded<d ed!<ded"<ded#<d$ed%<d&ed'<d(d)d*œd+d,„Z
e j d-d.œd/d0„ƒZ e j d-d.œd1d2„ƒZejdd.œd3d4„ƒZdd)d5œd6d7„Zdd.œd8d9„Zd:dd;œd<d=„Zd>d)d?œd@dA„Zdd.œdBdC„ZddDddd)dEœdFdG„ZdHd)dIœdJdK„ZdHd)dIœdLdM„Ze dNdO¡dd:dPœdQdR„ƒZdd:dPœdSdT„Zd:d)dUœdVdW„Zd_dXddddYddZd[œd\d]„Z‡ZS)`roz(Represents a column in a database table.r"Tr^rqzOptional[FetchedValue]rNÚautoF)raÚtype_Ú autoincrementrwÚdocrqrJr=rƒrÚonupdater™rÚserver_onupdaterÂÚsystemrÉÚinsert_sentinelÚ_omit_from_statementsÚ_proxiesz@Optional[Union[str, _TypeEngineArgument[_T], SchemaEventTarget]]z;Optional[Union[_TypeEngineArgument[_T], SchemaEventTarget]]r#r_ú!Optional[_TypeEngineArgument[_T]]r9r‘rÏúOptional[_InfoType]z<Optional[Union[bool, Literal[SchemaConst.NULL_UNSPECIFIED]]]r¸z Optional[_ServerDefaultArgument]r)Ú_Column__name_posÚ_Column__type_posrzrarRrSrwrTrqrJr=rƒrrUr™rrVrÂrWrÉrXrYrZÚdialect_kwargscs¾||gt|ƒ}~|rXt|dtƒrB|dk    r6t d¡‚| d¡}n|ddkrX| d¡|r¢|d}t|dƒrŒ|dk    r€t d¡‚| d¡}n|ddkr¢| d¡|dk    r¶t||ƒ}n|dk    rÈt d¡‚tƒ     ||¡|dk    râ|n||_
||_ ||_ ||_ | |_}|tk    r||_n| |_|    |_|
|_||_||_||_tƒ|_tƒ|_||_d|_d|_|dk    rp||_n | |j¡|dk    r°t|tt fƒsžt|ƒ}||_!| "|¡nd|_!| dk    rît| tt fƒsÜt| dd} | |_#| "| ¡nd|_$|dk    r2t|t%ƒr | &d    ¡}| "|¡nt'|ƒ}| "|¡||_(|dk    rzt|t%ƒrd| &d¡}| "|¡nt'|dd}| "|¡||_)|j*t+t,t-|ƒŽt. /|¡| dk    r®| |_0|j1f|ŽdS)
aua
        Construct a new ``Column`` object.
 
        :param name: The name of this column as represented in the database.
          This argument may be the first positional argument, or specified
          via keyword.
 
          Names which contain no upper case characters
          will be treated as case insensitive names, and will not be quoted
          unless they are a reserved word.  Names with any number of upper
          case characters will be quoted and sent exactly.  Note that this
          behavior applies even for databases which standardize upper
          case names as case insensitive such as Oracle.
 
          The name field may be omitted at construction time and applied
          later, at any time before the Column is associated with a
          :class:`_schema.Table`.  This is to support convenient
          usage within the :mod:`~sqlalchemy.ext.declarative` extension.
 
        :param type\_: The column's type, indicated using an instance which
          subclasses :class:`~sqlalchemy.types.TypeEngine`.  If no arguments
          are required for the type, the class of the type can be sent
          as well, e.g.::
 
            # use a type with arguments
            Column('data', String(50))
 
            # use no arguments
            Column('level', Integer)
 
          The ``type`` argument may be the second positional argument
          or specified by keyword.
 
          If the ``type`` is ``None`` or is omitted, it will first default to
          the special type :class:`.NullType`.  If and when this
          :class:`_schema.Column` is made to refer to another column using
          :class:`_schema.ForeignKey` and/or
          :class:`_schema.ForeignKeyConstraint`, the type
          of the remote-referenced column will be copied to this column as
          well, at the moment that the foreign key is resolved against that
          remote :class:`_schema.Column` object.
 
        :param \*args: Additional positional arguments include various
          :class:`.SchemaItem` derived constructs which will be applied
          as options to the column.  These include instances of
          :class:`.Constraint`, :class:`_schema.ForeignKey`,
          :class:`.ColumnDefault`, :class:`.Sequence`, :class:`.Computed`
          :class:`.Identity`.  In some cases an
          equivalent keyword argument is available such as ``server_default``,
          ``default`` and ``unique``.
 
        :param autoincrement: Set up "auto increment" semantics for an
          **integer primary key column with no foreign key dependencies**
          (see later in this docstring for a more specific definition).
          This may influence the :term:`DDL` that will be emitted for
          this column during a table create, as well as how the column
          will be considered when INSERT statements are compiled and
          executed.
 
          The default value is the string ``"auto"``,
          which indicates that a single-column (i.e. non-composite) primary key
          that is of an INTEGER type with no other client-side or server-side
          default constructs indicated should receive auto increment semantics
          automatically. Other values include ``True`` (force this column to
          have auto-increment semantics for a :term:`composite primary key` as
          well), ``False`` (this column should never have auto-increment
          semantics), and the string ``"ignore_fk"`` (special-case for foreign
          key columns, see below).
 
          The term "auto increment semantics" refers both to the kind of DDL
          that will be emitted for the column within a CREATE TABLE statement,
          when methods such as :meth:`.MetaData.create_all` and
          :meth:`.Table.create` are invoked, as well as how the column will be
          considered when an INSERT statement is compiled and emitted to the
          database:
 
          * **DDL rendering** (i.e. :meth:`.MetaData.create_all`,
            :meth:`.Table.create`): When used on a :class:`.Column` that has
            no other
            default-generating construct associated with it (such as a
            :class:`.Sequence` or :class:`.Identity` construct), the parameter
            will imply that database-specific keywords such as PostgreSQL
            ``SERIAL``, MySQL ``AUTO_INCREMENT``, or ``IDENTITY`` on SQL Server
            should also be rendered.  Not every database backend has an
            "implied" default generator available; for example the Oracle
            backend always needs an explicit construct such as
            :class:`.Identity` to be included with a :class:`.Column` in order
            for the DDL rendered to include auto-generating constructs to also
            be produced in the database.
 
          * **INSERT semantics** (i.e. when a :func:`_sql.insert` construct is
            compiled into a SQL string and is then executed on a database using
            :meth:`_engine.Connection.execute` or equivalent): A single-row
            INSERT statement will be known to produce a new integer primary key
            value automatically for this column, which will be accessible
            after the statement is invoked via the
            :attr:`.CursorResult.inserted_primary_key` attribute upon the
            :class:`_result.Result` object.   This also applies towards use of the
            ORM when ORM-mapped objects are persisted to the database,
            indicating that a new integer primary key will be available to
            become part of the :term:`identity key` for that object.  This
            behavior takes place regardless of what DDL constructs are
            associated with the :class:`_schema.Column` and is independent
            of the "DDL Rendering" behavior discussed in the previous note
            above.
 
          The parameter may be set to ``True`` to indicate that a column which
          is part of a composite (i.e. multi-column) primary key should
          have autoincrement semantics, though note that only one column
          within a primary key may have this setting.    It can also
          be set to ``True`` to indicate autoincrement semantics on a
          column that has a client-side or server-side default configured,
          however note that not all dialects can accommodate all styles
          of default as an "autoincrement".  It can also be
          set to ``False`` on a single-column primary key that has a
          datatype of INTEGER in order to disable auto increment semantics
          for that column.
 
          The setting *only* has an effect for columns which are:
 
          * Integer derived (i.e. INT, SMALLINT, BIGINT).
 
          * Part of the primary key
 
          * Not referring to another column via :class:`_schema.ForeignKey`,
            unless
            the value is specified as ``'ignore_fk'``::
 
                # turn on autoincrement for this column despite
                # the ForeignKey()
                Column('id', ForeignKey('other.id'),
                            primary_key=True, autoincrement='ignore_fk')
 
          It is typically not desirable to have "autoincrement" enabled on a
          column that refers to another via foreign key, as such a column is
          required to refer to a value that originates from elsewhere.
 
          The setting has these effects on columns that meet the
          above criteria:
 
          * DDL issued for the column, if the column does not already include
            a default generating construct supported by the backend such as
            :class:`.Identity`, will include database-specific
            keywords intended to signify this column as an
            "autoincrement" column for specific backends.   Behavior for
            primary SQLAlchemy dialects includes:
 
            * AUTO INCREMENT on MySQL and MariaDB
            * SERIAL on PostgreSQL
            * IDENTITY on MS-SQL - this occurs even without the
              :class:`.Identity` construct as the
              :paramref:`.Column.autoincrement` parameter pre-dates this
              construct.
            * SQLite - SQLite integer primary key columns are implicitly
              "auto incrementing" and no additional keywords are rendered;
              to render the special SQLite keyword ``AUTOINCREMENT``
              is not included as this is unnecessary and not recommended
              by the database vendor.  See the section
              :ref:`sqlite_autoincrement` for more background.
            * Oracle - The Oracle dialect has no default "autoincrement"
              feature available at this time, instead the :class:`.Identity`
              construct is recommended to achieve this (the :class:`.Sequence`
              construct may also be used).
            * Third-party dialects - consult those dialects' documentation
              for details on their specific behaviors.
 
          * When a single-row :func:`_sql.insert` construct is compiled and
            executed, which does not set the :meth:`_sql.Insert.inline`
            modifier, newly generated primary key values for this column
            will be automatically retrieved upon statement execution
            using a method specific to the database driver in use:
 
            * MySQL, SQLite - calling upon ``cursor.lastrowid()``
              (see
              `https://www.python.org/dev/peps/pep-0249/#lastrowid
              <https://www.python.org/dev/peps/pep-0249/#lastrowid>`_)
            * PostgreSQL, SQL Server, Oracle - use RETURNING or an equivalent
              construct when rendering an INSERT statement, and then retrieving
              the newly generated primary key values after execution
            * PostgreSQL, Oracle for :class:`_schema.Table` objects that
              set :paramref:`_schema.Table.implicit_returning` to False -
              for a :class:`.Sequence` only, the :class:`.Sequence` is invoked
              explicitly before the INSERT statement takes place so that the
              newly generated primary key value is available to the client
            * SQL Server for :class:`_schema.Table` objects that
              set :paramref:`_schema.Table.implicit_returning` to False -
              the ``SELECT scope_identity()`` construct is used after the
              INSERT statement is invoked to retrieve the newly generated
              primary key value.
            * Third-party dialects - consult those dialects' documentation
              for details on their specific behaviors.
 
          * For multiple-row :func:`_sql.insert` constructs invoked with
            a list of parameters (i.e. "executemany" semantics), primary-key
            retrieving behaviors are generally disabled, however there may
            be special APIs that may be used to retrieve lists of new
            primary key values for an "executemany", such as the psycopg2
            "fast insertmany" feature.  Such features are very new and
            may not yet be well covered in documentation.
 
        :param default: A scalar, Python callable, or
            :class:`_expression.ColumnElement` expression representing the
            *default value* for this column, which will be invoked upon insert
            if this column is otherwise not specified in the VALUES clause of
            the insert. This is a shortcut to using :class:`.ColumnDefault` as
            a positional argument; see that class for full detail on the
            structure of the argument.
 
            Contrast this argument to
            :paramref:`_schema.Column.server_default`
            which creates a default generator on the database side.
 
            .. seealso::
 
                :ref:`metadata_defaults_toplevel`
 
        :param doc: optional String that can be used by the ORM or similar
            to document attributes on the Python side.   This attribute does
            **not** render SQL comments; use the
            :paramref:`_schema.Column.comment`
            parameter for this purpose.
 
        :param key: An optional string identifier which will identify this
            ``Column`` object on the :class:`_schema.Table`.
            When a key is provided,
            this is the only identifier referencing the ``Column`` within the
            application, including ORM attribute mapping; the ``name`` field
            is used only when rendering SQL.
 
        :param index: When ``True``, indicates that a :class:`_schema.Index`
            construct will be automatically generated for this
            :class:`_schema.Column`, which will result in a "CREATE INDEX"
            statement being emitted for the :class:`_schema.Table` when the DDL
            create operation is invoked.
 
            Using this flag is equivalent to making use of the
            :class:`_schema.Index` construct explicitly at the level of the
            :class:`_schema.Table` construct itself::
 
                Table(
                    "some_table",
                    metadata,
                    Column("x", Integer),
                    Index("ix_some_table_x", "x")
                )
 
            To add the :paramref:`_schema.Index.unique` flag to the
            :class:`_schema.Index`, set both the
            :paramref:`_schema.Column.unique` and
            :paramref:`_schema.Column.index` flags to True simultaneously,
            which will have the effect of rendering the "CREATE UNIQUE INDEX"
            DDL instruction instead of "CREATE INDEX".
 
            The name of the index is generated using the
            :ref:`default naming convention <constraint_default_naming_convention>`
            which for the :class:`_schema.Index` construct is of the form
            ``ix_<tablename>_<columnname>``.
 
            As this flag is intended only as a convenience for the common case
            of adding a single-column, default configured index to a table
            definition, explicit use of the :class:`_schema.Index` construct
            should be preferred for most use cases, including composite indexes
            that encompass more than one column, indexes with SQL expressions
            or ordering, backend-specific index configuration options, and
            indexes that use a specific name.
 
            .. note:: the :attr:`_schema.Column.index` attribute on
               :class:`_schema.Column`
               **does not indicate** if this column is indexed or not, only
               if this flag was explicitly set here.  To view indexes on
               a column, view the :attr:`_schema.Table.indexes` collection
               or use :meth:`_reflection.Inspector.get_indexes`.
 
            .. seealso::
 
                :ref:`schema_indexes`
 
                :ref:`constraint_naming_conventions`
 
                :paramref:`_schema.Column.unique`
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param nullable: When set to ``False``, will cause the "NOT NULL"
            phrase to be added when generating DDL for the column.   When
            ``True``, will normally generate nothing (in SQL this defaults to
            "NULL"), except in some very specific backend-specific edge cases
            where "NULL" may render explicitly.
            Defaults to ``True`` unless :paramref:`_schema.Column.primary_key`
            is also ``True`` or the column specifies a :class:`_sql.Identity`,
            in which case it defaults to ``False``.
            This parameter is only used when issuing CREATE TABLE statements.
 
            .. note::
 
                When the column specifies a :class:`_sql.Identity` this
                parameter is in general ignored by the DDL compiler. The
                PostgreSQL database allows nullable identity column by
                setting this parameter to ``True`` explicitly.
 
        :param onupdate: A scalar, Python callable, or
            :class:`~sqlalchemy.sql.expression.ClauseElement` representing a
            default value to be applied to the column within UPDATE
            statements, which will be invoked upon update if this column is not
            present in the SET clause of the update. This is a shortcut to
            using :class:`.ColumnDefault` as a positional argument with
            ``for_update=True``.
 
            .. seealso::
 
                :ref:`metadata_defaults` - complete discussion of onupdate
 
        :param primary_key: If ``True``, marks this column as a primary key
            column. Multiple columns can have this flag set to specify
            composite primary keys. As an alternative, the primary key of a
            :class:`_schema.Table` can be specified via an explicit
            :class:`.PrimaryKeyConstraint` object.
 
        :param server_default: A :class:`.FetchedValue` instance, str, Unicode
            or :func:`~sqlalchemy.sql.expression.text` construct representing
            the DDL DEFAULT value for the column.
 
            String types will be emitted as-is, surrounded by single quotes::
 
                Column('x', Text, server_default="val")
 
                x TEXT DEFAULT 'val'
 
            A :func:`~sqlalchemy.sql.expression.text` expression will be
            rendered as-is, without quotes::
 
                Column('y', DateTime, server_default=text('NOW()'))
 
                y DATETIME DEFAULT NOW()
 
            Strings and text() will be converted into a
            :class:`.DefaultClause` object upon initialization.
 
            This parameter can also accept complex combinations of contextually
            valid SQLAlchemy expressions or constructs::
 
                from sqlalchemy import create_engine
                from sqlalchemy import Table, Column, MetaData, ARRAY, Text
                from sqlalchemy.dialects.postgresql import array
 
                engine = create_engine(
                    'postgresql+psycopg2://scott:tiger@localhost/mydatabase'
                )
                metadata_obj = MetaData()
                tbl = Table(
                        "foo",
                        metadata_obj,
                        Column("bar",
                               ARRAY(Text),
                               server_default=array(["biz", "bang", "bash"])
                               )
                )
                metadata_obj.create_all(engine)
 
            The above results in a table created with the following SQL::
 
                CREATE TABLE foo (
                    bar TEXT[] DEFAULT ARRAY['biz', 'bang', 'bash']
                )
 
            Use :class:`.FetchedValue` to indicate that an already-existing
            column will generate a default value on the database side which
            will be available to SQLAlchemy for post-fetch after inserts. This
            construct does not specify any DDL and the implementation is left
            to the database, such as via a trigger.
 
            .. seealso::
 
                :ref:`server_defaults` - complete discussion of server side
                defaults
 
        :param server_onupdate: A :class:`.FetchedValue` instance
            representing a database-side default generation function,
            such as a trigger. This
            indicates to SQLAlchemy that a newly generated value will be
            available after updates. This construct does not actually
            implement any kind of generation function within the database,
            which instead must be specified separately.
 
 
            .. warning:: This directive **does not** currently produce MySQL's
               "ON UPDATE CURRENT_TIMESTAMP()" clause.  See
               :ref:`mysql_timestamp_onupdate` for background on how to
               produce this clause.
 
            .. seealso::
 
                :ref:`triggered_columns`
 
        :param quote: Force quoting of this column's name on or off,
             corresponding to ``True`` or ``False``. When left at its default
             of ``None``, the column identifier will be quoted according to
             whether the name is case sensitive (identifiers with at least one
             upper case character are treated as case sensitive), or if it's a
             reserved word. This flag is only needed to force quoting of a
             reserved word which is not known by the SQLAlchemy dialect.
 
        :param unique: When ``True``, and the :paramref:`_schema.Column.index`
            parameter is left at its default value of ``False``,
            indicates that a :class:`_schema.UniqueConstraint`
            construct will be automatically generated for this
            :class:`_schema.Column`,
            which will result in a "UNIQUE CONSTRAINT" clause referring
            to this column being included
            in the ``CREATE TABLE`` statement emitted, when the DDL create
            operation for the :class:`_schema.Table` object is invoked.
 
            When this flag is ``True`` while the
            :paramref:`_schema.Column.index` parameter is simultaneously
            set to ``True``, the effect instead is that a
            :class:`_schema.Index` construct which includes the
            :paramref:`_schema.Index.unique` parameter set to ``True``
            is generated.  See the documentation for
            :paramref:`_schema.Column.index` for additional detail.
 
            Using this flag is equivalent to making use of the
            :class:`_schema.UniqueConstraint` construct explicitly at the
            level of the :class:`_schema.Table` construct itself::
 
                Table(
                    "some_table",
                    metadata,
                    Column("x", Integer),
                    UniqueConstraint("x")
                )
 
            The :paramref:`_schema.UniqueConstraint.name` parameter
            of the unique constraint object is left at its default value
            of ``None``; in the absence of a :ref:`naming convention <constraint_naming_conventions>`
            for the enclosing :class:`_schema.MetaData`, the UNIQUE CONSTRAINT
            construct will be emitted as unnamed, which typically invokes
            a database-specific naming convention to take place.
 
            As this flag is intended only as a convenience for the common case
            of adding a single-column, default configured unique constraint to a table
            definition, explicit use of the :class:`_schema.UniqueConstraint` construct
            should be preferred for most use cases, including composite constraints
            that encompass more than one column, backend-specific index configuration options, and
            constraints that use a specific name.
 
            .. note:: the :attr:`_schema.Column.unique` attribute on
                :class:`_schema.Column`
                **does not indicate** if this column has a unique constraint or
                not, only if this flag was explicitly set here.  To view
                indexes and unique constraints that may involve this column,
                view the
                :attr:`_schema.Table.indexes` and/or
                :attr:`_schema.Table.constraints` collections or use
                :meth:`_reflection.Inspector.get_indexes` and/or
                :meth:`_reflection.Inspector.get_unique_constraints`
 
            .. seealso::
 
                :ref:`schema_unique_constraint`
 
                :ref:`constraint_naming_conventions`
 
                :paramref:`_schema.Column.index`
 
        :param system: When ``True``, indicates this is a "system" column,
             that is a column which is automatically made available by the
             database, and should not be included in the columns list for a
             ``CREATE TABLE`` statement.
 
             For more elaborate scenarios where columns should be
             conditionally rendered differently on different backends,
             consider custom compilation rules for :class:`.CreateColumn`.
 
        :param comment: Optional string that will render an SQL comment on
             table creation.
 
             .. versionadded:: 1.2 Added the
                :paramref:`_schema.Column.comment`
                parameter to :class:`_schema.Column`.
 
        :param insert_sentinel: Marks this :class:`_schema.Column` as an
         :term:`insert sentinel` used for optimizing the performance of the
         :term:`insertmanyvalues` feature for tables that don't
         otherwise have qualifying primary key configurations.
 
         .. versionadded:: 2.0.10
 
         .. seealso::
 
            :func:`_schema.insert_sentinel` - all in one helper for declaring
            sentinel columns
 
            :ref:`engine_insertmanyvalues`
 
            :ref:`engine_insertmanyvalues_sentinel_columns`
 
 
        rNz0May not pass name positionally and as a keyword.Z
_sqla_typez1May not pass type_ positionally and as a keyword.z9Explicit 'name' is required when sending 'quote' argumentT©Ú
for_updateF)2Úlistrnr^r0r}r¶Úhasattrr(r×r¼rqr™Ú_insert_sentinelrYÚ_user_defined_nullabler[rrJr=rWrTrSrÙr¡r›rÉÚcomputedrrZÚ    _set_typeÚtypeÚ ColumnDefaultrrwr@rUZonpudaterSÚ_as_for_updateÚ DefaultClauserrVrrÚ_typing_SequencerPr2Úset_creation_orderrƒrÞ)r~r]r^rarRrSrwrTrqrJr=rƒrrUr™rrVrÂrWrÉrXrYrZrzr_Zl_argsZcoltypeZudnrâr\r]r¼çs®ÿ  
 
ÿ  
 ÿ
 
 
 
 
 
 
 
 
 
 ÿ
 
 
zColumn.__init__rRrpr r¡ršr›rJr=zOptional[Computed]rfzOptional[Identity]rzTypeEngine[Any]rx)rRrccCsH||_t|jtƒr|j |¡|jj ¡D]}t|tƒr*| |¡q*dSrm)rhrnr#r{Ú_variant_mappingÚvalues)r~rRÚimplr\r\r]rgŸs   
zColumn._set_typerr‚cCs t |j¡S©z1used by default.py -> _process_execute_defaults())rÚ_from_column_defaultrwr…r\r\r]Ú_default_description_tuple§sz!Column._default_description_tuplecCs t |j¡Srq)rrrrUr…r\r\r]Ú_onupdate_description_tuple­sz"Column._onupdate_description_tuplecCs|jdk    o|jjS)zäspecial attribute used by cache key gen, if true, we will
        use a static cache key for the annotations dictionary, else we
        will generate a new cache key for annotations each time.
 
        Added for #8790
 
        N)rpZ    _is_tabler…r\r\r]Ú!_gen_static_annotations_cache_key²s    z(Column._gen_static_annotations_cache_keyrücKs| |¡dSrmrýrÿr\r\r]rÞ½szColumn._extra_kwargscCsD|jdkrdS|jdk    r:|jjr2|jjd|jS|jSn|jSdS)Nz    (no name)rd)rarpZnamed_with_columnrr…r\r\r]rÀs
 
zColumn.__str__ú Column[Any]©r"rccCs&|jD]}|jj |j¡rdSqdS)zOReturn True if this Column references the given column via foreign
        key.TFN)r›r"Z    proxy_setÚ intersection©r~r"Úfkr\r\r]Ú
referencesËs
zColumn.referencesÚ
ForeignKey©rzrccCs| |¡dSrmr')r~rzr\r\r]Úappend_foreign_keyÕszColumn.append_foreign_keycsêg}ˆjˆjkr| d¡ˆjr*| d¡ˆjs:| d¡ˆjrJ| d¡ˆjrZ| d¡ˆjrj| d¡ˆjrz| d¡dd         t
ˆjƒgt
ˆj ƒgd
d „ˆj Dƒd d „ˆj Dƒˆjdk    rÌd ˆjjpÎdg‡fdd „|Dƒ¡S)Nrqr™rrUrwrrÉz
Column(%s)rcSsg|]}|dk    rt|ƒ‘qSrmrrr\r\r]rùësz#Column.__repr__.<locals>.<listcomp>cSsg|] }t|ƒ‘qSr\rrr\r\r]rùìsz
table=<%s>z
table=Nonecs"g|]}d|ttˆ|ƒƒf‘qSrrrr…r\r]rùôs)rqrar@r™rrUrwrrÉrrrhr›r¡rpr)r~Úkwargr\r…r]r†Øs@ 
 
 
 
 
 
 
 
 
ÿþý
 
ÿüü õÿzColumn.__repr__zDict[str, Column[Any]])r*rÖrÕrlrcc
     sÄ|‰tˆtƒst‚|js"t d¡‚| ¡|jdkr<|j|_t|ddƒ}|dk    rn|ˆk    rnt d|j|j    f¡‚d}d}d}|jˆj
krªˆj
|j}|j|jkr¤d}qÈd}n|j|krÈ||j}|h}d}|dk    rH||k    rH|st  d|›d|dkrü|jn|j›d    ˆj›d
¡‚|j D].}    ˆj   |    ¡|    jˆjkrˆj  |    j¡q|rŠ|dk    rŠ|j|jkrŠt d |j›d |j›d |j›d¡ˆj
j||d|||j<ˆ|_|jrÒ|jjdk    rÊt d¡‚||j_|jrèˆj |¡n$|jˆjkr t d|jˆjf¡‚|jrLt|jtƒr,t d¡‚ˆ td|jt|jƒdd¡n4|jr€t|jtƒrlt d¡‚ˆ t|jdd¡|  ‡fdd„¡|j!rÀt|j"t#ƒs¶t|j$t#ƒrÀt d¡‚dS)NzfColumn must be constructed with a non-blank name or assign a non-blank .name before adding to a Table.rpz1Column object '%s' already assigned to Table '%s'ÚrarqzA column with z 'z' is already present in table 'z'.z Column with user-specified key "z-" is being replaced with plain named column "z", key "zs" is being removed.  If this is a reflection operation, specify autoload_replace=False to prevent this replacement.)Ú extra_removez2a Table may have only one explicit sentinel columnzTTrying to redefine primary-key column '%s' as a non-primary-key column on table '%s'z–The 'index' keyword argument on Column is boolean only. To create indexes with a specific name, create an explicit Index object external to the Table.T)r=rEzõThe 'unique' keyword argument on Column is boolean only. To create unique constraints or indexes with a specific name, append an explicit UniqueConstraint to the Table's list of elements, or create an explicit Index object external to the Table.)rEcs
| ˆ¡Srm)Ú_set_remote_table©rz©rpr\r]rëk    rìz$Column._set_parent.<locals>.<lambda>z4An column cannot specify both Identity and Sequence.)%rnrRrØrar0r}Z_reset_memoizationsrqrrrr$r›rûrðr¡r2r?rtrprdrŸr™Ú_replacerÛrJr^r(rFr¸r=ÚUniqueConstraintÚ_setup_on_memoized_fksrrwrrU)
r~r*rÖrÕrlÚexistingrZ existing_colZ conflicts_onrzr\r„r]r+÷s¶ÿ
 
ÿÿ   
 
 
 
ÿÿ
 ÿ
ÿ
þÿÿÿÿÿ ÿ
ÿ
þÿzColumn._set_parentúCallable[..., Any]©rárccCsj|jj|jfdf|jj|jfdfg}|D]<\}}||jjjkr(|jjj|D]}|j|krL||ƒqLq(dS)NFT)rprqrarÀÚ    _fk_memosÚ link_to_name)r~ráZfk_keysÚfk_keyrŒrzr\r\r]r‡u    sþ 
zColumn._setup_on_memoized_fkscCs*|jdk    r|||jƒnt |d|¡dS)Nr½)rpr/rÜ)r~rár\r\r]Ú_on_table_attach€    s
zColumn._on_table_attachr©z]The :meth:`_schema.Column.copy` method is deprecated and will be removed in a future release.©rlrccKs |jf|ŽSrm©rA©r~rlr\r\r]rˆ†    sz Column.copyc  s‡fdd„|jDƒ‡fdd„|jDƒ}i}|jD]2}|j|j}| ¡D]\}}|||d|<qJq2|j}|j}    t|tt    fƒrš| 
|j fˆŽ¡d}}    |j }
t|
t ƒr¶|
jfˆŽ}
|j||j|
|j|j|j|j|j|j|j||j|    |j|j|j|jdœ|—Ž} |j| _|j| _| | ¡S)z…Create a copy of this ``Column``, uninitialized.
 
        This is used in :meth:`_schema.Table.to_metadata` and by the ORM.
 
        csg|]}|js|jfˆŽ‘qSr\)rDrArø©rlr\r]rù–    sþz Column._copy.<locals>.<listcomp>csg|]}|js|jfˆŽ‘qSr\)rðrArør’r\r]rùš    sþÚ_N)rarRrqr™r=rWrJrSrwrrUrVrTrÉrYrX) r¡r›Údialect_optionsÚ _non_defaultsÚitemsrrVrnÚComputedÚIdentityr@rArhr#rˆÚ _constructorrarqr™r=rWrJrSrwrUrTrÉrYrdrrer‹) r~rlrzZ column_kwargsÚ dialect_namer”Údialect_option_keyÚdialect_option_valuerrVrRrrr\r’r]rAŽ    sd
þ
þü 
 ýþ
ÿ
 ïïíz Column._copy)Úotherrcc CsÊ|jr d|_|j}|jsp|jjrpt|tƒr2| ¡}||_t|tƒrL| |¡|j ¡D]}t|tƒrV| |¡qV|j    t
k    r”|j    t
kr”|j |_ |j    |_    |j dk    r¼|j dkr¼|j   ¡}| |¡|jrö|jdkrö|j}t|tƒrð|  ¡}| |¡n||_|jr"|jdkr"|j}|  ¡}| |¡|jrJ|jdkrJ|j  ¡}| |¡|jr`|js`d|_|jrv|jsvd|_|jD] }|js||  ¡}    |     |¡q||jD] }
|
js¤|
  ¡} |  |¡q¤dS)z–merge the elements of another column into this one.
 
        this is used by ORM pep-593 merge and will likely need a lot
        of fixes.
 
 
        TN)r™rhÚ_isnullrnr#rˆr{rnrorer[rrwrAr+rrSrVrUrJr=r¡rDr›rð) r~rrRrpZ new_defaultZnew_server_defaultZnew_server_onupdateZ new_onupdaterIZ    new_constrzZnew_fkr\r\r]Ú_mergeØ    s\    
 
 
 
 ÿþ
 
 
 
 
 
 
 
z Column._mergerLz.Optional[_typing_Sequence[ColumnElement[Any]]]zTuple[str, ColumnClause[_T]])Ú
selectablerarqÚname_is_truncatableÚcompound_select_colsrlrcc
 
Ks.dd„dd„|jDƒDƒ}|dkr6|jdkr6t d¡‚zj|j|rXt tj|rP|n|j¡n|p`|j|j    f|ž|rr|n |rz|n|j
|j |j |r’t |ƒn|gdœŽ}Wn2tk
rÒ}    ztd|jƒ|    ‚W5d}    ~    XYnX||_|j|_|jdk    rþ|jj |j
¡|_|j r|j  |¡|r$|j |¡|j
|fS)a$Create a *proxy* for this column.
 
        This is a copy of this ``Column`` referenced by a different parent
        (such as an alias or select statement).  The column should
        be used only in select scenarios, as its full DDL/default
        information is not transferred.
 
        cSs2g|]*\}}t|dk    r|n|j|dk|jd‘qS)N)Ú _unresolvableÚ _constraint)r|Ú_colspecrð)rñÚfrHr\r\r]rù2
s ûýz&Column._make_proxy.<locals>.<listcomp>cSsg|]}||jddf‘qS)F©Úraiseerr©Ú_resolve_column)rñrzr\r\r]rù8
sÿNz^Cannot initialize a sub-selectable with this Column object until its 'name' has been assigned.)rqr™rrZzÊCould not create a copy of this %r object.  Ensure the class includes a _constructor() attribute or method which accepts the standard Column constructor arguments, or references the Column class itself.)r›rar0r¹r™rÚexpectrZTruncatedLabelRolerhrqr™rrbr´rãrpZ_propagate_attrsZ _is_clone_ofr¥rµrÚupdate)
r~r rarqr¡r¢rlrzrrr€r\r\r]Ú _make_proxy
sZþú ÿý ÿúòÿ
ó üÿú
  zColumn._make_proxy)NN)NNFN) rVrWrXrŒrZ inherit_cacher–rTr[r¼rgr3Zmemoized_attributersrtr2rŽrurÞrr{r~r†r+r‡rŽrOrˆrArŸr­rPr\r\râr]roÝsˆ
ù    âD  
 
~ þJIøroT)rwÚomit_from_statementsr[r‘r¸rv)rarRrwr®rccCs.t||dkrtjn||dk    r |ntƒ|ddS)aProvides a surrogate :class:`_schema.Column` that will act as a
    dedicated insert :term:`sentinel` column, allowing efficient bulk
    inserts with deterministic RETURNING sorting for tables that
    don't otherwise have qualifying primary key configurations.
 
    Adding this column to a :class:`.Table` object requires that a
    corresponding database table actually has this column present, so if adding
    it to an existing model, existing database tables would need to be migrated
    (e.g. using ALTER TABLE or similar) to include this column.
 
    For background on how this object is used, see the section
    :ref:`engine_insertmanyvalues_sentinel_columns` as part of the
    section :ref:`engine_insertmanyvalues`.
 
    The :class:`_schema.Column` returned will be a nullable integer column by
    default and make use of a sentinel-specific default generator used only in
    "insertmanyvalues" operations.
 
    .. seealso::
 
        :func:`_orm.orm_insert_sentinel`
 
        :paramref:`_schema.Column.insert_sentinel`
 
        :ref:`engine_insertmanyvalues`
 
        :ref:`engine_insertmanyvalues_sentinel_columns`
 
 
    .. versionadded:: 2.0.10
 
    NT)rarRrwrYrX)rorÚ INTEGERTYPEÚ_InsertSentinelColumnDefault)rarRrwr®r\r\r]rXi
s'ÿùrXc@sàeZdZUdZdZded<ded<dTd    d
d d d d dd d d dd d ddœdd„Zddœdd„Ze     dd¡ddœd dddœdd„ƒZ
ddœd dddœdd„Z dUd d d dd!œd"d#„Z e d dœd$d%„ƒZddœd&d'„Ze e ƒZd(d d)œd*d+„Zd,dd)œd-d.„Zejd/dœd0d1„ƒZd2dœd3d4„Zd(d(d dd5œd6d7„Zdd8d9œd:d;„Zejddœd<d=„ƒZed>d?œd@ddAœdBdC„ƒZed>d?œd ddAœdDdC„ƒZdEd?œd ddAœdFdC„ZdGdd8dHœdIdJ„Zd(d8d)œdKdL„ZdMd8dNœdOdP„Zdd(d8dQœdRdS„ZdS)Vr|a;Defines a dependency between two columns.
 
    ``ForeignKey`` is specified as an argument to a :class:`_schema.Column`
    object,
    e.g.::
 
        t = Table("remote_table", metadata,
            Column("remote_id", ForeignKey("main_table.id"))
        )
 
    Note that ``ForeignKey`` is only a marker object that defines
    a dependency between two columns.   The actual constraint
    is in all cases represented by the :class:`_schema.ForeignKeyConstraint`
    object.   This object will be generated automatically when
    a ``ForeignKey`` is associated with a :class:`_schema.Column` which
    in turn is associated with a :class:`_schema.Table`.   Conversely,
    when :class:`_schema.ForeignKeyConstraint` is applied to a
    :class:`_schema.Table`,
    ``ForeignKey`` markers are automatically generated to be
    present on each associated :class:`_schema.Column`, which are also
    associated with the constraint object.
 
    Note that you cannot define a "composite" foreign key constraint,
    that is a constraint between a grouping of multiple parent/child
    columns, using ``ForeignKey`` objects.   To define this grouping,
    the :class:`_schema.ForeignKeyConstraint` object must be used, and applied
    to the :class:`_schema.Table`.   The associated ``ForeignKey`` objects
    are created automatically.
 
    The ``ForeignKey`` objects associated with an individual
    :class:`_schema.Column`
    object are available in the `foreign_keys` collection
    of that column.
 
    Further examples of foreign key configuration are in
    :ref:`metadata_foreignkeys`.
 
    Z foreign_keyrvr*ržÚ _table_columnNFr:zOptional[ForeignKeyConstraint]r¸Ú_ConstraintNameArgumentr_rÏr\r)r"r¤Ú    use_alterrarUÚondeleteÚ
deferrableÚ    initiallyrŒÚmatchrƒrÉr£Ú
dialect_kwcKs°t tj|¡|_| |_t|jtƒr*d|_n0|j|_t|jj    t
dƒt fƒsZt   d|jj    ¡‚||_d|_||_||_||_||_||_||_|    |_|
|_| |_| r¦| |_||_dS)aà
        Construct a column-level FOREIGN KEY.
 
        The :class:`_schema.ForeignKey` object when constructed generates a
        :class:`_schema.ForeignKeyConstraint`
        which is associated with the parent
        :class:`_schema.Table` object's collection of constraints.
 
        :param column: A single target column for the key relationship. A
            :class:`_schema.Column` object or a column name as a string:
            ``tablename.columnkey`` or ``schema.tablename.columnkey``.
            ``columnkey`` is the ``key`` which has been assigned to the column
            (defaults to the column name itself), unless ``link_to_name`` is
            ``True`` in which case the rendered name of the column is used.
 
        :param name: Optional string. An in-database name for the key if
            `constraint` is not provided.
 
        :param onupdate: Optional string. If set, emit ON UPDATE <value> when
            issuing DDL for this constraint. Typical values include CASCADE,
            DELETE and RESTRICT.
 
        :param ondelete: Optional string. If set, emit ON DELETE <value> when
            issuing DDL for this constraint. Typical values include CASCADE,
            DELETE and RESTRICT.
 
        :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
            DEFERRABLE when issuing DDL for this constraint.
 
        :param initially: Optional string. If set, emit INITIALLY <value> when
            issuing DDL for this constraint.
 
        :param link_to_name: if True, the string name given in ``column`` is
            the rendered name of the referenced column, not its locally
            assigned ``key``.
 
        :param use_alter: passed to the underlying
            :class:`_schema.ForeignKeyConstraint`
            to indicate the constraint should
            be generated/dropped externally from the CREATE TABLE/ DROP TABLE
            statement.  See :paramref:`_schema.ForeignKeyConstraint.use_alter`
            for further description.
 
            .. seealso::
 
                :paramref:`_schema.ForeignKeyConstraint.use_alter`
 
                :ref:`use_alter`
 
        :param match: Optional string. If set, emit MATCH <value> when issuing
            DDL for this constraint. Typical values include SIMPLE, PARTIAL
            and FULL.
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param comment: Optional string that will render an SQL comment on
          foreign key constraint creation.
 
            .. versionadded:: 2.0
 
        :param \**dialect_kw:  Additional keyword arguments are dialect
            specific, and passed in the form ``<dialectname>_<argname>``.  The
            arguments are ultimately handled by a corresponding
            :class:`_schema.ForeignKeyConstraint`.
            See the documentation regarding
            an individual dialect at :ref:`dialect_toplevel` for detail on
            documented arguments.
 
        Nz8ForeignKey received Column not bound to a Table, got: %r)rr«rZDDLReferredColumnRoler¥r£rnr^r±rprhr*r0r}rðr*r³rarUr´rµr¶rŒr·rÉrƒÚ_unvalidated_dialect_kw)r~r"r¤r³rarUr´rµr¶rŒr·rƒrÉr£r¸r\r\r]r¼É
s8X 
ÿÿÿ
zForeignKey.__init__r^r‚cCs d| ¡S)NzForeignKey(%r))Ú _get_colspecr…r\r\r]r†H szForeignKey.__repr__r©zaThe :meth:`_schema.ForeignKey.copy` method is deprecated and will be removed in a future release.r)rbrlrccKs|jfd|i|—ŽS)Nrbr)r~rbrlr\r\r]rˆK szForeignKey.copyc KsJt|j|df|j|j|j|j|j|j|j|j    |j
dœ    |j —Ž}|  |¡S)aProduce a copy of this :class:`_schema.ForeignKey` object.
 
        The new :class:`_schema.ForeignKey` will not be bound
        to any :class:`_schema.Column`.
 
        This method is usually used by the internal
        copy procedures of :class:`_schema.Column`, :class:`_schema.Table`,
        and :class:`_schema.MetaData`.
 
        :param schema: The returned :class:`_schema.ForeignKey` will
          reference the original table and column name, qualified
          by the given string schema name.
 
        r)    r³rarUr´rµr¶rŒr·rÉ) r|rºr³rarUr´rµr¶rŒr·rÉr¹r‹)r~rbrlrzr\r\r]rAS s 
ÿö õ zForeignKey._copyzROptional[Union[str, Literal[SchemaConst.RETAIN_SCHEMA, SchemaConst.BLANK_SCHEMA]]])rbÚ
table_nameÚ_is_copyrccCsÞ|dtfkrH|j\}}}|dk    r$|}|tkr8d||fSd|||fSn’|rx|j\}}}|rjd|||fSd||fSnb|jdk    rÄ|jjdkr®|r¦t d|j›¡‚n|jjSd|jjj|jjfSt    |j
t ƒsÔt ‚|j
SdS)zïReturn a string based 'column specification' for this
        :class:`_schema.ForeignKey`.
 
        This is usually the equivalent of the string-based "tablename.colname"
        argument first passed to the object's constructor.
 
        NrÒz%s.%s.%szDCan't copy ForeignKey object which refers to non-table bound Column ) rYÚ_column_tokensrZr±rpr0r¹rqrÛrnr¥r^rØ)r~rbr»r¼Z_schemaÚtnameÚcolnamer\r\r]rºq s2    
 
ÿþzForeignKey._get_colspeccCs
|jdS©Nr)r½r…r\r\r]rC¢ szForeignKey._referred_schemacCs@|jdk    r&|jjdkrdS|jjjSn|j\}}}t||ƒSdSrm)r±rprqr½re)r~rbr¾r¿r\r\r]Ú
_table_key¦ s 
   zForeignKey._table_keyrRrcCs| |j¡dk    S)zrReturn True if the given :class:`_schema.Table`
        is referenced by this
        :class:`_schema.ForeignKey`.N)Úcorresponding_columnr"r r\r\r]r{² szForeignKey.referencesrLcCs|j |j¡S)a-Return the :class:`_schema.Column` in the given
        :class:`_schema.Table` (or any :class:`.FromClause`)
        referenced by this :class:`_schema.ForeignKey`.
 
        Returns None if this :class:`_schema.ForeignKey`
        does not reference the given
        :class:`_schema.Table`.
 
        )r¥rÂr"r r\r\r]Ú get_referent¹ s zForeignKey.get_referentz(Tuple[Optional[str], str, Optional[str]]cCsv| ¡ d¡}|dkr&t d|j¡‚t|ƒdkr@| ¡}d}n| ¡}| ¡}t|ƒdkrhd |¡}nd}|||fS)z7parse a string-based _colspec into its component parts.rdNz,Invalid foreign key column specification: %srr)rºÚsplitr0r}r¥Úlenr¶r)r~Úmr¾r¿rbr\r\r]r½È sÿ   zForeignKey._column_tokensz Tuple[Table, str, Optional[str]]cCsÈ|jdkrt d¡‚n|jjdkr,t d¡‚|jj}|jrZ|j\}}}t||ƒ}|||fS|jjD] }t|t    ƒrb|j|ks~t
‚qŒqbdsŒt
‚|j\}}}|dkr´|j j dk    r´|j j }t||ƒ}|||fS)NzLthis ForeignKey object does not yet have a parent Column associated with it.zCthis ForeignKey's parent column is not yet associated with a Table.F) r*r0r¹rpr£r½reZ base_columnsrnrorØrÀrb)r~Ú parenttablerbr¾r¿Útablekeyrrr\r\r]Ú_resolve_col_tokensç s.
ÿ ÿ 
 
 
 
zForeignKey._resolve_col_tokens)rÇrpr¿rccCsšd}|dkr4|j}|dk    st‚|j}|j |d¡}n8|jrZ|}|jD]}|j|krD|}qDn|}|j |d¡}|dkr–t d|j    |j|j|f|j|¡‚|S)NziCould not initialize target column for ForeignKey '%s' on table '%s': table '%s' has no column named '%s')
r*rØrqrrrµrŒrar0ÚNoReferencedColumnErrorr¥)r~rÇrpr¿Ú_columnr*rqrrr\r\r]Ú_link_to_col_by_colstring s, 
 
ýú    z$ForeignKey._link_to_col_by_colstringrxrwcsL|jdk    st‚|jjjr"ˆj|j_dddœ‡fdd„ }|j |¡ˆ|_dS)Nr|rxr}cs|jjjrˆj|j_dSrm)r*rhržrƒ©r"r\r]Úset_type= s
z/ForeignKey._set_target_column.<locals>.set_type)r*rØrhržr‡r")r~r"rÎr\rÍr]Ú_set_target_column3 s 
 
 zForeignKey._set_target_columncCs| ¡S)z¾Return the target :class:`_schema.Column` referenced by this
        :class:`_schema.ForeignKey`.
 
        If no target column has been established, an exception
        is raised.
 
        r©r…r\r\r]r"E s
zForeignKey.column.r§z Literal[True])r¨rccCsdSrmr\©r~r¨r\r\r]rªQ szForeignKey._resolve_columncCsdSrmr\rÐr\r\r]rªU sTcCs´t|jtƒrŒ| ¡\}}}|js*||jkrL|s2dSt d|j||f|¡‚q°|j    |jkrp|s`dSt 
d|¡‚q°|jj |}|  |||¡Sn$t |jdƒr¦|j ¡}|S|j}|SdS)Nz|Foreign key associated with column '%s' could not find table '%s' with which to generate a foreign key to target column '%s'z9Table %s is no longer associated with its parent MetaDataÚ__clause_element__)rnr¥r^rÉr£rÀr0ZNoReferencedTableErrorr*rqr¹r·rÌrcrÑ)r~r¨rÇrÈr¿rprËr\r\r]rª[ s< 
ýû ÿÿ ÿ 
r#r)cKsRt|tƒst‚|jdk    r,|j|k    r,t d¡‚||_|jj |¡|j |j    ¡dS)Nz&This ForeignKey already has a parent !)
rnrorØr*r0r¹r›rrŽÚ
_set_table©r~r*rlr\r\r]r+‚ sÿzForeignKey._set_parentcCsD| ¡\}}}| |||¡}| |¡|jdk    s4t‚|j |¡dSrm)rÉrÌrÏrðrØÚ_validate_dest_table)r~rprÇr“r¿rËr\r\r]r‚ s
 
zForeignKey._set_remote_tablerÍ©rÀrccCs8| ¡\}}}||f}||j|kr4|j| |¡dSrm)rÉr‹rû)r~rÀrÇÚ    table_keyr¿rr\r\r]Ú_remove_from_metadata” sz ForeignKey._remove_from_metadata©r"rprcc Cs0t|tƒst‚|jdkrjtggf|j|j|j|j|j    |j
|j |j dœ|j —Ž|_|j ||¡|j |¡|j |¡t|jtƒrø| ¡\}}}||f}||jjkrä|jj|}z| |||¡}Wntjk
rØYn X| |¡|jj| |¡n4t|jdƒr|j ¡}| |¡n|j}| |¡dS)N)r³rarUr´rµr¶r·rÉrÑ)rnrRrØrðrBr³rarUr´rµr¶r·rÉr¹Ú_append_elementr{r›rr¥r^rÉrÀr·rÌr0rÊrÏr‹r@rcrÑ)r~r"rprÇrÖr¿rrËr\r\r]rÒœ sP
þö õ      ÿ
 
 zForeignKey._set_table) NFNNNNNFNNNF)NNF) rVrWrXrŒrr–r¼r†r2rOrˆrArºrMrCrÁZtarget_fullnamer{rÃrŽr½rÉrÌrÏrNr"rrªr+r‚r×rÒr\r\r\r]r|›
sh
'ò*þ%÷1
($ ÿÿ' r|zOptional[DefaultGenerator]zTypeGuard[Sequence])ÚobjrccCsdSrmr\©rÚr\r\r]r Í sr z%TypeGuard[ColumnElementColumnDefault]cCsdSrmr\rÛr\r\r]Údefault_is_clause_elementÒ srÜz%TypeGuard[ScalarElementColumnDefault]cCsdSrmr\rÛr\r\r]Údefault_is_scalar× srÝÚ is_sequenceÚis_clause_elementÚ    is_scalarc@sœeZdZUdZdZdZdZdZdZdZ    dZ
dZ dZ dZ ded<dddd    œd
d „Zd d ddœdd„Zddœdd„Zdddd dœdd„Zdddd dœdd„ZdS)ÚDefaultGeneratorzœBase class for column *default* values.
 
    This object is only present on column.default or column.onupdate.
    It's not valid as a server default.
 
    Zdefault_generatorTFržr"r¸rx©rarccCs
||_dSrmr`©r~rar\r\r]r¼ù szDefaultGenerator.__init__r#rr)cKs4trt|tƒst‚||_|jr(||j_n||j_dSrm)rrnrorØr"rarUrwrÓr\r\r]r+ü s 
zDefaultGenerator._set_parentr‚cCs
tƒ‚dSrm©ÚNotImplementedErrorr…r\r\r]rA szDefaultGenerator._copyrErGrH)Ú
connectionÚdistilled_paramsÚexecution_optionsrccCst dd¡| |||¡S)NzoUsing the .execute() method to invoke a DefaultGenerator object is deprecated; please use the .scalar() method.z2.0)r2Zwarn_deprecatedÚ_execute_on_scalar©r~rærçrèr\r\r]Ú_execute_on_connection süÿz'DefaultGenerator._execute_on_connectioncCs| |||¡Srm)Z_execute_defaultrêr\r\r]ré s
ÿz#DefaultGenerator._execute_on_scalarN)F)rVrWrXrŒrZ_is_default_generatorrÞÚ is_identityÚis_server_defaultrßr ràÚhas_argr
r–r¼r+rArërér\r\r\r]ráä s"
    rác@s„eZdZUdZded<edddddœd    d
„ƒZedd dd dœd d
„ƒZedddddœdd
„ƒZdddddœdd
„Zddœdd„ZdS)riaïA plain default value on a column.
 
    This could correspond to a constant, a callable function,
    or a SQL clause.
 
    :class:`.ColumnDefault` is generated automatically
    whenever the ``default``, ``onupdate`` arguments of
    :class:`_schema.Column` are used.  A :class:`.ColumnDefault`
    can be passed positionally as well.
 
    For example, the following::
 
        Column('foo', Integer, default=50)
 
    Is equivalent to::
 
        Column('foo', Integer, ColumnDefault(50))
 
 
    rÚarg.r‰r¸ÚCallableColumnDefault©rïrarccCsdSrmr\©r¬rïrar\r\r]r­; szColumnDefault.__new__rfÚColumnElementColumnDefaultcCsdSrmr\ròr\r\r]r­A sr²cCsdSrmr\ròr\r\r]r­J sNFcCsJt|tƒrt d¡‚n*t|ƒr$t}nt|tƒr4t}n |dk    r@t}t     
|¡S)a{Construct a new :class:`.ColumnDefault`.
 
 
        :param arg: argument representing the default value.
         May be one of the following:
 
         * a plain non-callable Python value, such as a
           string, integer, boolean, or other simple type.
           The default value will be used as is each time.
         * a SQL expression, that is one which derives from
           :class:`_expression.ColumnElement`.  The SQL expression will
           be rendered into the INSERT or UPDATE statement,
           or in the case of a primary key column when
           RETURNING is not used may be
           pre-executed before an INSERT within a SELECT.
         * A Python callable.  The function will be invoked for each
           new row subject to an INSERT or UPDATE.
           The callable must accept exactly
           zero or one positional arguments.  The one-argument form
           will receive an instance of the :class:`.ExecutionContext`,
           which provides contextual information as to the current
           :class:`_engine.Connection` in use as well as the current
           statement and parameters.
 
        z4ColumnDefault may not be a server-side default type.N) rnrSr0r}Úcallablerðr%róÚScalarElementColumnDefaultr²r­ròr\r\r]r­N s
ÿ
r^r‚cCs|jj›d|j›dS)Nú(ú))rãrVrïr…r\r\r]r†x szColumnDefault.__repr__).).).)NF)rVrWrXrŒr–rr­r†r\r\r\r]ri# s
ÿÿÿ*ric@s:eZdZdZdZdZdddddœdd    „Zdd
œd d „Zd S)rõzQdefault generator for a fixed scalar Python value
 
    .. versionadded: 2.0
 
    TFrr¸rxrñcCs||_||_dSrm©rarï©r~rïrar\r\r]r¼† sz#ScalarElementColumnDefault.__init__r‚cCst|j|jdS©N©rïra)rõrïrar…r\r\r]rAŠ sÿz ScalarElementColumnDefault._copyN)F)rVrWrXrŒràrîr¼rAr\r\r\r]rõ| s
rõcs`eZdZdZdZdZdZddœdd„Zddœd    d
„Zd d dd œ‡fdd„ Z    ddœdd„Z
‡Z S)r°zÎDefault generator that's specific to the use of a "sentinel" column
    when using the insertmanyvalues feature.
 
    This default is used as part of the :func:`_schema.insert_sentinel`
    construct.
 
    TFNr‚cCs
t |¡Srm)r²r­)r¬r\r\r]r­ sz$_InsertSentinelColumnDefault.__new__rxcCsdSrmr\r…r\r\r]r¼  sz%_InsertSentinelColumnDefault.__init__r#rr)c s@td|ƒ}|jst d¡‚n|js,t d¡‚tƒj|f|ŽdS)Nrvz_The _InsertSentinelColumnDefault may only be applied to a Column marked as insert_sentinel=TruezQThe _InsertSentinelColumnDefault may only be applied to a Column that is nullable)rrdr0r}rr×r+©r~r*rlrHrâr\r]r+£ s
ÿÿz(_InsertSentinelColumnDefault._set_parentcCstƒSrm)r°r…r\r\r]rA² sz"_InsertSentinelColumnDefault._copy) rVrWrXrŒr
rarïr­r¼r+rArPr\r\râr]r° sr°)rfr)c@sbeZdZUdZdZdZded<dddddœd    d
„Zdd œd d „Ze    j
e      d¡dd œdd„ƒƒZ dS)rózGdefault generator for a SQL expression
 
    .. versionadded:: 2.0
 
    TÚ_SQLExprDefaultrïFr¸rxrñcCs||_||_dSrmrørùr\r\r]r¼Ä sz#ColumnElementColumnDefault.__init__r‚cCst|j|jdSrú)rórïrar…r\r\r]rAÌ sÿz ColumnElementColumnDefault._copyzsqlalchemy.sql.sqltypescCstjj}t|jj|jƒ Srm)r2Ú    preloadedZ sql_sqltypesrnrïrhZNullType)r~Zsqltypesr\r\r]Ú _arg_is_typedÑ sz(ColumnElementColumnDefault._arg_is_typedN)F) rVrWrXrŒrßrîr–r¼rAr2rŽÚpreload_modulerÿr\r\r\r]ró¹ s
ýróc@seZdZdddœdd„ZdS)Ú_CallableColumnDefaultProtocolrIr)ÚcontextrccCsdSrmr\)r~rr\r\r]Ú__call__Ú sz'_CallableColumnDefaultProtocol.__call__N)rVrWrXrr\r\r\r]rÙ src@sTeZdZUdZdZded<dZddddd    œd
d „Zdd œd d„Zdddœdd„Z    dS)rðzQdefault generator for a callable Python function
 
    .. versionadded:: 2.0
 
    TrrïFz8Union[_CallableColumnDefaultProtocol, Callable[[], Any]]r¸rxrñcCs||_| |¡|_dSrm)raÚ_maybe_wrap_callablerïrùr\r\r]r¼é szCallableColumnDefault.__init__r‚cCst|j|jdSrú)rðrïrar…r\r\r]rAñ szCallableColumnDefault._copyrŠcsžztjˆdd}Wn(tk
r:t ‡fdd„ˆ¡YSX|ddk    rTt|dƒpVd}t|dƒ|}|dkr„t ‡fdd„ˆ¡S|d    krˆSt d
¡‚dS) z±Wrap callables that don't accept a context.
 
        This is to allow easy compatibility with default callables
        that aren't specific to accepting of a context.
 
        T)Zno_selfcsˆƒSrmr\©Úctx©rár\r]rërìz<CallableColumnDefault._maybe_wrap_callable.<locals>.<lambda>rUNrcsˆƒSrmr\rrr\r]rërìrzDColumnDefault Python function takes zero or one positional arguments)r2Zget_callable_argspecr´Z wrap_callablerÅr0r})r~ráZargspecZ    defaultedZ positionalsr\rr]rô s
ÿz*CallableColumnDefault._maybe_wrap_callableN)F)
rVrWrXrŒr r–rîr¼rArr\r\r\r]rðÞ s
ýrðc @sDeZdZdZd dddddddddddœ
dd„Zed    d
œd d „ƒZdS)ÚIdentityOptionsz–Defines options for a named database sequence or an identity column.
 
    .. versionadded:: 1.3.18
 
    .. seealso::
 
        :class:`.Sequence`
 
    Nú Optional[int]rÏrx)
ÚstartÚ    incrementÚminvalueÚmaxvalueÚ
nominvalueÚ
nomaxvalueÚcycleÚcacheÚorderrcc
 
Cs:||_||_||_||_||_||_||_||_|    |_dS)a\Construct a :class:`.IdentityOptions` object.
 
        See the :class:`.Sequence` documentation for a complete description
        of the parameters.
 
        :param start: the starting index of the sequence.
        :param increment: the increment value of the sequence.
        :param minvalue: the minimum value of the sequence.
        :param maxvalue: the maximum value of the sequence.
        :param nominvalue: no minimum value of the sequence.
        :param nomaxvalue: no maximum value of the sequence.
        :param cycle: allows the sequence to wrap around when the maxvalue
         or minvalue has been reached.
        :param cache: optional integer value; number of future values in the
         sequence which are calculated in advance.
        :param order: optional boolean value; if ``True``, renders the
         ORDER keyword.
 
        N©    r
r r r rrrrr)
r~r
r r r rrrrrr\r\r]r¼szIdentityOptions.__init__r¸r‚cCs|jdk    o|jdkSrÀ)r r…r\r\r]rFsz&IdentityOptions._increment_is_negative)    NNNNNNNNN)rVrWrXrŒr¼rMrr\r\r\r]rs ö")rcsôeZdZUdZdZdZded<ded<d3d
d d d d d d d d d d ddd dd dddœdd„Ze     d¡ddœdd„ƒZ
ddddœ‡fdd„ Z ddœdd „Z d!d"dd#œd$d%„Z d&dd'œd(d)„Zd4d*ddd+œd,d-„Zd5d*ddd+œd.d/„Zd0dœd1d2„Z‡ZS)6raRepresents a named database sequence.
 
    The :class:`.Sequence` object represents the name and configurational
    parameters of a database sequence.   It also represents
    a construct that can be "executed" by a SQLAlchemy :class:`_engine.Engine`
    or :class:`_engine.Connection`,
    rendering the appropriate "next value" function
    for the target database and returning a result.
 
    The :class:`.Sequence` is typically associated with a primary key column::
 
        some_table = Table(
            'some_table', metadata,
            Column('id', Integer, Sequence('some_table_seq', start=1),
            primary_key=True)
        )
 
    When CREATE TABLE is emitted for the above :class:`_schema.Table`, if the
    target platform supports sequences, a CREATE SEQUENCE statement will
    be emitted as well.   For platforms that don't support sequences,
    the :class:`.Sequence` construct is ignored.
 
    .. seealso::
 
        :ref:`defaults_sequences`
 
        :class:`.CreateSequence`
 
        :class:`.DropSequence`
 
    ÚsequenceTržr"zOptional[TypeEngine[int]]Ú    data_typeNFr^r    rÏrÎz"Optional[_TypeEngineArgument[int]]r¸zOptional[MetaData]rx)rar
r r r rrrrbrrrÚoptionalrÂrÀrÃrarcc CsÈtj||dtj|||||||||
| d
d|_t||ƒ|_| |_|    tkrXd|_}    n2|dk    r||    dkr||jr||j|_}    nt     |    |¡|_||_
t ||    ƒ|_ |rª|  |¡| dk    r¾t| ƒ|_nd|_dS)a¶Construct a :class:`.Sequence` object.
 
        :param name: the name of the sequence.
 
        :param start: the starting index of the sequence.  This value is
         used when the CREATE SEQUENCE command is emitted to the database
         as the value of the "START WITH" clause. If ``None``, the
         clause is omitted, which on most platforms indicates a starting
         value of 1.
 
         .. versionchanged:: 2.0 The :paramref:`.Sequence.start` parameter
            is required in order to have DDL emit "START WITH".  This is a
            reversal of a change made in version 1.4 which would implicitly
            render "START WITH 1" if the :paramref:`.Sequence.start` were
            not included.  See :ref:`change_7211` for more detail.
 
        :param increment: the increment value of the sequence.  This
         value is used when the CREATE SEQUENCE command is emitted to
         the database as the value of the "INCREMENT BY" clause.  If ``None``,
         the clause is omitted, which on most platforms indicates an
         increment of 1.
        :param minvalue: the minimum value of the sequence.  This
         value is used when the CREATE SEQUENCE command is emitted to
         the database as the value of the "MINVALUE" clause.  If ``None``,
         the clause is omitted, which on most platforms indicates a
         minvalue of 1 and -2^63-1 for ascending and descending sequences,
         respectively.
 
        :param maxvalue: the maximum value of the sequence.  This
         value is used when the CREATE SEQUENCE command is emitted to
         the database as the value of the "MAXVALUE" clause.  If ``None``,
         the clause is omitted, which on most platforms indicates a
         maxvalue of 2^63-1 and -1 for ascending and descending sequences,
         respectively.
 
        :param nominvalue: no minimum value of the sequence.  This
         value is used when the CREATE SEQUENCE command is emitted to
         the database as the value of the "NO MINVALUE" clause.  If ``None``,
         the clause is omitted, which on most platforms indicates a
         minvalue of 1 and -2^63-1 for ascending and descending sequences,
         respectively.
 
        :param nomaxvalue: no maximum value of the sequence.  This
         value is used when the CREATE SEQUENCE command is emitted to
         the database as the value of the "NO MAXVALUE" clause.  If ``None``,
         the clause is omitted, which on most platforms indicates a
         maxvalue of 2^63-1 and -1 for ascending and descending sequences,
         respectively.
 
        :param cycle: allows the sequence to wrap around when the maxvalue
         or minvalue has been reached by an ascending or descending sequence
         respectively.  This value is used when the CREATE SEQUENCE command
         is emitted to the database as the "CYCLE" clause.  If the limit is
         reached, the next number generated will be the minvalue or maxvalue,
         respectively.  If cycle=False (the default) any calls to nextval
         after the sequence has reached its maximum value will return an
         error.
 
        :param schema: optional schema name for the sequence, if located
         in a schema other than the default.  The rules for selecting the
         schema name when a :class:`_schema.MetaData`
         is also present are the same
         as that of :paramref:`_schema.Table.schema`.
 
        :param cache: optional integer value; number of future values in the
         sequence which are calculated in advance.  Renders the CACHE keyword
         understood by Oracle and PostgreSQL.
 
        :param order: optional boolean value; if ``True``, renders the
         ORDER keyword, understood by Oracle, indicating the sequence is
         definitively ordered.   May be necessary to provide deterministic
         ordering using Oracle RAC.
 
        :param data_type: The type to be returned by the sequence, for
         dialects that allow us to choose between INTEGER, BIGINT, etc.
         (e.g., mssql).
 
         .. versionadded:: 1.4.0
 
        :param optional: boolean value, when ``True``, indicates that this
         :class:`.Sequence` object only needs to be explicitly generated
         on backends that don't provide another way to generate primary
         key identifiers.  Currently, it essentially means, "don't create
         this sequence on the PostgreSQL backend, where the SERIAL keyword
         creates a sequence for us automatically".
        :param quote: boolean value, when ``True`` or ``False``, explicitly
         forces quoting of the :paramref:`_schema.Sequence.name` on or off.
         When left at its default of ``None``, normal quoting rules based
         on casing and reserved words take place.
        :param quote_schema: Set the quoting preferences for the ``schema``
         name.
 
        :param metadata: optional :class:`_schema.MetaData` object which this
         :class:`.Sequence` will be associated with.  A :class:`.Sequence`
         that is associated with a :class:`_schema.MetaData`
         gains the following
         capabilities:
 
         * The :class:`.Sequence` will inherit the
           :paramref:`_schema.MetaData.schema`
           parameter specified to the target :class:`_schema.MetaData`, which
           affects the production of CREATE / DROP DDL, if any.
 
         * The :meth:`.Sequence.create` and :meth:`.Sequence.drop` methods
           automatically use the engine bound to the :class:`_schema.MetaData`
           object, if any.
 
         * The :meth:`_schema.MetaData.create_all` and
           :meth:`_schema.MetaData.drop_all`
           methods will emit CREATE / DROP for this :class:`.Sequence`,
           even if the :class:`.Sequence` is not associated with any
           :class:`_schema.Table` / :class:`_schema.Column`
           that's a member of this
           :class:`_schema.MetaData`.
 
         The above behaviors can only occur if the :class:`.Sequence` is
         explicitly associated with the :class:`_schema.MetaData`
         via this parameter.
 
         .. seealso::
 
            :ref:`sequence_metadata` - full discussion of the
            :paramref:`.Sequence.metadata` parameter.
 
        :param for_update: Indicates this :class:`.Sequence`, when associated
         with a :class:`_schema.Column`,
         should be invoked for UPDATE statements
         on that column's table, rather than for INSERT statements, when
         no value is otherwise present for that column in the statement.
 
        r`rN)rár¼rr"r(rarrZrbÚ    constructrÀreÚ_keyÚ _set_metadatar+r)r~rar
r r r rrrrbrrrrrÂrÀrÃrar\r\r]r¼ss:ö    
 zSequence.__init__zsqlalchemy.sql.functionsz Function[int]r‚cCstjjj |¡S)z´Return a :class:`.next_value` function element
        which will render the appropriate increment function
        for this :class:`.Sequence` within any SQL expression.
 
        )r2rþZ sql_functionsÚfuncÚ
next_valuer…r\r\r]r)szSequence.next_valuer#rr)c s.|}t|tƒst‚tƒ |¡| |j¡dSrm)rnrorØr×r+rŽrÒ©r~r*rlr"râr\r]r+2s zSequence._set_parentcCsDt|j|j|j|j|j|j|j|j|j    |j
|j |j |j |j|jdS)N)rar
r r r rrrrbrrrrrÀra)rrar
r r r rrrrbrrrrrÀrar…r\r\r]rA8s"ñzSequence._copyrvrRrØcCs| |j¡dSrm)rrÀ)r~r"rpr\r\r]rÒKszSequence._set_tablerÍrÕcCs||_||jj|j<dSrm)rÀÚ
_sequencesr)r~rÀr\r\r]rNszSequence._set_metadatar,r-cCs|jtj||ddS)z&Creates this sequence in the database.r0Nr1r3r\r\r]r4RszSequence.createcCs|jtj||ddS)z&Drops this sequence from the database.r0Nr5r3r\r\r]r6Wsz Sequence.dropr cCst d|jj¡‚dS)NzœThis %s cannot be used directly as a column expression.  Use func.next_value(sequence) to produce a 'next value' function that's usable as a column element.)r0r¹rãrVr…r\r\r]Ú_not_a_column_expr\s
ýÿzSequence._not_a_column_expr)NNNNNNNNNNNFNNNF)T)T)rVrWrXrŒrrÞr–r¼r2rrr+rArÒrr4r6rrPr\r\râr]rKs@
 î27rc@sŽeZdZUdZdZdZdZdZdZde    d<ddddœd    d
„Z
dddœd d „Z dd œdd„Z dddœdd„Z ddddœdd„Zdd œdd„ZdS)rSaŸA marker for a transparent database-side default.
 
    Use :class:`.FetchedValue` when the database is configured
    to provide some automatic default for a column.
 
    E.g.::
 
        Column('foo', Integer, FetchedValue())
 
    Would indicate that some trigger or default generator
    will create a new value for the ``foo`` column during an
    INSERT.
 
    .. seealso::
 
        :ref:`triggered_columns`
 
    TFržr"r¸rxrâcCs
||_dSrmr`rãr\r\r]r¼‚szFetchedValue.__init__cCs||jkr|S| |¡SdSrm)raÚ_clonerãr\r\r]rj…s
zFetchedValue._as_for_updater‚cCs
t|jƒSrm)rSrar…r\r\r]rA‹szFetchedValue._copyr7cCs4|j |j¡}|j |j¡|j dd¡||_|S)Nr")rãr­r‡r¬r¶ra)r~raÚnr\r\r]rŽs
zFetchedValue._cloner#rr)cKs4|}t|tƒst‚||_|jr(||j_n||j_dSrm)rnrorØr"rarVrrr\r\r]r+•s 
zFetchedValue._set_parentr^cCs
t |¡Srmr„r…r\r\r]r†žszFetchedValue.__repr__N)F)rVrWrXrŒríÚ    reflectedÚ has_argumentrßrìr–r¼rjrArr+r†r\r\r\r]rSes
    csNeZdZdZdZddddddœ‡fdd    „ Zdd
œd d „Zd d
œdd„Z‡ZS)rka>A DDL-specified DEFAULT column value.
 
    :class:`.DefaultClause` is a :class:`.FetchedValue`
    that also generates a "DEFAULT" clause when
    "CREATE TABLE" is emitted.
 
    :class:`.DefaultClause` is generated automatically
    whenever the ``server_default``, ``server_onupdate`` arguments of
    :class:`_schema.Column` are used.  A :class:`.DefaultClause`
    can be passed positionally as well.
 
    For example, the following::
 
        Column('foo', Integer, server_default="50")
 
    Is equivalent to::
 
        Column('foo', Integer, DefaultClause("50"))
 
    TFz%Union[str, ClauseElement, TextClause]r¸rx)rïraÚ
_reflectedrccs0t |tttfd¡tƒ |¡||_||_dS)Nrï)    r2Zassert_arg_typer^r%r)r×r¼rïr!)r~rïrar#râr\r]r¼ºs zDefaultClause.__init__r‚cCst|j|j|jdS)N)rïrar#)rkrïrar!r…r\r\r]rAÅs
ÿzDefaultClause._copyr^cCsd|j|jfS)Nz DefaultClause(%r, for_update=%r)rûr…r\r\r]r†ÊszDefaultClause.__repr__)FF)    rVrWrXrŒr"r¼rAr†rPr\r\râr]rk¢sü rkc @s¨eZdZUdZdZded<ded<d'd    d
d d d d ddddœ    dd„Zddddœdd„Zeddœdd„ƒZ    ddddœdd„Z
e   dd ¡dd!d"œd#d$„ƒZ dd!d"œd%d&„ZdS)(Ú
ConstraintarA table-level SQL constraint.
 
    :class:`_schema.Constraint` serves as the base class for the series of
    constraint objects that can be associated with :class:`_schema.Table`
    objects, including :class:`_schema.PrimaryKeyConstraint`,
    :class:`_schema.ForeignKeyConstraint`
    :class:`_schema.UniqueConstraint`, and
    :class:`_schema.CheckConstraint`.
 
    rðÚintrêr¸rENFr²rÏr_r\r‘rrx)    rarµr¶rƒrÉÚ _create_rulerDr¸rcc    KsF||_||_||_|r||_||_||_t |¡| |¡||_    dS)aËCreate a SQL constraint.
 
        :param name:
          Optional, the in-database name of this ``Constraint``.
 
        :param deferrable:
          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
          issuing DDL for this constraint.
 
        :param initially:
          Optional string.  If set, emit INITIALLY <value> when issuing DDL
          for this constraint.
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param comment: Optional string that will render an SQL comment on
          foreign key constraint creation.
 
            .. versionadded:: 2.0
 
        :param \**dialect_kw:  Additional keyword arguments are dialect
            specific, and passed in the form ``<dialectname>_<argname>``.  See
            the documentation regarding an individual dialect at
            :ref:`dialect_toplevel` for detail on documented arguments.
 
        :param _create_rule:
          used internally by some datatypes that also create constraints.
 
        :param _type_bound:
          used internally to indicate that this constraint is associated with
          a specific datatype.
 
        N)
rarµr¶rƒr&rDr2rmrþrÉ)    r~rarµr¶rƒrÉr&rDr¸r\r\r]r¼ßs.
 
zConstraint.__init__r?)ÚcompilerrlrccKsL|jdk    r| |¡sdS|jdk    rD|jjt |¡|dfd|i|—ŽSdSdS)NFr'T)r&rZ_should_executerZCreateConstraint)r~r'rlr\r\r]Ú_should_create_for_compilers
ÿÿÿz&Constraint._should_create_for_compilerrRr‚cCs<zt|jtƒr|jWSWntk
r,YnXt d¡‚dS)NzdThis constraint is not bound to a table.  Did you mean to call table.append_constraint(constraint) ?)rnr*rRr|r0r¹r…r\r\r]rp$s  ÿzConstraint.tabler#r)cKs(t|ttfƒst‚||_|j |¡dSrm)rnrRrorØr*r¡rrÓr\r\r]r+0szConstraint._set_parentr©zaThe :meth:`_schema.Constraint.copy` method is deprecated and will be removed in a future release.r7rcKs |jf|ŽSrmrr‘r\r\r]rˆ5szConstraint.copycKs
tƒ‚dSrmrär‘r\r\r]rA=szConstraint._copy)NNNNNNF)rVrWrXrŒrr–r¼r(rMrpr+r2rOrˆrAr\r\r\r]r$Îs,
 ø 9  þr$c@s¸eZdZUdZded<dZded<er8ddd    d
œd d „Zd dddœddddd    dœdd„Zd&dd    dœdd„Z    e
j ddœdd„ƒZ e
j ddœdd„ƒZ dd d!œd"d#„Zddd    d
œd$d%„ZdS)'ÚColumnCollectionMixinz«A :class:`_expression.ColumnCollection` of :class:`_schema.Column`
    objects.
 
    This collection represents the columns which are referred to by
    this object.
 
    rœrFz'List[Optional[Union[str, Column[Any]]]]Ú_pending_colargsr#rrxr)cKsdSrmr\rÓr\r\r]r{Rsz/ColumnCollectionMixin._set_parent_with_dispatchTN)Ú _autoattachrEÚ_gather_expressionsr:r¸z.Optional[List[Union[str, ColumnElement[Any]]]])r¥r+rEr,rcc    Gsz||_tƒ|_|}|dk    rTg|_t tj|¡D]"\}}}}|j |¡| |¡q.ndd„|Dƒ|_|rv|jrv|     ¡dS)NcSsg|]}t tj|¡‘qSr\)rr«rÚDDLConstraintColumnRole)rñr"r\r\r]rùtsÿz2ColumnCollectionMixin.__init__.<locals>.<listcomp>)
rEr rr*rZ expect_col_expression_collectionrr-r@Ú _check_attach)    r~r+rEr,r¥Zprocessed_expressionsr<r“Z add_elementr\r\r]r¼Ws,    þÿû þ
zColumnCollectionMixin.__init__)ràrcc
s"dd„ˆjDƒ}dd„|Dƒ}t|ƒ |¡‰ˆrŒ|r<tdƒ‚dd„ˆjDƒ |¡}|sŒddd    d
œ‡‡fd d „ }ˆˆ_ˆD]}| |¡qxdS|}d d„|Dƒ}t|ƒdkrºˆ | ¡¡ndt|ƒdkrˆj    s|dj
‰‡fdd„|dd…Dƒ}    |    rt   dd  dd„|    Dƒ¡ˆjf¡‚dS)NcSsg|]}t|tƒr|‘qSr\©rnrorør\r\r]rù}s
z7ColumnCollectionMixin._check_attach.<locals>.<listcomp>cSsg|]}t|jtƒr|‘qSr\)rnrprRrør\r\r]rùs z#Should not reach here on event callcSsh|]}|dk    r|’qSrmr\rør\r\r]ró‰sz6ColumnCollectionMixin._check_attach.<locals>.<setcomp>rvrRrxrØcs(t|tƒr$ˆ |¡ˆs$ˆjdddS)NT)rà)rnrRÚdiscardr.)r"rp)Ú cols_wo_tabler~r\r]Ú _col_attachedŽs
 
z:ColumnCollectionMixin._check_attach.<locals>._col_attachedcSsh|]
}|j’qSr\r„rør\r\r]róžsrrcsg|]}|jˆk    r|‘qSr\r„rør„r\r]rù£s
z(Column(s) %s are not part of table '%s'.rcss|]}d|VqdS©z'%s'Nr\rør\r\r]Ú    <genexpr>¨sz6ColumnCollectionMixin._check_attach.<locals>.<genexpr>)r*rÙÚ
differencerØZ_cols_wo_tablerŽrÅr{r¶Ú_allow_multiple_tablesrpr0r}rr)
r~ràZcol_objsZ cols_w_tableZhas_string_colsr2rHr¥r·Zothersr\)r1r~rpr]r.|s> ÿþ      
þÿÿz#ColumnCollectionMixin._check_attachr¤r‚cCs
|j ¡Srm©rZ as_readonlyr…r\r\r]r¥­szColumnCollectionMixin.columnscCs
|j ¡Srmr7r…r\r\r]rr±szColumnCollectionMixin.czUnion[Table, Column[Any]]zList[Optional[Column[Any]]])r*rcc sžtˆtƒr4dd„|jDƒ}t|ƒt|jƒks0t‚|Sz‡fdd„|jDƒWStk
r˜}z0t d|jj    ›dˆj
›d|j d›d¡|‚W5d}~XYnXdS)    NcSsg|]}t|tƒr|‘qSr\r/rør\r\r]rù¹s
z:ColumnCollectionMixin._col_expressions.<locals>.<listcomp>cs$g|]}t|tƒrˆj|n|‘qSr\)rnr^rr©rñrH©r*r\r]rùÀsÿz Can't create z  on table 'z': no column named 'rz ' is present.) rnror*rÅrØÚKeyErrorr0ZConstraintColumnNotFoundErrorrãrVrrz)r~r*ÚresultZker\r9r]Ú_col_expressionsµs 
ÿ
þ"ÿüz&ColumnCollectionMixin._col_expressionscKs:t|ttfƒst‚| |¡D]}|dk    r|j |¡qdSrm)rnrRrorØr<rrrür\r\r]r+Ësz!ColumnCollectionMixin._set_parent)F)rVrWrXrŒr–r6rr{r¼r.r2rNr¥rrr<r+r\r\r\r]r)As"
ù%1r)c @sÖeZdZUdZddddddddœdddd    d
d d d d ddœ
dd„Zded<dd ddœdd„Zd d dœdd„Ze     dd¡ddœdd ddœd d!„ƒZ
ddœdd ddœd"d#„Z d$d d%œd&d'„Z d(d)œd*d+„Z d,d)œd-d.„ZdS)/ÚColumnCollectionConstraintz-A constraint that proxies a ColumnCollection.NTF)rarµr¶rƒr+rEr,r:r²rÏr_r\r¸z"Optional[List[_DDLColumnArgument]]rrx)
r¥rarµr¶rƒr+rEr,r¸rcc
Os8tj|f||||dœ|    —Žtj|f|ž||dœŽdS)al
        :param \*columns:
          A sequence of column names or Column objects.
 
        :param name:
          Optional, the in-database name of this constraint.
 
        :param deferrable:
          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
          issuing DDL for this constraint.
 
        :param initially:
          Optional string.  If set, emit INITIALLY <value> when issuing DDL
          for this constraint.
 
        :param \**dialect_kw: other keyword arguments including
          dialect-specific arguments are propagated to the :class:`.Constraint`
          superclass.
 
        ©rarµr¶rƒ)r+rEN)r$r¼r))
r~rarµr¶rƒr+rEr,r¥r¸r\r\r]r¼Ös$ ÿûúÿÿÿz#ColumnCollectionConstraint.__init__r¤r¥r#r)cKs.t|ttfƒst‚t ||¡t ||¡dSrm)rnrorRrØr$r+r)rÓr\r\r]r+s z&ColumnCollectionConstraint._set_parent)rrccCs
||jkSrm)r)r~rr\r\r]Ú __contains__ sz'ColumnCollectionConstraint.__contains__r©zqThe :meth:`_schema.ColumnCollectionConstraint.copy` method is deprecated and will be removed in a future release.©rjrg©rjrlrccKs|jfd|i|—ŽS©Nrjr©r~rjrlr\r\r]rˆs zColumnCollectionConstraint.copyc     sŒi}ˆjD]2}ˆj|j}| ¡D]\}}|||d|<q"q
tˆjtƒsNt‚ˆj‡‡fdd„ˆjDƒˆj    ˆj
ˆj ˆj dœ|—Ž}ˆ  |¡S)Nr“csg|]}t|ˆjˆƒ‘qSr\)rur*r;©r~rjr\r]rù4sÿz4ColumnCollectionConstraint._copy.<locals>.<listcomp>)rarµr¶rÉ)r”r•r–rnr*rRrØrãrrarµr¶rÉr‹)    r~rjrlZconstraint_kwargsršr”r›rœrrr\rDr]rAs0
 ýþ
ÿ þýø    ÷ z ColumnCollectionConstraint._copyrv©rHrccCs |j |¡S)zïReturn True if this constraint contains the given column.
 
        Note that this object also contains an attribute ``.columns``
        which is a :class:`_expression.ColumnCollection` of
        :class:`_schema.Column` objects.
 
        )rÚcontains_column©r~rHr\r\r]rF=s    z*ColumnCollectionConstraint.contains_columnzIterator[Column[Any]]r‚cCs
t|jƒSrm)Úiterrr…r\r\r]Ú__iter__Hsz#ColumnCollectionConstraint.__iter__r%cCs
t|jƒSrm)rÅrr…r\r\r]Ú__len__Ksz"ColumnCollectionConstraint.__len__)rVrWrXrŒr¼r–r+r?r2rOrˆrArFrIrJr\r\r\r]r=Ós.
÷$,þý ý  r=csžeZdZdZdZdZedddƒd!d    d
d d d dddddddœ ‡fdd„ ƒZeddœdd„ƒZ    e
  dd¡ddœd dddœdd„ƒZ ddœd dddœdd „Z ‡ZS)"ÚCheckConstraintzlA table- or column-level CHECK constraint.
 
    Can be included in the definition of a Table or Column.
    TZ table_or_column_check_constraintÚsqltextz:class:`.CheckConstraint`z$:paramref:`.CheckConstraint.sqltext`NFz#_TextCoercedExpressionArgument[Any]r²rÏr_rgr\r‘r¸rrx) rLrarµr¶rprƒr&r+rDr¸rcc
 
sbt tj|¡|_g} t |jid| ji¡tƒj    | ||||||    |dœ|
—Ž|dk    r^| 
|¡dS)aªConstruct a CHECK constraint.
 
        :param sqltext:
         A string containing the constraint definition, which will be used
         verbatim, or a SQL expression construct.   If given as a string,
         the object is converted to a :func:`_expression.text` object.
         If the textual
         string includes a colon character, escape this using a backslash::
 
           CheckConstraint(r"foo ~ E'a(?\:b|c)d")
 
        :param name:
          Optional, the in-database name of the constraint.
 
        :param deferrable:
          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
          issuing DDL for this constraint.
 
        :param initially:
          Optional string.  If set, emit INITIALLY <value> when issuing DDL
          for this constraint.
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        r")rarµr¶r&rƒrDr+N) rr«rÚDDLExpressionRolerLrZtraverser@r×r¼r{) r~rLrarµr¶rprƒr&r+rDr¸r¥râr\r]r¼Ys"-ùù    ÷ zCheckConstraint.__init__r‚cCst|jtƒ Srm)rnr*rRr…r\r\r]Úis_column_level˜szCheckConstraint.is_column_levelr©zfThe :meth:`_schema.CheckConstraint.copy` method is deprecated and will be removed in a future release.r@rAcKs|jfd|i|—ŽSrBrrCr\r\r]rˆœszCheckConstraint.copyc KsP|dk    rt|j|j|ƒ}n|j}t||j|j|j|j||jd|j    d    }| 
|¡S)NF)rar¶rµr&rprÉr+rD) rurLrprKrar¶rµr&rÉrDr‹)r~rjrlrLrrr\r\r]rA¦s÷ zCheckConstraint._copy)NNNNNNTF)rVrWrXrŒr6rr$r¼rMrNr2rOrˆrArPr\r\râr]rKOs6ýö*:þÿÿrKc@s$eZdZUdZdZd8dddddddd    d    dd
d dd d dœdd„Zddd dœdd„Zded<ded<eddœdd„ƒZ    eddœdd„ƒZ
ed dœd!d"„ƒZ d d d#œd$d%„Z ed&dœd'd(„ƒZ ed)dœd*d+„ƒZd,d d d-œd.d/„Ze d0d1¡ddd2œdd
d dd3œd4d5„ƒZddd2œdd
d dd3œd6d7„ZdS)9rBa¾A table-level FOREIGN KEY constraint.
 
    Defines a single column or composite FOREIGN KEY ... REFERENCES
    constraint. For a no-frills, single column foreign key, adding a
    :class:`_schema.ForeignKey` to the definition of a :class:`_schema.Column`
    is a
    shorthand equivalent for an unnamed, single column
    :class:`_schema.ForeignKeyConstraint`.
 
    Examples of foreign key configuration are in :ref:`metadata_foreignkeys`.
 
    Zforeign_key_constraintNFz$_typing_Sequence[_DDLColumnArgument]r²r_rÏr¸rgr\rrx)r¥Ú
refcolumnsrarUr´rµr¶r³rŒr·rprƒrÉr¸rcc sÌtjˆf|||| | dœ|—Ž|ˆ_|ˆ_|    ˆ_|ˆ_|
ˆ_tt|ƒƒt|ƒkrztt|ƒƒt|ƒkrpt     
d¡‚n
t     
d¡‚‡fdd„|Dƒˆ_ t jˆf|žŽ| dk    rÈt ˆdƒr¾| ˆjks¾t‚ˆ | ¡dS)a Construct a composite-capable FOREIGN KEY.
 
        :param columns: A sequence of local column names. The named columns
          must be defined and present in the parent Table. The names should
          match the ``key`` given to each column (defaults to the name) unless
          ``link_to_name`` is True.
 
        :param refcolumns: A sequence of foreign column names or Column
          objects. The columns must all be located within the same Table.
 
        :param name: Optional, the in-database name of the key.
 
        :param onupdate: Optional string. If set, emit ON UPDATE <value> when
          issuing DDL for this constraint. Typical values include CASCADE,
          DELETE and RESTRICT.
 
        :param ondelete: Optional string. If set, emit ON DELETE <value> when
          issuing DDL for this constraint. Typical values include CASCADE,
          DELETE and RESTRICT.
 
        :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
          DEFERRABLE when issuing DDL for this constraint.
 
        :param initially: Optional string. If set, emit INITIALLY <value> when
          issuing DDL for this constraint.
 
        :param link_to_name: if True, the string name given in ``column`` is
          the rendered name of the referenced column, not its locally assigned
          ``key``.
 
        :param use_alter: If True, do not emit the DDL for this constraint as
          part of the CREATE TABLE definition. Instead, generate it via an
          ALTER TABLE statement issued after the full collection of tables
          have been created, and drop it via an ALTER TABLE statement before
          the full collection of tables are dropped.
 
          The use of :paramref:`_schema.ForeignKeyConstraint.use_alter` is
          particularly geared towards the case where two or more tables
          are established within a mutually-dependent foreign key constraint
          relationship; however, the :meth:`_schema.MetaData.create_all` and
          :meth:`_schema.MetaData.drop_all`
          methods will perform this resolution
          automatically, so the flag is normally not needed.
 
          .. seealso::
 
                :ref:`use_alter`
 
        :param match: Optional string. If set, emit MATCH <value> when issuing
          DDL for this constraint. Typical values include SIMPLE, PARTIAL
          and FULL.
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param comment: Optional string that will render an SQL comment on
          foreign key constraint creation.
 
            .. versionadded:: 2.0
 
        :param \**dialect_kw:  Additional keyword arguments are dialect
          specific, and passed in the form ``<dialectname>_<argname>``.  See
          the documentation regarding an individual dialect at
          :ref:`dialect_toplevel` for detail on documented arguments.
 
        )rarµr¶rƒrÉzOForeignKeyConstraint with duplicate source column references are not supported.z_ForeignKeyConstraint number of constrained columns must match the number of referenced columns.csBg|]:}t|fˆˆjˆjˆjˆjˆjˆjˆjˆjdœ    ˆj    —Ž‘qS))    r¤rarUr´r³rŒr·rµr¶)
r|rarUr´r³rŒr·rµr¶r_)rñZrefcolr…r\r]rùFs óÿö õz1ForeignKeyConstraint.__init__.<locals>.<listcomp>Nr*)r$r¼rUr´rŒr³r·rÅrÙr0r}Úelementsr)rcr*rØr{)r~r¥rOrarUr´rµr¶r³rŒr·rprƒrÉr¸r\r…r]r¼Îs@Tÿúù    ÿÿ
 
ò
zForeignKeyConstraint.__init__rvr|)r"rzrccCs|j |¡|j |¡dSrm)rrrPr@ryr\r\r]rÙ]s z$ForeignKeyConstraint._append_elementr¤r¥zList[ForeignKey]rPz!util.OrderedDict[str, ForeignKey]r‚cCst t|j|jƒ¡Srm)r2Ú OrderedDictÚzipÚ column_keysrPr…r\r\r]Ú    _elementsrszForeignKeyConstraint._elementscCs|jD] }|jSdSrm)rPrC)r~Úelemr\r\r]rCws
 
z%ForeignKeyConstraint._referred_schemarRcCs|jdjjS)aKThe :class:`_schema.Table` object to which this
        :class:`_schema.ForeignKeyConstraint` references.
 
        This is a dynamically calculated attribute which may not be available
        if the constraint and/or parent table is not yet associated with
        a metadata collection that contains the referred table.
 
        r)rPr"rpr…r\r\r]Úreferred_table~s
z#ForeignKeyConstraint.referred_tablercCsVdd„|jDƒ}d|krRt|ƒdkrRt|ƒdd…\}}t d|j|j||f¡‚dS)NcSsh|] }| ¡’qSr\)rÁ)rñrUr\r\r]ró‹sz<ForeignKeyConstraint._validate_dest_table.<locals>.<setcomp>rrr.zJForeignKeyConstraint on %s(%s) refers to multiple remote tables: %s and %s)rPrÅrîr0r}rÛÚ_col_description)r~rpZ
table_keysZelem0Zelem1r\r\r]rÔŠsþÿz)ForeignKeyConstraint._validate_dest_tablez_typing_Sequence[str]cCs(t|dƒr|j ¡Sdd„|jDƒSdS)aReturn a list of string keys representing the local
        columns in this :class:`_schema.ForeignKeyConstraint`.
 
        This list is either the original string arguments sent
        to the constructor of the :class:`_schema.ForeignKeyConstraint`,
        or if the constraint has been initialized with :class:`_schema.Column`
        objects, is the string ``.key`` of each element.
 
        r*cSs$g|]}t|tƒr|jnt|ƒ‘qSr\)rnr'rqr^r8r\r\r]rù¢sÿz4ForeignKeyConstraint.column_keys.<locals>.<listcomp>N)rcrÚkeysr*r…r\r\r]rS”s
 
 
þz ForeignKeyConstraint.column_keysr^cCs d |j¡S)Nr)rrSr…r\r\r]rW§sz%ForeignKeyConstraint._col_descriptionr#r)cKsn|}t|tƒst‚t ||¡t ||¡t|j|jƒD]&\}}t    |dƒrT|j
|k    r8|  |¡q8|  |¡dS)Nr*) rnrRrØr$r+r=rRrrPrcr*r{rÔ)r~r*rlrprHrzr\r\r]r+«s   z ForeignKeyConstraint._set_parentr©zkThe :meth:`_schema.ForeignKeyConstraint.copy` method is deprecated and will be removed in a future release.r:)rbrjrlrccKs|jf||dœ|—ŽS)Nr:r)r~rbrjrlr\r\r]rˆ¸s zForeignKeyConstraint.copyc sztdd„|jDƒ‡‡fdd„|jDƒ|j|j|j|j|j|j|j|j    |j
d }t |j|jƒD]\}}|  |¡q\|  |¡S)NcSsg|] }|jj‘qSr\)r*rqrr\r\r]rùÎsz.ForeignKeyConstraint._copy.<locals>.<listcomp>cs<g|]4}|jˆˆdk    r.| ¡|jjjkr.ˆjnddd‘qS)NT)rbr»r¼)rºrÁr*rprqrarr:r\r]rùÏs    øÿþú)    rarUr´r³rµr¶rŒr·rÉ) rBrPrarUr´r³rµr¶rŒr·rÉrRr‹)r~rbrjrlròZself_fkZother_fkr\r:r]rAÆs$     ÷ ë zForeignKeyConstraint._copy) NNNNNFFNNNN)rVrWrXrŒrr¼rÙr–rMrTrCrVrÔrSrWr+r2rOrˆrAr\r\r\r]rB¾sP
 ò,  
 þü ürBc
s¢eZdZdZdZddddddœddddd    d
d d d œ‡fdd„Zdd d dœ‡fdd„ Zdd dœdd„Zdd dœdd„Ze    ddœdd„ƒZ
e j d dœd!d"„ƒZ ‡ZS)#r˜a«
A table-level PRIMARY KEY constraint.
 
    The :class:`.PrimaryKeyConstraint` object is present automatically
    on any :class:`_schema.Table` object; it is assigned a set of
    :class:`_schema.Column` objects corresponding to those marked with
    the :paramref:`_schema.Column.primary_key` flag::
 
        >>> my_table = Table('mytable', metadata,
        ...                 Column('id', Integer, primary_key=True),
        ...                 Column('version_id', Integer, primary_key=True),
        ...                 Column('data', String(50))
        ...     )
        >>> my_table.primary_key
        PrimaryKeyConstraint(
            Column('id', Integer(), table=<mytable>,
                   primary_key=True, nullable=False),
            Column('version_id', Integer(), table=<mytable>,
                   primary_key=True, nullable=False)
        )
 
    The primary key of a :class:`_schema.Table` can also be specified by using
    a :class:`.PrimaryKeyConstraint` object explicitly; in this mode of usage,
    the "name" of the constraint can also be specified, as well as other
    options which may be recognized by dialects::
 
        my_table = Table('mytable', metadata,
                    Column('id', Integer),
                    Column('version_id', Integer),
                    Column('data', String(50)),
                    PrimaryKeyConstraint('id', 'version_id',
                                         name='mytable_pk')
                )
 
    The two styles of column-specification should generally not be mixed.
    An warning is emitted if the columns present in the
    :class:`.PrimaryKeyConstraint`
    don't match the columns that were marked as ``primary_key=True``, if both
    are present; in this case, the columns are taken strictly from the
    :class:`.PrimaryKeyConstraint` declaration, and those columns otherwise
    marked as ``primary_key=True`` are ignored.  This behavior is intended to
    be backwards compatible with previous behavior.
 
    For the use case where specific options are to be specified on the
    :class:`.PrimaryKeyConstraint`, but the usual style of using
    ``primary_key=True`` flags is still desirable, an empty
    :class:`.PrimaryKeyConstraint` may be specified, which will take on the
    primary key column collection from the :class:`_schema.Table` based on the
    flags::
 
        my_table = Table('mytable', metadata,
                    Column('id', Integer, primary_key=True),
                    Column('version_id', Integer, primary_key=True),
                    Column('data', String(50)),
                    PrimaryKeyConstraint(name='mytable_pk',
                                         mssql_clustered=True)
                )
 
    Zprimary_key_constraintNF)rarµr¶rƒrÑr:r_rÏr\r¸rrx)r¥rarµr¶rƒrÑr¸rccs&||_tƒj|||||dœ|—ŽdS)Nr>)rÑr×r¼)r~rarµr¶rƒrÑr¥r¸râr\r]r¼'s
ûúzPrimaryKeyConstraint.__init__r#r)c
s|}t|tƒst‚tƒ |¡|j|k    rH|j |j¡||_|j |¡dd„|j    Dƒ}|j
rÌ|rÌt |ƒt |j
ƒkrÌt   d|jd dd„|Dƒ¡d dd„|j
Dƒ¡d dd„|j
Dƒ¡f¡g|dd…<|j
D]}d    |_|jtkrÒd
|_qÒ|rþ|j
 |¡dS) NcSsg|]}|jr|‘qSr\)r™rør\r\r]rùEsz4PrimaryKeyConstraint._set_parent.<locals>.<listcomp>zÇTable '%s' specifies columns %s as primary_key=True, not matching locally specified columns %s; setting the current primary key columns to %s. This warning may become an exception in a future releasercss|]}d|jVqdSr3r÷rør\r\r]r4Rsz3PrimaryKeyConstraint._set_parent.<locals>.<genexpr>css|]}d|jVqdSr3r÷rør\r\r]r4Sscss|]}d|jVqdSr3r÷rør\r\r]r4TsTF)rnrRrØr×r+r™r¡r0rrrrrÙr2r?rarrer[rÚextend)r~r*rlrpZ    table_pksrrrâr\r]r+;s< 
 ÿþýüüÿ 
 
z PrimaryKeyConstraint._set_parentzIterable[Column[Any]])r¥rccCs8|D]
}d|_q|j |¡tj |¡| |j¡dS)aKrepopulate this :class:`.PrimaryKeyConstraint` given
        a set of columns.
 
        Existing columns in the table that are marked as primary_key=True
        are maintained.
 
        Also fires a new event.
 
        This is basically like putting a whole new
        :class:`.PrimaryKeyConstraint` object on the parent
        :class:`_schema.Table` object without actually replacing the object.
 
        The ordering of the given list of columns is also maintained; these
        columns will be appended to the list of columns after any which
        are already present.
 
        TN)r™rrYr˜rÚ_resetr{rp)r~r¥rHr\r\r]Ú_reload`s
  zPrimaryKeyConstraint._reloadrvrEcCs*tj |¡|j |¡|j ||¡dSrm)r˜rrZrrtr‰Z'_sa_event_column_added_to_pk_constraintrGr\r\r]r…}s  zPrimaryKeyConstraint._replacezList[Column[Any]]r‚cs6|j‰ˆdk    r(ˆg‡fdd„|jDƒSt|jƒSdS)Ncsg|]}|ˆk    r|‘qSr\r\rø©Úautoincr\r]rùˆsz>PrimaryKeyConstraint.columns_autoinc_first.<locals>.<listcomp>)rrrbr…r\r\r]Úcolumns_autoinc_firstƒsz*PrimaryKeyConstraint.columns_autoinc_firstrcCs´ddddœdd„}t|jƒdkrdt|jƒd}|jdkrF||dƒ|S|jd    kr^||d
ƒr^|SdSnLd}|jD]<}|jdkrn||dƒ|dk    r¦t d |j|jf¡‚qn|}qn|SdS) Nrvr¸)rHÚ autoinc_truerccSs˜|jjdks&t|jjtjjtjjfƒsF|r@t d|j|f¡‚q”dSnNt|j    tdƒt
fƒsb|sbdS|j dk    r€t|j t ƒs€|s€dS|j r”|jdkr”dSdS)NzGColumn type %s on column '%s' is not compatible with autoincrement=TrueF)TÚ    ignore_fkT)rhZ_type_affinityÚ
issubclassrr¯Z NUMERICTYPEr0r}rnrwrrr˜r›rS)rHr_r\r\r]Ú_validate_autoincŽs8þþÿÿÿþÿ
þýzEPrimaryKeyConstraint._autoincrement_column.<locals>._validate_autoincrrT)rQr`FzGOnly one Column may be marked autoincrement=True, found both %s and %s.)rÅrrbrSr0r}ra)r~rbrHr]r\r\r]rŒs.!
 
 
ý
 
 
 
þÿz*PrimaryKeyConstraint._autoincrement_column)rVrWrXrŒrr¼r+r[r…rMr^r2rNrrPr\r\râr]r˜és;ù$%r˜c@seZdZdZdZdS)r†aA table-level UNIQUE constraint.
 
    Defines a single column or composite UNIQUE constraint. For a no-frills,
    single column constraint, adding ``unique=True`` to the ``Column``
    definition is a shorthand equivalent for an unnamed, single column
    UniqueConstraint.
    Zunique_constraintN)rVrWrXrŒrr\r\r\r]r†Îsr†c @s¢eZdZUdZdZded<ded<ded<d    d
d
d
d    d œd d ddddddddœ    dd„Zddddœdd„Zd$ddddœdd„Zd%ddddœdd„Z    d d!œd"d#„Z
d
S)&rFaÇA table-level INDEX.
 
    Defines a composite (one or more column) INDEX.
 
    E.g.::
 
        sometable = Table("sometable", metadata,
                        Column("name", String(50)),
                        Column("address", String(100))
                    )
 
        Index("some_index", sometable.c.name)
 
    For a no-frills, single column index, adding
    :class:`_schema.Column` also supports ``index=True``::
 
        sometable = Table("sometable", metadata,
                        Column("name", String(50), index=True)
                    )
 
    For a composite index, multiple columns can be specified::
 
        Index("some_index", sometable.c.name, sometable.c.address)
 
    Functional indexes are supported as well, typically by using the
    :data:`.func` construct in conjunction with table-bound
    :class:`_schema.Column` objects::
 
        Index("some_index", func.lower(sometable.c.name))
 
    An :class:`.Index` can also be manually associated with a
    :class:`_schema.Table`,
    either through inline declaration or using
    :meth:`_schema.Table.append_constraint`.  When this approach is used,
    the names
    of the indexed columns can be specified as strings::
 
        Table("sometable", metadata,
                        Column("name", String(50)),
                        Column("address", String(100)),
                        Index("some_index", "name", "address")
                )
 
    To support functional or expression-based indexes in this form, the
    :func:`_expression.text` construct may be used::
 
        from sqlalchemy import text
 
        Table("sometable", metadata,
                        Column("name", String(50)),
                        Column("address", String(100)),
                        Index("some_index", text("lower(name)"))
                )
 
    .. seealso::
 
        :ref:`schema_indexes` - General information on :class:`.Index`.
 
        :ref:`postgresql_indexes` - PostgreSQL-specific options available for
        the :class:`.Index` construct.
 
        :ref:`mysql_indexes` - MySQL-specific options available for the
        :class:`.Index` construct.
 
        :ref:`mssql_indexes` - MSSQL-specific options available for the
        :class:`.Index` construct.
 
    rJrgrpz0_typing_Sequence[Union[str, ColumnElement[Any]]]Ú expressionsz$_typing_Sequence[ColumnElement[Any]]rGFN)r=rÂrƒr>rEr_r:r¸rÏr\rrx)    rarcr=rÂrƒr>rEr¸rcc
Osxd|_}    t ||¡|_||_|dk    r,||_|dk    r8|}    | |¡g|_tj    |f|ž||jdœŽ|    dk    rt| 
|    ¡dS)avConstruct an index object.
 
        :param name:
          The name of the index
 
        :param \*expressions:
          Column expressions to include in the index.   The expressions
          are normally instances of :class:`_schema.Column`, but may also
          be arbitrary SQL expressions which ultimately refer to a
          :class:`_schema.Column`.
 
        :param unique=False:
            Keyword only argument; if True, create a unique index.
 
        :param quote=None:
            Keyword only argument; whether to apply quoting to the name of
            the index.  Works in the same manner as that of
            :paramref:`_schema.Column.quote`.
 
        :param info=None: Optional data dictionary which will be populated
            into the :attr:`.SchemaItem.info` attribute of this object.
 
        :param \**dialect_kw: Additional keyword arguments not mentioned above
            are dialect specific, and passed in the form
            ``<dialectname>_<argname>``. See the documentation regarding an
            individual dialect at :ref:`dialect_toplevel` for detail on
            documented arguments.
 
        N)rEr,) rpr(rrar=rƒrþrcr)r¼r+)
r~rar=rÂrƒr>rErcr¸rpr\r\r]r¼(s&(
 
ÿþüzIndex.__init__r#r)c    KsÞ|}t|tƒst‚t ||¡|jdk    rN||jk    rNt d|j|jj    |j    f¡‚||_|j
  |¡|j }|  |¡}t|ƒt|ƒks„t‚g}t||ƒD]:\}}t|tƒr°| |¡q’|dk    rÄ| |¡q’ds’t‚q’||_ |_dS)NzKIndex '%s' is against table '%s', and cannot be associated with table '%s'.F)rnrRrØr)r+rpr0r}rarr¢rrcr<rÅrRr%r@rG)    r~r*rlrprcZcol_expressionsÚexprsr<Zcolexprr\r\r]r+js, þÿ 
 
 
zIndex._set_parentr,r-cCs|jtj||ddS)zäIssue a ``CREATE`` statement for this
        :class:`.Index`, using the given
        :class:`.Connection` or :class:`.Engine`` for connectivity.
 
        .. seealso::
 
            :meth:`_schema.MetaData.create_all`.
 
        r0Nr1r3r\r\r]r4†s
z Index.createcCs|jtj||ddS)zßIssue a ``DROP`` statement for this
        :class:`.Index`, using the given
        :class:`.Connection` or :class:`.Engine` for connectivity.
 
        .. seealso::
 
            :meth:`_schema.MetaData.drop_all`.
 
        r0Nr5r3r\r\r]r6’s
z
Index.dropr^r‚cCs6dd t|jƒgdd„|jDƒ|jr,dgp.g¡S)Nz    Index(%s)rcSsg|] }t|ƒ‘qSr\r)rñÚer\r\r]rù¤sz"Index.__repr__.<locals>.<listcomp>z unique=True)rrrarcr=r…r\r\r]r†žs
ÿþÿÿzIndex.__repr__)F)F) rVrWrXrŒrr–r¼r+r4r6r†r\r\r\r]rFÚs
Eø"B  rFÚixzix_%(column_0_label)szutil.immutabledict[str, str]ÚDEFAULT_NAMING_CONVENTIONc @seZdZUdZdZd<dddddd    œd
d „Zd ed <ddœdd„Zdddœdd„Zdddddœdd„Z    ddddœdd„Z
ddœdd „Z ddd!œd"d#„Z ddœd$d%„Z ddd&œd'd(„Zed)dœd*d+„ƒZe d,¡d=d/ddd0dddd1dd2œ    d3d4„ƒZd>d5d6ddd7œd8d9„Zd?d5d6ddd7œd:d;„ZdS)@rÍaDA collection of :class:`_schema.Table`
    objects and their associated schema
    constructs.
 
    Holds a collection of :class:`_schema.Table` objects as well as
    an optional binding to an :class:`_engine.Engine` or
    :class:`_engine.Connection`.  If bound, the :class:`_schema.Table` objects
    in the collection and their columns may participate in implicit SQL
    execution.
 
    The :class:`_schema.Table` objects themselves are stored in the
    :attr:`_schema.MetaData.tables` dictionary.
 
    :class:`_schema.MetaData` is a thread-safe object for read operations.
    Construction of new tables within a single :class:`_schema.MetaData`
    object,
    either explicitly or via reflection, may not be completely thread-safe.
 
    .. seealso::
 
        :ref:`metadata_describing` - Introduction to database metadata
 
    rÀNr_rÏzOptional[Dict[str, str]]r\rx)rbrÃÚnaming_conventionrƒrccCsv|dk    r(t|tƒs(t dt|ƒ›d¡‚t ¡|_t     ||¡|_
|rH|nt |_ |rX||_ tƒ|_i|_t t¡|_dS)aCreate a new MetaData object.
 
        :param schema:
           The default schema to use for the :class:`_schema.Table`,
           :class:`.Sequence`, and potentially other objects associated with
           this :class:`_schema.MetaData`. Defaults to ``None``.
 
           .. seealso::
 
                :ref:`schema_metadata_schema_name` - details on how the
                :paramref:`_schema.MetaData.schema` parameter is used.
 
                :paramref:`_schema.Table.schema`
 
                :paramref:`.Sequence.schema`
 
        :param quote_schema:
            Sets the ``quote_schema`` flag for those :class:`_schema.Table`,
            :class:`.Sequence`, and other objects which make usage of the
            local ``schema`` name.
 
        :param info: Optional data dictionary which will be populated into the
            :attr:`.SchemaItem.info` attribute of this object.
 
        :param naming_convention: a dictionary referring to values which
          will establish default naming conventions for :class:`.Constraint`
          and :class:`.Index` objects, for those objects which are not given
          a name explicitly.
 
          The keys of this dictionary may be:
 
          * a constraint or Index class, e.g. the :class:`.UniqueConstraint`,
            :class:`_schema.ForeignKeyConstraint` class, the :class:`.Index`
            class
 
          * a string mnemonic for one of the known constraint classes;
            ``"fk"``, ``"pk"``, ``"ix"``, ``"ck"``, ``"uq"`` for foreign key,
            primary key, index, check, and unique constraint, respectively.
 
          * the string name of a user-defined "token" that can be used
            to define new naming tokens.
 
          The values associated with each "constraint class" or "constraint
          mnemonic" key are string naming templates, such as
          ``"uq_%(table_name)s_%(column_0_name)s"``,
          which describe how the name should be composed.  The values
          associated with user-defined "token" keys should be callables of the
          form ``fn(constraint, table)``, which accepts the constraint/index
          object and :class:`_schema.Table` as arguments, returning a string
          result.
 
          The built-in names are as follows, some of which may only be
          available for certain types of constraint:
 
            * ``%(table_name)s`` - the name of the :class:`_schema.Table`
              object
              associated with the constraint.
 
            * ``%(referred_table_name)s`` - the name of the
              :class:`_schema.Table`
              object associated with the referencing target of a
              :class:`_schema.ForeignKeyConstraint`.
 
            * ``%(column_0_name)s`` - the name of the :class:`_schema.Column`
              at
              index position "0" within the constraint.
 
            * ``%(column_0N_name)s`` - the name of all :class:`_schema.Column`
              objects in order within the constraint, joined without a
              separator.
 
            * ``%(column_0_N_name)s`` - the name of all
              :class:`_schema.Column`
              objects in order within the constraint, joined with an
              underscore as a separator.
 
            * ``%(column_0_label)s``, ``%(column_0N_label)s``,
              ``%(column_0_N_label)s`` - the label of either the zeroth
              :class:`_schema.Column` or all :class:`.Columns`, separated with
              or without an underscore
 
            * ``%(column_0_key)s``, ``%(column_0N_key)s``,
              ``%(column_0_N_key)s`` - the key of either the zeroth
              :class:`_schema.Column` or all :class:`.Columns`, separated with
              or without an underscore
 
            * ``%(referred_column_0_name)s``, ``%(referred_column_0N_name)s``
              ``%(referred_column_0_N_name)s``,  ``%(referred_column_0_key)s``,
              ``%(referred_column_0N_key)s``, ...  column tokens which
              render the names/keys/labels of columns that are referenced
              by a  :class:`_schema.ForeignKeyConstraint`.
 
            * ``%(constraint_name)s`` - a special key that refers to the
              existing name given to the constraint.  When this key is
              present, the :class:`.Constraint` object's existing name will be
              replaced with one that is composed from template string that
              uses this token. When this token is present, it is required that
              the :class:`.Constraint` is given an explicit name ahead of time.
 
            * user-defined: any additional token may be implemented by passing
              it along with a ``fn(constraint, table)`` callable to the
              naming_convention dictionary.
 
          .. versionadded:: 1.3.0 - added new ``%(column_0N_name)s``,
             ``%(column_0_N_name)s``, and related tokens that produce
             concatenations of names, keys, or labels for all columns referred
             to by a given constraint.
 
          .. seealso::
 
                :ref:`constraint_naming_conventions` - for detailed usage
                examples.
 
        Nz-expected schema argument to be a string, got rd)rnr^r0r}rhr2Z
FacadeDictr·r(rrbrgrhrƒrÙÚ_schemasrÚ collectionsÚ defaultdictrbr‹)r~rbrÃrhrƒr\r\r]r¼Ês yÿ
ÿýþzMetaData.__init__zutil.FacadeDict[str, Table]r·r^r‚cCsdS)Nz
MetaData()r\r…r\r\r]r†iszMetaData.__repr__zUnion[str, Table]r¸)Ú table_or_keyrccCst|tƒs|j}||jkSrm)rnr^rqr·)r~rlr\r\r]r?ls
zMetaData.__contains__rR)rarbrprccCs,t||ƒ}|j ||¡|r(|j |¡dSrm)rer·Z _insert_itemrir)r~rarbrprqr\r\r]r»qs
zMetaData._add_tabler`cCsXt||ƒ}t |j|d¡}|dk    r8|jD]}| |¡q(|jrTdd„|j ¡Dƒ|_dS)NcSsh|]}|jdk    r|j’qSrmr)rñÚtr\r\r]ró€s
z)MetaData._remove_table.<locals>.<setcomp>)reÚdictr¶r·r›r×riro)r~rarbrqÚremovedrzr\r\r]r¿ys
 
 ÿzMetaData._remove_tablezDict[str, Any]cCs|j|j|j|j|j|jdœS)N)r·rbÚschemasÚ    sequencesÚfk_memosrh)r·rbrirr‹rhr…r\r\r]Ú __getstate__„súzMetaData.__getstate__)r”rccCs@|d|_|d|_|d|_|d|_|d|_|d|_dS)Nr·rbrhrqrprr)r·rbrhrrir‹)r~r”r\r\r]Ú __setstate__Žs 
 
 
 
 
zMetaData.__setstate__cCs$t |j¡|j ¡|j ¡dS)z+Clear all Table objects from this MetaData.N)rnÚclearr·rir‹r…r\r\r]ru–s 
zMetaData.clearrcCs| |j|j¡dS)z1Remove the given Table object from this MetaData.N)r¿rarbr r\r\r]rûszMetaData.removez List[Table]cCst t|j ¡dd„d¡S)a®Returns a list of :class:`_schema.Table` objects sorted in order of
        foreign key dependency.
 
        The sorting will place :class:`_schema.Table`
        objects that have dependencies
        first, before the dependencies themselves, representing the
        order in which they can be created.   To get the order in which
        the tables would be dropped, use the ``reversed()`` Python built-in.
 
        .. warning::
 
            The :attr:`.MetaData.sorted_tables` attribute cannot by itself
            accommodate automatic resolution of dependency cycles between
            tables, which are usually caused by mutually dependent foreign key
            constraints. When these cycles are detected, the foreign keys
            of these tables are omitted from consideration in the sort.
            A warning is emitted when this condition occurs, which will be an
            exception raise in a future release.   Tables which are not part
            of the cycle will still be returned in dependency order.
 
            To resolve these cycles, the
            :paramref:`_schema.ForeignKeyConstraint.use_alter` parameter may be
            applied to those constraints which create a cycle.  Alternatively,
            the :func:`_schema.sort_tables_and_constraints` function will
            automatically return foreign key constraints in a separate
            collection when cycles are detected so that they may be applied
            to a schema separately.
 
            .. versionchanged:: 1.3.17 - a warning is emitted when
               :attr:`.MetaData.sorted_tables` cannot perform a proper sort
               due to cyclical dependencies.  This will be an exception in a
               future release.  Additionally, the sort will continue to return
               other tables not involved in the cycle in dependency order which
               was not the case previously.
 
        .. seealso::
 
            :func:`_schema.sort_tables`
 
            :func:`_schema.sort_tables_and_constraints`
 
            :attr:`_schema.MetaData.tables`
 
            :meth:`_reflection.Inspector.get_table_names`
 
            :meth:`_reflection.Inspector.get_sorted_table_and_fkc_names`
 
 
        cSs|jSrmrí)rmr\r\r]rëÖrìz(MetaData.sorted_tables.<locals>.<lambda>rí)rZ sort_tablesrîr·ror…r\r\r]Ú sorted_tables¢s3ÿzMetaData.sorted_tableszsqlalchemy.engine.reflectionFTrärÐr)    r.rbÚviewsÚonlyr¯rÅrÆr_rcc s t |¡ ¡}    |    ˆ||tƒdœ}
|
 |¡ˆdkr<ˆj‰ˆdk    rLˆ|
d<tjjj    j
} t  |      ˆ¡¡‰|r²tjjj    j } ˆ |     ˆ¡¡zˆ |     ˆ¡¡Wntk
r°YnXˆdk    rÔt  ‡fdd„ˆDƒ¡} nˆ} tˆjƒ‰ˆdkr‡‡fdd„tˆ| ƒDƒ} n†tˆƒr2‡‡‡‡fdd„tˆ| ƒDƒ} n\‡fdd„ˆDƒ}|rzˆrZd    ˆp\d
}t d |j|d  |¡f¡‚‡‡fd d„ˆDƒ} |    jfˆ| ˆ| tjjjj dœ|—Ž}||
d<| D]R}zt|ˆf|
ŽWn8tjk
r }zt d||f¡W5d}~XYnXq¾W5QRXdS)a.Load all available table definitions from the database.
 
        Automatically creates ``Table`` entries in this ``MetaData`` for any
        table available in the database but not yet present in the
        ``MetaData``.  May be called multiple times to pick up tables recently
        added to the database, however no special action is taken if a table
        in this ``MetaData`` no longer exists in the database.
 
        :param bind:
          A :class:`.Connection` or :class:`.Engine` used to access the
          database.
 
        :param schema:
          Optional, query and reflect tables from an alternate schema.
          If None, the schema associated with this :class:`_schema.MetaData`
          is used, if any.
 
        :param views:
          If True, also reflect views (materialized and plain).
 
        :param only:
          Optional.  Load only a sub-set of available named tables.  May be
          specified as a sequence of names or a callable.
 
          If a sequence of names is provided, only those tables will be
          reflected.  An error is raised if a table is requested but not
          available.  Named tables already present in this ``MetaData`` are
          ignored.
 
          If a callable is provided, it will be used as a boolean predicate to
          filter the list of potential table names.  The callable is called
          with a table name and this ``MetaData`` instance as positional
          arguments and should return a true value for any table to reflect.
 
        :param extend_existing: Passed along to each :class:`_schema.Table` as
          :paramref:`_schema.Table.extend_existing`.
 
        :param autoload_replace: Passed along to each :class:`_schema.Table`
          as
          :paramref:`_schema.Table.autoload_replace`.
 
        :param resolve_fks: if True, reflect :class:`_schema.Table`
         objects linked
         to :class:`_schema.ForeignKey` objects located in each
         :class:`_schema.Table`.
         For :meth:`_schema.MetaData.reflect`,
         this has the effect of reflecting
         related tables that might otherwise not be in the list of tables
         being reflected, for example if the referenced table is in a
         different schema or is omitted via the
         :paramref:`.MetaData.reflect.only` parameter.  When False,
         :class:`_schema.ForeignKey` objects are not followed to the
         :class:`_schema.Table`
         in which they link, however if the related table is also part of the
         list of tables that would be reflected in any case, the
         :class:`_schema.ForeignKey` object will still resolve to its related
         :class:`_schema.Table` after the :meth:`_schema.MetaData.reflect`
         operation is
         complete.   Defaults to True.
 
         .. versionadded:: 1.3.0
 
         .. seealso::
 
            :paramref:`_schema.Table.resolve_fks`
 
        :param \**dialect_kwargs: Additional keyword arguments not mentioned
         above are dialect specific, and passed in the form
         ``<dialectname>_<argname>``.  See the documentation regarding an
         individual dialect at :ref:`dialect_toplevel` for detail on
         documented arguments.
 
        .. seealso::
 
            :ref:`metadata_reflection_toplevel`
 
            :meth:`_events.DDLEvents.column_reflect` - Event used to customize
            the reflected columns. Usually used to generalize the types using
            :meth:`_types.TypeEngine.as_generic`
 
            :ref:`metadata_reflection_dbagnostic_types` - describes how to
            reflect tables using general types.
 
        )rÄr¯rÅrÆrÌNrbcsg|]}ˆ›d|›‘qS)rdr\©rñrarr\r]rùYsz$MetaData.reflect.<locals>.<listcomp>cs g|]\}}ˆs|ˆkr|‘qSr\r\©rñraZschname©Úcurrentr¯r\r]rùasþcs*g|]"\}}ˆs|ˆkrˆ|ˆƒr|‘qSr\r\rz)r|r¯rxr~r\r]rùgs
 
ýcsg|]}|ˆkr|‘qSr\r\ry)Ú    availabler\r]rùnsz  schema '%s'r€zACould not reflect: requested table(s) not available in %r%s: (%s)rcsg|]}ˆs|ˆkr|‘qSr\r\ryr{r\r]rùusþ)rbZ filter_namesr}ÚkindZscoperÓzSkipping table %s: %s)r1rçrèrÙr¬rbr2rþZengine_reflectionZ
ObjectKindZTABLEZ
OrderedSetZget_table_namesÚANYZget_view_namesZget_materialized_view_namesrår·rRrôr0r¹ÚenginerZ_get_reflection_infoZ ObjectScoperRZUnreflectableTableErrorr?)r~r.rbrwrxr¯rÅrÆr_réZ reflect_optsr~Zavailable_w_schemaÚloadÚmissingÚsrÓraZuerrr\)r}r|r¯rxrbr~r]ÚreflectÙs~aû
 ÿ ÿ
 
 þ
þÿÿ þ
ûúzMetaData.reflectr,z!Optional[_typing_Sequence[Table]])r.r·r/rccCs|jtj|||ddS)aDCreate all tables stored in this metadata.
 
        Conditional by default, will not attempt to recreate tables already
        present in the target database.
 
        :param bind:
          A :class:`.Connection` or :class:`.Engine` used to access the
          database.
 
        :param tables:
          Optional list of ``Table`` objects, which is a subset of the total
          tables in the ``MetaData`` (others are ignored).
 
        :param checkfirst:
          Defaults to True, don't issue CREATEs for tables already present
          in the target database.
 
        ©r/r·Nr1©r~r.r·r/r\r\r]Ú
create_allŒs ÿzMetaData.create_allcCs|jtj|||ddS)a?Drop all tables stored in this metadata.
 
        Conditional by default, will not attempt to drop tables not present in
        the target database.
 
        :param bind:
          A :class:`.Connection` or :class:`.Engine` used to access the
          database.
 
        :param tables:
          Optional list of ``Table`` objects, which is a subset of the
          total tables in the ``MetaData`` (others are ignored).
 
        :param checkfirst:
          Defaults to True, only issue DROPs for tables confirmed to be
          present in the target database.
 
        r…Nr5r†r\r\r]Údrop_all¨s ÿzMetaData.drop_all)NNNN)NFNFTT)NT)NT)rVrWrXrŒrr¼r–r†r?r»r¿rsrtrurûrMrvr2rr„r‡rˆr\r\r\r]rͯsD
û 
6ø"6üürÍc@sœeZdZUdZdZded<edddƒd"d    d
d d œd d„ƒZddd dœdd„Zdddœdd„Z    e
  dd¡ddœddddœdd„ƒZ ddœddddœd d!„Z dS)#r—aDefines a generated column, i.e. "GENERATED ALWAYS AS" syntax.
 
    The :class:`.Computed` construct is an inline construct added to the
    argument list of a :class:`_schema.Column` object::
 
        from sqlalchemy import Computed
 
        Table('square', metadata_obj,
            Column('side', Float, nullable=False),
            Column('area', Float, Computed('side * side'))
        )
 
    See the linked documentation below for complete details.
 
    .. versionadded:: 1.3.11
 
    .. seealso::
 
        :ref:`computed_ddl`
 
    Zcomputed_columnržr"rLz:class:`.Computed`z:paramref:`.Computed.sqltext`Nr:rÏrx)rLÚ    persistedrccCs t tj|¡|_||_d|_dS)a Construct a GENERATED ALWAYS AS DDL construct to accompany a
        :class:`_schema.Column`.
 
        :param sqltext:
          A string containing the column generation expression, which will be
          used verbatim, or a SQL expression construct, such as a
          :func:`_expression.text`
          object.   If given as a string, the object is converted to a
          :func:`_expression.text` object.
 
        :param persisted:
          Optional, controls how this column should be persisted by the
          database.   Possible values are:
 
          * ``None``, the default, it will use the default persistence
            defined by the database.
          * ``True``, will render ``GENERATED ALWAYS AS ... STORED``, or the
            equivalent for the target database if supported.
          * ``False``, will render ``GENERATED ALWAYS AS ... VIRTUAL``, or
            the equivalent for the target database if supported.
 
          Specifying ``True`` or ``False`` may raise an error when the DDL
          is emitted to the target database if the database does not support
          that persistence option.   Leaving this parameter at its default
          of ``None`` is guaranteed to succeed for all databases that support
          ``GENERATED ALWAYS AS``.
 
        N)rr«rrMrLr‰r")r~rLr‰r\r\r]r¼às"zComputed.__init__r#rr)cKs`t|tƒst‚t|jtdƒtfƒr6t|jtdƒtfƒs@t d¡‚||_    ||_
||j    _||j    _dS)NzPA generated column cannot specify a server_default or a server_onupdate argument) rnrorØrrhr—rVr0r}r"rfrÓr\r\r]r+s
ÿþÿzComputed._set_parentr¸rSrâcCs|Srmr\rãr\r\r]rjszComputed._as_for_updater©z_The :meth:`_schema.Computed.copy` method is deprecated and will be removed in a future release.r@rgrAcKs|jfd|i|—ŽSrBrrCr\r\r]rˆsz Computed.copycKs8t|j|jdk    r|jjnd|ƒ}t||jd}| |¡S)N)r‰)rurLr"rpr—r‰r‹)r~rjrlrLÚgr\r\r]rA"sýzComputed._copy)N)rVrWrXrŒrr–r$r¼r+rjr2rOrˆrAr\r\r\r]r—Ås(
ÿÿ#þÿÿr—c@sŒeZdZdZdZdZddddddddddddd    d
œ d d „Zd dd    dœdd„Zdddœdd„Ze     
dd¡dddœdd„ƒZ dddœdd„Z dS)r˜aDefines an identity column, i.e. "GENERATED { ALWAYS | BY DEFAULT }
    AS IDENTITY" syntax.
 
    The :class:`.Identity` construct is an inline construct added to the
    argument list of a :class:`_schema.Column` object::
 
        from sqlalchemy import Identity
 
        Table('foo', metadata_obj,
            Column('id', Integer, Identity())
            Column('description', Text),
        )
 
    See the linked documentation below for complete details.
 
    .. versionadded:: 1.4
 
    .. seealso::
 
        :ref:`identity_ddl`
 
    Zidentity_columnTFNr¸rÏr    rx) ÚalwaysÚon_nullr
r r r rrrrrrcc Cs4tj||||||||    |
| d
||_||_d|_dS)ahConstruct a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY DDL
        construct to accompany a :class:`_schema.Column`.
 
        See the :class:`.Sequence` documentation for a complete description
        of most parameters.
 
        .. note::
            MSSQL supports this construct as the preferred alternative to
            generate an IDENTITY on a column, but it uses non standard
            syntax that only support :paramref:`_schema.Identity.start`
            and :paramref:`_schema.Identity.increment`.
            All other parameters are ignored.
 
        :param always:
          A boolean, that indicates the type of identity column.
          If ``False`` is specified, the default, then the user-specified
          value takes precedence.
          If ``True`` is specified, a user-specified value is not accepted (
          on some backends, like PostgreSQL, OVERRIDING SYSTEM VALUE, or
          similar, may be specified in an INSERT to override the sequence
          value).
          Some backends also have a default value for this parameter,
          ``None`` can be used to omit rendering this part in the DDL. It
          will be treated as ``False`` if a backend does not have a default
          value.
 
        :param on_null:
          Set to ``True`` to specify ON NULL in conjunction with a
          ``always=False`` identity column. This option is only supported on
          some backends, like Oracle.
 
        :param start: the starting index of the sequence.
        :param increment: the increment value of the sequence.
        :param minvalue: the minimum value of the sequence.
        :param maxvalue: the maximum value of the sequence.
        :param nominvalue: no minimum value of the sequence.
        :param nomaxvalue: no maximum value of the sequence.
        :param cycle: allows the sequence to wrap around when the maxvalue
         or minvalue has been reached.
        :param cache: optional integer value; number of future values in the
         sequence which are calculated in advance.
        :param order: optional boolean value; if true, renders the
         ORDER keyword.
 
        rN)rr¼r‹rŒr") r~r‹rŒr
r r r rrrrrr\r\r]r¼Ks;ö zIdentity.__init__r#rr)cKsvt|tƒst‚t|jtdƒtfƒr2t|jtdƒƒs<t d¡‚|j    dkrPt d¡‚||_
||_ |j t krld|_||_dS)Nz^A column with an Identity object cannot specify a server_default or a server_onupdate argumentFzCA column with an Identity object cannot specify autoincrement=False)rnrorØrrhr˜rVr0r}rSr"rrer[rrÓr\r\r]r+–s&
ÿþÿ
ÿ
zIdentity._set_parentrSrâcCs|Srmr\rãr\r\r]rj¬szIdentity._as_for_updater©z_The :meth:`_schema.Identity.copy` method is deprecated and will be removed in a future release.rcKs |jf|ŽSrmrr‘r\r\r]rˆ¯sz Identity.copyc Ks>t|j|j|j|j|j|j|j|j|j    |j
|j d }|  |¡S)N) r‹rŒr
r r r rrrrr) r˜r‹rŒr
r r r rrrrrr‹)r~rlÚir\r\r]rA·sõzIdentity._copy) FNNNNNNNNNN) rVrWrXrŒrrìr¼r+rjr2rOrˆrAr\r\r\r]r˜/s.ô&Kþr˜)NN)’rŒÚ
__future__rÚabcrrjÚenumrÚoperatorrKrrrrr    r
r r r rrrrlrrrrrr€rrrrrÚbaserrrrr r!r"r#r$rPr%r&r'r(r)r r*r+r,r-r/r0r1r2r3Z util.typingr4r5r6r7r8Ú_typingr9r:r;r<r=r>r'r?r@Z    functionsrArBrCrDr€rErFZengine.interfacesrGrHrIZ engine.mockrJZengine.reflectionrKZsql.selectablerLrMrOrQr,r^r²Z_ServerDefaultArgumentrTrYr–rZr[reruZ_self_inspectsZ    VisitablerPrr—Z InspectablerRrorXr|r rÜrÝÚ
attrgetterrárirõr°rýrórrðrrSrkr$r)r=rKrBr˜r†rFZ immutabledictrgrÍr—r˜r\r\r\r]Ú<module>sp                                                                            ÿ%þ
þ
þ
    -3
ÿ-þû24
 
 
?Y& 49<,s|o-f
ÿQÿ j