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
U
¸ý°d²(ã@s*dZddlmZddlZddlmZddlZddlmZddlZddl    Z    ddl
m Z ddl
m Z ddl
m Z dd    l
mZdd
l
mZdd l
mZdd l
mZdd l
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
mZddl
m 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%l#m,Z,d&d'l!m-Z-d&d(l!m.Z.d&d)l!m/Z/d&d*l/m0Z0d&d+l/m1Z1d&d,l/m
Z2d&d-l3m4Z4d&d.l3m5Z5d&d/l3m6Z6er®dd0l!m7Z7dd1l!m8Z8dd2l!m9Z9dd3l:m;Z;dd4l:m<Z<dd5l=m>Z>dd6l8m?Z?dd7l8m@Z@dd8l8mAZAdd9l8mBZBdd:l8mCZCdd;l8mDZDdd<l8mEZEdd=l8mFZFdd>lGmHZHdd?lGmIZIdd@lJmKZKddAlJmLZLddBlJmMZMd&dClNmOZOd&dDlNmPZPd&dElQmRZRd&dFlQmSZSd&dGlQmTZTd&dHlQmUZUd&dIlQmVZVd&dJlQmWZWd&dKlQmXZXd&dLlQmYZYd&dMlQmZZZd&dNlQm[Z[d&dOl-m\Z\esÀdZ7dZ8dZ9GdPdQ„dQeƒZ]e]j^Z^GdRdS„dSeƒZ_e_j`ZaedTe dUZbedVe dWe fdUZceededfZeGdXdY„dYeƒZfe gdZ¡ZhGd[d\„d\e4ƒZiGd]d^„d^e4ƒZjd_d`daœdbdc„Zkedde dUZlGdedf„dfƒZmGdgdh„dhemƒZndidjdkœdldm„Zodndodkœdpdq„ZpedrdsdUZqGdtds„dse2j4ƒZrdVdVduœdvdw„Zsdxd_dydzœd{d|„Ztd}d~„Zudddkœd€d„Zvddd‚dƒœd„d…„Zwddd‚dƒœd†d‡„ZxGdˆd‰„d‰eede fƒZyGdŠd‹„d‹eede fƒZze/ {dŒ¡ddŽ„ƒZ|Gdd„dƒZ}Gd‘d’„d’ƒZ~Gd“d”„d”e0ƒZGd•d–„d–e0ƒZ€Gd—d˜„d˜eƒZGd™dš„dše‚ƒZƒGd›dœ„dœeƒdZ„GdždŸ„dŸe„e%ƒZ…Gd d¡„d¡e(ƒZ†Gd¢d£„d£e"j‡ƒZˆGd¤d¥„d¥e-j‰ƒZŠGd¦d§„d§e)ƒZ‹Gd¨d©„d©eƒZŒGdªd«„d«eƒZed¬e dedfedƒZŽed­d®d¯d°Zed±d²dUZGd³d´„d´eeƒZ‘Gdµd¶„d¶eeŽefƒZ’ed·d¸dUZ“Gd¹dº„dºe’ede“fƒZ”Gd»d¼„d¼e/j•e’eŽefƒZ–Gd½d¾„d¾e/j—d¿ƒZ˜dÀd\dÁœdÂdÄZ™e^fdÀdxdÄdÅdƜdÇdȄZšdS)Éz4Foundational utilities common to many sql modules.
 
é)Ú annotationsN)ÚEnum©Ú zip_longest)ÚAny)ÚCallable)Úcast)ÚDict)Ú    FrozenSet)ÚGeneric)ÚIterable)ÚIterator)ÚList)ÚMapping)ÚMutableMapping)Ú
NamedTuple)ÚNoReturn)ÚOptional)Úoverload)ÚSequence)ÚSet)ÚTuple)ÚType)Ú TYPE_CHECKING)ÚTypeVar)ÚUnioné)Úroles)Úvisitors)Ú HasCacheKey)ÚMemoizedHasCacheKey)ÚHasCopyInternals)Ú ClauseVisitor)ÚExtendedInternalTraversal)ÚExternallyTraversible)ÚInternalTraversalé)Úevent)Úexc)Úutil)Ú HasMemoized)Ú hybridmethod)Útyping)ÚProtocol)ÚSelf)Ú    TypeGuard)Ú    coercions©Úelements)Útype_api)ÚDMLStrategyArgument)ÚSynchronizeSessionArgument)Ú_CLE)Ú BindParameter)Ú
ClauseList)Ú ColumnClause)Ú ColumnElement)ÚKeyedColumnElement)Ú NamedColumn)ÚSQLCoreOperations)Ú
TextClause)ÚColumn)ÚDefaultGenerator)Ú_JoinTargetElement)Ú_SelectIterable)Ú
FromClause)Ú
Connection)Ú CursorResult)Ú_CoreMultiExecuteParams)Ú_ExecuteOptions)Ú_ImmutableExecuteOptions)Ú
CacheStats)ÚCompiled)ÚCompiledCacheType)ÚCoreExecuteOptionsParameter)ÚDialect)ÚIsolationLevel)ÚSchemaTranslateMapType)Ú
dispatcherc@seZdZdZdd„ZdS)Ú_NoArgrcCs d|j›S)Nz_NoArg.)Úname©Úself©rUúJd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/sql/base.pyÚ__repr__ksz_NoArg.__repr__N)Ú__name__Ú
__module__Ú __qualname__ÚNO_ARGrWrUrUrUrVrQhsrQc@seZdZdZdS)Ú    _NoneNamerN)rXrYrZÚ    NONE_NAMErUrUrUrVr\rsr\Ú_T)ÚboundÚ_Fn.c@sBeZdZUded<ded<ded<ded<edddœd    d
„ƒZd S) Ú_DefaultDescriptionTuplerÚargzOptional[bool]Ú    is_scalarÚ is_callableÚ is_sentinelzOptional[DefaultGenerator])ÚdefaultÚreturncCs:|r,|js|js,|jr,t|j|j|j|jƒStddddƒS©N)Úhas_argZ
for_updatererarbrcrd)ÚclsrfrUrUrVÚ_from_column_default†s úø    ÷    ÷ü ôz-_DefaultDescriptionTuple._from_column_defaultN)rXrYrZÚ__annotations__Ú classmethodrkrUrUrUrVra€s
raZ_omit_from_statementsc@seZdZdddœdd„ZdS)Ú_EntityNamespaceÚstrúSQLCoreOperations[Any]©ÚkeyrgcCsdSrhrU©rTrrrUrUrVÚ __getattr__žsz_EntityNamespace.__getattr__N)rXrYrZrtrUrUrUrVrnsrnc@s eZdZejddœdd„ƒZdS)Ú_HasEntityNamespacern©rgcCsdSrhrUrSrUrUrVÚentity_namespace£sz$_HasEntityNamespace.entity_namespaceN)rXrYrZr)Úro_non_memoized_propertyrwrUrUrUrVru¢srurzTypeGuard[_HasEntityNamespace])ÚelementrgcCs
t|dƒS)Nrw)Úhasattr)ryrUrUrVÚ_is_has_entity_namespace¨sr{Ú_Selfc@sReZdZdZdZdZdd„Zdd„Zdd    dd
œd d „Zdd œdd    ddœdd„Z    dS)Ú    Immutablea%mark a ClauseElement as 'immutable' when expressions are cloned.
 
    "immutable" objects refers to the "mutability" of an object in the
    context of SQL DQL and DML generation.   Such as, in DQL, one can
    compose a SELECT or subquery of varied forms, but one cannot modify
    the structure of a specific table or column within DQL.
    :class:`.Immutable` is mostly intended to follow this concept, and as
    such the primary "immutable" objects are :class:`.ColumnClause`,
    :class:`.Column`, :class:`.TableClause`, :class:`.Table`.
 
    rUTcOs tdƒ‚dS©Nz(Immutable objects do not support copying©ÚNotImplementedError©rTZ optionaldictÚkwargsrUrUrVÚ unique_paramsÁszImmutable.unique_paramscOs tdƒ‚dSr~rrrUrUrVÚparamsÄszImmutable.paramsr|r)rTÚkwrgcKs|SrhrU©rTr…rUrUrVÚ_cloneÇszImmutable._clone)Ú
omit_attrsz Iterable[str]ÚNone)rˆr…rgcKsdSrhrU)rTrˆr…rUrUrVÚ_copy_internalsÊszImmutable._copy_internalsN)
rXrYrZÚ__doc__Ú    __slots__Z _is_immutablerƒr„r‡rŠrUrUrUrVr}°s ÿr}c@sReZdZUdZdZded<dddddœdd„Zejd    d
œd d „ƒZ    e
d d„ƒZ dS)ÚSingletonConstantz.Represent SQL constants like NULL, TRUE, FALSETÚ
_singletonr^r)rjrbr…rgcOs tt|jƒSrh)rr^rŽ)rjrbr…rUrUrVÚ__new__×szSingletonConstant.__new__zFrozenSet[ColumnElement[Any]]rvcCs
tƒ‚dSrhrrSrUrUrVÚ    proxy_setÚszSingletonConstant.proxy_setcCs(t |¡}| ¡t|gƒ|_||_dSrh)ÚobjectrÚ__init__Ú    frozensetrrŽ)rjÚobjrUrUrVÚ_create_singletonÞs
     z#SingletonConstant._create_singletonN) rXrYrZr‹Z_is_singleton_constantrlrr)Znon_memoized_propertyrrmr•rUrUrUrVrÐs
