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
U
¸ý°dþ8ã@s dZddlmZddlmZddlZddlZddlZddlZddlm    Z    ddlm
Z
ddlm Z ddlm Z dd    lm Z dd
lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm 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+ejs²e(sÀdd%l,m-Z-n dd%l.m-Z-ejrìdd&l/m0Z0dd'l1m2Z2ee3d(fZ4ee3d(e5fZ6e    Z7ee4e7fZ8eeee    fZ9ee    d)fZ:ed*e9d+Z;ed,e    d+Z<ed-ee    d)fd+Z=ee;e:fZ>eee    fZ?eed.Z@e
ee    gee    fZAe
e    ge    fZBeee    eeBfZCGd/d0„d0ƒZDGd1d2„d2ejEe    ƒZFGd3d4„d4eDƒZGdWd5d6d7d8œd9d:„ZHGd;d<„d<eƒZIeIjJZJGd=d>„d>e$e e;ƒZKGd?d@„d@ƒZLGdAdB„dBeLeKee=ƒZMGdCdD„dDeKe;ƒZNGdEdF„dFeNe;ƒZOGdGdH„dHeNe;e jPƒZQGdIdJ„dJeLeNeƒZRGdKdL„dLe e=ƒZSGdMdN„dNeMe=ƒZTdOdPœdQdR„ZUGdSdT„dTeTe=ƒZVGdUdV„dVeTe=ƒZWdS)Xz%Define generic result set constructs.é)Ú annotations)ÚEnumN)ÚAny)ÚCallable)Úcast)ÚDict)ÚGeneric)ÚIterable)ÚIterator)ÚList)ÚMapping)ÚNoReturn)ÚOptional)Úoverload)ÚSequence)ÚSet)ÚTuple)Ú TYPE_CHECKING)ÚTypeVar)ÚUnioné)ÚRow)Ú
RowMappingé)Úexc)Úutil)Ú _generative)Ú HasMemoized)ÚInPlaceGenerative)Ú!HasMemoized_ro_memoized_attribute)ÚNONE_SET)ÚHAS_CYEXTENSION)ÚLiteral)ÚSelf)Ú tuplegetter)ÚColumn)Ú_ResultProcessorTypez Column[Any].Ú_R)ÚboundÚ_TÚ_TPz_ResultProcessorType[Any]c@sšeZdZUdZdZdZded<dZded<dZded    <d
ed <d ed <ded<ded<e    ddœdd„ƒZ
dddœdd„Z ddœdd„Z e dOddd d!d"œd#d$„ƒZe dPddd%d&d"œd'd$„ƒZe dQdddd(d"œd)d$„ƒZdRdddd(d"œd+d$„Zd,d!d-œd.d/„Zd0dd1d2œd3d4„Zd5d6d7œd8d9„Zd5d:d7œd;d<„Zd5dd7œd=d>„ZdSddd?d2œd@dA„Zd5dBd7œdCdD„ZdEdFddGœdHdI„Zddd!dJœdKdL„Ze    ddœdMdN„ƒZdS)TÚResultMetaDataz$Base for metadata about result rows.©NúOptional[_TupleGetterType]Ú _tuplefilterúOptional[Sequence[int]]Ú_translated_indexesú(Optional[Sequence[Callable[[Any], Any]]]Ú_unique_filtersÚ _KeyMapTypeÚ_keymapú Sequence[str]Ú_keysúOptional[_ProcessorsType]Ú _processorsúMapping[_KeyType, int]Ú _key_to_indexÚ    RMKeyView©ÚreturncCst|ƒS©N)r;©Úselfr,r,úOd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/engine/result.pyÚkeysjszResultMetaData.keysÚobjectÚbool©Úkeyr=cCs
tƒ‚dSr>©ÚNotImplementedError©r@rFr,r,rAÚ_has_keynszResultMetaData._has_keycCs
tƒ‚dSr>rGr?r,r,rAÚ _for_freezeqszResultMetaData._for_freeze.rzOptional[Exception]ú Literal[True]r )rFÚerrÚraiseerrr=cCsdSr>r,©r@rFrMrNr,r,rAÚ _key_fallbacktszResultMetaData._key_fallbackzLiteral[False]ÚNonecCsdSr>r,rOr,r,rArPzszOptional[NoReturn]cCsdSr>r,rOr,r,rArPƒsTcCs|st‚t|ƒ|‚dSr>)ÚAssertionErrorÚKeyErrorrOr,r,rArP‰sÚ_KeyMapRecType)Úrecr=cCs tdƒ‚dS)NzCambiguous column name logic is implemented for CursorResultMetaDatarG)r@rUr,r,rAÚ _raise_for_ambiguous_column_namesÿz/ResultMetaData._raise_for_ambiguous_column_nameÚ _KeyIndexTypeú Optional[int]©rFrNr=cCs
tƒ‚dSr>rG©r@rFrNr,r,rAÚ_index_for_key—szResultMetaData._index_for_keyúSequence[_KeyIndexType]ú Sequence[int]©rBr=cCs
tƒ‚dSr>rG©r@rBr,r,rAÚ_indexes_for_keysœsz ResultMetaData._indexes_for_keysúIterator[_KeyMapRecType]cCs
tƒ‚dSr>rGr_r,r,rAÚ_metadata_for_keys¡sz!ResultMetaData._metadata_for_keyscCs
tƒ‚dSr>rGr_r,r,rAÚ_reduce¦szResultMetaData._reduceú#Optional[Callable[[Row[Any]], Any]]cCs&| ||¡}|dk    rt |¡SdSdSr>)r[ÚoperatorÚ
itemgetter)r@rFrNÚindexr,r,rAÚ_getter©s 
zResultMetaData._getterÚ_TupleGetterTypecCs| |¡}t|ŽSr>)r`r$)r@rBÚindexesr,r,rAÚ_row_as_tuple_getter´s
z#ResultMetaData._row_as_tuple_getterz Mapping[_KeyType, Sequence[Any]]Úint)Úkeymaprgr=cs‡fdd„| ¡DƒS)Ncs&i|]\}}|ˆdk    r||ˆ“qSr>r,)Ú.0rFrU©rgr,rAÚ
<dictcomp>½s þz5ResultMetaData._make_key_to_index.<locals>.<dictcomp>)Úitems)r@rmrgr,rorAÚ_make_key_to_indexºs
þz!ResultMetaData._make_key_to_index)rFÚ
attr_errorr=c
Csv||jkr| |j|¡nV|rfz| |d¡Wqrtk
rb}zt|jdƒ|‚W5d}~XYqrXn | |d¡dS©Nr)r4rVrPrSÚAttributeErrorÚargs)r@rFrsÚker,r,rAÚ_key_not_foundÃs
$zResultMetaData._key_not_foundcCs |jrt |j¡rdS|jSdSr>)r8r Ú
issupersetr?r,r,rAÚ_effective_processorsÑsz$ResultMetaData._effective_processors).).).)T)T)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    __slots__r.Ú__annotations__r0r2ÚpropertyrBrJrKrrPrVr[r`rbrcrhrkrrrxrzr,r,r,rAr+]sH
   ÿüÿÿÿ     r+c@sŠeZdZUdZded<ded<ddœdd„Zd    d
œd d „Zd d
œdd„Zdd
œdd„Zdddœdd„Z    dddœdd„Z
dddœdd„Z dS)r;©Ú_parentr6r+rƒr5r6)ÚparentcCs||_dd„|jDƒ|_dS)NcSsg|]}|dk    r|‘qSr>r,)rnÚkr,r,rAÚ
<listcomp>ász&RMKeyView.__init__.<locals>.<listcomp>r‚)r@r„r,r,rAÚ__init__ßszRMKeyView.__init__rlr<cCs
t|jƒSr>)Úlenr6r?r,r,rAÚ__len__ãszRMKeyView.__len__ÚstrcCs
d |¡S)Nz#{0.__class__.__name__}({0._keys!r}))Úformatr?r,r,rAÚ__repr__æszRMKeyView.__repr__z Iterator[str]cCs
t|jƒSr>)Úiterr6r?r,r,rAÚ__iter__észRMKeyView.__iter__rrD)Úitemr=cCst|tƒrdS|j |¡S)NF)Ú
isinstancerlrƒrJ)r@rr,r,rAÚ __contains__ìs
zRMKeyView.__contains__)Úotherr=cCst|ƒt|ƒkSr>©Úlist©r@r’r,r,rAÚ__eq__ôszRMKeyView.__eq__cCst|ƒt|ƒkSr>r“r•r,r,rAÚ__ne__÷szRMKeyView.__ne__N) r{r|r}rr€r‡r‰rŒrŽr‘r–r—r,r,r,rAr;Ùs
r;c@sÊeZdZUdZdZded<d2ddddd    d
d œd d „Zdddœdd„Zddœdd„Zddœdd„Z    dddœdd„Z
dddd œd!d"„Z d3ddd$d%œd&d'„Z d(d)d*œd+d,„Z d(d-d*œd.d/„Zd(dd*œd0d1„ZdS)4ÚSimpleResultMetaDataz*result metadata for in-memory collections.)r6r4r8r.r0r2r:r5r6NzOptional[Sequence[Any]]r7r-r/r1)rBÚextrar8r.r0r2cCszt|ƒ|_||_||_||_|r<dd„tt|j|ƒƒDƒ}ndd„t|jƒDƒ}dd„|Dƒ|_||_|     |jd¡|_
dS)NcSs0g|](\}\}}|f|r|nd|||ff‘qS©r,r,)rnrgÚnameÚextrasr,r,rAr†s
ýþz1SimpleResultMetaData.__init__.<locals>.<listcomp>cSs g|]\}}|f||dff‘qSršr,)rnrgr›r,r,rAr† sÿcSs i|]\}}|D]
}||“qqSr,r,)rnrBrUrFr,r,rArp%s
z1SimpleResultMetaData.__init__.<locals>.<dictcomp>r) r”r6r.r0r2Ú    enumerateÚzipr4r8rrr:)r@rBr™r8r.r0r2Z
recs_namesr,r,rAr‡
s    
ûþzSimpleResultMetaData.__init__rCrDrEcCs
||jkSr>©r4rIr,r,rArJ+szSimpleResultMetaData._has_keyr+r<cs:ˆj}|rˆjrˆ |¡}tˆj‡fdd„ˆjDƒ|dS)Ncsg|]}ˆj|d‘qS)rrŸ©rnrFr?r,rAr†7sz4SimpleResultMetaData._for_freeze.<locals>.<listcomp>)r™r2)r2r.r˜r6)r@Zunique_filtersr,r?rArK.s
 
