hyb
2026-01-07 c7f60dc7e9a36596f0e0d1787bd0cca4e9b57bcb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
Ë
nñúh¨Œãó—dZddlmZddlmZmZddlmZmZddl    m
Z
m    Z    m Z ddl m Z ddlZddlmZmZmZmZmZmZddlZddlZdd    lmZdd
lmZdd lmZdd lm Z m!Z!dd l"m#Z#ddl$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;cm<Z=ddl:m>Z>ddl?m@Z@ddlAmBZBddlCmDZDer*ddlEmFZFmGZGddlHmIZIddlJmKZKmLZLddlMmNZNmOZOmPZPmQZQmRZRddl/mSZSd „ZT    dQ            dRd!„ZUd"„ZV        dS                    dTd%„ZW                    dU                    dVd&„ZXdddd$d'œ                            dWd(„ZYdXd)„ZZe                            dY                                                    dZd*„«Z[e                            dY                                                    d[d+„«Z[ddd#dddej¸f                                                                    d\d,„Z[e                            dY                                                    d]d-„«Z]e                            dY                                                    d^d.„«Z]dd#ddddej¸f                                                            d_d/„Z]e                                d`                                            dad0„«Z^e                                d`                                            dbd1„«Z^dd#ddddej¸df                                                    dcd2„Z^                                dd                                                                            ded3„Z_dXdfd4„Z`e`Za        dg                    dhd6„ZbGd7„d8e9«ZcGd9„d5e9e«ZdGd:„d;«ZeGd<„d=ee«Zfdid>„ZgGd?„d@ed«ZhGdA„dBed«ZidCdDdEdFdGdHdEdIœZjdjdJ„ZkdjdK„ZlGdL„dMec«ZmGdN„dOed«Zn                dk                            dldP„Zoy)mz|
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
é)Ú annotations)ÚABCÚabstractmethod)Ú    ExitStackÚcontextmanager)ÚdateÚdatetimeÚtime)ÚpartialN)Ú TYPE_CHECKINGÚAnyÚCallableÚLiteralÚcastÚoverload)Úusing_string_dtype)Úlib©Úimport_optional_dependency)ÚAbstractMethodErrorÚ DatabaseError)Úfind_stack_level)Úcheck_dtype_backend)Ú is_dict_likeÚ is_list_likeÚis_object_dtypeÚis_string_dtype)ÚDatetimeTZDtype)Úisna)Ú
get_option)Ú    DataFrameÚSeries)ÚArrowExtensionArray)Ú StringDtype)Ú PandasObject)Úmaybe_make_list)Úconvert_object_array)Ú to_datetime)Úarrow_table_to_pandas)ÚIteratorÚMapping)ÚTable)ÚSelectÚ
TextClause)ÚDateTimeErrorChoicesÚDtypeArgÚ DtypeBackendÚ
IndexLabelÚSelf)ÚIndexcó@—|dus||durg}|St|d«s|g}|S)z3Process parse_dates argument for read_sql functionsTFÚ__iter__)Úhasattr)Ú parse_datess ú@H:\Change_password\venv_build\Lib\site-packages\pandas/io/sql.pyÚ_process_parse_dates_argumentr:`s>€ðdјkÐ1°[ÀEÑ5I؈ ð Ðô[ *Ô -Ø"mˆ Ø Ðócó—t|t«r6|jdd«xsd}|dk(r     t|fi|¤ŽSt|fd|i|¤ŽS|€^t |jjtj«s.t |jjtj«rd}|dvrt|d||¬«St|jt«r t|d¬«St|d||¬    «S#tt
f$r|cYSwxYw)
NÚerrorsÚignoreÚs)ÚDÚdÚhÚmr?ÚmsÚusÚnsÚcoerce)r=ÚunitÚutcT©rI)r=ÚformatrI) Ú
isinstanceÚdictÚpopr(Ú    TypeErrorÚ
ValueErrorÚ
issubclassÚdtypeÚtypeÚnpÚfloatingÚintegerr)ÚcolrIrKÚerrors    r9Ú_handle_date_columnrYksô€ô&œ$Ôð
'-§j¡j°¸4Ó&@Ò&LÀHˆØ HÒ ð Ü" 3Ñ1¨&Ñ1Ð1ô˜3Ñ7 uÐ7°Ñ7Ð7ð ˆ>Ü s—y‘y—~‘~¤r§{¡{Ô 3ܘ#Ÿ)™)Ÿ.™.¬"¯*©*Ô5àˆFØ Ð@Ñ @ܘs¨8¸&ÀcÔJÐ JÜ ˜Ÿ    ™    ¤?Ô 3ô˜s¨Ô-Ð -ä˜s¨8¸FÈÔLÐ Løô'œzÐ*ò à’
ð ús­ C0Ã0DÄDcó—t|«}t|j««D]J\}\}}t|jt
«s||vsŒ(    ||}|j|t||¬««ŒL|S#t tf$rd}YŒ4wxYw)zz
    Force non-datetime columns to be read as such.
    Supports both string formatted and integer timestamp columns.
    N©rK)
r:Ú    enumerateÚitemsrLrRrÚKeyErrorrOÚisetitemrY)Ú
data_framer8ÚiÚcol_nameÚdf_colÚfmts      r9Ú_parse_date_columnsresš€ô
0° Ó<€Kô
"+¨:×+;Ñ+;Ó+=Ó!>òLÑˆÑ ˆHfÜ f—l‘l¤OÔ 4¸ÀKÒ8Oð Ø! (Ñ+ð × Ñ  Ô#6°vÀcÔ#JÕ Kð Lð Ðøô    œiÐ(ò Ø’ð úsÁA4Á4BÂBTÚnumpyc óü—tj|«}tt|j«d||¬«}|dk(rqt d«}g}|D]]}|j |d¬«}    |jdk(r|    j|j««}    |jt|    ««Œ_|}|rBtttttt!|«««|«««}
||
_|
St|¬«S)N)rRÚ coerce_floatÚ dtype_backendÚpyarrowT)Ú from_pandasÚstring)Úcolumns)rÚto_object_array_tuplesr'ÚlistÚTrÚarrayrRrrlÚappendr#r!rMÚzipÚrangeÚlenrm) ÚdatarmrhriÚcontentÚarraysÚpaÚ result_arraysÚarrÚpa_arrayÚdfs            r9Ú_convert_arrays_to_dataframer~¢sé€ô ×(Ñ(¨Ó.€GÜ !Ü ˆWY‰Y‹ØØ!Ø#ô    €Fð ˜    Ò!Ü '¨    Ó 2ˆàˆ Øò    @ˆCØ—x‘x °xÓ6ˆH؏y‰y˜HÒ$ð$Ÿ=™=¨¯©«Ó5Ø ×  Ñ  Ô!4°XÓ!>Õ ?ð    @ðˆÙ Ü ”tœC¤¤U¬3¨w«<Ó%8Ó 9¸6ÓBÓCÓ DˆØˆŒ
؈    ä Ô)Ð)r;có†—t||||«}|r|j|«}t||«}||j|«}|S©z5Wrap result set of a SQLAlchemy query in a DataFrame.)r~ÚastypereÚ    set_index)rvrmÚ    index_colrhr8rRriÚframes        r9Ú _wrap_resultr…ÄsJ€ô )¨¨w¸ ÀmÓ T€Eá Ø— ‘ ˜UÓ#ˆä   {Ó 3€EàÐØ—‘     Ó*ˆà €Lr;)rƒr8rRricój—|r|j|«}t||«}||j|«}|Sr€)rrer‚)r}rƒr8rRris     r9Ú_wrap_result_adbcr‡Ûs:€ñ Ø Y‰YuÓ ˆä    ˜R Ó    -€BàÐØ \‰\˜)Ó $ˆà €Ir;có4—tjdtt«¬«t    dd¬«}|1t |t |jjf«r td«‚t|d¬    «5}|j||«cddd«S#1swYyxYw)
a¢
    Execute the given SQL query using the provided connection object.
 
    Parameters
    ----------
    sql : string
        SQL query to be executed.
    con : SQLAlchemy connection or sqlite3 connection
        If a DBAPI2 object, only sqlite3 is supported.
    params : list or tuple, optional, default: None
        List of parameters to pass to execute method.
 
    Returns
    -------
    Results Iterable
    zP`pandas.io.sql.execute` is deprecated and will be removed in the future version.©Ú
stacklevelÚ
sqlalchemyr>©r=Nz+pandas.io.sql.execute requires a connectionT)Úneed_transaction) ÚwarningsÚwarnÚ FutureWarningrrrLÚstrÚengineÚEnginerOÚpandasSQL_builderÚexecute)ÚsqlÚconÚparamsr‹Ú
pandas_sqls     r9r•r•ïs‰€ô" ‡MMð    1äÜ#Ó%õ    ô ,¨LÀÔJ€JàФ*¨S´3¸
×8IÑ8I×8PÑ8PÐ2QÔ"RÜÐEÓFÐFÜ    ˜3°Ô    6ð/¸*Ø×!Ñ! # vÓ.÷/÷/ò/ús Á2BÂBc    ó—y©N©©    Ú
table_namer—Úschemarƒrhr8rmÚ    chunksizeris             r9Úread_sql_tabler¡ó€ðr;c    ó—yr›rœrs             r9r¡r¡!r¢r;c    
óF—t|«|tjurd}|tjusJ‚t||d¬«5}    |    j    |«st d|›d«‚|    j |||||||¬«}
ddd«
|
St d|›d|«‚#1swYŒxYw)a0
 
    Read SQL database table into a DataFrame.
 
    Given a table name and a SQLAlchemy connectable, returns a DataFrame.
    This function does not support DBAPI connections.
 
    Parameters
    ----------
    table_name : str
        Name of SQL table in database.
    con : SQLAlchemy connectable or str
        A database URI could be provided as str.
        SQLite DBAPI connection mode not supported.
    schema : str, default None
        Name of SQL schema in database to query (if database flavor
        supports this). Uses default schema if None (default).
    index_col : str or list of str, optional, default: None
        Column(s) to set as index(MultiIndex).
    coerce_float : bool, default True
        Attempts to convert values of non-string, non-numeric objects (like
        decimal.Decimal) to floating point. Can result in loss of Precision.
    parse_dates : list or dict, default None
        - List of column names to parse as dates.
        - Dict of ``{column_name: format string}`` where format string is
          strftime compatible in case of parsing string times or is one of
          (D, s, ns, ms, us) in case of parsing integer timestamps.
        - Dict of ``{column_name: arg dict}``, where the arg dict corresponds
          to the keyword arguments of :func:`pandas.to_datetime`
          Especially useful with databases without native Datetime support,
          such as SQLite.
    columns : list, default None
        List of column names to select from SQL table.
    chunksize : int, default None
        If specified, returns an iterator where `chunksize` is the number of
        rows to include in each chunk.
    dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:
 
        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.
 
        .. versionadded:: 2.0
 
    Returns
    -------
    DataFrame or Iterator[DataFrame]
        A SQL table is returned as two-dimensional data structure with labeled
        axes.
 
    See Also
    --------
    read_sql_query : Read SQL query into a DataFrame.
    read_sql : Read SQL query or database table into a DataFrame.
 
    Notes
    -----
    Any datetime values with time zone information will be converted to UTC.
 
    Examples
    --------
    >>> pd.read_sql_table('table_name', 'postgres:///db_name')  # doctest:+SKIP
    rfT©rŸrzTable z
 not found©rƒrhr8rmr riN)rrÚ
no_defaultr”Ú    has_tablerPÚ
read_table) ržr—rŸrƒrhr8rmr rir™Útables            r9r¡r¡0s€ôZ˜ Ô&ØœŸ™Ñ&؈ Ø ¤§¡Ñ .Ð.Ð .ä    ˜3 vÀÔ    Eð 
ÈØ×#Ñ# JÔ/ܘv j \°Ð<Ó=Ð =à×%Ñ%Ø ØØ%Ø#ØØØ'ð&ó
ˆ÷     
ð ÐØˆ ä˜6 * ¨ZÐ8¸#Ó>Ð>÷# 
ð 
ús Á9BÂB c    ó—yr›rœ©    r–r—rƒrhr˜r8r rRris             r9Úread_sql_queryr­–r¢r;c    ó—yr›rœr¬s             r9r­r­¥r¢r;c     óܗt|«|tjurd}|tjusJ‚t|«5}    |    j    ||||||||¬«cddd«S#1swYyxYw)aØ
    Read SQL query into a DataFrame.
 
    Returns a DataFrame corresponding to the result set of the query
    string. Optionally provide an `index_col` parameter to use one of the
    columns as the index, otherwise default integer index will be used.
 
    Parameters
    ----------
    sql : str SQL query or SQLAlchemy Selectable (select or text object)
        SQL query to be executed.
    con : SQLAlchemy connectable, str, or sqlite3 connection
        Using SQLAlchemy makes it possible to use any DB supported by that
        library. If a DBAPI2 object, only sqlite3 is supported.
    index_col : str or list of str, optional, default: None
        Column(s) to set as index(MultiIndex).
    coerce_float : bool, default True
        Attempts to convert values of non-string, non-numeric objects (like
        decimal.Decimal) to floating point. Useful for SQL result sets.
    params : list, tuple or mapping, optional, default: None
        List of parameters to pass to execute method.  The syntax used
        to pass parameters is database driver dependent. Check your
        database driver documentation for which of the five syntax styles,
        described in PEP 249's paramstyle, is supported.
        Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}.
    parse_dates : list or dict, default: None
        - List of column names to parse as dates.
        - Dict of ``{column_name: format string}`` where format string is
          strftime compatible in case of parsing string times, or is one of
          (D, s, ns, ms, us) in case of parsing integer timestamps.
        - Dict of ``{column_name: arg dict}``, where the arg dict corresponds
          to the keyword arguments of :func:`pandas.to_datetime`
          Especially useful with databases without native Datetime support,
          such as SQLite.
    chunksize : int, default None
        If specified, return an iterator where `chunksize` is the number of
        rows to include in each chunk.
    dtype : Type name or dict of columns
        Data type for data or columns. E.g. np.float64 or
        {'a': np.float64, 'b': np.int32, 'c': 'Int64'}.
 
        .. versionadded:: 1.3.0
    dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:
 
        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.
 
        .. versionadded:: 2.0
 
    Returns
    -------
    DataFrame or Iterator[DataFrame]
 
    See Also
    --------
    read_sql_table : Read SQL database table into a DataFrame.
    read_sql : Read SQL query or database table into a DataFrame.
 
    Notes
    -----
    Any datetime values with time zone information parsed via the `parse_dates`
    parameter will be converted to UTC.
 
    Examples
    --------
    >>> from sqlalchemy import create_engine  # doctest: +SKIP
    >>> engine = create_engine("sqlite:///database.db")  # doctest: +SKIP
    >>> with engine.connect() as conn, conn.begin():  # doctest: +SKIP
    ...     data = pd.read_sql_table("data", conn)  # doctest: +SKIP
    rf)rƒr˜rhr8r rRriN)rrr§r”Ú
read_query)
r–r—rƒrhr˜r8r rRrir™s
          r9r­r­´sz€ôl˜ Ô&ØœŸ™Ñ&؈ Ø ¤§¡Ñ .Ð.Ð .ä    ˜3Ó    ð
 
 :Ø×$Ñ$Ø ØØØ%Ø#ØØØ'ð%ó    
÷
 
÷
 
ò
 
ús ¿A"Á"A+c
ó—yr›rœ©
r–r—rƒrhr˜r8rmr rirRs
          r9Úread_sqlr³ó€ðr;c
ó—yr›rœr²s
          r9r³r³,r´r;c
óÌ—t|«|tjurd}|tjusJ‚t|«5}
t    |
t
«r"|
j ||||||||    ¬«cddd«S    |
j|«} | r!|
j|||||||¬«cddd«S|
j ||||||||    ¬«cddd«S#t$rd} YŒRwxYw#1swYyxYw)ak
    Read SQL query or database table into a DataFrame.
 
    This function is a convenience wrapper around ``read_sql_table`` and
    ``read_sql_query`` (for backward compatibility). It will delegate
    to the specific function depending on the provided input. A SQL query
    will be routed to ``read_sql_query``, while a database table name will
    be routed to ``read_sql_table``. Note that the delegated function might
    have more specific notes about their functionality not listed here.
 
    Parameters
    ----------
    sql : str or SQLAlchemy Selectable (select or text object)
        SQL query to be executed or a table name.
    con : ADBC Connection, SQLAlchemy connectable, str, or sqlite3 connection
        ADBC provides high performance I/O with native type support, where available.
        Using SQLAlchemy makes it possible to use any DB supported by that
        library. If a DBAPI2 object, only sqlite3 is supported. The user is responsible
        for engine disposal and connection closure for the ADBC connection and
        SQLAlchemy connectable; str connections are closed automatically. See
        `here <https://docs.sqlalchemy.org/en/20/core/connections.html>`_.
    index_col : str or list of str, optional, default: None
        Column(s) to set as index(MultiIndex).
    coerce_float : bool, default True
        Attempts to convert values of non-string, non-numeric objects (like
        decimal.Decimal) to floating point, useful for SQL result sets.
    params : list, tuple or dict, optional, default: None
        List of parameters to pass to execute method.  The syntax used
        to pass parameters is database driver dependent. Check your
        database driver documentation for which of the five syntax styles,
        described in PEP 249's paramstyle, is supported.
        Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}.
    parse_dates : list or dict, default: None
        - List of column names to parse as dates.
        - Dict of ``{column_name: format string}`` where format string is
          strftime compatible in case of parsing string times, or is one of
          (D, s, ns, ms, us) in case of parsing integer timestamps.
        - Dict of ``{column_name: arg dict}``, where the arg dict corresponds
          to the keyword arguments of :func:`pandas.to_datetime`
          Especially useful with databases without native Datetime support,
          such as SQLite.
    columns : list, default: None
        List of column names to select from SQL table (only used when reading
        a table).
    chunksize : int, default None
        If specified, return an iterator where `chunksize` is the
        number of rows to include in each chunk.
    dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:
 
        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.
 
        .. versionadded:: 2.0
    dtype : Type name or dict of columns
        Data type for data or columns. E.g. np.float64 or
        {'a': np.float64, 'b': np.int32, 'c': 'Int64'}.
        The argument is ignored if a table is passed instead of a query.
 
        .. versionadded:: 2.0.0
 
    Returns
    -------
    DataFrame or Iterator[DataFrame]
 
    See Also
    --------
    read_sql_table : Read SQL database table into a DataFrame.
    read_sql_query : Read SQL query into a DataFrame.
 
    Examples
    --------
    Read data from SQL via either a SQL query or a SQL tablename.
    When using a SQLite database only SQL queries are accepted,
    providing only the SQL tablename will result in an error.
 
    >>> from sqlite3 import connect
    >>> conn = connect(':memory:')
    >>> df = pd.DataFrame(data=[[0, '10/11/12'], [1, '12/11/10']],
    ...                   columns=['int_column', 'date_column'])
    >>> df.to_sql(name='test_data', con=conn)
    2
 
    >>> pd.read_sql('SELECT int_column, date_column FROM test_data', conn)
       int_column date_column
    0           0    10/11/12
    1           1    12/11/10
 
    >>> pd.read_sql('test_data', 'postgres:///db_name')  # doctest:+SKIP
 
    Apply date parsing to columns through the ``parse_dates`` argument
    The ``parse_dates`` argument calls ``pd.to_datetime`` on the provided columns.
    Custom argument values for applying ``pd.to_datetime`` on a column are specified
    via a dictionary format:
 
    >>> pd.read_sql('SELECT int_column, date_column FROM test_data',
    ...             conn,
    ...             parse_dates={"date_column": {"format": "%d/%m/%y"}})
       int_column date_column
    0           0  2012-11-10
    1           1  2010-11-12
 
    .. versionadded:: 2.2.0
 
       pandas now supports reading via ADBC drivers
 
    >>> from adbc_driver_postgresql import dbapi  # doctest:+SKIP
    >>> with dbapi.connect('postgres:///db_name') as conn:  # doctest:+SKIP
    ...     pd.read_sql('SELECT int_column FROM test_data', conn)
       int_column
    0           0
    1           1
    rf)rƒr˜rhr8r rirRNFr¦)