rzEUnion[ColumnElement[Any], FromClause, TextClause, _JoinTargetElement]zIterator[FromClause]©r2rgcGstj dd„|Dƒ¡S)NcSsg|]
}|j‘qSrU)Ú _from_objects)Ú.0ryrUrUrVÚ
<listcomp>ôsz!_from_objects.<locals>.<listcomp>©Ú    itertoolsÚchainÚ from_iterabler1rUrUrVr—îs ÿr—z!Iterable[roles.ColumnsClauseRole]rBcCstj dd„|Dƒ¡S)zXexpand tables into individual columns in the
    given list of column expressions.
 
    cSsg|]
}|j‘qSrU)Z_select_iterable©r˜ÚcrUrUrVr™sz%_select_iterables.<locals>.<listcomp>ršr1rUrUrVÚ_select_iterablesøs ÿr Ú_SelfGenerativeTypeÚ_GenerativeTypec@seZdZddœdd„ZdS)r¢r.rvcCsdSrhrUrSrUrUrVÚ    _generatesz_GenerativeType._generateN)rXrYrZr£rUrUrUrVr¢s)ÚfnrgcCs.tjddddddœdd„ƒ}||ƒ}||_|S)z”non-caching _generative() decorator.
 
    This is basically the legacy decorator that copies the object and
    runs a method on the new copy.
 
    r`r¡r)r¤rTÚargsr…rgc_s,| ¡}||f|ž|Ž}||ks(tdƒ‚|S)zMark a method as generative.z#generative methods must return self)r£ÚAssertionError)r¤rTr¥r…ÚxrUrUrVÚ _generativesz _generative.<locals>._generative)r)Ú    decoratorZnon_generative)r¤r¨Z    decoratedrUrUrVr¨ s
 
r¨roúCallable[[_Fn], _Fn])Únamesr…rgcsB| di¡‰| di¡‰‡fdd„|Dƒ‰tj‡‡fdd„ƒ}|S)NÚmsgsÚdefaultscs$g|]}|t |¡ˆ |d¡f‘qSrh)ÚoperatorÚ
attrgetterÚget)r˜rR)r­rUrVr™)sÿz&_exclusive_against.<locals>.<listcomp>csb|d}|dd…}ˆD]8\}}}||ƒ|k    rˆ |d|j|jf¡}t |¡‚q||f|ž|ŽS)Nrrz9Method %s() has already been invoked on this %s construct)r°rXÚ    __class__r(ÚInvalidRequestError)r¤r¥r…rTrRÚgetterZdefault_Úmsg)Úgettersr¬rUrVÚcheck.s  
ÿþ z!_exclusive_against.<locals>.check)Úpopr)r©)r«r…r¶rU)r­rµr¬rVÚ_exclusive_against$s  
þr¸cKs |jf|ŽSrh)r‡)ryr…rUrUrVr‡Asr‡zIterable[_CLE]cCstjdd„|DƒŽS)z\expand the given set of ClauseElements to be the set of all 'cloned'
    predecessors.
 
    cSsg|]
}|j‘qSrU)Ú _cloned_set©r˜r§rUrUrVr™Msz"_expand_cloned.<locals>.<listcomp>)r›rœr1rUrUrVÚ_expand_clonedEsr»z    Set[_CLE])ÚaÚbrgcs(tt|ƒƒ t|ƒ¡‰‡fdd„|DƒS)z¬return the intersection of sets a and b, counting
    any overlap between 'cloned' predecessors.
 
    The returned set is in terms of the entities present within 'a'.
 
    csh|]}ˆ |j¡r|’qSrU©Ú intersectionr¹©r˜Úelem©Z all_overlaprUrVÚ    <setcomp>Xs z'_cloned_intersection.<locals>.<setcomp>©Úsetr»r¿©r¼r½rUrÂrVÚ_cloned_intersectionPsrÇcs(tt|ƒƒ t|ƒ¡‰‡fdd„|DƒS)Ncsh|]}ˆ |j¡s|’qSrUr¾rÀrÂrUrVrÃ]s z%_cloned_difference.<locals>.<setcomp>rÄrÆrUrÂrVÚ_cloned_difference[s
ÿrÈc@sHeZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dd„Z
dS)Ú_DialectArgViewzaA dictionary view of dialect-level arguments in the form
    <dialectname>_<argument_name>.
 
    cCs
||_dSrh)r”)rTr”rUrUrVr’hsz_DialectArgView.__init__c
CsNz| dd¡\}}Wn,tk
r@}zt|ƒ|‚W5d}~XYn
X||fSdS)NÚ_r)ÚsplitÚ
ValueErrorÚKeyError)rTrrÚdialectÚ    value_keyÚerrrUrUrVÚ_keyks
z_DialectArgView._keyc
CsZ| |¡\}}z|jj|}Wn.tjk
rL}zt|ƒ|‚W5d}~XYn
X||SdSrh)rÑr”Údialect_optionsr(ÚNoSuchModuleErrorrÍ)rTrrrÎrÏÚoptrÐrUrUrVÚ __getitem__ss z_DialectArgView.__getitem__c
CsVz| |¡\}}Wn.tk
r@}zt d¡|‚W5d}~XYnX||jj||<dS)Nz0Keys must be of the form <dialectname>_<argname>)rÑrÍr(Ú ArgumentErrorr”rÒ)rTrrÚvaluerÎrÏrÐrUrUrVÚ __setitem__}sÿþz_DialectArgView.__setitem__cCs | |¡\}}|jj||=dSrh)rÑr”rÒ)rTrrrÎrÏrUrUrVÚ __delitem__‡sz_DialectArgView.__delitem__cCstdd„|jj ¡DƒƒS)Ncss|]}t|jƒVqdSrh)ÚlenÚ _non_defaults)r˜r¥rUrUrVÚ    <genexpr>Œsÿz*_DialectArgView.__len__.<locals>.<genexpr>)Úsumr”rÒÚvaluesrSrUrUrVÚ__len__‹s
þz_DialectArgView.__len__cs‡fdd„ˆjjDƒS)Nc3s.|]&}ˆjj|jD]}d||fVqqdS)z%s_%sN)r”rÒrÛ)r˜Ú dialect_nameZ
value_namerSrUrVrܒs ÿþz+_DialectArgView.__iter__.<locals>.<genexpr>)r”rÒrSrUrSrVÚ__iter__‘s
þz_DialectArgView.__iter__N) rXrYrZr‹r’rÑrÕrØrÙrßrárUrUrUrVrÉbs
 
rÉc@s@eZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dS)Ú_DialectArgDictz¼A dictionary view of dialect-level arguments for a specific
    dialect.
 
    Maintains a separate collection of user-specified arguments
    and dialect-specified default arguments.
 
    cCsi|_i|_dSrh©rÛÚ    _defaultsrSrUrUrVr’¤sz_DialectArgDict.__init__cCstt|jƒ |j¡ƒSrh)rÚrÅrÛÚunionrärSrUrUrVrߨsz_DialectArgDict.__len__cCstt|jƒ |j¡ƒSrh)ÚiterrÅrÛrårärSrUrUrVrá«sz_DialectArgDict.__iter__cCs"||jkr|j|S|j|SdSrhrãrsrUrUrVrÕ®s
 
z_DialectArgDict.__getitem__cCs||j|<dSrh©rÛ©rTrrr×rUrUrVrØ´sz_DialectArgDict.__setitem__cCs |j|=dSrhrçrsrUrUrVrÙ·sz_DialectArgDict.__delitem__N)
rXrYrZr‹r’rßrárÕrØrÙrUrUrUrVrâ›srâzsqlalchemy.dialectscCs(tjjj |¡}|jdkrdSt|jƒSrh)r)Ú    preloadedZdialectsÚregistryÚloadZconstruct_argumentsÚdict)ràZ dialect_clsrUrUrVÚ_kw_reg_for_dialect»s
ríc@sveZdZdZdZdejfgZedd„ƒZ    e
j dd„ƒZ e dd    „ƒZe
 e¡Zd
d „Ze
j d d „ƒZdddœdd„ZdS)Ú DialectKWArgsa9Establish the ability for a class to have dialect-specific arguments
    with defaults and constructor validation.
 
    The :class:`.DialectKWArgs` interacts with the
    :attr:`.DefaultDialect.construct_arguments` present on a dialect.
 
    .. seealso::
 
        :attr:`.DefaultDialect.construct_arguments`
 
    rUrÒcCs@tj|}|dkr t d|¡‚||kr0i||<||||<dS)a_Add a new kind of dialect-specific keyword argument for this class.
 
        E.g.::
 
            Index.argument_for("mydialect", "length", None)
 
            some_index = Index('a', 'b', mydialect_length=5)
 
        The :meth:`.DialectKWArgs.argument_for` method is a per-argument
        way adding extra arguments to the
        :attr:`.DefaultDialect.construct_arguments` dictionary. This
        dictionary provides a list of argument names accepted by various
        schema-level constructs on behalf of a dialect.
 
        New dialects should typically specify this dictionary all at once as a
        data member of the dialect class.  The use case for ad-hoc addition of
        argument names is typically for end-user code that is also using
        a custom compilation scheme which consumes the additional arguments.
 
        :param dialect_name: name of a dialect.  The dialect must be
         locatable, else a :class:`.NoSuchModuleError` is raised.   The
         dialect must also include an existing
         :attr:`.DefaultDialect.construct_arguments` collection, indicating
         that it participates in the keyword-argument validation and default
         system, else :class:`.ArgumentError` is raised.  If the dialect does
         not include this collection, then any keyword argument can be
         specified on behalf of this dialect already.  All dialects packaged
         within SQLAlchemy include this collection, however for third party
         dialects, support may vary.
 
        :param argument_name: name of the parameter.
 
        :param default: default value of the parameter.
 
        NzRDialect '%s' does have keyword-argument validation and defaults enabled configured)rîÚ _kw_registryr(rÖ)rjràZ argument_namerfÚconstruct_arg_dictionaryrUrUrVÚ argument_forÖs&
ÿÿzDialectKWArgs.argument_forcCst|ƒS)a¤A collection of keyword arguments specified as dialect-specific
        options to this construct.
 
        The arguments are present here in their original ``<dialect>_<kwarg>``
        format.  Only arguments that were actually passed are included;
        unlike the :attr:`.DialectKWArgs.dialect_options` collection, which
        contains all options known by this dialect including defaults.
 
        The collection is also writable; keys are accepted of the
        form ``<dialect>_<kwarg>`` where the value will be assembled
        into the list of options.
 
        .. seealso::
 
            :attr:`.DialectKWArgs.dialect_options` - nested dictionary form
 
        )rÉrSrUrUrVÚdialect_kwargsszDialectKWArgs.dialect_kwargscCs|jS)z4A synonym for :attr:`.DialectKWArgs.dialect_kwargs`.)ròrSrUrUrVr‚szDialectKWArgs.kwargscCsXtj|}tƒ}|dkr*|j ddi¡n*t|jjƒD]}||kr6|j ||¡q6|S)NÚ*)rîrïrâräÚupdateÚreversedr±Ú__mro__)rTràrðÚdrjrUrUrVÚ_kw_reg_for_dialect_cls"s
z%DialectKWArgs._kw_reg_for_dialect_clscCst t |j¡¡S)aìA collection of keyword arguments specified as dialect-specific
        options to this construct.
 
        This is a two-level nested registry, keyed to ``<dialect_name>``
        and ``<argument_name>``.  For example, the ``postgresql_where``
        argument would be locatable as::
 
            arg = my_object.dialect_options['postgresql']['where']
 
        .. versionadded:: 0.9.2
 
        .. seealso::
 
            :attr:`.DialectKWArgs.dialect_kwargs` - flat dictionary form
 
        )r)Ú PopulateDictZportable_instancemethodrørSrUrUrVrÒ.s
ÿzDialectKWArgs.dialect_optionsúDict[str, Any]r‰)r‚rgc    CsÜ|sdS|D]Ê}t d|¡}|s,td|ƒ‚| dd¡\}}z|j|}WnVtjk
r t d||f¡t    ƒ|j|<}|j
  ddi¡|||j |<Yq Xd|krÊ||krÊt  d|||jf¡‚q ||||<q dS)Nz ^(.+?)_(.+)$zGAdditional arguments should be named <dialectname>_<argument>, got '%s'rr&zHCan't validate argument %r; can't locate any SQLAlchemy dialect named %rróz9Argument %r is not accepted by dialect %r on behalf of %r)ÚreÚmatchÚ    TypeErrorÚgrouprÒr(rÓr)ÚwarnrârärôrÛrÖr±)rTr‚ÚkÚmràZarg_namerðr÷rUrUrVÚ_validate_dialect_kwargsEs@ ÿÿþÿÿþ
þÿz&DialectKWArgs._validate_dialect_kwargsN)rXrYrZr‹rŒr%Zdp_dialect_optionsZ"_dialect_kwargs_traverse_internalsrmrñr)Úmemoized_propertyròÚpropertyr‚rùrírïrørÒrrUrUrUrVrîÃs ÿ
/
 
 
 
rîc@s~eZdZUdZdZiZded<ded<edd„ƒZd    d
„Z    ed d d œdd„ƒZ
ed dd dœdd„ƒZ eddddœdd„ƒZ dS)Ú CompileStateaProduces additional object state necessary for a statement to be
    compiled.
 
    the :class:`.CompileState` class is at the base of classes that assemble
    state for a particular statement object that is then used by the
    compiler.   This process is essentially an extension of the process that
    the SQLCompiler.visit_XYZ() method takes, however there is an emphasis
    on converting raw user intent into more organized structures rather than
    producing string output.   The top-level :class:`.CompileState` for the
    statement being executed is also accessible when the execution context
    works with invoking the statement and collecting results.
 
    The production of :class:`.CompileState` is specific to the compiler,  such
    as within the :meth:`.SQLCompiler.visit_insert`,
    :meth:`.SQLCompiler.visit_select` etc. methods.  These methods are also
    responsible for associating the :class:`.CompileState` with the
    :class:`.SQLCompiler` itself, if the statement is the "toplevel" statement,
    i.e. the outermost SQL statement that's actually being executed.
    There can be other :class:`.CompileState` objects that are not the
    toplevel, such as when a SELECT subquery or CTE-nested
    INSERT/UPDATE/DELETE is generated.
 
    .. versionadded:: 1.4
 
    )Ú    statementÚ_ambiguous_table_name_mapz)Dict[Tuple[str, str], Type[CompileState]]Úpluginsz Optional[_AmbiguousTableNameMap]rcKs||jrB|j dd¡}|j ||jfd¡}|dkrR|jd|jf}n|jd|jf}||krh|||f|ŽS|j||f|ŽSdS©NZcompile_state_pluginrf)Ú_propagate_attrsr°rÚ_effective_plugin_targetÚcreate_for_statement)rjrÚcompilerr…Ú plugin_nameÚklassrUrUrVr Žs&ÿÿÿÿz!CompileState.create_for_statementcKs
||_dSrh)r)rTrr r…rUrUrVr’¨szCompileState.__init__Ú
ExecutableúOptional[Type[CompileState]])rrgcCs^|j dd¡}|r0||jf}||jkr0|j|Sz|jd|jfWStk
rXYdSXdSr    )r
r°r rrÍ)rjrrrrrUrUrVÚget_plugin_class«sÿ
 
 
zCompileState.get_plugin_classro)rrrgcCs.z|j||jfWStk
r(YdSXdSrh)rr rÍ)rjrrrUrUrVÚ_get_plugin_class_for_pluginÁs ÿz)CompileState._get_plugin_class_for_pluginrª)rÚ
visit_namergcs‡‡‡fdd„}|S)Ncs|ˆjˆˆf<|Srh)r)Zcls_to_decorate©rjrrrUrVÚdecorateÐsz)CompileState.plugin_for.<locals>.decoraterU)rjrrrrUrrVÚ
plugin_forÌszCompileState.plugin_forN) rXrYrZr‹rŒrrlrmr r’rrrrUrUrUrVrms
 
 
rc@seZdZdZddœdd„ZdS)Ú
GenerativezUProvide a method-chaining pattern in conjunction with the
    @_generative decorator.r.rvcsJ|j‰|j}| |¡}ˆr:‡fdd„|j ¡ ¡Dƒ|_n |j ¡|_|S)Ncsi|]\}}|ˆkr||“qSrUrU)r˜rÚv©ÚskiprUrVÚ
<dictcomp>ász(Generative._generate.<locals>.<dictcomp>)Ú_memoized_keysr±rÚ__dict__ÚcopyÚitems)rTrjÚsrUrrVr£Ûs
 
 ÿ
 zGenerative._generateN)rXrYrZr‹r£rUrUrUrVr×src@seZdZdZdZdd„ZdS)ÚInPlaceGenerativezkProvide a method-chaining pattern in conjunction with the
    @_generative decorator that mutates in place.rUcCs"|j}|D]}|j |d¡q
|Srh)rrr·)rTrrrUrUrVr£ïszInPlaceGenerative._generateN)rXrYrZr‹rŒr£rUrUrUrVr"ésr"c@s2eZdZUdZdZded<ejZded<e    j
Z dS)ÚHasCompileStatez=A class that has a :class:`.CompileState` associated with it.NrÚ_compile_state_pluginúutil.immutabledict[str, Any]Ú _attributes) rXrYrZr‹r$rlr)Ú
EMPTY_DICTr&rr Z_compile_state_factoryrUrUrUrVr#÷s
 r#c@sXeZdZUdZded<dd„ZerTdddœd    d
„Zddd d œd d„Zdd dœdd„Z    dS)Ú _MetaOptionszêmetaclass for the Options class.
 
    This metaclass is actually necessary despite the availability of the
    ``__init_subclass__()`` hook as this type also provides custom class-level
    behavior for the ``__add__()`` method.
 
    úTuple[str, ...]Ú _cache_attrscCsB|ƒ}t|ƒ |j¡r2td|t|ƒ |j¡fƒ‚|j |¡|S©NzBdictionary contains attributes not covered by Options class %s: %r)rÅÚ
differencer*rýrrô©rTÚotherZo1rUrUrVÚ__add__ sþÿ z_MetaOptions.__add__rorrqcCsdSrhrUrsrUrUrVrtsz_MetaOptions.__getattr__r‰©rrr×rgcCsdSrhrUrèrUrUrVÚ __setattr__sz_MetaOptions.__setattr__cCsdSrhrUrsrUrUrVÚ __delattr__!sz_MetaOptions.__delattr__N)
rXrYrZr‹rlr/rrtr1r2rUrUrUrVr(s
 r(csöeZdZUdZdZded<ddœ‡fdd„ Zd    d
„Zd d „Zd d„Z    dd„Z
e dddœdd„ƒZ e dd„ƒZe ddœdd„ƒZejZded<ejddœdd„ƒZe dd „ƒZe d!d"„ƒZerîd#d$d%œd&d'„Zd#d$dd(œd)d*„Zd#dd%œd+d,„Z‡ZS)-ÚOptionsz,A cacheable option dictionary with defaults.rUr)r*r‰rvcs,|j}ttdd„|Dƒƒƒ|_tƒ ¡dS)Ncss$|]}| d¡s|dkr|VqdS)Ú__)Z_cache_key_traversalN)Ú
startswith)r˜r÷rUrUrVrÜ/s
ýz,Options.__init_subclass__.<locals>.<genexpr>)rÚtupleÚsortedr*ÚsuperÚ__init_subclass__)rjZdict_©r±rUrVr9,sþÿzOptions.__init_subclass__cKs|j |¡dSrh)rrôr†rUrUrVr’8szOptions.__init__cCsX|j |j¡}|j |j¡t|ƒ |j¡rHtd|t|ƒ |j¡fƒ‚|j |¡|Sr+)r±rrrôrÅr,r*rýr-rUrUrVr/;sþÿ zOptions.__add__cCs6t|j|jƒD]"\}}t||ƒt||ƒkrdSqdS©NFT)rr*Úgetattr)rTr.r¼r½rUrUrVÚ__eq__IszOptions.__eq__cs&dˆjjd ‡fdd„ˆjDƒ¡fS)Nú%s(%s)ú, c3s*|]"}|ˆjkrd|ˆj|fVqdS)z%s=%rN©r)r˜rrSrUrVrÜVs
þz#Options.__repr__.<locals>.<genexpr>)r±rXÚjoinr*rSrUrSrVrWQs þþzOptions.__repr__z    Type[Any]Úbool)rrgcCs
t||ƒSrh)Ú
issubclass)rjrrUrUrVÚ
isinstance]szOptions.isinstancecCs||t||ƒ|iSrh)r<)rTrRr×rUrUrVÚadd_to_elementaszOptions.add_to_elementzMapping[str, Any]cCs|jSrhr@rSrUrUrVÚ_state_dict_insteszOptions._state_dict_instr%Ú_state_dict_constcCs|jSrh)rG)rjrUrUrVÚ _state_dictkszOptions._state_dictcCsR| ¡}||jk    rJ|jrJt|jƒ |j¡rJtd||t|jƒ |j¡fƒ‚||S)Nz]other element %r is not empty, is not of type %s, and contains attributes not covered here %r)rHr±r*rÅr,rý)rjr.r÷rUrUrVÚ
safe_mergeos ÿþýýþÿ    zOptions.safe_mergec Cs”| t|ƒ |¡¡}| ||¡}|rˆi}|D]6}d|}    ||krN||||    <q,||kr,||||    <q,||}
t ¡ |||
i¡}|
|fS||fSdS)a{process Options argument in terms of execution options.
 
 
        e.g.::
 
            (
                load_options,
                execution_options,
            ) = QueryContext.default_load_options.from_execution_options(
                "_sa_orm_load_options",
                {
                    "populate_existing",
                    "autoflush",
                    "yield_per"
                },
                execution_options,
                statement._execution_options,
            )
 
        get back the Options and refresh "_sa_orm_load_options" in the
        exec options dict w/ the Options as well
 
        rÊN)r¿rÅrår°r)Z immutabledictZ
merge_with) rjrrÚattrsZ exec_optionsZstatement_exec_optionsZcheck_argnamesZexisting_optionsÚresultÚargnameÚlocalÚ new_optionsrUrUrVÚfrom_execution_optionsˆs& ÿ ÿzOptions.from_execution_optionsrorrqcCsdSrhrUrsrUrUrVrtÀszOptions.__getattr__r0cCsdSrhrUrèrUrUrVr1ÃszOptions.__setattr__cCsdSrhrUrsrUrUrVr2ÆszOptions.__delattr__)rXrYrZr‹rŒrlr9r’r/r=rWrmrDr+rErFr)r'rGÚ
classlevelrHrIrOrrtr1r2Ú __classcell__rUrUr:rVr3%s2
 
 
 
5r3)Ú    metaclassc@s6eZdZdZedd„ƒZejdd„ƒZedd„ƒZdS)    ÚCacheableOptionsrUcCst |||¡Srh)rÚ_gen_cache_key)rTÚanon_mapÚ
bindparamsrUrUrVÚ_gen_cache_key_instÍsz$CacheableOptions._gen_cache_key_instcCs|dfS)NrUrU)rjrUrVrUrUrVrTÑszCacheableOptions._gen_cache_keycCs
t |¡Srh)rZ_generate_cache_key_for_objectrSrUrUrVÚ_generate_cache_keyÕsz$CacheableOptions._generate_cache_keyN)    rXrYrZrŒr+rWrPrTrXrUrUrUrVrSÊs
 
rSc@s*eZdZdZejZdZdZdZ    dd„Z
dS)ÚExecutableOptionrUZexecutable_optionFTcKs|j |j¡}t|jƒ|_|S)z/Create a shallow copy of this ExecutableOption.)r±rrìr)rTr…rŸrUrUrVr‡ås zExecutableOption._cloneN) rXrYrZrŒr)r'Ú _annotationsÚ__visit_name__Z_is_has_cache_keyZ_is_corer‡rUrUrUrVrYÚs rYc@sÖeZdZUdZdZded<ejZded<dZ    dZ
d    ed
<dZ d ed <d ed<d
e j fd ejfdejfgZdZdZdZdZdZdZerÖded<dddœddddddddœdd„Zdddd d!œd"d#„Zddddd!œd$d%„Zejd&d'„ƒZedd(œd)d*„ƒZe d+d,d-œd.d/„ƒZ!e d0d,d1œd2d3„ƒZ"e d0d,d-œd4d5„ƒZ#e d6dd,d7œd8d9„ƒZ$e%d:d:d:ddd:d:d:d:ddd:d:d:d:d;œddd<ddd=d=d=dddd>d?dddd,d@œdAdB„ƒZ&e%dd,dCœdDdB„ƒZ&e dd,dEœdFdB„ƒZ&dGd(œdHdI„Z'dS)JrzøMark a :class:`_expression.ClauseElement` as supporting execution.
 
    :class:`.Executable` is a superclass for all "statement" types
    of objects, including :func:`select`, :func:`delete`, :func:`update`,
    :func:`insert`, :func:`text`.
 
    TrBÚsupports_executionrHÚ_execution_optionsFrUzTuple[ExecutableOption, ...]Ú _with_optionsz6Tuple[Tuple[Callable[[CompileState], None], Any], ...]Ú_with_context_optionsz9Optional[Union[Type[CacheableOptions], CacheableOptions]]Ú_compile_optionsr
ror[N)Úfor_executemanyÚschema_translate_maprMzOptional[CompiledCacheType]z    List[str]z Optional[SchemaTranslateMapType]rzCTuple[Compiled, Optional[Sequence[BindParameter[Any]]], CacheStats])rÎÚcompiled_cacheÚ column_keysrarbr…rgcKsdSrhrU)rTrÎrcrdrarbr…rUrUrVÚ_compile_w_caches zExecutable._compile_w_cacherDrFrLzCursorResult[Any])Ú
connectionÚdistilled_paramsÚexecution_optionsrgcCsdSrhrU©rTrfrgrhrUrUrVÚ_execute_on_connection sz!Executable._execute_on_connectioncCsdSrhrUrirUrUrVÚ_execute_on_scalar(szExecutable._execute_on_scalarcCs
tƒ‚dSrhrrSrUrUrVÚ_all_selected_columns0sz Executable._all_selected_columnsrvcCs|jSrh)r[rSrUrUrVr 4sz#Executable._effective_plugin_targetrYr.)ÚoptionsrgcGs |jtdd„|Dƒƒ7_|S)aJApply options to this statement.
 
        In the general sense, options are any kind of Python object
        that can be interpreted by the SQL compiler for the statement.
        These options can be consumed by specific dialects or specific kinds
        of compilers.
 
        The most commonly known kind of option are the ORM level options
        that apply "eager load" and other loading behaviors to an ORM
        query.   However, options can theoretically be used for many other
        purposes.
 
        For background on specific kinds of options for specific kinds of
        statements, refer to the documentation for those option objects.
 
        .. versionchanged:: 1.4 - added :meth:`.Executable.options` to
           Core statement objects towards the goal of allowing unified
           Core / ORM querying capabilities.
 
        .. seealso::
 
            :ref:`loading_columns` - refers to options specific to the usage
            of ORM queries
 
            :ref:`relationship_loader_options` - refers to options specific
            to the usage of ORM queries
 
        css|]}t tj|¡VqdSrh)r0ÚexpectrZExecutableOptionRole)r˜rÔrUrUrVrÜVsÿz%Executable.options.<locals>.<genexpr>)r^r6©rTrmrUrUrVrm8sþ zExecutable.optionsrS)Úcompile_optionsrgcCs
||_|S)z|Assign the compile options to a new value.
 
        :param compile_options: appropriate CacheableOptions structure
 
        )r`)rTrprUrUrVÚ_set_compile_options\szExecutable._set_compile_optionscCs |jdk    st‚|j|7_|S)z*update the _compile_options with new keys.N)r`r¦rorUrUrVÚ_update_compile_optionsgsz"Executable._update_compile_optionszCallable[[CompileState], None])Ú    callable_Ú
cache_argsrgcCs|j||ff7_|S)aMAdd a context option to this statement.
 
        These are callable functions that will
        be given the CompileState object upon compilation.
 
        A second argument cache_args is required, which will be combined with
        the ``__code__`` identity of the function itself in order to produce a
        cache key.
 
        )r_)rTrsrtrUrUrVÚ_add_context_optionoszExecutable._add_context_option.)rcÚ logging_tokenÚisolation_levelÚ no_parametersÚstream_resultsÚmax_row_bufferÚ    yield_perÚinsertmanyvalues_page_sizerbÚpopulate_existingÚ    autoflushÚsynchronize_sessionÚ dml_strategyÚis_delete_usingÚis_update_fromrNÚintr5r4)rcrvrwrxryrzr{r|rbr}r~rr€rr‚rÔrgcKsdSrhrU)rTrcrvrwrxryrzr{r|rbr}r~rr€rr‚rÔrUrUrVrh‚szExecutable.execution_options)rÔrgcKsdSrhrU)rTrÔrUrUrVrh™s)r…rgcKs6d|krt d¡‚d|kr$t d¡‚|j |¡|_|S)a­Set non-SQL options for the statement which take effect during
        execution.
 
        Execution options can be set at many scopes, including per-statement,
        per-connection, or per execution, using methods such as
        :meth:`_engine.Connection.execution_options` and parameters which
        accept a dictionary of options such as
        :paramref:`_engine.Connection.execute.execution_options` and
        :paramref:`_orm.Session.execute.execution_options`.
 
        The primary characteristic of an execution option, as opposed to
        other kinds of options such as ORM loader options, is that
        **execution options never affect the compiled SQL of a query, only
        things that affect how the SQL statement itself is invoked or how
        results are fetched**.  That is, execution options are not part of
        what's accommodated by SQL compilation nor are they considered part of
        the cached state of a statement.
 
        The :meth:`_sql.Executable.execution_options` method is
        :term:`generative`, as
        is the case for the method as applied to the :class:`_engine.Engine`
        and :class:`_orm.Query` objects, which means when the method is called,
        a copy of the object is returned, which applies the given parameters to
        that new copy, but leaves the original unchanged::
 
            statement = select(table.c.x, table.c.y)
            new_statement = statement.execution_options(my_option=True)
 
        An exception to this behavior is the :class:`_engine.Connection`
        object, where the :meth:`_engine.Connection.execution_options` method
        is explicitly **not** generative.
 
        The kinds of options that may be passed to
        :meth:`_sql.Executable.execution_options` and other related methods and
        parameter dictionaries include parameters that are explicitly consumed
        by SQLAlchemy Core or ORM, as well as arbitrary keyword arguments not
        defined by SQLAlchemy, which means the methods and/or parameter
        dictionaries may be used for user-defined parameters that interact with
        custom code, which may access the parameters using methods such as
        :meth:`_sql.Executable.get_execution_options` and
        :meth:`_engine.Connection.get_execution_options`, or within selected
        event hooks using a dedicated ``execution_options`` event parameter
        such as
        :paramref:`_events.ConnectionEvents.before_execute.execution_options`
        or :attr:`_orm.ORMExecuteState.execution_options`, e.g.::
 
             from sqlalchemy import event
 
             @event.listens_for(some_engine, "before_execute")
             def _process_opt(conn, statement, multiparams, params, execution_options):
                 "run a SQL function before invoking a statement"
 
                 if execution_options.get("do_special_thing", False):
                     conn.exec_driver_sql("run_special_function()")
 
        Within the scope of options that are explicitly recognized by
        SQLAlchemy, most apply to specific classes of objects and not others.
        The most common execution options include:
 
        * :paramref:`_engine.Connection.execution_options.isolation_level` -
          sets the isolation level for a connection or a class of connections
          via an :class:`_engine.Engine`.  This option is accepted only
          by :class:`_engine.Connection` or :class:`_engine.Engine`.
 
        * :paramref:`_engine.Connection.execution_options.stream_results` -
          indicates results should be fetched using a server side cursor;
          this option is accepted by :class:`_engine.Connection`, by the
          :paramref:`_engine.Connection.execute.execution_options` parameter
          on :meth:`_engine.Connection.execute`, and additionally by
          :meth:`_sql.Executable.execution_options` on a SQL statement object,
          as well as by ORM constructs like :meth:`_orm.Session.execute`.
 
        * :paramref:`_engine.Connection.execution_options.compiled_cache` -
          indicates a dictionary that will serve as the
          :ref:`SQL compilation cache <sql_caching>`
          for a :class:`_engine.Connection` or :class:`_engine.Engine`, as
          well as for ORM methods like :meth:`_orm.Session.execute`.
          Can be passed as ``None`` to disable caching for statements.
          This option is not accepted by
          :meth:`_sql.Executable.execution_options` as it is inadvisable to
          carry along a compilation cache within a statement object.
 
        * :paramref:`_engine.Connection.execution_options.schema_translate_map`
          - a mapping of schema names used by the
          :ref:`Schema Translate Map <schema_translating>` feature, accepted
          by :class:`_engine.Connection`, :class:`_engine.Engine`,
          :class:`_sql.Executable`, as well as by ORM constructs
          like :meth:`_orm.Session.execute`.
 
        .. seealso::
 
            :meth:`_engine.Connection.execution_options`
 
            :paramref:`_engine.Connection.execute.execution_options`
 
            :paramref:`_orm.Session.execute.execution_options`
 
            :ref:`orm_queryguide_execution_options` - documentation on all
            ORM-specific execution options
 
        rwz 'isolation_level' execution option may only be specified on Connection.execution_options(), or per-engine using the isolation_level argument to create_engine().rczm'compiled_cache' execution option may only be specified on Connection.execution_options(), not per statement.)r(rÖr]rår†rUrUrVrhsgÿÿrGcCs|jS)z±Get the non-SQL options which will take effect during execution.
 
        .. versionadded:: 1.3
 
        .. seealso::
 
            :meth:`.Executable.execution_options`
        )r]rSrUrUrVÚget_execution_optionss    z Executable.get_execution_options)(rXrYrZr‹r\rlr)r'r]Z_is_default_generatorr^r_r%Zdp_executable_optionsr#Zdp_with_context_optionsZdp_propagate_attrsZ_executable_traverse_internalsZ    is_selectZ    is_updateZ    is_insertZis_textZ    is_deleteZis_dmlrrerjrkrxrlrr r¨rmrqrrrurrhr„rUrUrUrVrìsz
  þ
þú    ù
#
ï4urc@s>eZdZUdZded<ddddœdd„Zddddœd    d
„Zd S) ÚSchemaEventTargetzžBase class for elements that are the targets of :class:`.DDLEvents`
    events.
 
    This includes :class:`.SchemaItem` as well as :class:`.SchemaType`.
 
    zdispatcher[SchemaEventTarget]Údispatchrr‰)Úparentr…rgcKsdS)z0Associate with this SchemaEvent's parent object.NrU©rTr‡r…rUrUrVÚ _set_parent)szSchemaEventTarget._set_parentcKs.|j ||¡|j|f|Ž|j ||¡dSrh)r†Zbefore_parent_attachr‰Zafter_parent_attachrˆrUrUrVÚ_set_parent_with_dispatch,sz+SchemaEventTarget._set_parent_with_dispatchN)rXrYrZr‹rlr‰rŠrUrUrUrVr…s
r…c@seZdZdZddiZdS)Ú SchemaVisitorz/Define the visiting for ``SchemaItem`` objects.Zschema_visitorTN)rXrYrZr‹Z__traverse_options__rUrUrUrVr‹4sr‹c@s(eZdZdZdZdZdZdZdZdZ    dS)    Ú _SentinelDefaultCharacterizationÚnoneÚunknownZ
clientsideZsentinel_defaultZ
serversideÚidentityÚsequenceN)
rXrYrZÚNONEÚUNKNOWNZ
CLIENTSIDEZSENTINEL_DEFAULTZ
SERVERSIDEZIDENTITYZSEQUENCErUrUrUrVrŒ:srŒc@s@eZdZUdZded<dZded<dZded<ejZ    ded    <dS)
Ú_SentinelColumnCharacterizationNzOptional[Sequence[Column[Any]]]ÚcolumnsFrBÚ is_explicitÚ
is_autoincrŒÚdefault_characterization)
rXrYrZr”rlr•r–rŒr‘r—rUrUrUrVr“Ds
 
   ÿr“Ú_COLKEYÚ_COL_coúColumnElement[Any]T)r_Ú    covariantÚ_COLzKeyedColumnElement[Any]c@sJeZdZUdZded<dddœdd„Zdd    „Zd
d „Zd d dœdd„ZdS)Ú_ColumnMetrics©Úcolumnr™rŸzColumnCollection[Any, _COL_co])Ú
collectionÚcolcCs.||_|j}|r*|jD]}|| |¡qdSrh)rŸÚ _proxy_indexÚ_expanded_proxy_setÚadd)rTr r¡ÚpiÚeps_colrUrUrVr’Xs
 
z_ColumnMetrics.__init__cCs|jjSrh)rŸr£rSrUrUrVÚget_expanded_proxy_setdsz%_ColumnMetrics.get_expanded_proxy_setcCsL|j}|sdS|jjD]0}| |d¡}|r4| |¡|dk    r|s||=qdSrh)r¢rŸr£r°Údiscard)rTr r¥r¡ZcolsetrUrUrVÚdisposegs  
 z_ColumnMetrics.disposez=Union[Set[ColumnElement[Any]], FrozenSet[ColumnElement[Any]]]rB)Ú
target_setrgcCs2|jj}| |¡D]}| t|gƒ¡sdSqdSr;)rŸr£r,r¿r»)rTrªZexpanded_proxy_setÚtrUrUrVÚembeddedrs
z_ColumnMetrics.embeddedN)    rXrYrZrŒrlr’r§r©r¬rUrUrUrVrSs
  rc@sdeZdZUdZdZded<ded<ded<d    ed
<dwd d œdd„Ze d¡ddœdd„ƒZ    dddœdd„Z
e ddœdd„ƒZ ddœdd„Z ddœd d!„Zd"dœd#d$„Zd%dœd&d'„Zd(dœd)d*„Zd+dœd,d-„Zed.d/d0œd1d2„ƒZed3d4d0œd5d2„ƒZed6d4d0œd7d2„ƒZd8d9d0œd:d2„Zd;d/d0œd<d=„Zd;d%d0œd>d?„Zd@d%dAœdBdC„ZdDd%dAœdEdF„Zdxd;dGdGdHœdIdJ„Zd;dœdKdL„Zd;dDdMdNœdOdP„Zd;dMd0œdQdR„Zd;dDdMdSœdTdU„ZdMdœdVdW„ZdDddXœdYdZ„ZdDdMdœd[d\„Z d Z!dddœd]d^„Z"dyd_d`ddaœdbdc„Z#dddœdedf„Z$ddddgœdhdi„Z%d_d%djœdkdl„Z&d4dœdmdn„Z'dodp„Z(dzdrd%dsdtœdudv„Z)d S){ÚColumnCollectiona»Collection of :class:`_expression.ColumnElement` instances,
    typically for
    :class:`_sql.FromClause` objects.
 
    The :class:`_sql.ColumnCollection` object is most commonly available
    as the :attr:`_schema.Table.c` or :attr:`_schema.Table.columns` collection
    on the :class:`_schema.Table` object, introduced at
    :ref:`metadata_tables_and_columns`.
 
    The :class:`_expression.ColumnCollection` has both mapping- and sequence-
    like behaviors. A :class:`_expression.ColumnCollection` usually stores
    :class:`_schema.Column` objects, which are then accessible both via mapping
    style access as well as attribute access style.
 
    To access :class:`_schema.Column` objects using ordinary attribute-style
    access, specify the name like any other object attribute, such as below
    a column named ``employee_name`` is accessed::
 
        >>> employee_table.c.employee_name
 
    To access columns that have names with special characters or spaces,
    index-style access is used, such as below which illustrates a column named
    ``employee ' payment`` is accessed::
 
        >>> employee_table.c["employee ' payment"]
 
    As the :class:`_sql.ColumnCollection` object provides a Python dictionary
    interface, common dictionary method names like
    :meth:`_sql.ColumnCollection.keys`, :meth:`_sql.ColumnCollection.values`,
    and :meth:`_sql.ColumnCollection.items` are available, which means that
    database columns that are keyed under these names also need to use indexed
    access::
 
        >>> employee_table.c["values"]
 
 
    The name for which a :class:`_schema.Column` would be present is normally
    that of the :paramref:`_schema.Column.key` parameter.  In some contexts,
    such as a :class:`_sql.Select` object that uses a label style set
    using the :meth:`_sql.Select.set_label_style` method, a column of a certain
    key may instead be represented under a particular label name such
    as ``tablename_columnname``::
 
        >>> from sqlalchemy import select, column, table
        >>> from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL
        >>> t = table("t", column("c"))
        >>> stmt = select(t).set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL)
        >>> subq = stmt.subquery()
        >>> subq.c.t_c
        <sqlalchemy.sql.elements.ColumnClause at 0x7f59dcf04fa0; t_c>
 
    :class:`.ColumnCollection` also indexes the columns in order and allows
    them to be accessible by their integer position::
 
        >>> cc[0]
        Column('x', Integer(), table=None)
        >>> cc[1]
        Column('y', Integer(), table=None)
 
    .. versionadded:: 1.4 :class:`_expression.ColumnCollection`
       allows integer-based
       index access to the collection.
 
    Iterating the collection yields the column expressions in order::
 
        >>> list(cc)
        [Column('x', Integer(), table=None),
         Column('y', Integer(), table=None)]
 
    The base :class:`_expression.ColumnCollection` object can store
    duplicates, which can
    mean either two columns with the same key, in which case the column
    returned by key  access is **arbitrary**::
 
        >>> x1, x2 = Column('x', Integer), Column('x', Integer)
        >>> cc = ColumnCollection(columns=[(x1.name, x1), (x2.name, x2)])
        >>> list(cc)
        [Column('x', Integer(), table=None),
         Column('x', Integer(), table=None)]
        >>> cc['x'] is x1
        False
        >>> cc['x'] is x2
        True
 
    Or it can also mean the same column multiple times.   These cases are
    supported as :class:`_expression.ColumnCollection`
    is used to represent the columns in
    a SELECT statement which may include duplicates.
 
    A special subclass :class:`.DedupeColumnCollection` exists which instead
    maintains SQLAlchemy's older behavior of not allowing duplicates; this
    collection is used for schema level objects like :class:`_schema.Table`
    and
    :class:`.PrimaryKeyConstraint` where this deduping is helpful.  The
    :class:`.DedupeColumnCollection` class also has additional mutation methods
    as the schema constructs have more use cases that require removal and
    replacement of columns.
 
    .. versionchanged:: 1.4 :class:`_expression.ColumnCollection`
       now stores duplicate
       column keys as well as the same column in multiple positions.  The
       :class:`.DedupeColumnCollection` class is added to maintain the
       former behavior in those cases where deduplication as well as
       additional replace/remove operations are needed.
 
 
    )Ú _collectionÚ_indexÚ_colsetr¢z6List[Tuple[_COLKEY, _COL_co, _ColumnMetrics[_COL_co]]]r®z4Dict[Union[None, str, int], Tuple[_COLKEY, _COL_co]]r¯z6Dict[ColumnElement[Any], Set[_ColumnMetrics[_COL_co]]]r¢z Set[_COL_co]r°Nz+Optional[Iterable[Tuple[_COLKEY, _COL_co]]])r”cCsTt |dtƒ¡t |di¡t |dt tj¡¡t |dg¡|rP| |¡dS)Nr°r¯r¢r®)r‘r1rÅÚ collectionsÚ defaultdictr)Ú