ýz SimpleResultMetaData._for_freezezDict[str, Any]cCs|j|jdœS)N©r6r0r¡r?r,r,rAÚ __getstate__;sþz!SimpleResultMetaData.__getstate__rQ)Ústater=cCs:|dr|d}t|Ž}nd}}|j|d||ddS)Nr0r6)r0r.)r$r‡)r@r£r0r.r,r,rAÚ __setstate__As
ýz!SimpleResultMetaData.__setstate__rúRow[Any])ÚvalueÚrowr=cCs
||jkSr>)Ú_data)r@r¦r§r,r,rAÚ    _containsMszSimpleResultMetaData._containsTrlrYc
Cs^t|jjkr|j|}z|j|}Wn0tk
rT}z| |||¡}W5d}~XYnX|dSrt©rlÚ    __class__Ú__mro__r6r4rSrP)r@rFrNrUrwr,r,rAr[Ps 
 z#SimpleResultMetaData._index_for_keyú Sequence[Any]r]r^cs‡fdd„|DƒS)Ncsg|]}ˆj|d‘qS©rrŸr r?r,rAr†[sz:SimpleResultMetaData._indexes_for_keys.<locals>.<listcomp>r,r_r,r?rAr`Zsz&SimpleResultMetaData._indexes_for_keysrac csj|D]`}t|jjkr|j|}z|j|}Wn0tk
r\}z| ||d¡}W5d}~XYnX|VqdS)NTrª)r@rBrFrUrwr,r,rArb]s 
 z'SimpleResultMetaData._metadata_for_keysc    