rrr§r”rLÚSQLiteDatabaser°r¨Ú    Exceptionr©) r–r—rƒrhr˜r8rmr rirRr™Ú_is_table_names             r9r³r³<s"€ôB˜ Ô&ØœŸ™Ñ&؈ Ø ¤§¡Ñ .Ð.Ð .ä    ˜3Ó    ð' :Ü j¤.Ô 1Ø×(Ñ(ØØ#ØØ)Ø'Ø#Ø+Øð)ó    ÷'ñ'ð    #Ø'×1Ñ1°#Ó6ˆNñ
Ø×(Ñ(ØØ#Ø)Ø'ØØ#Ø+ð)ó÷)'ñ'ð<×(Ñ(ØØ#ØØ)Ø'Ø#Ø+Øð)ó    ÷='ñ'øôò    #à"ŠNð    #ú÷'ð'ús5¿)CÁ3C    ÂCÂ'Cà    CÃCÃCÃCÃC#c ó"—|dvrtd|›d«‚t|t«r|j«}nt|t«s t d«‚t ||d¬«5} | j||f|||||||    |
dœ| ¤Žcddd«S#1swYyxYw)    aµ
    Write records stored in a DataFrame to a SQL database.
 
    Parameters
    ----------
    frame : DataFrame, Series
    name : str
        Name of SQL table.
    con : ADBC Connection, SQLAlchemy connectable, str, or sqlite3 connection
        or sqlite3 DBAPI2 connection
        ADBC provides high performance I/O with native type support, where available.
        Using SQLAlchemy makes it possible to use any DB supported by that
        library.
        If a DBAPI2 object, only sqlite3 is supported.
    schema : str, optional
        Name of SQL schema in database to write to (if database flavor
        supports this). If None, use default schema (default).
    if_exists : {'fail', 'replace', 'append'}, default 'fail'
        - fail: If table exists, do nothing.
        - replace: If table exists, drop it, recreate it, and insert data.
        - append: If table exists, insert data. Create if does not exist.
    index : bool, default True
        Write DataFrame index as a column.
    index_label : str or sequence, optional
        Column label for index column(s). If None is given (default) and
        `index` is True, then the index names are used.
        A sequence should be given if the DataFrame uses MultiIndex.
    chunksize : int, optional
        Specify the number of rows in each batch to be written at a time.
        By default, all rows will be written at once.
    dtype : dict or scalar, optional
        Specifying the datatype for columns. If a dictionary is used, the
        keys should be the column names and the values should be the
        SQLAlchemy types or strings for the sqlite3 fallback mode. If a
        scalar is provided, it will be applied to all columns.
    method : {None, 'multi', callable}, optional
        Controls the SQL insertion clause used:
 
        - None : Uses standard SQL ``INSERT`` clause (one per row).
        - ``'multi'``: Pass multiple values in a single ``INSERT`` clause.
        - callable with signature ``(pd_table, conn, keys, data_iter) -> int | None``.
 
        Details and a sample callable implementation can be found in the
        section :ref:`insert method <io.sql.method>`.
    engine : {'auto', 'sqlalchemy'}, default 'auto'
        SQL engine library to use. If 'auto', then the option
        ``io.sql.engine`` is used. The default ``io.sql.engine``
        behavior is 'sqlalchemy'
 
        .. versionadded:: 1.3.0
 
    **engine_kwargs
        Any additional kwargs are passed to the engine.
 
    Returns
    -------
    None or int
        Number of rows affected by to_sql. None is returned if the callable
        passed into ``method`` does not return an integer number of rows.
 
        .. versionadded:: 1.4.0
 
    Notes
    -----
    The returned rows affected is the sum of the ``rowcount`` attribute of ``sqlite3.Cursor``
    or SQLAlchemy connectable. If using ADBC the returned rows are the result
    of ``Cursor.adbc_ingest``. The returned value may not reflect the exact number of written
    rows as stipulated in the
    `sqlite3 <https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.rowcount>`__ or
    `SQLAlchemy <https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.BaseCursorResult.rowcount>`__
    )ÚfailÚreplacerrú'ú' is not valid for if_existsz9'frame' argument should be either a Series or a DataFrameTr¥)Ú    if_existsÚindexÚ index_labelrŸr rRÚmethodr’N)rPrLr"Úto_framer!ÚNotImplementedErrorr”Úto_sql) r„Únamer—rŸr¿rÀrÁr rRrÂr’Ú engine_kwargsr™s              r9rÅrÅìs·€ðjÐ5Ñ5ܘ1˜Y˜KÐ'CÐDÓEÐEä%œÔ Ø—‘Ó ‰Ü ˜œyÔ )Ü!Ø Gó
ð    
ô
˜3 vÀÔ    Eð 
ÈØ ˆz× Ñ Ø Ø ð 
ð ØØ#ØØØØØñ 
ðñ 
÷ 
÷ 
ò 
ús ÁBÂBcój—t||¬«5}|j|«cddd«S#1swYyxYw)a€
    Check if DataBase has named table.
 
    Parameters
    ----------
    table_name: string
        Name of SQL table.
    con: ADBC Connection, SQLAlchemy connectable, str, or sqlite3 connection
        ADBC provides high performance I/O with native type support, where available.
        Using SQLAlchemy makes it possible to use any DB supported by that
        library.
        If a DBAPI2 object, only sqlite3 is supported.
    schema : string, default None
        Name of SQL schema in database to write to (if database flavor supports
        this). If None, use default schema (default).
 
    Returns
    -------
    boolean
    ©rŸN)r”r¨)ržr—rŸr™s    r9r¨r¨[s3€ô*
˜3 vÔ    .ð0°*Ø×#Ñ# JÓ/÷0÷0ò0úsŽ)©2Ú    PandasSQLcóÌ—ddl}t||j«s|€ t|«St    dd¬«}t|t
«r |€ t d«‚|3t|t
|jjf«r t|||«St    dd¬«}|r!t||j«r t|«Stjdtt«¬    «t|«S)
    Convenience function to return the correct PandasSQL subclass based on the
    provided parameters.  Also creates a sqlalchemy connection and transaction
    if necessary.
    rNr‹r>rŒz.Using URI string without sqlalchemy installed.zadbc_driver_manager.dbapiz»pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.r‰)Úsqlite3rLÚ