OrderedSetÚ_initial_populate)rTr”rUrUrVr’ós
ÿzColumnCollection.__init__zsqlalchemy.sql.elementsr8rvcCstjj}|j|jtjddœŽS)NF)Z_literal_as_text_rolerþ)r)réZ sql_elementsr8Ú _all_columnsrZColumnsClauseRole©rTr2rUrUrVÚ__clause_element__ÿs þþz#ColumnCollection.__clause_element__z!Iterable[Tuple[_COLKEY, _COL_co]]r‰©Úiter_rgcCs| |¡dSrh©Ú_populate_separate_keys©rTr¹rUrUrVr´    sz"ColumnCollection._initial_populatez List[_COL_co]cCsdd„|jDƒS)NcSsg|]\}}}|‘qSrUrU©r˜rÊr¡rUrUrVr™sz1ColumnCollection._all_columns.<locals>.<listcomp>©r®rSrUrUrVrµszColumnCollection._all_columnsz List[_COLKEY]cCsdd„|jDƒS)zQReturn a sequence of string key names for all columns in this
        collection.cSsg|]\}}}|‘qSrUrU)r˜rrÊrUrUrVr™sz)ColumnCollection.keys.<locals>.<listcomp>r¾rSrUrUrVÚkeysszColumnCollection.keyscCsdd„|jDƒS)z†Return a sequence of :class:`_sql.ColumnClause` or
        :class:`_schema.Column` objects for all columns in this
        collection.cSsg|]\}}}|‘qSrUrUr½rUrUrVr™sz+ColumnCollection.values.<locals>.<listcomp>r¾rSrUrUrVrÞszColumnCollection.valueszList[Tuple[_COLKEY, _COL_co]]cCsdd„|jDƒS)zÖReturn a sequence of (key, column) tuples for all columns in this
        collection each consisting of a string key name and a
        :class:`_sql.ColumnClause` or
        :class:`_schema.Column` object.
        cSsg|]\}}}||f‘qSrUrU©r˜rr¡rÊrUrUrVr™$sz*ColumnCollection.items.<locals>.<listcomp>r¾rSrUrUrVr szColumnCollection.itemsrBcCs