s˜z‡fdd„|Dƒ}Wn6tk
rL}zˆ |jd|d¡W5d}~XYnXt|Ž\}}}ˆjrt‡fdd„|Dƒ}t|Ž}t||||ˆjˆjd}|S)Ncs,g|]$}ˆjt|jjkr"ˆj|n|‘qSr,)r4rlr«r¬r6r r?r,rAr†msýÿz0SimpleResultMetaData._reduce.<locals>.<listcomp>rTcsg|]}ˆj|‘qSr,)r0)rnÚidxr?r,rAr†|s)r™r.r0r8r2)    rSrPrvržr0r$r˜r8r2)    r@rBZmetadata_for_keysrwrjZnew_keysr™ÚtupZ new_metadatar,r?rArcks&
ü
&ú    zSimpleResultMetaData._reduce)NNNNN)T)r{r|r}r~rr€r‡rJrKr¢r¤r©r[r`rbrcr,r,r,rAr˜ûs$
 
ù!  
r˜r5ú Optional[Any]z#Callable[[Iterable[Any]], Row[Any]])Úfieldsr™r=cCst||ƒ}t t||j|j¡Sr>)r˜Ú    functoolsÚpartialrrzr:)r²r™r„r,r,rAÚ result_tupleŒs
ÿrµc@seZdZdZdS)Ú_NoRowrN)r{r|r}Ú_NO_ROWr,r,r,rAr¶˜sr¶c@sœeZdZUdZdZded<dZded<ded    <dZd
ed <dZded <d Z    ded<ded<ddœdd„Z
dJdddœdd„Z dKdddœdd„Z ddœdd„Z dLdd d!œd"d#„Zed$dœd%d&„ƒZed'dœd(d)„ƒZd*dœd+d,„Zd*dœd-d.„Zed/dœd0d1„ƒZed2dœd3d4„ƒZedd5dd6d7œd8d9„ƒZedddd:d7œd;d9„ƒZdddd:d7œd<d9„Zd=dœd>d?„Zd6dœd@dA„ZedBdCdDœdEdF„ƒZejdGdœdHdI„ƒZdS)MÚResultInternalr,NúOptional[Result[Any]]Ú _real_resultTrDÚ_generate_rowsúOptional[Callable[[Any], Any]]Ú_row_logging_fnz Optional[_UniqueFilterStateType]Ú_unique_filter_stateÚ_post_creational_filterFr+Ú    _metadataÚ_source_supports_scalarsú#Iterator[_InterimRowType[Row[Any]]]r<cCs
tƒ‚dSr>rGr?r,r,rAÚ_fetchiter_impl®szResultInternal._fetchiter_implú#Optional[_InterimRowType[Row[Any]]]©Ú
hard_closer=cCs
tƒ‚dSr>rG©r@rÆr,r,rAÚ_fetchone_impl±szResultInternal._fetchone_implrXúList[_InterimRowType[Row[Any]]]©Úsizer=cCs
tƒ‚dSr>rG©r@rËr,r,rAÚ_fetchmany_impl¶szResultInternal._fetchmany_implcCs
tƒ‚dSr>rGr?r,r,rAÚ_fetchall_impl»szResultInternal._fetchall_implrQ©Úhardr=cCs
tƒ‚dSr>rG©r@rÐr,r,rAÚ _soft_close¾szResultInternal._soft_closeúOptional[Callable[..., _R]]csÞ|jr |jntd|ƒ}|jrF|js&dSt‰ddddddœ‡fdd    „ }nt}|j}|j}|j}|j}|r¤|js¤|rx||ƒ}t     
||||¡‰|‰d
d d œ‡‡fd d„ }nt     
||||¡}|j rÚ|j ‰|‰d
d d œ‡‡fdd„ }|S)Nú Result[Any]r+r7r9rr¥)ÚmetadataÚ
processorsÚ key_to_indexÚ
scalar_objr=csˆ||||fƒSr>r,)rÕrÖr×rØ)Ú_procr,rAÚ process_rowÏs ÿz/ResultInternal._row_getter.<locals>.process_rowz_InterimRowType[Row[Any]]r')r§r=cs ˆˆ|ƒƒSr>r,©r§)Ú_make_row_origÚfixed_tfr,rAÚmake_rowìsz,ResultInternal._row_getter.<locals>.make_rowcs ˆˆ|ƒƒSr>r,rÛ)Ú_log_rowÚ    _make_rowr,rArÞøs) rºrrÁr»rrÀr:rzr.r³r´r½)r@Ú real_resultrÚrÕr×rÖÚtfrÞr,)rßràrÜrÙrÝrAÚ _row_getterÁsHÿý 
ÿÿzResultInternal._row_getterzCallable[..., Iterator[_R]]csR|j‰|j‰|jr8|j\‰‰dddœ‡‡‡‡fdd„ }ndddœ‡‡fdd„ }|S)NrÔú Iterator[_R]©r@r=c3sX| ¡D]J}ˆrˆ|ƒn|}ˆr(ˆ|ƒn|}|ˆkr6qˆ |¡ˆrLˆ|ƒ}|VqdSr>)rÃÚadd)r@Úraw_rowÚobjÚhashed©rÞÚpost_creational_filterÚstrategyÚuniquesr,rAÚiterrowss ÿ
z1ResultInternal._iterator_getter.<locals>.iterrowsc3s4| ¡D]&}ˆrˆ|ƒn|}ˆr(ˆ|ƒ}|VqdSr>)rÃ)r@rçr§©rÞrër,rArîs  ÿ©rãr¿r¾Ú_unique_strategy)r@rîr,rêrAÚ_iterator_getterýs
    zResultInternal._iterator_getterúList[_R]cs,|j‰ˆdk    st‚| ¡}‡fdd„|DƒS)Ncsg|] }ˆ|ƒ‘qSr,r,©rnr§©rÞr,rAr†%sz0ResultInternal._raw_all_rows.<locals>.<listcomp>)rãrRrÎ)r@Úrowsr,rõrAÚ _raw_all_rows!s zResultInternal._raw_all_rowscs€|j‰|j‰| ¡}ˆr,‡fdd„|Dƒ}n|}|jrb|j\‰‰‡fdd„‡fdd„|DƒDƒ}n|}ˆr|‡fdd„|Dƒ}|S)Ncsg|] }ˆ|ƒ‘qSr,r,rôrõr,rAr†0sz+ResultInternal._allrows.<locals>.<listcomp>cs&g|]\}}|ˆkrˆ |¡s|‘qSr,©ræ©rnÚmade_rowZsig_row©rír,rAr†9s
øcs g|]}|ˆrˆ|ƒn|f‘qSr,r,©rnrú©rìr,rAr†;sýþcsg|] }ˆ|ƒ‘qSr,r,rô©rër,rAr†Hs)r¿rãrÎr¾rñ)r@röÚ    made_rowsZ interim_rowsr,rêrAÚ_allrows's&
 
 
ûþ 
ÿzResultInternal._allrowsz1Callable[..., Union[Literal[_NoRow._NO_ROW], _R]]csR|j‰|j‰|jr8|j\‰‰dddœ‡‡‡‡fdd„ }ndddœ‡‡fdd„ }|S)NrÔzUnion[_NoRow, _R]råcsd|j}|ƒ}|dkrtSˆr$ˆ|ƒn|}ˆr4ˆ|ƒn|}|ˆkrDqn
ˆ |¡ˆrZˆ|ƒ}|SqdSr>)rÈr·ræ)r@Z_onerowr§rèrérêr,rAÚonerowXsÿ
z-ResultInternal._onerow_getter.<locals>.onerowcs8| ¡}|dkrtSˆr ˆ|ƒn|}ˆr0ˆ|ƒ}|SdSr>)rÈr·)r@r§Z interim_rowrïr,rArmsÿrð)r@rr,rêrAÚ_onerow_getterMs
 zResultInternal._onerow_getterzCallable[..., List[_R]]csn|j‰|j‰|jrR|j\‰‰ddddddœdd„‰d    d
dd œ‡‡‡‡‡fd d „ }nd    d
dd œ‡‡fdd „ }|S)NrÓz    List[Any]z$Optional[Callable[[List[Any]], Any]]zSet[Any]ró)rÞrörìrír=csNˆr‡fdd„|Dƒ}ˆr.‡fdd„|Dƒ}ndd„|Dƒ}‡fdd„|DƒS)Ncsg|] }ˆ|ƒ‘qSr,r,rôrõr,rAr†‹szFResultInternal._manyrow_getter.<locals>.filterrows.<locals>.<listcomp>c3s|]}|ˆ|ƒfVqdSr>r,rürýr,rAÚ    <genexpr>ŽszEResultInternal._manyrow_getter.<locals>.filterrows.<locals>.<genexpr>css|]}||fVqdSr>r,rür,r,rAr’scs&g|]\}}|ˆkrˆ |¡s|‘qSr,rørùrûr,rAr†“s
þr,)rÞrörìrírÿr,)rÞrìrírAÚ
filterrows„s
ÿ
þz2ResultInternal._manyrow_getter.<locals>.filterrowszResultInternal[_R]rX)r@Únumr=csÖg}|j}|dkrx|jr|jntd|ƒ}|jr:|j}}q|||ƒ}t|ƒ}ˆdk    sVt‚| ˆˆ|ˆˆƒ¡|t|ƒ}n|}|dk    sˆt‚|r¼||ƒ}|sšq¼| ˆˆ|ˆˆƒ¡|t|ƒ}qˆˆr҇fdd„|Dƒ}|S)NrÔcsg|] }ˆ|ƒ‘qSr,r,rôrþr,rAr†ÅsúDResultInternal._manyrow_getter.<locals>.manyrows.<locals>.<listcomp>)rÍrºrÚ
_yield_perrˆrRÚextend)r@rZcollectZ    _manyrowsráZ num_requiredrö©rrÞrërìrír,rAÚmanyrows™s:ÿý   ÿ  ÿz0ResultInternal._manyrow_getter.<locals>.manyrowscs^|dkr$|jr|jntd|ƒ}|j}| |¡}ˆrD‡fdd„|Dƒ}ˆrZ‡fdd„|Dƒ}|S)NrÔcsg|] }ˆ|ƒ‘qSr,r,rôrõr,rAr†×srcsg|] }ˆ|ƒ‘qSr,r,rôrþr,rAr†Ùs)rºrrrÍ)r@rrárörïr,rAr
Êsÿý
rð)r@r
r,r    rAÚ_manyrow_getter{s
 1zResultInternal._manyrow_getterrLr')Úraise_for_second_rowÚraise_for_noneÚscalarr=cCsdSr>r,©r@r r rr,r,rAÚ _only_one_rowÞszResultInternal._only_one_rowú Optional[_R]cCsdSr>r,rr,r,rArçsc Cs¬|j}|dd}|dkr,|r(t d¡‚ndS|rB|jrBd|_d}n|j}z|rV||ƒn|}Wn|jdd‚YnX|rf|jr"|j\}}|rœ||ƒn|}    |dd}
|
dkrºt    }
q:zH|rÈ||
ƒn|
}
|rî|
t    k    sÜt
‚|    ||
ƒkrúWq n ||
krúWq Wq:Wq |jdd‚Yq Xq n|dd}
|
dkr:t    }
|
t    k    rv|jddt  |r^dnd¡‚nt    }
|jdd|s|j } | r| |ƒ}|r¤|r¤|dS|SdS)    NT©rÆz&No row was found when one was requiredF©rÐz6Multiple rows were found when exactly one was requiredz6Multiple rows were found when one or none was requiredr) rÈrZ NoResultFoundrÁr»rãrÒr¾rñr·rRZMultipleResultsFoundr¿) r@r r rrr§rÞrírìZexisting_row_hashZnext_rowrër,r,rArðsp
ÿ
 
 
 
 
 
 
 ÿý  räcCs
| |¡Sr>)ròr?r,r,rAÚ
_iter_implFszResultInternal._iter_implcCs"| |¡}|tkrtƒ‚n|SdSr>)rr·Ú StopIteration©r@r§r,r,rAÚ
_next_implIs
zResultInternal._next_implr\r#)rjr=cCsD|jr |jntd|ƒ}|jr(t|ƒdkr6|j |¡|_|js@t‚|S)NrÔr)rºrrÁrˆrÀrcr»rR)r@rjrár,r,rAÚ_column_slicesPsÿý
zResultInternal._column_slicesÚ_UniqueFilterStateTypecCsˆ|jdk    st‚|j\}}|jdk    r(|jntd|ƒ}|s€|jjr€|jrX|jsX|jjd}n(|jj}|jjrt|j |¡}t     
d|¡}||fS)NrÔrZ_filter_on_values) r¾rRrºrrÀr2rÁr»r.reÚ methodcaller)r@rírìráÚfiltersr,r,rArñ_s"
ÿý ÿþ  zResultInternal._unique_strategy)F)N)F)r{r|r}rrºr€r»r¾r¿Z
_is_cursorrÃrÈrÍrÎrÒrrãròr÷rrr rrrrrrrZmemoized_attributerñr,r,r,rAr¸ŸsJ
    ÿÿ;#&-bVr¸c@s(eZdZUdZded<ddœdd„ZdS)    Ú    _WithKeysr,r+rÀr;r<cCs|jjS)akReturn an iterable view which yields the string keys that would
        be represented by each :class:`_engine.Row`.
 
        The keys can represent the labels of the columns returned by a core
        statement or the names of the orm classes returned by an orm
        execution.
 
        The view also can be tested for key containment using the Python
        ``in`` operator, which will test both for the string keys represented
        in the view, as well as for alternate keys such as column objects.
 
        .. versionchanged:: 1.4 a key view object is returned rather than a
           plain list.
 
 
        )rÀrBr?r,r,rArBsz_WithKeys.keysN)r{r|r}rr€rBr,r,r,rArys
rc@sæeZdZUdZdZdZded<dZded<dZd    ed
<e     
¡Z d ed <d dœdd„Z ddœdd„Z dddddœdd„Zddœdd„Zeddœdd„ƒZeddœdd„ƒZed dd!œd"d#„ƒZedd$dd%œd&d'„ƒZd(dd)œd*d+„Zed,d-d.œd/d0„ƒZed,d1d-d2œd3d0„ƒZed€d(d5d6œd7d0„ƒZdd(d5d6œd8d0„Zd‚d(dd:d;œd<d=„Zd>d?d@œdAdB„ZdCdœdDdE„ZedFdœdGdH„ƒZdFdœdIdJ„ZdKdœdLdM„ZdNdœdOdP„ZdQdœdRdS„Z dƒd    dTdUœdVdW„Z!dXdœdYdZ„Z"d[dœd\d]„Z#d„d    dXdUœd^d_„Z$dXdœd`da„Z%d[dœdbdc„Z&d[dœddde„Z'ed,dfd.œdgdh„ƒZ(eddœdidh„ƒZ(ddœdjdh„Z(ed,dkd.œdldm„ƒZ)edndœdodm„ƒZ)dndœdpdm„Z)dQdœdqdr„Z*ed,dkd.œdsdt„ƒZ+eddœdudt„ƒZ+ddœdvdt„Z+dwdœdxdy„Z,dzd{d|œd}d~„Z-dS)…ÚResulta\Represent a set of database results.
 
    .. versionadded:: 1.4  The :class:`_engine.Result` object provides a
       completely updated usage model and calling facade for SQLAlchemy
       Core and SQLAlchemy ORM.   In Core, it forms the basis of the
       :class:`_engine.CursorResult` object which replaces the previous
       :class:`_engine.ResultProxy` interface.   When using the ORM, a
       higher level object called :class:`_engine.ChunkedIteratorResult`
       is normally used.
 
    .. note:: In SQLAlchemy 1.4 and above, this object is
       used for ORM results returned by :meth:`_orm.Session.execute`, which can
       yield instances of ORM mapped objects either individually or within
       tuple-like rows. Note that the :class:`_engine.Result` object does not
       deduplicate instances or rows automatically as is the case with the
       legacy :class:`_orm.Query` object. For in-Python de-duplication of
       instances or rows, use the :meth:`_engine.Result.unique` modifier
       method.
 
    .. seealso::
 
        :ref:`tutorial_fetching_rows` - in the :doc:`/tutorial/index`
 
    )rÀÚ__dict__Nz(Optional[Callable[[Row[Any]], Row[Any]]]r½FrDrÁrXrzutil.immutabledict[Any, Any]Ú _attributesr+)Úcursor_metadatacCs
||_dSr>)rÀ)r@r r,r,rAr‡·szResult.__init__r#r<cCs|Sr>r,r?r,r,rAÚ    __enter__ºszResult.__enter__rrQ©Útype_r¦Ú    tracebackr=cCs | ¡dSr>)Úclose©r@r#r¦r$r,r,rAÚ__exit__½szResult.__exit__cCs|jdddS)aýclose this :class:`_engine.Result`.
 
        The behavior of this method is implementation specific, and is
        not implemented by default.    The method should generally end
        the resources in use by the result object and also cause any
        subsequent iteration or row fetching to raise
        :class:`.ResourceClosedError`.
 
        .. versionadded:: 1.4.27 - ``.close()`` was previously not generally
           available for all :class:`_engine.Result` classes, instead only
           being available on the :class:`_engine.CursorResult` returned for
           Core statement executions. As most other result objects, namely the
           ones used by the ORM, are proxying a :class:`_engine.CursorResult`
           in any case, this allows the underlying cursor result to be closed
           from the outside facade for the case when the ORM query is using
           the ``yield_per`` execution option where it does not immediately
           exhaust and autoclose the database cursor.
 
        TrN)rÒr?r,r,rAr%Àsz Result.closecCs