Connectionr·rr‘Ú ImportErrorr’Ú ConnectableÚ SQLDatabaseÚ ADBCDatabaserŽrÚ UserWarningr)r—rŸrrÌr‹Úadbcs      r9r”r”wsπóä#w×)Ñ)Ô*¨c¨kܘcÓ"Ð"ä+¨LÀÔJ€Jä#”sÔ 
Р2ÜÐJÓKÐKàФ*¨S´3¸
×8IÑ8I×8UÑ8UÐ2VÔ"Wܘ3 Ð(8Ó9Ð9ä %Ð&AÈ(Ô S€DÙ ”
˜3 §¡Ô0ܘCÓ Ð ä ‡MMð    Dô    Ü#Ó%õ ô ˜#Ó Ðr;có—eZdZdZ                                d                                            dd„Zd„Zdd„Zdd„Zdd„Zdd„Z    dd    „Z
dd
„Z         d                    dd „Z             d                            dd „Z                     d                                    dd „Zd„Zd„Zd„Z        d             d!d„Zd"d„Zd„Zy)#ÚSQLTablezî
    For mapping Pandas tables to SQL tables.
    Uses fact that table is reflected by SQLAlchemy to
    do better type conversions.
    Also holds various flags needed to avoid having to
    pass them between functions all the time.
    Nc ó²—||_||_||_||_|j    ||«|_||_||_|    |_|
|_    ||j«|_ n5|jj|j|j «|_ |j€td|›d«‚t|j«s td«‚y)NzCould not init table 'r½zEmpty table name specified)rÆÚpd_sqlÚprefixr„Ú _index_namerÀrŸr¿ÚkeysrRÚ_create_table_setuprªÚ    get_tablerPru) ÚselfrÆÚpandas_sql_enginer„rÀr¿rØrÁrŸrÚrRs            r9Ú__init__zSQLTable.__init__§sÀðˆŒ    Ø'ˆŒ ؈Œ ؈Œ
Ø×%Ñ% e¨[Ó9ˆŒ
؈Œ Ø"ˆŒØˆŒ    ØˆŒ
à Ð à×1Ñ1Ó3ˆDJðŸ™×.Ñ.¨t¯y©y¸$¿+¹+ÓFˆDŒJà :‰:Ð ÜÐ5°d°V¸1Ð=Ó>Ð >ä4—9‘9Œ~ÜÐ9Ó:Ð :ðr;cób—|jj|j|j«Sr›)r×r¨rÆrŸ©rÝs r9ÚexistszSQLTable.existsËs!€Ø{‰{×$Ñ$ T§Y¡Y°· ± Ó<Ð<r;cóŠ—ddlm}t||j«j    |j
j ««S)Nr)Ú CreateTable)Úsqlalchemy.schemarär‘rªÚcompiler×r—)rÝräs  r9Ú
sql_schemazSQLTable.sql_schemaÎs,€Ý1ä‘;˜tŸz™zÓ*×2Ñ2°4·;±;·?±?ÓCÓDÐDr;có*—|jj|jj«|_|jj    «5|jj |jj ¬«ddd«y#1swYyxYw)N©Úbind)rªÚ to_metadatar×ÚmetaÚrun_transactionÚcreater—rás r9Ú_execute_createzSQLTable._execute_createÓsd€à—Z‘Z×+Ñ+¨D¯K©K×,<Ñ,<Ó=ˆŒ
Ø [‰[× (Ñ (Ó *ñ    4Ø J‰J× Ñ  4§;¡;§?¡?Ð Ô 3÷    4÷    4ñ    4ús Á1B        Bcó†—|j«r¡|jdk(rtd|j›d«‚|jdk(rA|jj |j|j «|j«y|jdk(rytd|j›d«‚|j«y)Nr»úTable 'ú' already exists.r¼rrr½r¾)râr¿rPrÆr×Ú
drop_tablerŸrïrás r9rîzSQLTable.createÙs™€Ø ;‰;Œ=؏~‰~ Ò'Ü  7¨4¯9©9¨+Ð5FÐ!GÓHÐH؏~‰~ Ò*Ø— ‘ ×&Ñ& t§y¡y°$·+±+Ô>Ø×$Ñ$Õ&Ø—‘ 8Ò+Øä  1 T§^¡^Ð$4Ð4PÐ!QÓRÐRà ×  Ñ  Õ "r;c    ó¼—|Dcgc]}tt||««‘Œ}}|j|jj    «|«}|j
Scc}w)a<
        Execute SQL statement inserting data
 
        Parameters
        ----------
        conn : sqlalchemy.engine.Engine or sqlalchemy.engine.Connection
        keys : list of str
           Column names
        data_iter : generator of list
           Each item contains a list of values to be inserted
        )rMrsr•rªÚinsertÚrowcount)rÝÚconnrÚÚ    data_iterÚrowrvÚresults       r9Ú_execute_insertzSQLTable._execute_insertçsN€ð1:Ö:¨””S˜˜s“^Õ$Ð:ˆÐ:Ø—‘˜dŸj™j×/Ñ/Ó1°4Ó8ˆØ‰Ðùò;s…Ac    óؗddlm}|Dcgc]}tt||««‘Œ}}||j«j |«}|j |«}|jScc}w)a
 
        Alternative to _execute_insert for DBs support multi-value INSERT.
 
        Note: multi-value insert is usually faster for analytics DBs
        and tables containing a few columns
        but performance degrades quickly with increase of columns.
 
        r)rõ)r‹rõrMrsrªÚvaluesr•rö)    rÝr÷rÚrørõrùrvÚstmtrús             r9Ú_execute_insert_multizSQLTable._execute_insert_multi÷s[€õ    &à09Ö:¨””S˜˜s“^Õ$Ð:ˆÐ:ِd—j‘jÓ!×(Ñ(¨Ó.ˆØ—‘˜dÓ#ˆØ‰Ðùò;s‹A'cóÈ—|jI|jj«}|j|j_    |j    d¬«n |j}t tt|j««}t|«}dg|z}t|j««D]\}\}}|jjdk(röt|j t"«rÁddl}    |    j&j)|jj*«r"|j j-t.¬«}
n%t1j2«5t1j4dt6¬«t9j:|j<j?«t.¬«}
ddd«n¹|j j?«}
nž|jjd    k(rf|j } t| t"«r%| j-t9jd
«¬«} | jAd «jCt.«}
n|j jCt.«}
t
t8jD«sJtG|
««‚|jHrtK|
«} d|
| <|
||<Œ||fS#t
$r}t d|›«|‚d}~wwxYw#1swYŒ{xYw) NT©Úinplacez!duplicate name in index/columns: ÚMr)rRr>)ÚcategoryrCzm8[ns]Úi8)&rÀr„ÚcopyÚnamesÚ reset_indexrProÚmapr‘rmrur\r]rRÚkindrLÚ_valuesr#rjÚtypesÚis_dateÚ pyarrow_dtypeÚto_numpyÚobjectrŽÚcatch_warningsÚfilterwarningsrrTÚasarrayÚdtÚ to_pydatetimeÚviewrÚndarrayrSÚ _can_hold_nar) rÝÚtempÚerrÚ column_namesÚncolsÚ    data_listraÚ_ÚserryrAÚvalsÚmasks              r9Ú insert_datazSQLTable.insert_datas@€Ø :‰:Ð !Ø—:‘:—?‘?Ó$ˆDØ#Ÿz™zˆDJ‰JÔ ð UØ× Ñ ¨Ð Õ.ð—:‘:ˆDäœC¤ T§\¡\Ó2Ó3ˆ ܐLÓ!ˆð(, f¨u¡nˆ    ä$ T§Z¡Z£\Ó2ó    ‰KˆA‰x3؏y‰y~‰~ Ò$ܘcŸk™kÔ+>Ô?Û(à—x‘x×'Ñ'¨¯    ©    ×(?Ñ(?Ô@àŸK™K×0Ñ0´vÐ0Ó>šä%×4Ñ4Ó6ñQÜ$×3Ñ3°HÄ}ÕUä "§
¡
¨3¯6©6×+?Ñ+?Ó+AÌÔ P˜A÷QðQð
Ÿ ™ ×1Ñ1Ó3‘AØ—‘—‘ 3Ò&Ø—{‘{Ü˜dÔ$7Ô8ØŸ=™=¬r¯x©x¸Ó/A˜=ÓBDà—I‘I˜d“O×*Ñ*¬6Ó2‘à—K‘K×&Ñ&¤vÓ.ä˜a¤§¡Ô,Ð 5¬d°1«gÓ 5Ð,à×Òä˜A“wØ$‘àˆIa‹Lð?    ðB˜YÐ&Ð&øôYò UÜ Ð#DÀSÀEÐ!JÓKÐQTÐTûð Uú÷(QðQús%ÁJ8ÅAKÊ8    KËKËKËK!    có@‡ ‡—|€ |j}n8|dk(r |j}n&t|«r t||«}nt    d|›«‚|j «\}}t |j«}|dk(ry|€|}n|dk(r t    d«‚||zdz}d}|jj«5}    t|«D]I}
|
|zŠt|
dz|z|«Š ‰‰ k\rn+tˆ ˆfd„|D«Ž} ||    || «} | €Œ@|€| }ŒE|| z }ŒKddd«|S#1swY|SxYw)NÚmultizInvalid parameter `method`: rz%chunksize argument should be non-zeroéc3ó(•K—|]    }|‰‰–—Œ y­wr›rœ)Ú.0r{Úend_iÚstart_is  €€r9ú    <genexpr>z"SQLTable.insert.<locals>.<genexpr>`søèø€Ò"K¸# 3 w¨uÔ#5Ñ"Kùsƒ) rûrÿÚcallabler rPr"rur„r×rírtÚminrs)rÝr rÂÚ exec_insertrÚrÚnrowsÚchunksÚtotal_insertedr÷raÚ
chunk_iterÚ num_insertedr(r)s             @@r9rõzSQLTable.insert<sQù€ð ˆ>Ø×.Ñ.‰KØ wÒ Ø×4Ñ4‰KÜ fÔ Ü! &¨$Ó/‰KäÐ;¸F¸8ÐDÓEÐ Eà×*Ñ*Ó,‰ˆˆiäD—J‘J“ˆà AŠ:Øà Р؉IØ ˜!Š^ÜÐDÓEÐ Eà˜9Ñ$¨Ñ)ˆØˆØ [‰[× (Ñ (Ó *ð    7¨dܘ6“]ò 7Ø˜i™-Ü˜Q ™U iÑ/°Ó7Ø˜eÒ#Ùä Ô"KÀÔ"KÐL
Ù*¨4°°zÓB àÑ+Ø%Ð-Ø)5™à&¨,Ñ6™ð 7÷    7ðÐ÷    7ðÐúsÂ1A DÃ= DÄDc#óvK—d}|5    |j|«}    |    s|stjg||¬«–—njd}t|    |||«|_|j ||¬«|j '|jj|j d¬«|j–—Œš    ddd«y#1swYyxYw­w)z,Return generator through chunked result set.FT©rmrh©r8riNr)Ú    fetchmanyr!Ú from_recordsr~r„Ú_harmonize_columnsrÀr‚)
rÝrúÚ
exit_stackr rmrhr8riÚ has_read_datarvs
          r9Ú_query_iteratorzSQLTable._query_iteratorjsËèø€ðˆ Ø ñ    !ØØ×'Ñ'¨    Ó2ÙÙ(Ü'×4Ñ4ب¸lôòðà $ Ü9ؘ' <°ó”
ð×'Ñ'Ø +¸=ð(ôð—:‘:Ð)Ø—J‘J×(Ñ(¨¯©¸TÐ(ÔBà—j‘jÒ ð+ð÷    !÷    !ñ    !üs‚B9‡BB-Â$    B9Â-B6Â2B9c    óÀ—ddlm}|†t|«dkDrx|Dcgc]}|jj|‘Œ}    }|j
@|j
ddd…D]+}
|    j d|jj|
«Œ-||    Ž} n||j«} |jj| «} | j«} ||j| ||| |||¬«S| j«}t|| ||«|_ |j||¬«|j
'|jj|j
d¬«|jScc}w)Nr)Úselectéÿÿÿÿ)rhr8rir5Tr)r‹r=rurªÚcrÀrõr×r•rÚr;Úfetchallr~r„r8r‚)rÝr9rhr8rmr rir=ÚnÚcolsÚidxÚ
sql_selectrúrrvs               r9Úreadz SQLTable.readŽsU€õ    &à Ð ¤3 w£<°!Ò#3Ø-4Ö5¨D—J‘J—L‘L “OÐ5ˆDÐ5؏z‰zÐ%ØŸ:™:¡d¨ dÑ+ò6CØ—K‘K  4§:¡:§<¡<°Ñ#4Õ5ð6á ˜‰Já §
¡
Ó+ˆJØ—‘×$Ñ$ ZÓ0ˆØ—{‘{“}ˆ à Ð  Ø×'Ñ'ØØØØØ)Ø'Ø+ð(óð ð—?‘?Ó$ˆDÜ5ؐl L°-óˆDŒJð × #Ñ #Ø'°}ð $ô ðz‰zÐ%Ø—
‘
×$Ñ$ T§Z¡Z¸Ð$Ô>à—:‘:Ð ùòC6s› Ecóâ—|durÆ|jjj}|1t|t«s|g}t |«|k7rt d|›«‚|S|dk(r;d|jjvr#|jjj€dgStj|jjj«St|t«r|gSt|t«r|Sy)NTz@Length of 'index_label' should match number of levels, which is r%rÀ) r„rÀÚnlevelsrLrorurPrmrÆÚcomÚfill_missing_namesrr‘)rÝrÀrÁrGs    r9rÙzSQLTable._index_name½så€à D‰=Ø—j‘j×&Ñ&×.Ñ.ˆGàÐ&Ü! +¬tÔ4Ø#. -Kܐ{Ó# wÒ.Ü$ð,Ø,3¨9ð6óðð#Ð"ð˜1’ Ø 4§:¡:×#5Ñ#5Ñ5Ø—J‘J×$Ñ$×)Ñ)Ð1àyРä×-Ñ-¨d¯j©j×.>Ñ.>×.DÑ.DÓEÐEô˜œsÔ #ؐ7ˆNÜ ˜œtÔ $؈Làr;c
óð—g}|jet|j«D]M\}}||jjj|««}|j    t |«|df«ŒO|t t|jj««Dcgc]H}t |jj|«||jjdd…|f«df‘ŒJc}z }|Scc}w)NTF)
rÀr\r„Ú_get_level_valuesrrr‘rtrurmÚiloc)rÝÚ dtype_mapperÚcolumn_names_and_typesraÚ    idx_labelÚidx_types      r9Ú_get_column_names_and_typesz$SQLTable._get_column_names_and_typesÝs݀Ø!#ÐØ :‰:Ð !Ü )¨$¯*©*Ó 5ò P‘ 9Ù'¨¯
©
×(8Ñ(8×(JÑ(JÈ1Ó(MÓNØ&×-Ñ-¬s°9«~¸xÈÐ.NÕOð Pð    äœ3˜tŸz™z×1Ñ1Ó2Ó3ö#
àô—‘×#Ñ# AÑ&Ó '©°d·j±j·o±oÂaÈÀdÑ6KÓ)LÈeÒ Tò#
ñ    
Ðð
&Ð%ùò #
sÂA C3c
ó—ddlm}m}m}ddlm}|j |j«}|Dcgc]\}}}||||¬«‘Œ}    }}}|jUt|j«s|jg}
n |j}
||
d|jdziŽ} |    j| «|jxs |jjj} |«} ||j| g|    ¢­d| iŽScc}}}w)Nr)ÚColumnÚPrimaryKeyConstraintr,©ÚMetaData)rÀrÆÚ_pkrŸ)r‹rSrTr,rårVrQÚ_sqlalchemy_typerÚrrÆrrrŸr×rì)rÝrSrTr,rVrNrÆÚtypÚis_indexrmrÚÚpkcrŸrìs              r9rÛzSQLTable._create_table_setupësò€÷    
ñ    
õ
    /à!%×!AÑ!AÀ$×BWÑBWÓ!XÐð(>÷
ð
á#c˜8ñ 4˜ HÖ -ð
ˆò
ð
9‰9Ð  Ü §    ¡    Ô*ØŸ    ™    {‘à—y‘yÙ&¨ÐE°4·9±9¸uÑ3DÑEˆCØ N‰N˜3Ô à—‘Ò7 § ¡ × 0Ñ 0× 7Ñ 7ˆñ‹zˆÙT—Y‘Y Ð> wÒ>°vÑ>Ð>ùô%
s²C9có~—t|«}|jjD]v}|j}    |j|}||vr!    ||}t ||¬«|j|<ŒE|j|j«}|tus|tus|tur#|tu}t ||¬«|j|<nÜ|dk(r)|tur!|j|d¬«|j|<n®t«rDt|«r9t!|j|«r!|j|d¬«|j|<n`|dk(r[t#|«|j%«k(r?|t'j(d«us|t*ur |j|d¬«|j|<Œyy#t
$rd}YŒ_wxYw#t,$rYŒ™wxYw)a
        Make the DataFrame's column types align with the SQL table
        column types.
        Need to work around limited NA value support. Floats are always
        fine, ints must always be floats if there are Null values.
        Booleans are hard because converting bool column with None replaces
        all Nones with false. Therefore only convert bool if there are no
        NA values.
        Datetimes should already be converted to np.datetime64 if supported,
        but here we also force conversion if required.
        Nr[rJrfF)rÚint64)r:rªrmrÆr„rOrYÚ