t|jƒSrh)rBr®rSrUrUrVÚ__bool__&szColumnCollection.__bool__rƒcCs
t|jƒSrh)rÚr®rSrUrUrVrß)szColumnCollection.__len__zIterator[_COL_co]cCstdd„|jDƒƒS)NcSsg|]\}}}|‘qSrUrUr½rUrUrVr™.sz-ColumnCollection.__iter__.<locals>.<listcomp>)rær®rSrUrUrVrá,szColumnCollection.__iter__zUnion[str, int]r™rqcCsdSrhrUrsrUrUrVrÕ0szColumnCollection.__getitem__zTuple[Union[str, int], ...]z*ReadOnlyColumnCollection[_COLKEY, _COL_co]cCsdSrhrUrsrUrUrVrÕ4sÚslicecCsdSrhrUrsrUrUrVrÕ:sz3Union[str, int, slice, Tuple[Union[str, int], ...]]z:Union[ReadOnlyColumnCollection[_COLKEY, _COL_co], _COL_co]c
s®zbt|ttfƒrPt|tƒr0dd„ˆj|Dƒ}n‡fdd„|Dƒ}t|ƒ ¡WSˆj|dWSWnFtk
r¨}z(t|jdt    ƒr–t
|jdƒ|‚n‚W5d}~XYnXdS)Ncss|]\}}}||fVqdSrhrU)r˜Úsub_keyr¡rÊrUrUrVrÜFsÿz/ColumnCollection.__getitem__.<locals>.<genexpr>c3s|]}ˆj|VqdSrh©r¯)r˜rÃrSrUrVrÜKsrr) rDr6rÂr®r­Ú as_readonlyr¯rÍr¥rƒÚ
IndexError)rTrrÚcolsrÐrUrSrVrÕ@s
þroc
CsBz|j|dWStk
r<}zt|ƒ|‚W5d}~XYnXdS)Nr)r¯rÍÚAttributeError)rTrrrÐrUrUrVrtVszColumnCollection.__getattr__cCs*||jkr"t|tƒst d¡‚dSdSdS)Nz'__contains__ requires a string argumentFT)r¯rDror(rÖrsrUrUrVÚ __contains__\s
 