tƒ‚dSr>rGr?r,r,rAÚ _soft_closedÖszResult._soft_closedcCs
tƒ‚dS)zkreturn ``True`` if this :class:`_engine.Result` reports .closed
 
        .. versionadded:: 1.4.43
 
        NrGr?r,r,rAÚclosedÚsz Result.closedrl©rr=cCs
||_|S)aåConfigure the row-fetching strategy to fetch ``num`` rows at a time.
 
        This impacts the underlying behavior of the result when iterating over
        the result object, or otherwise making use of  methods such as
        :meth:`_engine.Result.fetchone` that return one row at a time.   Data
        from the underlying cursor or other data source will be buffered up to
        this many rows in memory, and the buffered collection will then be
        yielded out one row at a time or as many rows are requested. Each time
        the buffer clears, it will be refreshed to this many rows or as many
        rows remain if fewer remain.
 
        The :meth:`_engine.Result.yield_per` method is generally used in
        conjunction with the
        :paramref:`_engine.Connection.execution_options.stream_results`
        execution option, which will allow the database dialect in use to make
        use of a server side cursor, if the DBAPI supports a specific "server
        side cursor" mode separate from its default mode of operation.
 
        .. tip::
 
            Consider using the
            :paramref:`_engine.Connection.execution_options.yield_per`
            execution option, which will simultaneously set
            :paramref:`_engine.Connection.execution_options.stream_results`
            to ensure the use of server side cursors, as well as automatically
            invoke the :meth:`_engine.Result.yield_per` method to establish
            a fixed row buffer size at once.
 
            The :paramref:`_engine.Connection.execution_options.yield_per`
            execution option is available for ORM operations, with
            :class:`_orm.Session`-oriented use described at
            :ref:`orm_queryguide_yield_per`. The Core-only version which works
            with :class:`_engine.Connection` is new as of SQLAlchemy 1.4.40.
 
        .. versionadded:: 1.4
 
        :param num: number of rows to fetch each time the buffer is refilled.
         If set to a value below 1, fetches all rows for the next buffer.
 
        .. seealso::
 
            :ref:`engine_stream_results` - describes Core behavior for
            :meth:`_engine.Result.yield_per`
 
            :ref:`orm_queryguide_yield_per` - in the :ref:`queryguide_toplevel`
 
        )r©r@rr,r,rAÚ    yield_perãs1zResult.yield_perúOptional[_UniqueFilterType]©rìr=cCstƒ|f|_|S)aApply unique filtering to the objects returned by this
        :class:`_engine.Result`.
 
        When this filter is applied with no arguments, the rows or objects
        returned will filtered such that each row is returned uniquely. The
        algorithm used to determine this uniqueness is by default the Python
        hashing identity of the whole tuple.   In some cases a specialized
        per-entity hashing scheme may be used, such as when using the ORM, a
        scheme is applied which  works against the primary key identity of
        returned objects.
 
        The unique filter is applied **after all other filters**, which means
        if the columns returned have been refined using a method such as the
        :meth:`_engine.Result.columns` or :meth:`_engine.Result.scalars`
        method, the uniquing is applied to **only the column or columns
        returned**.   This occurs regardless of the order in which these
        methods have been called upon the :class:`_engine.Result` object.
 
        The unique filter also changes the calculus used for methods like
        :meth:`_engine.Result.fetchmany` and :meth:`_engine.Result.partitions`.
        When using :meth:`_engine.Result.unique`, these methods will continue
        to yield the number of rows or objects requested, after uniquing
        has been applied.  However, this necessarily impacts the buffering
        behavior of the underlying cursor or datasource, such that multiple
        underlying calls to ``cursor.fetchmany()`` may be necessary in order
        to accumulate enough objects in order to provide a unique collection
        of the requested size.
 
        :param strategy: a callable that will be applied to rows or objects
         being iterated, which should return an object that represents the
         unique value of the row.   A Python ``set()`` is used to store
         these identities.   If not passed, a default uniqueness strategy
         is used which may have been assembled by the source of this
         :class:`_engine.Result` object.
 
        ©Úsetr¾©r@rìr,r,rAÚuniques& z Result.uniquerW©Úcol_expressionsr=cGs
| |¡S)a9Establish the columns that should be returned in each row.
 
        This method may be used to limit the columns returned as well
        as to reorder them.   The given list of expressions are normally
        a series of integers or string key names.   They may also be
        appropriate :class:`.ColumnElement` objects which correspond to
        a given statement construct.
 
        .. versionchanged:: 2.0  Due to a bug in 1.4, the
           :meth:`_engine.Result.columns` method had an incorrect behavior
           where calling upon the method with just one index would cause the
           :class:`_engine.Result` object to yield scalar values rather than
           :class:`_engine.Row` objects.   In version 2.0, this behavior
           has been corrected such that calling upon
           :meth:`_engine.Result.columns` with a single index will
           produce a :class:`_engine.Result` object that continues
           to yield :class:`_engine.Row` objects, which include
           only a single column.
 
        E.g.::
 
            statement = select(table.c.x, table.c.y, table.c.z)
            result = connection.execute(statement)
 
            for z, y in result.columns('z', 'y'):
                # ...
 
 
        Example of using the column objects from the statement itself::
 
            for z, y in result.columns(
                    statement.selected_columns.c.z,
                    statement.selected_columns.c.y
            ):
                # ...
 
        .. versionadded:: 1.4
 
        :param \*col_expressions: indicates columns to be returned.  Elements
         may be integer row indexes, string column names, or appropriate
         :class:`.ColumnElement` objects corresponding to a select construct.
 
        :return: this :class:`_engine.Result` object with the modifications
         given.
 
        ©r©r@r4r,r,rAÚcolumns@s/zResult.columnszResult[Tuple[_T]]zScalarResult[_T]råcCsdSr>r,r?r,r,rAÚscalarsqszResult.scalarsz