_get_dtyperSr    rrÚfloatrrrrruÚcountrTrRÚboolr^)    rÝr8riÚsql_colrbrcrdÚcol_typerIs             r9r8zSQLTable._harmonize_columns    s €ô 4°KÓ@ˆ à—z‘z×)Ñ)ó(    ˆGØ—|‘|ˆHð& ØŸ™ HÑ-ð˜{Ñ*ð#Ø)¨(Ñ3˜ô,?¸vÈcÔ+RD—J‘J˜xÑ(Øð Ÿ?™?¨7¯<©<Ó8ð¤Ñ(ؤ4Ñ'ؤ?Ñ2ð#¤oÐ5CÜ+>¸vÈ3Ô+OD—J‘J˜xÒ(Ø" gÒ-°(¼eÑ2Cà+1¯=©=¸È¨=Ó+ND—J‘J˜xÒ(ä&Ô(Ü'¨Ô1Ü'¨¯
©
°8Ñ(<Ô=à+1¯=©=¸È¨=Ó+ND—J‘J˜xÒ(Ø" gÒ-´#°f³+ÀÇÁÃÒ2Oà¤2§8¡8¨GÓ#4Ñ4¸ÄDÑ8HØ/5¯}©}¸XÈE¨}Ó/R˜Ÿ
™
 8Ñ,ùñM(    øô%ò#Ø"›ð#ûô:ò Úð ús<³F/ÁFÁ F/Á'D2F/Æ F,Æ(F/Æ+F,Æ,F/Æ/    F<Æ;F<có—|jxsi}t|«r-tt|«}|j|vr||jSt j |d¬«}ddlm}m    }m
}m }m }m }    m}
m} m} m} |dvr#    |j$j&    |d¬«S    |S|dk(r&t-j.d    t0t3«¬
«|S|d k(r!|jd k(r    |    d ¬«S|    d¬«S|dk(r„|jjj5«dvr| S|jjj5«dvr|
S|jjj5«dk(r t7d«‚|S|dk(r|S|dk(r|S|dk(r| S|dk(r t7d«‚| S#t($rt+|dd« |d¬«cYSY|SwxYw)NT©Úskipnar)
Ú    TIMESTAMPÚ
BigIntegerÚBooleanÚDateÚDateTimeÚFloatÚIntegerÚ SmallIntegerÚTextÚTime)Ú
datetime64r    )ÚtimezoneÚtzÚ timedelta64últhe 'timedelta' type is not supported, and will be written as integer values (ns frequency) to the database.r‰rUÚfloat32é)Ú    precisioné5rV)Úint8Úuint8Úint16)Úuint16Úint32Úuint64z1Unsigned 64 bit integer datatype is not supportedÚbooleanrr
ÚcomplexúComplex datatypes not supported)rRrrrMrÆrÚ infer_dtypeÚsqlalchemy.typesrgrhrirjrkrlrmrnrorprrsÚAttributeErrorÚgetattrrŽrrÒrÚlowerrP)rÝrWrRrcrgrhrirjrkrlrmrnrorps              r9rXzSQLTable._sqlalchemy_typeEsӀ؟*™*Ò*¨ˆÜ ˜Ô Üœ˜uÓ%ˆE؏x‰x˜5ѠؘSŸX™X‘Ð&ô—?‘? 3¨tÔ4ˆ÷     
÷     
÷     
ð Ð1Ñ 1ð 4à—6‘6—9‘9Ð(Ù$¨dÔ3Ð3ð)ðˆOØ }Ò $Ü M‰MðLäÜ+Ó-õ     ð Ð Ø ˜Ò #؏y‰y˜IÒ%Ù rÔ*Ð*á rÔ*Ð*Ø ˜Ò "ày‰y~‰~×#Ñ#Ó%Ð)CÑCØ#Ð#Ø—‘—‘×%Ñ%Ó'Ð+>Ñ>ؐؗ‘—‘×%Ñ%Ó'¨8Ò3Ü Ð!TÓUÐUà!Ð!Ø ˜Ò "؈NØ ˜Ò ؈KØ ˜Ò ؈KØ ˜Ò "ÜÐ>Ó?Ð ?àˆ øôM"ò 4ô˜3  dÓ+Ð7Ù$¨dÔ3Ò3ð8àˆOð  4úsÁ=F Æ GÇGcó¬—ddlm}m}m}m}m}m}m}t||«rtSt||«rtjd«St||«r|jstStSt||«rtSt||«rtSt||«rt St||«r$t#«rt%tj&¬«St(S)Nr)rgrirjrkrlrmÚStringr])Úna_value)r„rgrirjrkrlrmr‰rLr_rTrRrrr    rrrarr$Únanr)    rÝÚsqltypergrirjrkrlrmr‰s             r9r^zSQLTable._get_dtypeŒsª€÷    
÷    
ñ    
ô g˜uÔ %܈LÜ ˜ Ô )ä—8‘8˜GÓ$Ð $Ü ˜ Ô +à×#Ò#ܐÜ"Ð "Ü ˜ Ô *äˆOÜ ˜ Ô &܈KÜ ˜ Ô )܈KÜ ˜ Ô (Ü!Ô#Ü"¬B¯F©FÔ3Ð3äˆ r;)NTr»ÚpandasNNNN) rÆr‘rÀúbool | str | list[str] | Noner¿ú$Literal['fail', 'replace', 'append']rØr‘rRúDtypeArg | NoneÚreturnÚNone©r‘r‘©r‘r’)rÚú    list[str]r‘Úint)r‘z"tuple[list[str], list[np.ndarray]])NN)r ú
int | NonerÂú"Literal['multi'] | Callable | Noner‘r—)TNrf)r9rr r—rhrariúDtypeBackend | Literal['numpy'])TNNNrf)
r9rrhrar r—rir™r‘úDataFrame | Iterator[DataFrame])Nrf)rir™r‘r’)rWzIndex | Series)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rßrârçrïrîrûrÿr"rõr;rErÙrQrÛr8rXr^rœr;r9rÕr՜so„ñðØ/3Ø:@ØØØØ Ø!%ð";àð";ð
-ð ";ð 8ð ";ðð";ðð";ð
ó";òH=óEó
4ó #óó ó"2'ðl!%Ø59ð,àð,ð3ð,ð
ó    ,ðh"ØØ9@ð"!ðð"!ðð    "!ð ð "!ð7ó"!ðN"ØØØ $Ø9@ð-àð-ðð-ð ð -ð7ð-ð
)ó-ò^ò@ &ò?ð@Ø9@ð:ð7ð:ð
ó    :óxEóN r;rÕcó(—eZdZdZd d„Zd d„Z                            d                                                     dd„Ze                            d                                                     dd„«Ze                                d                                                            dd„«Z    eddd„«Z
eddd    „«Z e            d                                            dd
„«Z y)rÊz9
    Subclasses Should define read_query and to_sql.
    có—|Sr›rœrás r9Ú    __enter__zPandasSQL.__enter__´s€Øˆ r;có—yr›rœ©rÝÚargss  r9Ú__exit__zPandasSQL.__exit__·s€Ø r;Nc    ó—t‚r›©rÄ)    rÝržrƒrhr8rmrŸr ris             r9r©zPandasSQL.read_tableºs
€ô"Ð!r;c    ó—yr›rœ)    rÝr–rƒrhr8r˜r rRris             r9r°zPandasSQL.read_queryÇs€ð     r;c ó—yr›rœ) rÝr„rÆr¿rÀrÁrŸr rRrÂr’rÇs             r9rÅzPandasSQL.to_sqlÕs€ð     r;có—yr›rœ)rÝr–r˜s   r9r•zPandasSQL.executeæó€à r;có—yr›rœ)rÝrÆrŸs   r9r¨zPandasSQL.has_tableêr«r;có—yr›rœ©rÝr„ržrÚrRrŸs      r9Ú_create_sql_schemazPandasSQL._create_sql_schemaîs€ð     r;)r‘r3r”©NTNNNNrf©ržr‘rƒústr | list[str] | NonerhrarŸú
str | Noner r—rir™r‘rš©r–r‘rƒr²rhrar r—rRrrir™r‘rš©r»TNNNNNÚauto)rÆr‘r¿rrÀrar r—rRrrÂr˜r’r‘r‘r—r›©r–zstr | Select | TextClause©rÆr‘rŸr³r‘ra©NNN© r„r!ržr‘rÚúlist[str] | NonerRrrŸr³r‘r‘) r›rœrržr¡r¥r©rr°rÅr•r¨r¯rœr;r9rÊrʯsà„ñóó ð -1Ø!ØØØ!Ø $Ø9@ð "àð "ð*ð "ðð     "ðð "ðð "ð7ð "ð
)ó "ðð-1Ø!ØØØ $Ø!%Ø9@ð  à ð  ð*ð  ðð      ðð  ðð  ð7ð  ð
)ò  óð  ðð
;AØØØØ $Ø!%Ø59Øð ðð ð8ð     ð
ð  ðð ðð ð3ð ðð ð
ò óð ð ó óð ðó óð ðð
"&Ø!%Ø!ð  àð ðð ðð     ð
ð  ð ð  ð
ò óñ r;có0—eZdZ                d                                    dd„Zy)Ú
BaseEngineNc     ó—t|«‚)z:
        Inserts data into already-prepared table
        )r)
rÝrªr—r„rÆrÀrŸr rÂrÇs
          r9Úinsert_recordszBaseEngine.insert_recordsûs€ô" $Ó'Ð'r;©TNNN©
rªrÕrÆr‘rÀrŽr r—r‘r—)r›rœrr¿rœr;r9r½r½úsE„ð04ØØ $Øð(àð(ð
ð (ð -ð (ðð(ð
ô(r;r½có8—eZdZdd„Z                d                                    dd„Zy)ÚSQLAlchemyEnginecó—tdd¬«y)Nr‹z'sqlalchemy is required for SQL support.)Úextrarrás r9rßzSQLAlchemyEngine.__init__s€Ü"Ø РIö    
r;Nc     óڗddlm}
    |j||¬«S#|
j$r@} d} t    | j
«} t j| | «r td«| ‚| ‚d} ~ wwxYw)Nr)Úexc)r rÂzg(\(1054, "Unknown column 'inf(e0)?' in 'field list'"\))(?#
            )|inf can not be used with MySQLzinf cannot be used with MySQL)    r‹rÇrõÚStatementErrorr‘ÚorigÚreÚsearchrP)rÝrªr—r„rÆrÀrŸr rÂrÇrÇrÚmsgÚerr_texts              r9r¿zSQLAlchemyEngine.insert_recordssj€õ    #ð
    Ø—<‘<¨)¸F<ÓCÐ CøØ×!Ñ!ò    ð0ˆCä˜3Ÿ8™8“}ˆH܏y‰y˜˜hÔ'Ü Ð!@ÓAÀsÐJ؈Iûð    úsˆ›A*ª;A%Á%A*r”rÀrÁ)r›rœrrßr¿rœr;r9rÃrà sJ„ó