ÿzColumnCollection.__contains__zColumnCollection[Any, Any])r.rgcCs&t||ƒD]\}}||k    r
dSq
dS)zdCompare this :class:`_expression.ColumnCollection` to another
        based on the names of the keysFTNr)rTr.ÚlÚrrUrUrVÚcomparefszColumnCollection.comparercCs
| |¡Srh)rÌ)rTr.rUrUrVr=pszColumnCollection.__eq__zOptional[_COL_co])rrrfrgcCs ||jkr|j|dS|SdS)zžGet a :class:`_sql.ColumnClause` or :class:`_schema.Column` object
        based on a string key name from this
        :class:`_expression.ColumnCollection`.rNrÄ)rTrrrfrUrUrVr°ss
zColumnCollection.getcCs d|jjd dd„|Dƒ¡fS)Nr>r?css|]}t|ƒVqdSrh)roržrUrUrVr܂sz+ColumnCollection.__str__.<locals>.<genexpr>)r±rXrArSrUrUrVÚ__str__sþzColumnCollection.__str__rr0cCs
tƒ‚dSrhrrèrUrUrVr؅szColumnCollection.__setitem__cCs
tƒ‚dSrhrrsrUrUrVrوszColumnCollection.__delitem__)rrr”rgcCs
tƒ‚dSrhr)rTrrr”rUrUrVr1‹szColumnCollection.__setattr__cCs
tƒ‚dS)zQDictionary clear() is not implemented for
        :class:`_sql.ColumnCollection`.NrrSrUrUrVÚclearŽszColumnCollection.clear©rŸrgcCs