Literal[0])r@rgr=cCsdSr>r,©r@rgr,r,rAr8usrzScalarResult[Any])rgr=cCsdSr>r,r9r,r,rAr8{scCs
t||ƒS)a@Return a :class:`_engine.ScalarResult` filtering object which
        will return single elements rather than :class:`_row.Row` objects.
 
        E.g.::
 
            >>> result = conn.execute(text("select int_id from table"))
            >>> result.scalars().all()
            [1, 2, 3]
 
        When results are fetched from the :class:`_engine.ScalarResult`
        filtering object, the single column-row that would be returned by the
        :class:`_engine.Result` is instead returned as the column's value.
 
        .. versionadded:: 1.4
 
        :param index: integer or row key indicating the column to be fetched
         from each row, defaults to ``0`` indicating the first column.
 
        :return: a new :class:`_engine.ScalarResult` filtering object referring
         to this :class:`_engine.Result` object.
 
        )Ú ScalarResultr9r,r,rAr8sTrdrYcCs|jrtdƒ‚|j ||¡S)zareturn a callable that will retrieve the given key from a
        :class:`_engine.Row`.
 
        ú.can't use this function in 'only scalars' mode)rÁrHrÀrhrZr,r,rArh˜s
ÿzResult._getterr\rir^cCs|jrtdƒ‚|j |¡S)zbreturn a callable that will retrieve the given keys from a
        :class:`_engine.Row`.
 
        r;)rÁrHrÀrkr_r,r,rAÚ _tuple_getter¥s
ÿzResult._tuple_getterÚ MappingResultcCst|ƒS)a³Apply a mappings filter to returned rows, returning an instance of
        :class:`_engine.MappingResult`.
 
        When this filter is applied, fetching rows will return
        :class:`_engine.RowMapping` objects instead of :class:`_engine.Row`
        objects.
 
        .. versionadded:: 1.4
 
        :return: a new :class:`_engine.MappingResult` filtering object
         referring to this :class:`_engine.Result` object.
 
        )r=r?r,r,rAÚmappings°szResult.mappingszTupleResult[_TP]cCs|S)zÙApply a "typed tuple" typing filter to returned rows.
 
        The :attr:`_engine.Result.t` attribute is a synonym for
        calling the :meth:`_engine.Result.tuples` method.
 
        .. versionadded:: 2.0
 
        r,r?r,r,rAÚtÁs
zResult.tcCs|S)a+Apply a "typed tuple" typing filter to returned rows.
 
        This method returns the same :class:`_engine.Result` object
        at runtime,
        however annotates as returning a :class:`_engine.TupleResult` object
        that will indicate to :pep:`484` typing tools that plain typed
        ``Tuple`` instances are returned rather than rows.  This allows
        tuple unpacking and ``__getitem__`` access of :class:`_engine.Row`
        objects to by typed, for those cases where the statement invoked
        itself included typing information.
 
        .. versionadded:: 2.0
 
        :return: the :class:`_engine.TupleResult` type at typing time.
 
        .. seealso::
 
            :attr:`_engine.Result.t` - shorter synonym
 
            :attr:`_engine.Row.t` - :class:`_engine.Row` version
 
        r,r?r,r,rAÚtuplesÍsz Result.tuplesúIterator[_RowData]cCs
tƒ‚dS)z²Return a safe iterator that yields raw row data.
 
        This is used by the :meth:`_engine.Result.merge` method
        to merge multiple compatible results together.
 
        NrGr?r,r,rAÚ_raw_row_iteratorçszResult._raw_row_iteratorzIterator[Row[_TP]]cCs| ¡Sr>©rr?r,r,rArŽðszResult.__iter__zRow[_TP]cCs| ¡Sr>©rr?r,r,rAÚ__next__ószResult.__next__zIterator[Sequence[Row[_TP]]]rÊccs$|j}|||ƒ}|r |Vqq qdS)a¨Iterate through sub-lists of rows of the size given.
 
        Each list will be of the size given, excluding the last list to
        be yielded, which may have a small number of rows.  No empty
        lists will be yielded.
 
        The result object is automatically closed when the iterator
        is fully consumed.
 
        Note that the backend driver will usually buffer the entire result
        ahead of time unless the
        :paramref:`.Connection.execution_options.stream_results` execution
        option is used indicating that the driver should not pre-buffer
        results, if possible.   Not all drivers support this option and
        the option is silently ignored for those who do not.
 
        When using the ORM, the :meth:`_engine.Result.partitions` method
        is typically more effective from a memory perspective when it is
        combined with use of the
        :ref:`yield_per execution option <orm_queryguide_yield_per>`,
        which instructs both the DBAPI driver to use server side cursors,
        if available, as well as instructs the ORM loading internals to only
        build a certain amount of ORM objects from a result at a time before
        yielding them out.
 
        .. versionadded:: 1.4
 
        :param size: indicate the maximum number of rows to be present
         in each list yielded.  If None, makes use of the value set by
         the :meth:`_engine.Result.yield_per`, method, if it were called,
         or the :paramref:`_engine.Connection.execution_options.yield_per`
         execution option, which is equivalent in this regard.  If
         yield_per weren't set, it makes use of the
         :meth:`_engine.Result.fetchmany` default, which may be backend
         specific and not well defined.
 
        :return: iterator of lists
 
        .. seealso::
 
            :ref:`engine_stream_results`
 
            :ref:`orm_queryguide_yield_per` - in the :ref:`queryguide_toplevel`
 
        N©r ©r@rËÚgetterÚ    partitionr,r,rAÚ
partitionsös
1
zResult.partitionsúSequence[Row[_TP]]cCs| ¡S)z4A synonym for the :meth:`_engine.Result.all` method.©rr?r,r,rAÚfetchall0szResult.fetchallzOptional[Row[_TP]]cCs| |¡}|tkrdS|SdS)aÝFetch one row.
 
        When all rows are exhausted, returns None.
 
        This method is provided for backwards compatibility with
        SQLAlchemy 1.x.x.
 
        To fetch the first row of a result only, use the
        :meth:`_engine.Result.first` method.  To iterate through all
        rows, iterate the :class:`_engine.Result` object directly.
 
        :return: a :class:`_engine.Row` object if no filters are applied,
         or ``None`` if no rows remain.
 
        N©rr·rr,r,rAÚfetchone5s