ð04ØØ $Øðàðð
ð ð -ð ððð
ôr;rÃcóü—|dk(r td«}|dk(r'tg}d}|D] }    |«cStd|›«‚|dk(r
t«St    d«‚#t$r}|dt|«zz }Yd}~ŒUd}~wwxYw)    zreturn our implementationr¶z io.sql.engineÚz
 - Nz±Unable to find a usable engine; tried using: 'sqlalchemy'.
A suitable version of sqlalchemy is required for sql I/O support.
Trying to import the above resulted in these errors:r‹z*engine must be one of 'auto', 'sqlalchemy')r rÃrÎr‘rP)r’Úengine_classesÚ
error_msgsÚ engine_classrs     r9Ú
get_enginerÓ.sª€à ÒܘOÓ,ˆà Òä*Ð+ˆàˆ
Ø*ò    1ˆLð 1Ù#“~Ò%ð    1ô ð Cð ˆlð  ó
ð    
ðÒÜÓ!Ð!ä
ÐAÓ
BÐBøô!ò 1ؘg¬¨C«Ñ0Ñ0•
ûð 1ús¥AÁ    A;Á A6Á6A;cóª—eZdZdZ    d                    dd„Zdd„Zed„«Zddd„Z                            d                                                    dd„Z    e
                    d                                    dd„«Z                             d                                                    dd    „Z e Z                     d                                    dd
„Z                        dd „Z                                d                                                                    d d „Zed „«Zdd!d„Zdd"d„Zdd#d„Z            d$                                            d%d„Zy)&rÐaa
    This class enables conversion between DataFrame and SQL databases
    using SQLAlchemy to handle DataBase abstraction.
 
    Parameters
    ----------
    con : SQLAlchemy Connectable or URI string.
        Connectable to connect with the database. Using SQLAlchemy makes it
        possible to use any DB supported by that library.
    schema : string, default None
        Name of SQL schema in database to write to (if database flavor
        supports this). If None, use default schema (default).
    need_transaction : bool, default False
        If True, SQLDatabase will create a transaction.
 
    NcóØ—ddlm}ddlm}ddlm}t «|_t|t«r-||«}|jj|j«t||«r)|jj|j««}|r9|j«s)|jj|j««||_||¬«|_d|_y)Nr)Ú create_engine)r“rUrÉF)r‹rÖÚsqlalchemy.enginer“rårVrr9rLr‘ÚcallbackÚdisposeÚ enter_contextÚconnectÚin_transactionÚbeginr—rìÚreturns_generator)rÝr—rŸrrÖr“rVs       r9rßzSQLDatabase.__init__`s§€õ    -Ý,Ý.ô $›+ˆŒÜ cœ3Ô Ù Ó$ˆCØ O‰O× $Ñ $ S§[¡[Ô 1Ü c˜6Ô "Ø—/‘/×/Ñ/°· ± ³ Ó>ˆCÙ  C×$6Ñ$6Ô$8Ø O‰O× )Ñ )¨#¯)©)«+Ô 6؈ŒÙ FÔ+ˆŒ    Ø!&ˆÕr;cóR—|js|jj«yyr›)rÞr9Úcloser£s  r9r¥zSQLDatabase.__exit__ws €Ø×%Ò%Ø O‰O× !Ñ !Õ #ð&r;c#óØK—|jj«s2|jj«5|j–—ddd«y|j–—y#1swYyxYw­wr›)r—rÜrÝrás r9rízSQLDatabase.run_transaction{sQèø€àx‰x×&Ñ&Ô(Ø—‘—‘Ó!ñ Ø—h‘h’÷ ð ð—(‘(‹N÷ ð üs‚5A*·AÁA*ÁA'Á#A*có¤—|€gn|g}t|t«r|jj|g|¢­ŽS|jj|g|¢­ŽS)z,Simple passthrough to SQLAlchemy connectable)rLr‘r—Úexec_driver_sqlr•)rÝr–r˜r¤s    r9r•zSQLDatabase.executeƒsQ€à^‰r¨&¨ˆÜ cœ3Ô Ø+4—8‘8×+Ñ+¨CÐ7°$Ò7Ð 7؈tx‰x×Ñ Ð+ dÒ+Ð+r;c    óƗ|jj|j|gd¬«t||||¬«}    |d|_|    j |j |||||¬«S)ap
        Read SQL database table into a DataFrame.
 
        Parameters
        ----------
        table_name : str
            Name of SQL table in database.
        index_col : string, optional, default: None
            Column to set as index.
        coerce_float : bool, default True
            Attempts to convert values of non-string, non-numeric objects
            (like decimal.Decimal) to floating point. This can result in
            loss of precision.
        parse_dates : list or dict, default: None
            - List of column names to parse as dates.
            - Dict of ``{column_name: format string}`` where format string is
              strftime compatible in case of parsing string times, or is one of
              (D, s, ns, ms, us) in case of parsing integer timestamps.
            - Dict of ``{column_name: arg}``, where the arg corresponds
              to the keyword arguments of :func:`pandas.to_datetime`.
              Especially useful with databases without native Datetime support,
              such as SQLite.
        columns : list, default: None
            List of column names to select from SQL table.
        schema : string, default None
            Name of SQL schema in database to query (if database flavor
            supports this).  If specified, this overwrites the default
            schema of the SQL database object.
        chunksize : int, default None
            If specified, return an iterator where `chunksize` is the number
            of rows to include in each chunk.
        dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
            Back-end data type applied to the resultant :class:`DataFrame`
            (still experimental). Behaviour is as follows:
 
            * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
              (default).
            * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
              DataFrame.
 
            .. versionadded:: 2.0
 
        Returns
        -------
        DataFrame
 
        See Also
        --------
        pandas.read_sql_table
        SQLDatabase.read_query
 
        T)rêÚonlyÚviews)rÀrŸ)rhr8rmr ri)rìÚreflectr—rÕrÞrEr9)
rÝržrƒrhr8rmrŸr rirªs
          r9r©zSQLDatabase.read_tableŠsn€ð~         ‰    ×јtŸx™x¨z¨lÀ$ÐÔGܘ T°À6ÔJˆØ Ð  Ø%)ˆDÔ "؏z‰zØ O‰OØ%Ø#ØØØ'ð ó
ð    
r;c    
#óÄK—d}    |5    |j|«}
|
s|    stg||||||¬«–—nd}    t|
||||||¬«–—ŒA    ddd«y#1swYyxYw­w)ú+Return generator through chunked result setFT©rƒrhr8rRriN)r6r…) rúr9r rmrƒrhr8rRrir:rvs            r9r;zSQLDatabase._query_iteratorÖs•èø€ðˆ Ø ñ    ØØ×'Ñ'¨    Ó2ÙÙ(Ü*ØØ#Ø&/Ø)5Ø(3Ø"'Ø*7ôòðà $ Ü"ØØØ'Ø!-Ø +ØØ"/ôòð!ð÷    ÷    ñ    üs‚A ‡AAÁ     A ÁAÁA c     óè—|j||«}    |    j«}
|+d|_|j|    |j||
|||||¬«    S|    j «} t | |
|||||¬«} | S)aé
        Read SQL query into a DataFrame.
 
        Parameters
        ----------
        sql : str
            SQL query to be executed.
        index_col : string, optional, default: None
            Column name to use as index for the returned DataFrame object.
        coerce_float : bool, default True
            Attempt to convert values of non-string, non-numeric objects (like
            decimal.Decimal) to floating point, useful for SQL result sets.
        params : list, tuple or dict, optional, default: None
            List of parameters to pass to execute method.  The syntax used
            to pass parameters is database driver dependent. Check your
            database driver documentation for which of the five syntax styles,
            described in PEP 249's paramstyle, is supported.
            Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}
        parse_dates : list or dict, default: None
            - List of column names to parse as dates.
            - Dict of ``{column_name: format string}`` where format string is
              strftime compatible in case of parsing string times, or is one of
              (D, s, ns, ms, us) in case of parsing integer timestamps.
            - Dict of ``{column_name: arg dict}``, where the arg dict
              corresponds to the keyword arguments of
              :func:`pandas.to_datetime` Especially useful with databases
              without native Datetime support, such as SQLite.
        chunksize : int, default None
            If specified, return an iterator where `chunksize` is the number
            of rows to include in each chunk.
        dtype : Type name or dict of columns
            Data type for data or columns. E.g. np.float64 or
            {'a': np.float64, 'b': np.int32, 'c': 'Int64'}
 
            .. versionadded:: 1.3.0
 
        Returns
        -------
        DataFrame
 
        See Also
        --------
        read_sql_table : Read SQL database table into a DataFrame.
        read_sql
 
        Trê)r•rÚrÞr;r9r@r…) rÝr–rƒrhr8r˜r rRrirúrmrvr„s              r9r°zSQLDatabase.read_queryÿs™€ðr—‘˜c 6Ó*ˆØ—+‘+“-ˆà Ð  Ø%)ˆDÔ "Ø×'Ñ'ØØ—‘ØØØ#Ø)Ø'ØØ+ð(ó
ð
ð—?‘?Ó$ˆDÜ ØØØ#Ø)Ø'ØØ+ôˆEðˆLr;c
ó^—|r‚t|«s|Dcic]}||“Œ}}ntt|«}ddlm}    |j «D]=\}
} t | t«r t| |    «rŒ#t | |    «rŒ0td|
›d«‚t||||||||¬«} | j«| Scc}w)z_
        Prepares table in the database for data insertion. Creates it if needed, etc.
        r)Ú
TypeEnginez The type of z is not a SQLAlchemy type)r„rÀr¿rÁrŸrR) rrrMr„rír]rLrSrQrPrÕrî) rÝr„rÆr¿rÀrÁrŸrRrbrírWÚmy_typerªs              r9Ú
prep_tablezSQLDatabase.prep_tableWsĀñ Ü Ô&ð:?Ö?¨X˜ 5™Ð?Ñ?äœT 5Ó)å 3à %§ ¡ £ ò T‘ Wܘg¤tÔ,´¸GÀZÔ1PØÜ ¨Ô4Øä$ |°C°5Ð8QÐ%RÓSÐSð  TôØ Ø ØØØØ#ØØô    
ˆð     ‰ ŒØˆ ùò3@s’
B*có*—|j«sƒ|j«srddlm}||j«}|j |xs|j j¬«}||vr+d|›d}tj|tt«¬«yyyy)zv
        Checks table name for issues with case-sensitivity.
        Method is called after data is inserted.
        r©ÚinspectrÉzThe provided table name 'z—' is not found exactly as such in the database after writing the table, possibly due to case sensitivity issues. Consider using lower case table names.r‰N) ÚisdigitÚislowerr‹ròr—Úget_table_namesrìrŸrŽrrÒr)rÝrÆrŸÚsqlalchemy_inspectÚinspÚ table_namesrÌs       r9Úcheck_case_sensitivez SQLDatabase.check_case_sensitive‡s€ð|‰|Œ~ d§l¡l¤nõ Aá% d§h¡hÓ/ˆDØ×.Ñ.°fÒ6PÀÇ    Á    ×@PÑ@PÐ.ÓQˆKؘ;Ñ&à/°¨vð6(ð(ðô — ‘ ØÜÜ/Ó1öð'ð'5ˆ~r;c ó¼—t|
«} |j|||||||¬«} | jd| |j||||||    dœ| ¤Ž}|j    ||¬«|S)a    
        Write records stored in a DataFrame to a SQL database.
 
        Parameters
        ----------
        frame : DataFrame
        name : string
            Name of SQL table.
        if_exists : {'fail', 'replace', 'append'}, default 'fail'
            - fail: If table exists, do nothing.
            - replace: If table exists, drop it, recreate it, and insert data.
            - append: If table exists, insert data. Create if does not exist.
        index : boolean, default True
            Write DataFrame index as a column.
        index_label : string or sequence, default None
            Column label for index column(s). If None is given (default) and
            `index` is True, then the index names are used.
            A sequence should be given if the DataFrame uses MultiIndex.
        schema : string, default None
            Name of SQL schema in database to write to (if database flavor
            supports this). If specified, this overwrites the default
            schema of the SQLDatabase object.
        chunksize : int, default None
            If not None, then rows will be written in batches of this size at a
            time.  If None, all rows will be written at once.
        dtype : single type or dict of column name to SQL type, default None
            Optional specifying the datatype for columns. The SQL type should
            be a SQLAlchemy type. If all columns are of the same type, one
            single value can be used.
        method : {None', 'multi', callable}, default None
            Controls the SQL insertion clause used:
 
            * None : Uses standard SQL ``INSERT`` clause (one per row).
            * 'multi': Pass multiple values in a single ``INSERT`` clause.
            * callable with signature ``(pd_table, conn, keys, data_iter)``.
 
            Details and a sample callable implementation can be found in the
            section :ref:`insert method <io.sql.method>`.
        engine : {'auto', 'sqlalchemy'}, default 'auto'
            SQL engine library to use. If 'auto', then the option
            ``io.sql.engine`` is used. The default ``io.sql.engine``
            behavior is 'sqlalchemy'
 
            .. versionadded:: 1.3.0
 
        **engine_kwargs
            Any additional kwargs are passed to the engine.
        )r„rÆr¿rÀrÁrŸrR)rªr—r„rÆrÀrŸr rÂ)rÆrŸrœ)rÓrïr¿r—rù)rÝr„rÆr¿rÀrÁrŸr rRrÂr’rÇÚ
sql_enginerªr0s               r9rÅzSQLDatabase.to_sql¤s‘€ô|  Ó'ˆ
à—‘ØØØØØ#ØØð ó
ˆð3˜×2Ñ2ð
 
ØØ—‘ØØØØØØñ
 
ðñ
 
ˆð     ×!Ñ! t°FÐ!Ô;ØÐr;có.—|jjSr›)rìÚtablesrás r9rýzSQLDatabase.tablesýs€ày‰y×ÑÐr;có†—ddlm}||j«}|j||xs|jj
«S)Nrrñ)r‹ròr—r¨rìrŸ)rÝrÆrŸrör÷s     r9r¨zSQLDatabase.has_tables3€Ý<á! $§(¡(Ó+ˆØ~‰~˜d FÒ$>¨d¯i©i×.>Ñ.>Ó?Ð?r;cóü—ddlm}m}|xs|jj}|||j|j
|¬«}|j D]*}t|j|«sŒd|j_    Œ,|S)Nr)ÚNumericr,)Ú autoload_withrŸF)
r‹rr,rìrŸr—rmrLrSÚ    asdecimal)rÝržrŸrr,ÚtblÚcolumns       r9rÜzSQLDatabase.get_tablesi€÷    
ð
Ò+˜4Ÿ9™9×+Ñ+ˆÙJ §    ¡    ¸¿¹È&ÔQˆØ—k‘kò    .ˆFܘ&Ÿ+™+ wÕ/Ø(-— ‘ Õ%ð    .ðˆ
r;cóˆ—|xs|jj}|j||«rŠ|jj|j|g|d¬«|j «5|j ||«j|j¬«ddd«|jj«yy#1swYŒ%xYw)NT)rêrårŸræré)    rìrŸr¨rçr—rírÜÚdropÚclear©rÝržrŸs   r9rózSQLDatabase.drop_tables¤€ØÒ+˜4Ÿ9™9×+Ñ+ˆØ >‰>˜* fÔ -Ø I‰I× Ñ Ø—X‘X Z L¸Àtð ô ð×%Ñ%Ó'ñ GØ—‘˜z¨6Ó2×7Ñ7¸T¿X¹XÐ7ÔF÷ Gà I‰IO‰OÕ ð .÷ Gð Gús Á'-B8Â8Cc    óX—t|||d|||¬«}t|j««S©NF)r„rÀrÚrRrŸ)rÕr‘rç©rÝr„ržrÚrRrŸrªs       r9r¯zSQLDatabase._create_sql_schemas9€ôØ Ø ØØØØØô
ˆô5×#Ñ#Ó%Ó&Ð&r;©NF)rŸr³rrar‘r’r”r›r·r°r±©NTNNrf)
r9rr r–rhrarRrrir™r´)r»TNNN)
rÆr‘r¿rrÀrŽrRrr‘rÕ©rÆr‘rŸr³r‘r’rµ©rÆr‘r¿rrÀrarŸr³r r—rRrrÂr˜r’r‘r‘r—r¸)ržr‘rŸr³r‘r,©ržr‘rŸr³r‘r’r¹rº)r›rœrržrßr¥rrír•r©Ú staticmethodr;r°r³rïrùrÅÚpropertyrýr¨rÜrór¯rœr;r9rÐrÐNsׄñð$HMð'Ø%ð'Ø@Dð'à     ó'ó.$ðñóðô,ð-1Ø!ØØØ!Ø $Ø9@ðJ
àðJ
ð*ðJ
ðð    J
ððJ
ððJ
ð7ðJ
ð
)óJ
ðXð Ø!ØØ!%Ø9@ð&àð&ðð&ð ð &ðð&ð7ò&óð&ðV-1Ø!ØØØ $Ø!%Ø9@ðTà ðTð*ðTðð    TððTððTð7ðTð
)óTðl€Hð ;AØ/3ØØØ!%ð.ðð.ð8ð    .ð
-ð .ðð.ð
ó.ð`àðððð
ó    ðB;AØØØ!Ø $Ø!%Ø59ØðWððWð8ð    Wð
ð WððWððWððWð3ðWððWð
óWðrñ óð ô@ô ôð"&Ø!%Ø!ð 'àð'ðð'ðð    'ð
ð 'ð ð 'ð
ô'r;rÐcó—eZdZdZd d„Zed„«Zd d d„Z                            d                                                    dd„Z                            d                                                    dd„Z    e    Z
                                d                                                                    dd„Z d dd    „Z             d                                            dd