tƒ‚dSrhr)rTrŸrUrUrVÚremove“szColumnCollection.removecCs
tƒ‚dS)zRDictionary update() is not implemented for
        :class:`_sql.ColumnCollection`.Nrr¼rUrUrVrô–szColumnCollection.updatecsn‡fdd„|Dƒˆjdd…<}ˆj dd„|Dƒ¡ˆj dd„t|ƒDƒ¡ˆj dd„t|ƒDƒ¡dS)    ú*populate from an iterator of (key, column)cs g|]\}}||tˆ|ƒf‘qSrU©r©r˜rrŸrSrUrVr™£sz<ColumnCollection._populate_separate_keys.<locals>.<listcomp>Ncss|]\}}}| ¡VqdSrh©Ú _deannotate)r˜rÊrŸrUrUrVrܦsz;ColumnCollection._populate_separate_keys.<locals>.<genexpr>cSs i|]\}\}}}|||f“qSrUrU©r˜ÚidxrrŸrÊrUrUrVr¨s z<ColumnCollection._populate_separate_keys.<locals>.<dictcomp>cSsi|]\}}}|||f“qSrUrUrÀrUrUrVrªs)r®r°rôr¯Ú    enumeraterõ)rTr¹r rUrSrVr»žs
ÿÿz(ColumnCollection._populate_separate_keysršzOptional[_COLKEY]©rŸrrrgcCsz|dkr|j}n|}t|jƒ}tt|ƒ}|j ||t||ƒf¡|j |     ¡¡||f|j
|<||j
krv||f|j
|<dS)a¹Add a column to this :class:`_sql.ColumnCollection`.
 
        .. note::
 
            This method is **not normally used by user-facing code**, as the
            :class:`_sql.ColumnCollection` is usually part of an existing
            object such as a :class:`_schema.Table`. To add a
            :class:`_schema.Column` to an existing :class:`_schema.Table`
            object, use the :meth:`_schema.Table.append_column` method.
 
        N) rrrÚr®rr™Úappendrr°r¤rÕr¯)rTrŸrrZcolkeyrÊZ_columnrUrUrVr¤¬s
 