zResult.fetchonecCs | ||¡S)aŽFetch many rows.
 
        When all rows are exhausted, returns an empty list.
 
        This method is provided for backwards compatibility with
        SQLAlchemy 1.x.x.
 
        To fetch rows in groups, use the :meth:`_engine.Result.partitions`
        method.
 
        :return: a list of :class:`_engine.Row` objects.
 
        .. seealso::
 
            :meth:`_engine.Result.partitions`
 
        rFrÌr,r,rAÚ    fetchmanyKszResult.fetchmanycCs| ¡S)zêReturn all rows in a list.
 
        Closes the result set after invocation.   Subsequent invocations
        will return an empty list.
 
        .. versionadded:: 1.4
 
        :return: a list of :class:`_engine.Row` objects.
 
        rLr?r,r,rAÚall`s z
Result.allcCs|jddddS)aŠFetch the first row or ``None`` if no row is present.
 
        Closes the result set and discards remaining rows.
 
        .. note::  This method returns one **row**, e.g. tuple, by default.
           To return exactly one single scalar value, that is, the first
           column of the first row, use the
           :meth:`_engine.Result.scalar` method,
           or combine :meth:`_engine.Result.scalars` and
           :meth:`_engine.Result.first`.
 
           Additionally, in contrast to the behavior of the legacy  ORM
           :meth:`_orm.Query.first` method, **no limit is applied** to the
           SQL query which was invoked to produce this
           :class:`_engine.Result`;
           for a DBAPI driver that buffers results in memory before yielding
           rows, all rows will be sent to the Python process and all but
           the first row will be discarded.
 
           .. seealso::
 
                :ref:`migration_20_unify_select`
 
        :return: a :class:`_engine.Row` object, or None
         if no rows remain.
 
        .. seealso::
 
            :meth:`_engine.Result.scalar`
 
            :meth:`_engine.Result.one`
 
        F©r r r©rr?r,r,rAÚfirstns
#ÿz Result.firstcCs|jddddS)aÚReturn at most one result or raise an exception.
 
        Returns ``None`` if the result has no rows.
        Raises :class:`.MultipleResultsFound`
        if multiple rows are returned.
 
        .. versionadded:: 1.4
 
        :return: The first :class:`_engine.Row` or ``None`` if no row
         is available.
 
        :raises: :class:`.MultipleResultsFound`
 
        .. seealso::
 
            :meth:`_engine.Result.first`
 
            :meth:`_engine.Result.one`
 
        TFrRrSr?r,r,rAÚ one_or_none•s
ÿzResult.one_or_noner)cCsdSr>r,r?r,r,rAÚ
scalar_one®szResult.scalar_onecCsdSr>r,r?r,r,rArV²scCs|jddddS)aReturn exactly one scalar result or raise an exception.
 
        This is equivalent to calling :meth:`_engine.Result.scalars` and
        then :meth:`_engine.Result.one`.
 
        .. seealso::
 
            :meth:`_engine.Result.one`
 
            :meth:`_engine.Result.scalars`
 
        TrRrSr?r,r,rArV¶s
ÿú Optional[_T]cCsdSr>r,r?r,r,rAÚscalar_one_or_noneÇszResult.scalar_one_or_noner±cCsdSr>r,r?r,r,rArXËscCs|jddddS)a$Return exactly one scalar result or ``None``.
 
        This is equivalent to calling :meth:`_engine.Result.scalars` and
        then :meth:`_engine.Result.one_or_none`.
 
        .. seealso::
 
            :meth:`_engine.Result.one_or_none`
 
            :meth:`_engine.Result.scalars`
 
        TFrRrSr?r,r,rArXÏs
ÿcCs|jddddS)aeReturn exactly one row or raise an exception.
 
        Raises :class:`.NoResultFound` if the result returns no
        rows, or :class:`.MultipleResultsFound` if multiple rows
        would be returned.
 
        .. note::  This method returns one **row**, e.g. tuple, by default.
           To return exactly one single scalar value, that is, the first
           column of the first row, use the
           :meth:`_engine.Result.scalar_one` method, or combine
           :meth:`_engine.Result.scalars` and
           :meth:`_engine.Result.one`.
 
        .. versionadded:: 1.4
 
        :return: The first :class:`_engine.Row`.
 
        :raises: :class:`.MultipleResultsFound`, :class:`.NoResultFound`
 
        .. seealso::
 
            :meth:`_engine.Result.first`
 
            :meth:`_engine.Result.one_or_none`
 
            :meth:`_engine.Result.scalar_one`
 
        TFrRrSr?r,r,rAÚoneàs
ÿz
Result.onecCsdSr>r,r?r,r,rArsz Result.scalarcCsdSr>r,r?r,r,rArscCs|jddddS)a®Fetch the first column of the first row, and close the result set.
 
        Returns ``None`` if there are no rows to fetch.
 
        No validation is performed to test if additional rows remain.
 
        After calling this method, the object is fully closed,
        e.g. the :meth:`_engine.CursorResult.close`
        method will have been called.
 
        :return: a Python scalar value, or ``None`` if no rows remain.
 
        FTrRrSr?r,r,rAr    s
ÿúFrozenResult[_TP]cCst|ƒS)aReturn a callable object that will produce copies of this
        :class:`_engine.Result` when invoked.
 
        The callable object returned is an instance of
        :class:`_engine.FrozenResult`.
 
        This is used for result set caching.  The method must be called
        on the result when it has been unconsumed, and calling the method
        will consume the result fully.   When the :class:`_engine.FrozenResult`
        is retrieved from a cache, it can be called any number of times where
        it will produce a new :class:`_engine.Result` object each time
        against its stored set of rows.
 
        .. seealso::
 
            :ref:`do_orm_execute_re_executing` - example usage within the
            ORM to implement a result-set cache.
 
        )Ú FrozenResultr?r,r,rAÚfreezesz Result.freezerÔzMergedResult[_TP])Úothersr=cGst|j|f|ƒS)aÛMerge this :class:`_engine.Result` with other compatible result
        objects.
 
        The object returned is an instance of :class:`_engine.MergedResult`,
        which will be composed of iterators from the given result
        objects.
 
        The new result will use the metadata from this result object.
        The subsequent result objects must be against an identical
        set of result / cursor metadata, otherwise the behavior is
        undefined.
 
        )Ú MergedResultrÀ)r@r]r,r,rAÚmerge2sz Result.merge)N)r)r)T)N)N).r{r|r}r~rr½r€rÁrrZ immutabledictrr‡r!r'r%rr(r)rr,r2r7rr8rhr<r>r?r@rBrŽrErJrMrOrPrQrTrUrVrXrYrr\r_r,r,r,rAr“s|
   3(1ÿ       ÿ:'!rc@sòeZdZUdZdZded<ded<ddœd    d
„Zd d d d d œdd„Zedddœdd„ƒZ    d1dd dœdd„Z
e ddœdd„ƒZ e ddœdd„ƒZ d dœdd„Ze ddœd d!„ƒZd"dœd#d$„Zd2dd%d&œd'd(„Zd)dœd*d+„Zd3d-d)d.œd/d0„Zd,S)4Ú FilterResultaZA wrapper for a :class:`_engine.Result` that returns objects other than
    :class:`_engine.Row` objects, such as dictionaries or scalar objects.
 
    :class:`_engine.FilterResult` is the common base for additional result
    APIs including :class:`_engine.MappingResult`,
    :class:`_engine.ScalarResult` and :class:`_engine.AsyncResult`.
 
    )rºr¿rÀr¾rr¼r¿rÔrºr#r<cCs|Sr>r,r?r,r,rAr!YszFilterResult.__enter__rrQr"cCs|j |||¡dSr>)rºr'r&r,r,rAr'\szFilterResult.__exit__rlr*cCs|j |¡|_|S)a‡Configure the row-fetching strategy to fetch ``num`` rows at a time.
 
        The :meth:`_engine.FilterResult.yield_per` method is a pass through
        to the :meth:`_engine.Result.yield_per` method.  See that method's
        documentation for usage notes.
 
        .. versionadded:: 1.4.40 - added :meth:`_engine.FilterResult.yield_per`
           so that the method is available on all result set implementations
 
        .. seealso::
 
            :ref:`engine_stream_results` - describes Core behavior for
            :meth:`_engine.Result.yield_per`
 
            :ref:`orm_queryguide_yield_per` - in the :ref:`queryguide_toplevel`
 
        )rºr,r+r,r,rAr,_szFilterResult.yield_perFrDrÏcCs|jj|ddS©Nr)rºrÒrÑr,r,rArÒuszFilterResult._soft_closecCs|jjSr>)rºr(r?r,r,rAr(xszFilterResult._soft_closedcCs|jjS)z|Return ``True`` if the underlying :class:`_engine.Result` reports
        closed
 
        .. versionadded:: 1.4.43
 
        )rºr)r?r,r,rAr)|szFilterResult.closedcCs|j ¡dS)zUClose this :class:`_engine.FilterResult`.
 
        .. versionadded:: 1.4.43
 
        N)rºr%r?r,r,rAr%†szFilterResult.closezDict[Any, Any]cCs|jjSr>)rºrr?r,r,rArŽszFilterResult._attributesrÂcCs
|j ¡Sr>)rºrÃr?r,r,rArÒszFilterResult._fetchiter_implrÄrÅcCs|jj|dS)Nr)rºrÈrÇr,r,rArȕszFilterResult._fetchone_implrÉcCs
|j ¡Sr>)rºrÎr?r,r,rArΚszFilterResult._fetchall_implNrXrÊcCs|jj|dS©N©rË)rºrÍrÌr,r,rAr͝szFilterResult._fetchmany_impl)F)F)N)r{r|r}r~rr€r!r'rr,rÒrr(r)r%rrÃrÈrÎrÍr,r,r,rAr`Cs,
        ÿÿr`c@sÊeZdZUdZdZdZded<dddœd    d
„Zd+d d dœdd„Zd,dddœdd„Z    ddœdd„Z
d-dddœdd„Z ddœdd„Z ddœdd „Z d!dœd"d#„Zd$dœd%d&„Zd$dœd'd(„Zd!dœd)d*„Zd S).r:a‘A wrapper for a :class:`_engine.Result` that returns scalar values
    rather than :class:`_row.Row` values.
 
    The :class:`_engine.ScalarResult` object is acquired by calling the
    :meth:`_engine.Result.scalars` method.
 
    A special limitation of :class:`_engine.ScalarResult` is that it has
    no ``fetchone()`` method; since the semantics of ``fetchone()`` are that
    the ``None`` value indicates no more results, this is not compatible
    with :class:`_engine.ScalarResult` since there is no way to distinguish
    between ``None`` as a row value versus ``None`` as an indicator.  Use
    ``next(result)`` to receive values individually.
 
    r,Fr¼r¿rÔrW)rárgcCsD||_|jr|j|_d|_n|j |g¡|_t d¡|_|j|_dSrt)rºrÁrÀr¿rcrerfr¾)r@rárgr,r,rAr‡¹s zScalarResult.__init__Nr-r#r.cCstƒ|f|_|S)z¥Apply unique filtering to the objects returned by this
        :class:`_engine.ScalarResult`.
 
        See :meth:`_engine.Result.unique` for usage details.
 
        r/r1r,r,rAr2Ås zScalarResult.uniquerXúIterator[Sequence[_R]]rÊccs$|j}|||ƒ}|r |Vqq qdS)zÞIterate through sub-lists of elements of the size given.
 
        Equivalent to :meth:`_engine.Result.partitions` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
        NrFrGr,r,rArJÏs
    
zScalarResult.partitionsú Sequence[_R]r<cCs| ¡S)ú:A synonym for the :meth:`_engine.ScalarResult.all` method.rLr?r,r,rArMászScalarResult.fetchallcCs | ||¡S)z¸Fetch many objects.
 
        Equivalent to :meth:`_engine.Result.fetchmany` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
        rFrÌr,r,rArPæszScalarResult.fetchmanycCs| ¡S)zÂReturn all scalar values in a list.
 
        Equivalent to :meth:`_engine.Result.all` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
        rLr?r,r,rArQðszScalarResult.allräcCs| ¡Sr>rCr?r,r,rArŽúszScalarResult.__iter__r'cCs| ¡Sr>rDr?r,r,rArEýszScalarResult.__next__rcCs|jddddS)zÝFetch the first object or ``None`` if no object is present.
 
        Equivalent to :meth:`_engine.Result.first` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
 
        FrRrSr?r,r,rArTs
    ÿzScalarResult.firstcCs|jddddS)z×Return at most one object or raise an exception.
 
        Equivalent to :meth:`_engine.Result.one_or_none` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
        TFrRrSr?r,r,rArU s
ÿzScalarResult.one_or_nonecCs|jddddS)zÏReturn exactly one object or raise an exception.
 
        Equivalent to :meth:`_engine.Result.one` except that
        scalar values, rather than :class:`_engine.Row` objects,
        are returned.
 
        TFrRrSr?r,r,rArYs
ÿzScalarResult.one)N)N)N)r{r|r}r~rr»r€r‡r2rJrMrPrQrŽrErTrUrYr,r,r,rAr:£s
 
 
 
  r:c@sJeZdZdZdZerFd2dddœdd„Zd    d
œd d „Zd d
œdd„Zd3dd dœdd„Z    d d
œdd„Z
dd
œdd„Z dd
œdd„Z d    d
œdd„Z d    d
œdd„Zdd
œdd„Zed d!d"œd#d$„ƒZed%d
œd&d$„ƒZd%d
œd'd$„Zed d(d"œd)d*„ƒZed+d
œd,d*„ƒZd+d
œd-d*„Zed d(d"œd.d/„ƒZed%d
œd0d/„ƒZd%d
œd1d/„ZdS)4Ú TupleResultaA :class:`_engine.Result` that's typed as returning plain
    Python tuples instead of rows.
 
    Since :class:`_engine.Row` acts like a tuple in every way already,
    this class is a typing only class, regular :class:`_engine.Result` is
    still used at runtime.
 
    r,NrXrdrÊcCsdS)zíIterate through sub-lists of elements of the size given.
 
            Equivalent to :meth:`_engine.Result.partitions` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
            Nr,rÌr,r,rArJ4s
zTupleResult.partitionsrr<cCsdS)zÃFetch one tuple.
 
            Equivalent to :meth:`_engine.Result.fetchone` except that
            tuple values, rather than :class:`_engine.Row`
            objects, are returned.
 
            Nr,r?r,r,rArO@szTupleResult.fetchonerecCsdS)rfNr,r?r,r,rArMJszTupleResult.fetchallcCsdS)zÇFetch many objects.
 
            Equivalent to :meth:`_engine.Result.fetchmany` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
            Nr,rÌr,r,rArPNszTupleResult.fetchmanycCsdS)zÑReturn all scalar values in a list.
 
            Equivalent to :meth:`_engine.Result.all` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
            Nr,r?r,r,rArQXszTupleResult.allräcCsdSr>r,r?r,r,rArŽbszTupleResult.__iter__r'cCsdSr>r,r?r,r,rArEeszTupleResult.__next__cCsdS)zìFetch the first object or ``None`` if no object is present.
 
            Equivalent to :meth:`_engine.Result.first` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
 
            Nr,r?r,r,rArThs    zTupleResult.firstcCsdS)zæReturn at most one object or raise an exception.
 
            Equivalent to :meth:`_engine.Result.one_or_none` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
            Nr,r?r,r,rArUsszTupleResult.one_or_nonecCsdS)zÞReturn exactly one object or raise an exception.
 
            Equivalent to :meth:`_engine.Result.one` except that
            tuple values, rather than :class:`_engine.Row` objects,
            are returned.
 
            Nr,r?r,r,rArY}szTupleResult.onezTupleResult[Tuple[_T]]r)råcCsdSr>r,r?r,r,rArV‡szTupleResult.scalar_onercCsdSr>r,r?r,r,rArV‹scCsdS)a6Return exactly one scalar result or raise an exception.
 
            This is equivalent to calling :meth:`_engine.Result.scalars`
            and then :meth:`_engine.Result.one`.
 
            .. seealso::
 
                :meth:`_engine.Result.one`
 
                :meth:`_engine.Result.scalars`
 
            Nr,r?r,r,rArVs rWcCsdSr>r,r?r,r,rArXžszTupleResult.scalar_one_or_noner±cCsdSr>r,r?r,r,rArX¢scCsdS)a6Return exactly one or no scalar result.
 
            This is equivalent to calling :meth:`_engine.Result.scalars`
            and then :meth:`_engine.Result.one_or_none`.
 
            .. seealso::
 
                :meth:`_engine.Result.one_or_none`
 
                :meth:`_engine.Result.scalars`
 
            Nr,r?r,r,rArX¦s cCsdSr>r,r?r,r,rArµszTupleResult.scalarcCsdSr>r,r?r,r,rAr¹scCsdS)a×Fetch the first column of the first row, and close the result
            set.
 
            Returns ``None`` if there are no rows to fetch.
 
            No validation is performed to test if additional rows remain.
 
            After calling this method, the object is fully closed,
            e.g. the :meth:`_engine.CursorResult.close`
            method will have been called.
 
            :return: a Python scalar value , or ``None`` if no rows remain.
 
            Nr,r?r,r,rAr½s)N)N)r{r|r}r~rrrJrOrMrPrQrŽrErTrUrYrrVrXrr,r,r,rArg&s:    ÿ 
 
 
 
 
rgc@sæeZdZdZdZdZe d¡Zddœdd„Z    d/d
d d œd d„Z
dd dœdd„Z d0dddœdd„Z ddœdd„Z ddœdd„Zd1dddœdd „Zddœd!d"„Zd#dœd$d%„Zd&dœd'd(„Zddœd)d*„Zddœd+d,„Zd&dœd-d.„Zd    S)2r=zïA wrapper for a :class:`_engine.Result` that returns dictionary values
    rather than :class:`_engine.Row` values.
 
    The :class:`_engine.MappingResult` object is acquired by calling the
    :meth:`_engine.Result.mappings` method.
 
    r,TÚ_mappingrÔ©ÚresultcCs0||_|j|_|j|_|jr,|j dg¡|_dSrt)rºr¾rÀrÁrc©r@rjr,r,rAr‡Þs
zMappingResult.__init__Nr-r#r.cCstƒ|f|_|S)z¦Apply unique filtering to the objects returned by this
        :class:`_engine.MappingResult`.
 
        See :meth:`_engine.Result.unique` for usage details.
 
        r/r1r,r,rAr2ås zMappingResult.uniquerWr3cGs
| |¡S)z:Establish the columns that should be returned in each row.r5r6r,r,rAr7ïszMappingResult.columnsrXzIterator[Sequence[RowMapping]]rÊccs$|j}|||ƒ}|r |Vqq qdS)zóIterate through sub-lists of elements of the size given.
 
        Equivalent to :meth:`_engine.Result.partitions` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        NrFrGr,r,rArJós
 
zMappingResult.partitionszSequence[RowMapping]r<cCs| ¡S)z;A synonym for the :meth:`_engine.MappingResult.all` method.rLr?r,r,rArMszMappingResult.fetchallzOptional[RowMapping]cCs| |¡}|tkrdS|SdS)zÊFetch one object.
 
        Equivalent to :meth:`_engine.Result.fetchone` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        NrNrr,r,rArO s    
zMappingResult.fetchonecCs | ||¡S)zÍFetch many objects.
 
        Equivalent to :meth:`_engine.Result.fetchmany` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        rFrÌr,r,rArPs    zMappingResult.fetchmanycCs| ¡S)z×Return all scalar values in a list.
 
        Equivalent to :meth:`_engine.Result.all` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        rLr?r,r,rArQ&s    zMappingResult.allzIterator[RowMapping]cCs| ¡Sr>rCr?r,r,rArŽ1szMappingResult.__iter__rcCs| ¡Sr>rDr?r,r,rArE4szMappingResult.__next__cCs|jddddS)zòFetch the first object or ``None`` if no object is present.
 
        Equivalent to :meth:`_engine.Result.first` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
 
        FrRrSr?r,r,rArT7s
    ÿzMappingResult.firstcCs|jddddS)zìReturn at most one object or raise an exception.
 
        Equivalent to :meth:`_engine.Result.one_or_none` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        TFrRrSr?r,r,rArUDs
ÿzMappingResult.one_or_nonecCs|jddddS)zäReturn exactly one object or raise an exception.
 
        Equivalent to :meth:`_engine.Result.one` except that
        :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
        objects, are returned.
 
        TFrRrSr?r,r,rArYPs
ÿzMappingResult.one)N)N)N)r{r|r}r~rr»reÚ
attrgetterr¿r‡r2r7rJrMrOrPrQrŽrErTrUrYr,r,r,rAr=Ïs$
 
ÿ    r=c@sTeZdZUdZded<ddœdd„Zdd    œd
d „Zd d dœdd„Zdd    œdd„ZdS)r[aßRepresents a :class:`_engine.Result` object in a "frozen" state suitable
    for caching.
 
    The :class:`_engine.FrozenResult` object is returned from the
    :meth:`_engine.Result.freeze` method of any :class:`_engine.Result`
    object.
 
    A new iterable :class:`_engine.Result` object is generated from a fixed
    set of data each time the :class:`_engine.FrozenResult` is invoked as
    a callable::
 
 
        result = connection.execute(query)
 
        frozen = result.freeze()
 
        unfrozen_result_one = frozen()
 
        for row in unfrozen_result_one:
            print(row)
 
        unfrozen_result_two = frozen()
        rows = unfrozen_result_two.all()
 
        # ... etc
 
    .. versionadded:: 1.4
 
    .. seealso::
 
        :ref:`do_orm_execute_re_executing` - example usage within the
        ORM to implement a result-set cache.
 
        :func:`_orm.loading.merge_frozen_result` - ORM function to merge
        a frozen result back into a :class:`_orm.Session`.
 
    r­Údataz Result[_TP]ricCs@|j ¡|_|j|_|j|_|jr2t| ¡ƒ|_n
| ¡|_dSr>)    rÀrKrÕrÁrr”rBrmrMrkr,r,rAr‡†s  zFrozenResult.__init__zSequence[Sequence[Any]]r<cCs*|jrdd„|jDƒSdd„|jDƒSdS)NcSsg|]
}|g‘qSr,r,)rnÚelemr,r,rAr†’sz-FrozenResult.rewrite_rows.<locals>.<listcomp>cSsg|] }t|ƒ‘qSr,r“rôr,r,rAr†”s)rÁrmr?r,r,rAÚ rewrite_rowsszFrozenResult.rewrite_rowsrKrZ)Ú
tuple_datar=cCsDt t¡}|j|_|j|_|j|_|jr:dd„|Dƒ|_n||_|S)NcSsg|] }|d‘qSr®r,)rnÚdr,r,rAr†Ÿsz.FrozenResult.with_new_rows.<locals>.<listcomp>)r[Ú__new__rÕrrÁrm)r@rpÚfrr,r,rAÚ with_new_rows–s
zFrozenResult.with_new_rowscCs&t|jt|jƒƒ}|j|_|j|_|Sr>)ÚIteratorResultrÕrrmrrÁrkr,r,rAÚ__call__¤sÿzFrozenResult.__call__N)    r{r|r}r~r€r‡rortrvr,r,r,rAr[]s
&
r[c@s°eZdZdZdZdZd&dddddœd    d
„Zedd œd d „ƒZd'ddddœdd„Z    dd œdd„Z
dd œdd„Z dd œdd„Z d(dddœdd„Z dd œd d!„Zd)d"dd#œd$d%„ZdS)*ruzžA :class:`_engine.Result` that gets data from a Python iterator of
    :class:`_engine.Row` objects or similar row-like data.
 
    .. versionadded:: 1.4
 
    FNr+z(Iterator[_InterimSupportsScalarsRowType]r¹rD)r ÚiteratorÚrawrÁcCs||_||_||_||_dSr>)rÀrwrxrÁ)r@r rwrxrÁr,r,rAr‡¸szIteratorResult.__init__r<cCs|jS)z{Return ``True`` if this :class:`_engine.IteratorResult` has
        been closed
 
        .. versionadded:: 1.4.43
 
        )Ú _hard_closedr?r,r,rAr)ÄszIteratorResult.closedrrQ©rÐÚkwr=cKsF|r
d|_|jdk    r*|jjfd|i|—Žtgƒ|_| ¡d|_dS)NTrÐ)ryrxrÒrrwZ_reset_memoizationsr(©r@rÐr{r,r,rArÒÎs
 
zIteratorResult._soft_closer cCst d¡‚dS)NzThis result object is closed.)rZResourceClosedErrorr?r,r,rAÚ_raise_hard_closed×sz!IteratorResult._raise_hard_closedrAcCs|jSr>)rwr?r,r,rArBÚsz IteratorResult._raw_row_iteratorcCs|jr| ¡|jSr>)ryr}rwr?r,r,rArÃÝszIteratorResult._fetchiter_implrÄrÅcCs:|jr| ¡t|jtƒ}|tkr2|j|ddS|SdSra)ryr}Únextrwr·rÒ)r@rÆr§r,r,rArÈâs  zIteratorResult._fetchone_implrÉcCs,|jr| ¡zt|jƒW¢S| ¡XdSr>)ryr}rÒr”rwr?r,r,rArÎïs
zIteratorResult._fetchall_implrXrÊcCs"|jr| ¡tt |jd|¡ƒSrt)ryr}r”Ú    itertoolsÚislicerwrÌr,r,rArÍ÷szIteratorResult._fetchmany_impl)NF)F)F)N)r{r|r}r~ryr(r‡rr)rÒr}rBrÃrÈrÎrÍr,r,r,rAru­s"û         ÿ     ÿruzIteratorResult[Any]r<cCsttgƒtgƒƒSr>)rur˜rr,r,r,rAÚ null_result    srcsneZdZdZdddddddœd    d
„Zed d d œdd„ƒZdddddœ‡fdd„ Zddddœ‡fdd„ Z‡Z    S)ÚChunkedIteratorResultaÿAn :class:`_engine.IteratorResult` that works from an
    iterator-producing callable.
 
    The given ``chunks`` argument is a function that is given a number of rows
    to return in each chunk, or ``None`` for all rows.  The function should
    then return an un-consumed iterator of lists, each list of the requested
    size.
 
    The function can be called at any time again, in which case it should
    continue from the same result set but adjust the chunk size as given.
 
    .. versionadded:: 1.4
 
    FNr+zBCallable[[Optional[int]], Iterator[Sequence[_InterimRowType[_R]]]]rDr¹)r ÚchunksÚsource_supports_scalarsrxÚdynamic_yield_percCs6||_||_||_||_tj | d¡¡|_||_dSr>)    rÀrƒrÁrxrÚchainÚ from_iterablerwr…)r@r rƒr„rxr…r,r,rAr‡    s
zChunkedIteratorResult.__init__rlr#r*cCs||_tj | |¡¡|_|Sr>)rrr†r‡rƒrwr+r,r,rAr,%    szChunkedIteratorResult.yield_perrrQrzc s$tƒjfd|i|—Ždd„|_dS)NrÐcSsgSr>r,rcr,r,rAÚ<lambda>3    óz3ChunkedIteratorResult._soft_close.<locals>.<lambda>)ÚsuperrÒrƒr|©r«r,rArÒ1    sz!ChunkedIteratorResult._soft_closerXrÉrÊcs(|jrtj | |¡¡|_tƒj|dSrb)r…rr†r‡rƒrwrŠrÍrÌr‹r,rArÍ5    sz%ChunkedIteratorResult._fetchmany_impl)FNF)F)N)
r{r|r}r~r‡rr,rÒrÍÚ __classcell__r,r,r‹rAr‚    sø ÿr‚csJeZdZUdZdZded<dddœ‡fdd    „ Zdd
d d d œdd„Z‡ZS)r^z»A :class:`_engine.Result` that is merged from any number of
    :class:`_engine.Result` objects.
 
    Returned by the :meth:`_engine.Result.merge` method.
 
    .. versionadded:: 1.4
 
    FrXZrowcountr+zSequence[Result[_TP]])r Úresultscsf||_tƒ |tj dd„|Dƒ¡¡|dj|_|dj|_|dj|_|j    j
dd„|DƒŽ|_    dS)Ncss|]}| ¡VqdSr>)rB©rnÚrr,r,rArP    sz(MergedResult.__init__.<locals>.<genexpr>rcSsg|]
}|j‘qSr,)rrŽr,r,rAr†\    sz)MergedResult.__init__.<locals>.<listcomp>) Ú_resultsrŠr‡rr†r‡r¾rrÁrZ
merge_with)r@r rr‹r,rAr‡J    s ÿþ    ÿzMergedResult.__init__rDrrQrzcKs.|jD]}|jfd|i|—Žq|r*d|_dS)NrÐT)rrÒr))r@rÐr{rr,r,rArÒ_    s
zMergedResult._soft_close)F)    r{r|r}r~r)r€r‡rÒrŒr,r,r‹rAr^=    s
 
    r^)N)Xr~Ú
__future__rÚenumrr³rreÚtypingrrrrrr    r
r r r rrrrrrrrr§rrÚrrZsql.baserrrrr Z util._has_cyr!Z util.typingr"r#Z_py_rowr$Z"sqlalchemy.cyextension.resultproxyZ
sql.schemar%Z sql.type_apir&rŠZ_KeyTyperlrWrTr3Z_RowDataZ _RawRowTyper'r)r*Z_InterimRowTypeZ_InterimSupportsScalarsRowTypeZ_ProcessorsTyperiZ_UniqueFilterTyperr+ÚKeysViewr;r˜rµr¶r·r¸rrr`r:Z
TypingOnlyrgr=r[rurr‚r^r,r,r,rAÚ<module>s°                                           |"ÿ ]5`*PS9