„Z y)rÑzÈ
    This class enables conversion between DataFrame and SQL databases
    using ADBC to handle DataBase abstraction.
 
    Parameters
    ----------
    con : adbc_driver_manager.dbapi.Connection
    có—||_yr›©r—©rÝr—s  r9rßzADBCDatabase.__init__?ó    €Øˆr;c#óøK—|jj«5}    |–—|jj    «ddd«y#t$r|jj«‚wxYw#1swYyxYw­wr›)r—Úcursorr¸ÚrollbackÚcommit©rÝÚcurs  r9rízADBCDatabase.run_transactionBsmèø€à X‰X_‰_Ó ð     #ð Ø’    ð H‰HO‰OÔ ÷     ð    øôò Ø—‘×!Ñ!Ô#Øð ú÷    ð    üs1‚A:A.ŸA£A.½    A:Á%A+Á+A.Á.A7Á3A:Nc    ót—t|t«s td«‚|€gn|g}|jj    «}    |j
|g|¢­Ž|S#t $r[}    |jj«n&#t $r}td|›d|›d«}||‚d}~wwxYwtd|›d|›«}||‚d}~wwxYw©Nz/Query must be a string unless using sqlalchemy.zExecution failed on sql: ú
z
unable to rollbackzExecution failed on sql 'z': ©    rLr‘rOr—rr•r¸rr©rÝr–r˜r¤rrÇÚ    inner_excÚexs        r9r•zADBCDatabase.executeLóЀܘ#œsÔ#ÜÐMÓNÐ Nؐ^‰r¨&¨ˆØh‰ho‰oӈ𠠠  Ø ˆCK‰K˜Ð #˜dÓ #؈JøÜò
    ð (Ø—‘×!Ñ!Õ#øÜò (Ü"Ø/°¨u°B°s°eÐ;OÐPóð˜iÐ'ûð     (úô Ð!:¸3¸%¸sÀ3À%ÐHÓIˆBؘ#Ð ûð
    úó5¾AÁ    B7ÁA8Á7B2Á8    BÂBÂBÂB2Â2B7c    ó —|dur td«‚|r td«‚|r.|r t|«}    ng}    |    |z}
djd„|
D««} nd} |r d| ›d|›d    |›} nd| ›d|›} |jj    «5} | j | «| j «}t||¬
«}d d d «t||¬ «S#1swYŒxYw) a9
        Read SQL database table into a DataFrame.
 
        Parameters
        ----------
        table_name : str
            Name of SQL table in database.
        coerce_float : bool, default True
            Raises NotImplementedError
        parse_dates : list or dict, default: None
            - List of column names to parse as dates.
            - Dict of ``{column_name: format string}`` where format string is
              strftime compatible in case of parsing string times, or is one of
              (D, s, ns, ms, us) in case of parsing integer timestamps.
            - Dict of ``{column_name: arg}``, where the arg corresponds
              to the keyword arguments of :func:`pandas.to_datetime`.
              Especially useful with databases without native Datetime support,
              such as SQLite.
        columns : list, default: None
            List of column names to select from SQL table.
        schema : string, default None
            Name of SQL schema in database to query (if database flavor
            supports this).  If specified, this overwrites the default
            schema of the SQL database object.
        chunksize : int, default None
            Raises NotImplementedError
        dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
            Back-end data type applied to the resultant :class:`DataFrame`
            (still experimental). Behaviour is as follows:
 
            * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
              (default).
            * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
              DataFrame.
 
            .. versionadded:: 2.0
 
        Returns
        -------
        DataFrame
 
        See Also
        --------
        pandas.read_sql_table
        SQLDatabase.read_query
 
        Tú2'coerce_float' is not implemented for ADBC driversú/'chunksize' is not implemented for ADBC driversú, c3ó(K—|]
}d|›d–—Œ y­w)ú"Nrœ)r'Úxs  r9r*z*ADBCDatabase.read_table.<locals>.<genexpr>§sèø€Ò#@° a¨ s¨!¤HÑ#@ùs‚Ú*zSELECT z FROM ú.©riN)rƒr8)    rÄr&Újoinr—rr•Úfetch_arrow_tabler)r‡)rÝržrƒrhr8rmrŸr riÚ index_selectÚ    to_selectÚ select_listrþrÚpa_tabler}s                r9r©zADBCDatabase.read_table`sú€ðt ˜tÑ #Ü%ØDóð ñ Ü%Ð&WÓXÐ Xá ÙÜ.¨yÓ9‘ à! Ø$ wÑ.ˆIØŸ)™)Ñ#@°iÔ#@Ó@‰KàˆK٠ؘ[˜M¨°¨x°q¸¸ ÐE‰Dà˜[˜M¨°
¨|Ð<ˆDà X‰X_‰_Ó ð    N #Ø K‰K˜Ô Ø×,Ñ,Ó.ˆHÜ& x¸}ÔMˆB÷    Nô
!Ø ØØ#ô
ð    
÷     Nð    Nús Á?/CÃC c    ó,—|dur td«‚|r td«‚|r td«‚|jj«5}    |    j|«|    j    «}
t |
|¬«} ddd«t  |||¬«S#1swYŒxYw)aÜ
        Read SQL query into a DataFrame.
 
        Parameters
        ----------
        sql : str
            SQL query to be executed.
        index_col : string, optional, default: None
            Column name to use as index for the returned DataFrame object.
        coerce_float : bool, default True
            Raises NotImplementedError
        params : list, tuple or dict, optional, default: None
            Raises NotImplementedError
        parse_dates : list or dict, default: None
            - List of column names to parse as dates.
            - Dict of ``{column_name: format string}`` where format string is
              strftime compatible in case of parsing string times, or is one of
              (D, s, ns, ms, us) in case of parsing integer timestamps.
            - Dict of ``{column_name: arg dict}``, where the arg dict
              corresponds to the keyword arguments of
              :func:`pandas.to_datetime` Especially useful with databases
              without native Datetime support, such as SQLite.
        chunksize : int, default None
            Raises NotImplementedError
        dtype : Type name or dict of columns
            Data type for data or columns. E.g. np.float64 or
            {'a': np.float64, 'b': np.int32, 'c': 'Int64'}
 
            .. versionadded:: 1.3.0
 
        Returns
        -------
        DataFrame
 
        See Also
        --------
        read_sql_table : Read SQL database table into a DataFrame.
        read_sql
 
        Tr(z,'params' is not implemented for ADBC driversr)r0N)rƒr8rR)rÄr—rr•r2r)r‡) rÝr–rƒrhr8r˜r rRrirr6r}s             r9r°zADBCDatabase.read_queryºs§€ðf ˜tÑ #Ü%ØDóð ñ Ü%Ð&TÓUÐ UÙ Ü%Ð&WÓXÐ Xà X‰X_‰_Ó ð    N #Ø K‰K˜Ô Ø×,Ñ,Ó.ˆHÜ& x¸}ÔMˆB÷    Nô