ÿ
zColumnCollection.addrúcCsdd„|jDƒ|jdœS)NcSsg|]\}}}||f‘qSrUrU©r˜rrŸrÊrUrUrVr™Òsz1ColumnCollection.__getstate__.<locals>.<listcomp>©r®r¯rÜrSrUrUrVÚ __getstate__ÐsþzColumnCollection.__getstate__)Ústatergcsft ˆd|d¡t ˆdt tj¡¡t ˆd‡fdd„|dDƒ¡t ˆddd„ˆjDƒ¡dS)    Nr¯r¢r®cs g|]\}}||tˆ|ƒf‘qSrUrÒrÓrSrUrVr™Þsÿz1ColumnCollection.__setstate__.<locals>.<listcomp>r°cSsh|]\}}}|’qSrUrUrÀrUrUrVrÃäsz0ColumnCollection.__setstate__.<locals>.<setcomp>)r‘r1r±r²r)r³r®)rTrÞrUrSrVÚ __setstate__Ös$
ÿ
þýÿzColumnCollection.__setstate__)r¡rgcCs*||jkr"t|tƒrt d¡‚dSdSdS)z3Checks if a column object exists in this collectionzZcontains_column cannot be used with string arguments. Use ``col_name in table.c`` instead.FTN)r°rDror(rÖ©rTr¡rUrUrVÚcontains_columnçs
 
ÿz ColumnCollection.contains_columncCst|ƒS)zIReturn a "read only" form of this
        :class:`_sql.ColumnCollection`.)ÚReadOnlyColumnCollectionrSrUrUrVrÅószColumnCollection.as_readonlycCsD|j}|rdS|jD]*\}}}|jj}|D]}|| |¡q*qdS)aápopulate the "proxy index", if empty.
 
        proxy index is added in 2.0 to provide more efficient operation
        for the corresponding_column() method.
 
        For reasons of both time to construct new .c collections as well as
        memory conservation for large numbers of large .c collections, the
        proxy_index is only filled if corresponding_column() is called. once
        filled it stays that way, and new _ColumnMetrics objects created after
        that point will populate it with new data. Note this case would be
        unusual, if not nonexistent, as it means a .c collection is being
        mutated after corresponding_column() were used, however it is tested in
        test/base/test_utils.py.
 
        N)r¢r®rŸr£r¤)rTr¥rÊÚmetricsZepsr¦rUrUrVÚ_init_proxy_indexùsz"ColumnCollection._init_proxy_indexFrœzOptional[Union[_COL, _COL_co]])rŸÚrequire_embeddedrgc
sþˆ|jkrˆSd\}}ˆj}|j‰ˆs.| ¡‡fdd„|DƒD]®}|rR| |¡r@|dkr`|}q@| |jj¡}|dkr„| |jj¡}t|ƒt|ƒkrž|}|}q@||kr@t    ‡fdd„|j 
¡Dƒƒ}t    ‡fdd„|j 
¡Dƒƒ}    |    |kr@|}|}q@|rú|jSdS)aâGiven a :class:`_expression.ColumnElement`, return the exported
        :class:`_expression.ColumnElement` object from this
        :class:`_expression.ColumnCollection`
        which corresponds to that original :class:`_expression.ColumnElement`
        via a common
        ancestor column.
 
        :param column: the target :class:`_expression.ColumnElement`
                      to be matched.
 
        :param require_embedded: only return corresponding columns for
         the given :class:`_expression.ColumnElement`, if the given
         :class:`_expression.ColumnElement`
         is actually present within a sub-element
         of this :class:`_expression.Selectable`.
         Normally the column will match if
         it merely shares a common ancestor with one of the exported
         columns of this :class:`_expression.Selectable`.
 
        .. seealso::
 
            :meth:`_expression.Selectable.corresponding_column`
            - invokes this method
            against the collection returned by
            :attr:`_expression.Selectable.exported_columns`.
 
        .. versionchanged:: 1.4 the implementation for ``corresponding_column``
           was moved onto the :class:`_expression.ColumnCollection` itself.
 
        )NNc3s(|] }|ˆkrˆ|D]
}|VqqdSrhrU)r˜ÚtsÚmm)r¥rUrVrÜAs
 
z8ColumnCollection.corresponding_column.<locals>.<genexpr>Ncs$g|]}| ˆ¡r|j dd¡‘qS©Zweightr©Úshares_lineagerZr°©r˜ZscržrUrVr™gs
üz9ColumnCollection.corresponding_column.<locals>.<listcomp>cs$g|]}| ˆ¡r|j dd¡‘qSrèrérëržrUrVr™ps
ü) r°rr¢rär¬r¿rŸr£rÚrÝZ_uncached_proxy_list)
rTrŸråZselected_intersectionZselected_metricsrªZcurrent_metricsZcurrent_intersectionZselected_col_distanceZcurrent_col_distancerU)rŸr¥rVÚcorresponding_columnsN$
 
ÿ
ÿÿ 
ýÿ    
ýÿ    z%ColumnCollection.corresponding_column)N)N)N)F)*rXrYrZr‹rŒrlr’r)Úpreload_moduler·r´rrµr¿rÞr rÁrßrárrÕrtrÉrÌr=r°rÍrØrÙr1rÎrÐrôÚ__hash__r»r¤rÝrßrárÅrärìrUrUrUrVr­sd
lÿ         
 
ÿ ÿ$ ÿr­Ú    _NAMEDCOLzNamedColumn[Any]c@szeZdZdZdddddœdd„Zd    d
dd œd d „Zdddœdd„Zdddœdd„Zd
ddœdd„Zdd
dddœdd„Z    dS)ÚDedupeColumnCollectionauA :class:`_expression.ColumnCollection`
    that maintains deduplicating behavior.
 
    This is useful by schema level objects such as :class:`_schema.Table` and
    :class:`.PrimaryKeyConstraint`.    The collection includes more
    sophisticated mutator methods as well to suit schema objects which
    require mutable column collections.
 
    .. versionadded:: 1.4
 
    Nršz Optional[str]r‰rÙcCsŒtt|ƒ}|dk    r&|j|kr&t d¡‚|j}|dkr>t d¡‚||jkr||j|d}||krbdS| |¡tj     |d¡n | 
||¡dS)NúKDedupeColumnCollection requires columns be under the same key as their .keyz-Can't add unnamed column to column collectionrr) rrïrrr(rÖr¯Úreplacer)rÚresetÚ_append_new_column)rTrŸrrÚ named_columnÚexistingrUrUrVr¤s"
ÿÿ
 
zDedupeColumnCollection.addrorï)rrrõrgcCsRt|jƒ}|j ||t||ƒf¡|j | ¡¡||f|j|<||f|j|<dSrh)rÚr®rÚrr°r¤rÕr¯)rTrrrõrÊrUrUrVrô¯s
ÿz)DedupeColumnCollection._append_new_columnzIterable[Tuple[str, _NAMEDCOL]]r¸cCsÜt|ƒ}g}|D]~\}}|j|kr,t d¡‚|j|jkrP|j|jkrP| |¡q|j|jkrh| |¡q||f|j|<|j ||t||ƒf¡q|j     
dd„|jDƒ¡|j 
dd„t |jƒDƒ¡|D]}|  |¡qÈdS)rÑrñcss|]\}}}| ¡VqdSrhrÔrÛrUrUrVrÜÌszADedupeColumnCollection._populate_separate_keys.<locals>.<genexpr>css$|]\}\}}}|||ffVqdSrhrUrÖrUrUrVrÜÎs N) Úlistrrr(rÖrRr¯rÚr®rr°rôrØrò)rTr¹rÇZ replace_colrr¡rUrUrVr»¸s& 
ÿ    ÿz.DedupeColumnCollection._populate_separate_keyszIterable[_NAMEDCOL]cCs| dd„|Dƒ¡dS)Ncss|]}|j|fVqdSrh)rr)r˜r¡rUrUrVrÜÕsz0DedupeColumnCollection.extend.<locals>.<genexpr>rºr¼rUrUrVÚextendÔszDedupeColumnCollection.extendrÏcs–ˆ|jkrtdˆƒ‚|jˆj=|j ˆ¡‡fdd„|jDƒ|jdd…<|j ˆd¡D]}| |¡qX|j     dd„t
|jƒDƒ¡|jt |jƒ=dS)Nz8Can't remove column %r; column is not in this collectioncs$g|]\}}}|ˆk    r|||f‘qSrUrU)r˜rrŸrãržrUrVr™ßsþz1DedupeColumnCollection.remove.<locals>.<listcomp>rUcSs i|]\}\}}}|||f“qSrUrU©r˜r×rr¡rÊrUrUrVrès z1DedupeColumnCollection.remove.<locals>.<dictcomp>) r°rÌr¯rrrÐr®r¢r°r©rôrØrÚ)rTrŸrãrUržrVrÐ×s"
ÿÿ
 
þ ÿzDedupeColumnCollection.removezOptional[Iterable[_NAMEDCOL]])rŸÚ extra_removergc Cs˜|rt|ƒ}ntƒ}|j|jkrR|j|jkrR|j|jd}|j|jkrR| |¡|j|jkrt| |j|jd¡|sŠ| |j|¡dSg}d}|jD]D\}}}    ||krÌ|sÜd}| |j|t||ƒf¡q˜| |||    f¡q˜|r|j     
|¡|D]$}
|j   |
d¡D]}    |      |¡qqô|s8| |j|t||ƒf¡|j     | ¡¡||jdd…<|j ¡|j dd„t|jƒDƒ¡|j dd„|jDƒ¡dS)    aadd the given column to this collection, removing unaliased
        versions of this column  as well as existing columns with the
        same key.
 
        e.g.::
 
            t = Table('sometable', metadata, Column('col1', Integer))
            t.columns.replace(Column('col1', Integer, key='columnone'))
 
        will remove the original 'col1' from the collection, and add
        the new column under the name 'columnname'.
 
        Used by schema.Column to override columns during table reflection.
 
        rNFTrUcSs i|]\}\}}}|||f“qSrUrUrùrUrUrVr.s z2DedupeColumnCollection.replace.<locals>.<dictcomp>cSsi|]\}}}|||f“qSrUrUrÀrUrUrVr0s)rÅrRr¯rrr¤rôr®rÚrr°Údifference_updater¢r°r©rÕrÎrôrØ) rTrŸrúZ
remove_colr.Znew_colsZreplacedrr¡rãÚrcrUrUrVròísH
 
 ÿ 
ÿzDedupeColumnCollection.replace)N)N)
rXrYrZr‹r¤rôr»rørÐròrUrUrUrVrð‚s ÿ     ýrðc@s\eZdZdZdd„Zdd„Zdd„Zdd    d    d    d
œd d „Zd    d dœdd„Zd    d dœdd„Z    dS)râ©Ú_parentcCsRt |d|¡t |d|j¡t |d|j¡t |d|j¡t |d|j¡dS)Nrþr°r¯r®r¢)r‘r1r°r¯r®r¢)rTr rUrUrVr’8s
z!ReadOnlyColumnCollection.__init__cCs
d|jiS©NrþrýrSrUrUrVrÝ?sz%ReadOnlyColumnCollection.__getstate__cCs|d}| |¡dSrÿ)r’)rTrÞr‡rUrUrVrßBsz%ReadOnlyColumnCollection.__setstate__.rrÙcCs | ¡dSrh©Z    _readonly)rTrŸrrrUrUrVr¤FszReadOnlyColumnCollection.addrr–cCs | ¡dSrhrr¶rUrUrVrøIszReadOnlyColumnCollection.extend)ÚitemrgcCs | ¡dSrhr)rTrrUrUrVrÐLszReadOnlyColumnCollection.removeN).)
rXrYrZrŒr’rÝrßr¤rørÐrUrUrUrVrâ3srâc@s,eZdZdd„Zdd„Zdd„Zdd„Zd    S)
Ú    ColumnSetcCs||kSrhrUràrUrUrVráQszColumnSet.contains_columncCs|D]}| |¡qdSrh)r¤)rTrÇr¡rUrUrVrøTszColumnSet.extendcCs:g}|D]&}|D]}| |¡r| ||k¡qqtj|ŽSrh)rêrÚr2Úand_)rTr.rÊrŸrMrUrUrVr=Xs 
zColumnSet.__eq__cCsttdd„|DƒƒƒS)Ncss|]
}|VqdSrhrUrºrUrUrVrÜasz%ColumnSet.__hash__.<locals>.<genexpr>)Úhashr6rSrUrUrVrî`szColumnSet.__hash__N)rXrYrZrárør=rîrUrUrUrVrPsrzColumnClause[Any]z1Union[_HasEntityNamespace, ExternallyTraversible])ÚentityrgcCsVztt|ƒjWStk
rPt tt|ƒ¡D]}t|ƒr.|jYSq.‚YnXdS)z£Return the nearest .entity_namespace for the given entity.
 
    If not immediately available, does an iterate to find a sub-element
    that has one, if any.
 
    N)rrurwrÈrZiterater$r{)rrÁrUrUrVÚ_entity_namespaceds    rz%Union[SQLCoreOperations[Any], _NoArg]rp)rrrrfrgc
Csjz.t|ƒ}|tk    r t|||ƒWSt||ƒWSWn6tk
rd}zt d||f¡|‚W5d}~XYnXdS)zŒReturn an entry from an entity_namespace.
 
 
    Raises :class:`_exc.InvalidRequestError` rather than attribute error
    on not found.
 
    z.Entity namespace for "%s" has no property "%s"N)rr[r<rÈr(r²)rrrrfÚnsrÐrUrUrVÚ_entity_namespace_keyws 
ÿþr)›r‹Ú
__future__rr±Úenumrr›rr®rûr,rrrr    r
r r r rrrrrrrrrrrrrrÚrrÚ    cache_keyrr Z
traversalsr!r"r#r$r%r'r(r)r*r+Z compat_typingZ util.typingr-r.r/r0r2r3Z
_orm_typesr4r5Ú_typingr6r7r8r9r:r;r<r=r>Zschemar?r@Z
selectablerArBrCZenginerDrEZengine.interfacesrFrGrHrIrJrKrLrMrNrOrPrQr[r\r]Z
_NONE_NAMEr^r`roZ_AmbiguousTableNameMaprar¯Z_never_select_columnrnrur{r|r}rr—r r¡r¢r¨r¸r‡r»rÇrÈrÉrârírírîrrr"r#Útyper(r3rSrYZ StatementRolerZ EventTargetr…r‹rŒr“r˜r™rœrr­rïrðZReadOnlyContainerrâr³rrrrUrUrUrVÚ<module>    s.                                                                             
  
   9 
+j
$&5
     , 2
 
ÿý