!Ø ØØ#Øô    
ð    
÷     Nð    Nús Á/B
Bc  óÜ—|r td«‚|r td«‚|r td«‚|    r td«‚|
dk7r td«‚|r|›d|›} n|} d} |j||«rX|d    k(rtd
| ›d «‚|d k(r8|jj    «5}|j d | ›«ddd«n|dk(rd} ddl}    |jj||¬«}|jj    «5}|j||| |¬«}ddd«|jj«S#1swYŒxYw#|j$r}td«|‚d}~wwxYw#1swYŒTxYw)aü
        Write records stored in a DataFrame to a SQL database.
 
        Parameters
        ----------
        frame : DataFrame
        name : string
            Name of SQL table.
        if_exists : {'fail', 'replace', 'append'}, default 'fail'
            - fail: If table exists, do nothing.
            - replace: If table exists, drop it, recreate it, and insert data.
            - append: If table exists, insert data. Create if does not exist.
        index : boolean, default True
            Write DataFrame index as a column.
        index_label : string or sequence, default None
            Raises NotImplementedError
        schema : string, default None
            Name of SQL schema in database to write to (if database flavor
            supports this). If specified, this overwrites the default
            schema of the SQLDatabase object.
        chunksize : int, default None
            Raises NotImplementedError
        dtype : single type or dict of column name to SQL type, default None
            Raises NotImplementedError
        method : {None', 'multi', callable}, default None
            Raises NotImplementedError
        engine : {'auto', 'sqlalchemy'}, default 'auto'
            Raises NotImplementedError if not set to 'auto'
        z1'index_label' is not implemented for ADBC driversr)z+'dtype' is not implemented for ADBC driversz,'method' is not implemented for ADBC driversr¶z1engine != 'auto' not implemented for ADBC driversr/rîr»rñròr¼ú DROP TABLE Nrrr)Úpreserve_indexzdatatypes not supported)ržrvÚmodeÚdb_schema_name) rÄr¨rPr—rr•rjr,rkÚArrowNotImplementedErrorÚ adbc_ingestr)rÝr„rÆr¿rÀrÁrŸr rRrÂr’rÇržr;rryrrÇr0s                   r9rÅzADBCDatabase.to_sql    sŸ€ñV Ü%ØCóð ñ Ü%Ð&WÓXÐ XÙ Ü%Ð&SÓTÐ TÙ Ü%Ð&TÓUÐ UØ VÒ Ü%ØCóð ñ Ø"˜8 1 T FÐ+‰JàˆJð ˆØ >‰>˜$ Ô 'ؘFÒ"Ü  7¨:¨,Ð6GÐ!HÓIÐIؘiÒ'Ø—X‘X—_‘_Ó&ð<¨#Ø—K‘K +¨j¨\Р:Ô;÷<ð<à˜hÒ&ؐãð    AØ—(‘(×&Ñ& u¸UÐ&ÓCˆCðX‰X_‰_Ó ð     #Ø Ÿ_™_Ø c°ÀVð-óˆN÷    ð
     ‰‰ÔØÐ÷%<ð<ûð×*Ñ*ò    AÜÐ6Ó7¸SÐ @ûð    Aú÷    ð    ús0ÂD3ÃD?Ã9E"Ä3D<Ä?EÅ EÅEÅ"E+cóЗ|jj||¬«j«}|dj«D]%}|sŒ|D]}|sŒ|dD]}|d|k(sŒ yŒŒ'y)N)Údb_schema_filterÚtable_name_filterÚcatalog_db_schemasÚdb_schema_tablesržTF)r—Úadbc_get_objectsÚread_allÚ    to_pylist)rÝrÆrŸrìÚcatalog_schemaÚ schema_recordÚ table_records       r9r¨zADBCDatabase.has_table`    s€Øx‰x×(Ñ(Ø#°tð)ó
ç
‰(‹*ð     ð#Ð#7Ñ8×BÑBÓDò        $ˆNÙ!ØØ!/ò $ Ù$Øà$1Ð2DÑ$Eò$LØ# LÑ1°TÓ9Û#ñ$ñ     $ð        $ðr;có—td«‚)Nznot implemented for adbcr§r®s      r9r¯zADBCDatabase._create_sql_schemar    s€ô"Ð"<Ó=Ð=r;r”r›r·r°r±r´rµrr¸r¹rº)r›rœrržrßrrír•r©r°r³rÅr¨r¯rœr;r9rÑrÑ5sÒ„ñóðñóðôð.-1Ø!ØØØ!Ø $Ø9@ðX
àðX
ð*ðX
ðð    X
ððX
ððX
ð7ðX
ð
)óX
ðz-1Ø!ØØØ $Ø!%Ø9@ðF
à ðF
ð*ðF
ðð    F
ððF
ððF
ð7ðF
ð
)óF
ðP€Hð ;AØØØ!Ø $Ø!%Ø59ØðZððZð8ð    Zð
ð ZððZððZððZð3ðZððZð
óZôxð,"&Ø!%Ø!ð >àð>ðð>ðð    >ð
ð >ð ð >ð
ô>r;rÑÚTEXTÚREALÚINTEGERrgÚDATEÚTIME)rlrUrVr    rr
r€c󞗠   t|«jdd«jd«}|S#t$r}t    d|›d«|‚d}~wwxYw)Nzutf-8Ústrictz%Cannot convert identifier to UTF-8: 'r½)r‘ÚencodeÚdecodeÚ UnicodeErrorrP)rÆÚunamers   r9Ú_get_unicode_namerVŠ    s[€ðSܐD“    × Ñ  ¨(Ó3×:Ñ:¸7ÓCˆð €Løô òSÜÐ@ÀÀÀaÐHÓIÈsÐRûðSús‚*.®    A ·AÁA có¶—t|«}t|«s td«‚|jd«}|dk\r td«‚d|j    dd«zdzS)Nz$Empty table or column name specifiedúrz%SQLite identifier cannot contain NULsr,z"")rVrurPÚfindr¼)rÆrUÚ    nul_indexs   r9Ú_get_valid_sqlite_namer[’    s]€ô ˜dÓ #€EÜ ˆuŒ:ÜÐ?Ó@Ð@à—
‘
˜6Ó"€IؐA‚~ÜÐ@ÓAÐAØ —‘˜s DÓ)Ñ )¨CÑ /Ð/r;có`‡—eZdZdZd ˆfd„ Zd d„Zd d„Zd d„Zd d„Zdd„Z    dd„Z
d    „Z d
„Z ˆxZ S)Ú SQLiteTablezw
    Patch the SQLTable for fallback support.
    Instead of a table variable just use the Create Table statement.
    cóD•—t‰||i|¤Ž|j«yr›)ÚsuperrßÚ_register_date_adapters)rÝr¤ÚkwargsÚ    __class__s   €r9rßzSQLiteTable.__init__ª    s!ø€Ü ‰Ñ˜$Ð) &Ò)à ×$Ñ$Õ&r;cóø—ddl}d    d„}d„}d„}|jt|«|jt|«|jt|«d„}d„}|j d|«|j d|«y)
Nrcót—|jd›d|jd›d|jd›d|jd›S)NÚ02dú:r/Ú06d)ÚhourÚminuteÚsecondÚ microsecond)Úts r9Ú _adapt_timez8SQLiteTable._register_date_adapters.<locals>._adapt_time¶    s8€à—f‘f˜S\  1§8¡8¨C .°°!·(±(¸3°¸qÀÇÁÈsÐ@SÐTÐ Tr;có"—|j«Sr›©Ú    isoformat©Úvals r9ú<lambda>z5SQLiteTable._register_date_adapters.<locals>.<lambda>¾    s € S§]¡]£_€r;có$—|jd«S)Nú rorqs r9rsz5SQLiteTable._register_date_adapters.<locals>.<lambda>¿    s€¨¯©°sÓ);€r;cóH—tj|j««Sr›)rÚ fromisoformatrSrqs r9rsz5SQLiteTable._register_date_adapters.<locals>.<lambda>Æ    s€¤4×#5Ñ#5°c·j±j³lÓ#C€r;cóH—tj|j««Sr›)r    rwrSrqs r9rsz5SQLiteTable._register_date_adapters.<locals>.<lambda>Ç    s€¬×(>Ñ(>¸s¿z¹z»|Ó(L€r;rÚ    timestampr“)rÌÚregister_adapterr
rr    Úregister_converter)rÝrÌrmÚadapt_date_isoÚadapt_datetime_isoÚ convert_dateÚconvert_timestamps       r9r`z#SQLiteTable._register_date_adapters¯    sw€ó    ó    Uñ5ˆÙ;Ðà× Ñ ¤ {Ô3à× Ñ ¤ ~Ô6Ø× Ñ ¤Ð+=Ô>áCˆ ÙLÐà×"Ñ" 6¨<Ô8Ø×"Ñ" ;Ð0AÕBr;cóJ—tdj|j««S)Nz;
)r‘r1rªrás r9rçzSQLiteTable.sql_schemaÌ    s€Ü5—:‘:˜dŸj™jÓ)Ó*Ð*r;có¨—|jj«5}|jD]}|j|«Œ    ddd«y#1swYyxYwr›)r×rírªr•)rÝr÷rþs   r9rïzSQLiteTable._execute_createÏ    sH€Ø [‰[× (Ñ (Ó *ð    #¨dØŸ
™
ò #Ø— ‘ ˜TÕ"ñ #÷    #÷    #ñ    #ús ›#AÁAcó—ttt|jj««}d}t
}|j )|j ddd…D]}|jd|«Œ|Dcgc]
}||«‘Œ }}dj|«}dj|gt|«z«}    djt|«D
cgc]}
d|    ›d‘Œ
c}
«} d||j«›d|›d    | ›} | Scc}wcc}
w)
Nú?r>rú,ú(ú)z INSERT INTO ú (z    ) VALUES ) ror    r‘r„rmr[rÀrõr1rurtrÆ) rÝÚnum_rowsrÚwldÚescaperCrÚbracketed_namesÚ    col_namesÚ row_wildcardsrÚ    wildcardsÚinsert_statements              r9rzSQLiteTable.insert_statementÔ    sù€Ü”Sœ˜dŸj™j×0Ñ0Ó1Ó2ˆØˆÜ'ˆà :‰:Ð !Ø—z‘z¡$ B $Ñ'ò %Ø— ‘ ˜Q Õ$ð %ð9>Ö>¨f™6 &>Ð>ˆÐ>Ø—H‘H˜_Ó-ˆ    àŸ™ # ¬¨U«Ñ!3Ó4ˆ Ø—H‘H¼EÀ(»OÖL°q  - °Ò2ÒLÓMˆ    à™6 $§)¡)Ó,Ð-¨R°    ¨{¸)ÀIÀ;Ð Oð    ð Ðùò?ùòMs Á/C8à C=cót—t|«}|j|jd¬«|«|jS)Nr%©rˆ)roÚ executemanyrrö)rÝr÷rÚrørs     r9rûzSQLiteTable._execute_insertç    s3€Ü˜“Oˆ    Ø ×ј×.Ñ.¸Ð.Ó:¸IÔF؏}‰}Ðr;có—t|«}|Dcgc] }|D]}|‘ŒŒ }}}|j|jt|«¬«|«|jScc}}w)Nr‘)ror•rrurö)rÝr÷rÚrørrùr-Úflattened_datas        r9rÿz!SQLiteTable._execute_insert_multiì    sY€Ü˜“Oˆ    Ø'0×> ¸#Ò>°Qš!Ð>˜!Ð>ˆÑ>Ø  ‰ T×*Ñ*´C¸    ³NÐ*ÓCÀ^ÔT؏}‰}Ðùó?s‘AcóØ—|j|j«}t}|Dcgc]\}}}||«dz|z‘Œ}}}}|j‹t    |j«rvt |j«s|jg}n |j}dj |Dcgc]
}||«‘Œ c}«}    |jd|j›d|    ›d«|jr|jdz}
nd}
d|
z||j«zd    zd
j |«zd zg} |D cgc] \}}} | sŒ
|‘Œ } }}} t    | «r‚d j | «}d j | Dcgc]
}||«‘Œ c}«}    | jd|d|jzd z|z«zdz||j«zdz|    zdz«| Scc}}}wcc}wcc} }}wcc}w)zá
        Return a list of SQL statements that creates a table reflecting the
        structure of a DataFrame.  The first entry will be a CREATE TABLE
        statement while the rest will be CREATE INDEX statements.
        rur*z CONSTRAINT z_pk PRIMARY KEY (r†r/rÏz CREATE TABLE z (
z,
  z
)rr„z CREATE INDEX Úix_zON r‡)
rQÚ_sql_type_namer[rÚrurr1rrrÆrŸ)rÝrNrŠÚcnameÚctyperÚcreate_tbl_stmtsrÚr?Ú    cnames_brÚ schema_nameÚ create_stmtsrZÚix_colsÚcnamess               r9rÛzSQLiteTable._create_table_setupò    s€ð "&×!AÑ!AÀ$×BUÑBUÓ!VÐÜ'ˆð@V÷
ð
Ù,;¨E°5¸!‰F5‹M˜CÑ  %Ó 'ð
Ðò
ð 9‰9Ð  ¤S¨¯©¤^Ü §    ¡    Ô*ØŸ    ™    {‘à—y‘yØŸ    ™    °dÖ";°¡6¨!¥9Ò";Ó<ˆIØ × #Ñ #ؘdŸi™i˜[Ð(9¸)¸ÀAÐFô ð ;Š;ØŸ+™+¨Ñ+‰KàˆKà Øñ áT—Y‘YÓñ  ðñ ðl‰lÐ+Ó,ñ     -ð
ñ  ð
ˆ ð4J×VÐVÑ/˜U A xÊX’5ÐVˆÒVÜ ˆwŒ<Ø—X‘X˜gÓ&ˆFØŸ™°WÖ!=°¡&¨¥)Ò!=Ó>ˆIØ × Ñ ØÙ˜ §¡Ñ*¨SÑ0°6Ñ9Ó:ñ;àññ˜Ÿ™Ó#ñ$ðñ    ð
ñ ð ñ ô ðÐùôQ
ùò#<ùô"Wùò">s¨GÂ$GÄ1 G Ä=G Å0G'có~—|jxsi}t|«r-tt|«}|j|vr||jSt j |d¬«}|dk(r'tjdtt«¬«d}n |dk(rd}n|d    k(rd
}n|d k(r td «‚|tvrd
}t|S) NTrertrur‰rVrqr    Úemptyrlrr‚) rRrrrMrÆrrƒrŽrrÒrrPÚ
_SQL_TYPES)rÝrWrRrcs    r9r—zSQLiteTable._sql_type_name%
sÀ€ØŸ*™*Ò*¨ˆÜ ˜Ô Üœ˜uÓ%ˆE؏x‰x˜5ѠؘSŸX™X‘Ð&ô—?‘? 3¨tÔ4ˆà }Ò $Ü M‰MðLäÜ+Ó-õ     ð !‰Hà ˜Ò %Ø!‰Hà ˜Ò  Ø‰Hà ˜Ò "ÜÐ>Ó?Ð ?à œ:Ñ %؈Hä˜(Ñ#Ð#r;r”r“)rˆr–r‘r‘)r‘r–)r›rœrržrßr`rçrïrrûrÿrÛr—Ú __classcell__)rbs@r9r]r]¤    s7ø„ñõ
'ó
Có:+ó#ó
 ó&ó
ò 1öf $r;r]có—eZdZdZdd„Zed„«Zddd„Ze                    d                            dd„«Z                                d                                    dd„Z
d„Z                                 d                                                            dd    „Z ddd
„Z ddd „Zddd „Z            d                            dd „Zy)r·zÉ
    Version of SQLDatabase to support SQLite connections (fallback without
    SQLAlchemy). This should only be used internally.
 
    Parameters
    ----------
    con : sqlite connection object
 
    có—||_yr›rrs  r9rßzSQLiteDatabase.__init__S
rr;c#óK—|jj«}    |–—|jj«    |j «y#t$r|jj    «‚wxYw#|j «wxYw­wr›)r—rrr¸rràrs  r9rízSQLiteDatabase.run_transactionV
shèø€àh‰ho‰oӈ𠠠 ØŠIØ H‰HO‰OÕ ð
I‰IKøô    ò    Ø H‰H× Ñ Ô Ø ð    ûð I‰IKüs'‚B žA½B Á%A3Á3A6Á6BÂB Nc    ót—t|t«s td«‚|€gn|g}|jj    «}    |j
|g|¢­Ž|S#t $r[}    |jj«n&#t $r}td|›d|›d«}||‚d}~wwxYwtd|›d|›«}||‚d}~wwxYwrr!r"s        r9r•zSQLiteDatabase.executeb
r%r&c    #ó"K—d}    |j|«}    t|    «tk(r t|    «}    |    sB|j    «|s/t j g||¬«}
|r|
j|«}
|
–—yd}t|    ||||||¬«–—Œ‰­w)réFTr4rêN)    r6rSÚtupleroràr!r7rr…) rr rmrƒrhr8rRrir:rvrús            r9r;zSQLiteDatabase._query_iteratorv
s¢èø€ðˆ ØØ×#Ñ# IÓ.ˆDܐD‹zœUÒ"ܘD“zÙØ— ‘ ”Ù$Ü&×3Ñ3Ø G¸,ôFñØ!'§¡¨uÓ!5˜Ø ’LØà ˆMÜØØØ#Ø)Ø'ØØ+ôò ð!ùs‚B Bc    
ó—|j||«}    |    jD
cgc]}
|
d‘Œ    } }
||j|    || |||||¬«S|j|    «} |    j    «t | | |||||¬«} | Scc}
w)Nrrê)r•Ú descriptionr;Ú_fetchall_as_listràr…)rÝr–rƒrhr8r˜r rRrirÚcol_descrmrvr„s              r9r°zSQLiteDatabase.read_query
s®€ð—‘˜c 6Ó*ˆØ/5×/AÑ/AÖB 88˜A“;ÐBˆÐBà Ð  Ø×'Ñ'ØØØØ#Ø)Ø'ØØ+ð(ó    ð     ð×)Ñ)¨&Ó1ˆDØ L‰LŒNä ØØØ#Ø)Ø'ØØ+ôˆEðˆLùò5Cs¡ A?có\—|j«}t|t«s t|«}|Sr›)r@rLro)rÝrrús   r9r¬z SQLiteDatabase._fetchall_as_listÅ
s%€Ø—‘“ˆÜ˜&¤$Ô'ܘ&“\ˆF؈ r;c      óB—|ret|«s|D cic]} | |“Œ}} ntt|«}|j«D]&\} }t    |t
«rŒt | ›d|›d«‚t|||||||¬«}|j«|j||    «Scc} w)a@
        Write records stored in a DataFrame to a SQL database.
 
        Parameters
        ----------
        frame: DataFrame
        name: string
            Name of SQL table.
        if_exists: {'fail', 'replace', 'append'}, default 'fail'
            fail: If table exists, do nothing.
            replace: If table exists, drop it, recreate it, and insert data.
            append: If table exists, insert data. Create if it does not exist.
        index : bool, default True
            Write DataFrame index as a column
        index_label : string or sequence, default None
            Column label for index column(s). If None is given (default) and
            `index` is True, then the index names are used.
            A sequence should be given if the DataFrame uses MultiIndex.
        schema : string, default None
            Ignored parameter included for compatibility with SQLAlchemy
            version of ``to_sql``.
        chunksize : int, default None
            If not None, then rows will be written in batches of this
            size at a time. If None, all rows will be written at once.
        dtype : single type or dict of column name to SQL type, default None
            Optional specifying the datatype for columns. The SQL type should
            be a string. If all columns are of the same type, one single value
            can be used.
        method : {None, 'multi', callable}, default None
            Controls the SQL insertion clause used:
 
            * None : Uses standard SQL ``INSERT`` clause (one per row).
            * 'multi': Pass multiple values in a single ``INSERT`` clause.
            * callable with signature ``(pd_table, conn, keys, data_iter)``.
 
            Details and a sample callable implementation can be found in the
            section :ref:`insert method <io.sql.method>`.
        r‡z) not a string)r„rÀr¿rÁrR)
rrrMr]rLr‘rPr]rîrõ)rÝr„rÆr¿rÀrÁrŸr rRrÂr’rÇrbrWrîrªs                r9rÅzSQLiteDatabase.to_sqlË
sµ€ñh Ü Ô&ð:?Ö?¨X˜ 5™Ð?Ñ?äœT 5Ó)à %§ ¡ £ ò H‘ WÜ! '¬3Õ/Ü$¨ u¨B¨w¨i°~Ð%FÓGÐGð HôØ Ø ØØØØ#Øô
ˆð     ‰ ŒØ|‰|˜I vÓ.Ð.ùò%@s’
Bcól—d}d|›d}t|j||g«j««dkDS)Nrƒz‘
        SELECT
            name
        FROM
            sqlite_master
        WHERE
            type IN ('table', 'view')
            AND name=z
;
        r)rur•r@)rÝrÆrŸr‰Úquerys     r9r¨zSQLiteDatabase.has_table sG€ØˆððUð    ð ˆô4—<‘< ¨ vÓ.×7Ñ7Ó9Ó:¸QÑ>Ð>r;có—yr›rœrs   r9rÜzSQLiteDatabase.get_table) s€Ør;cóB—dt|«›}|j|«y)Nr9)r[r•)rÝrÆrŸÚdrop_sqls    r9rózSQLiteDatabase.drop_table, s!€Ø Ô!7¸Ó!=Р>Ð?ˆØ  ‰ XÕr;c    óX—t|||d|||¬«}t|j««Sr
)r]r‘rçr s       r9r¯z!SQLiteDatabase._create_sql_schema0 s9€ôØ Ø ØØØØØô
ˆô5×#Ñ#Ó%Ó&Ð&r;r”r›r·r )r r–rhrarRrrir™r°)
rhrar r—rRrrir™r‘ršrµ)rÆr‘r¿r‘rÀrar r—rRrrÂr˜r’r‘r‘r—r¸rrr¹)ržr‘rRrrŸr³r‘r‘)r›rœrržrßrrír•rr;r°r¬rÅr¨rÜrór¯rœr;r9r·r·H
s…„ñóðñ    óð    ôð(ð
Ø!ØØ!%Ø9@ð$àð$ð
ð $ðð$ð7ò$óð$ðRØ!ØØØ $Ø!%Ø9@ð&ðð    &ðð&ðð&ð7ð&ð
)ó&òPð ØØØØ $Ø!%Ø59ØðN/ððN/ðð    N/ð
ð N/ððN/ððN/ð3ðN/ððN/ð
óN/ô` ?ôôðØ!%Ø!ð 'ðð'ð
ð 'ð ð 'ð
ô'r;r·cór—t|¬«5}|j|||||¬«cddd«S#1swYyxYw)a]
    Get the SQL db table schema for the given frame.
 
    Parameters
    ----------
    frame : DataFrame
    name : str
        name of SQL table
    keys : string or sequence, default: None
        columns to use a primary key
    con: ADBC Connection, SQLAlchemy connectable, sqlite3 connection, default: None
        ADBC provides high performance I/O with native type support, where available.
        Using SQLAlchemy makes it possible to use any DB supported by that
        library
        If a DBAPI2 object, only sqlite3 is supported.
    dtype : dict of column name to SQL type, default None
        Optional specifying the datatype for columns. The SQL type should
        be a SQLAlchemy type, or a string for sqlite3 fallback connection.
    schema: str, default: None
        Optional specifying the schema to be used in creating the table.
    r)rÚrRrŸN)r”r¯)r„rÆrÚr—rRrŸr™s       r9Ú
get_schemar·D sA€ô:
˜sÔ    #ð
 zØ×,Ñ,Ø 4˜d¨%¸ð-ó
÷
÷
ò
ús-­6)FN)rIrarKzstr | dict[str, Any] | None)Trf)rhrarir™r‘r!r )rhrarRrrir™)r}r!rRrrir™r‘r!r›).......)ržr‘rƒr²r8ú!list[str] | dict[str, str] | Nonermr»r r’riúDtypeBackend | lib.NoDefaultr‘r!)ržr‘rƒr²r8r¸rmr»r r–rir¹r‘úIterator[DataFrame])ržr‘rŸr³rƒr²rhrar8r¸rmr»r r—rir¹r‘rš)rƒr²r˜ú$list[Any] | Mapping[str, Any] | Noner8r¸r r’rRrrir¹r‘r!)rƒr²r˜r»r8r¸r r–rRrrir¹r‘rº)rƒr²rhrar˜r»r8r¸r r—rRrrir¹r‘rš).......N) rƒr²rmr•r r’rir¹rRrr‘r!) rƒr²rmr•r r–rir¹rRrr‘rº)rƒr²rhrarmr»r r—rir¹rRrr‘rš)Nr»TNNNNr¶)rÆr‘rŸr³r¿rrÀrarÁzIndexLabel | Noner r—rRrrÂr˜r’r‘r‘r—)ržr‘rŸr³r‘rar )rŸr³rrar‘rÊ)r’r‘r‘r½)rÆr)NNNN)rÆr‘rRrrŸr³r‘r‘)pržÚ
__future__rÚabcrrÚ
contextlibrrr    rr
Ú    functoolsr rÊÚtypingr r rrrrrŽrfrTÚpandas._configrÚ pandas._libsrÚpandas.compat._optionalrÚ pandas.errorsrrÚpandas.util._exceptionsrÚpandas.util._validatorsrÚpandas.core.dtypes.commonrrrrÚpandas.core.dtypes.dtypesrÚpandas.core.dtypes.missingrrr Úpandas.core.apir!r"Úpandas.core.arraysr#Úpandas.core.arrays.string_r$Úpandas.core.baser%Úpandas.core.commonÚcoreÚcommonrHr&Ú"pandas.core.internals.constructionr'Úpandas.core.tools.datetimesr(Úpandas.io._utilr)Úcollections.abcr*r+r‹r,Úsqlalchemy.sql.expressionr-r.Úpandas._typingr/r0r1r2r3r4r:rYrer~r…r‡r•r¡r§r­r³rÅr¨Ú table_existsr”rÕrÊr½rÃrÓrÐrÑr¢rVr[r]r·r·rœr;r9ú<module>rØsðñõ
#÷÷÷ñõ
Û    ÷÷óãå-åÝ>÷õ5Ý7÷óõ 6Ý+å÷õ3Ý2Ý)ߠРÝ.ÝCÝ3å1á÷õ
!÷÷
õõò ðCGðMØðMØ$?óMòDð0Ø5<ð    *ðð*ð3ð    *ð
ó *ðJØØØ!Ø5<ððð    ð ð ð3óð4ØØ!Ø5<ñ Øðð
ð ð 3ð ðóó(/ðF
ð Ø(+ØØ58Ø #ØØ25ð Øð ð&ð     ð 3ð ðð ðð ð0ð ðò ó
ð ð
ð Ø(+ØØ58Ø #ØØ25ð Øð ð&ð     ð 3ð ðð ðð ð0ð ðò ó
ð ð"Ø(,ØØ59Ø $Ø Ø25·.±.ðc?Øðc?ð ðc?ð&ð    c?ð
ð c?ð 3ð c?ððc?ððc?ð0ðc?ð%óc?ðL
ð),ØØ36Ø58ØØ Ø25ð ð&ð ð
1ð ð 3ð ðð ð ð ð0ð ðò ó
ð ð
ð),ØØ36Ø58ØØ Ø25ð ð&ð ð
1ð ð 3ð ðð ð ð ð0ð ðò ó
ð ð")-ØØ37Ø59Ø Ø!Ø25·.±.ðe
ð&ðe
ðð    e
ð
1ð e
ð 3ð e
ððe
ð ðe
ð0ðe
ð%óe
ðP
ð),ØØ ØØØØ25Ø!ð ð&ð ðð ðð ð0ð ð ð ðò ó
ð ð
ð),ØØ ØØØØ25Ø!ð ð&ð ðð ðð ð0ð ð ð ðò ó
ð ð$)-ØØ ØØ $Ø Ø25·.±.Ø!ðmð&ðmðð    mððmððmð0ðmð ðmð%ómðhØ6<ØØ%)Ø Ø!Ø15Øðl
à
ðl
ð ð    l
ð
4ð l
ð ð l
ð#ðl
ððl
ð ðl
ð /ðl
ð ðl
ðól
ô^0ð2€ ð
Ø"ð"à ð"ðð"ðó    "ôJPˆ|ôPôfH  ˜côH ÷V(ñ(ô&zôóBCô@a')ôa'ôNE>9ôE>ðV
ØØØØ Ø Øñ€
óó0ô$a$(ôa$ôHy'Yôy'ð~
Ø Ø!Øð  
à
ð 
ð
ð  
ð ð  
ð    ô 
r;