zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
¸ý°dK¹ã @sºddlmZddlZddlZddlmZddlmZddlmZddlmZddlm    Z    ddlm
Z
dd    lm Z dd
lm Z dd lm Z dd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z#ddl m$Z%ddl m&Z&dd l'm(Z(dd!l'm)Z)dd"l*m+Z+erbdd#l,m-Z-dd$l.m/Z/dd%l.m0Z0dd&l.m1Z1dd'l.m2Z2dd(l.m3Z3dd)l.m4Z4dd*l.m5Z5dd+l.m6Z6dd,l.m7Z7dd-l8m9Z9dd.l:m;Z;dd/l<m=Z=dd0l<m>Z>dd1l?m@Z@dd2lAmBZBdd3lCmDZDed4ed5ZEd6d7d8d9œd:d;„ZFdnd=d>d7d8d?œd@dA„ZGd6d7dBdCœdDdE„ZHGdFdG„dGƒZIejJe!dHdIggdJdKdLdMgdNGdOdP„dPee!edPeIƒƒZKejJe&dQdRgdSdTdUgdVdWdLdXdYdZd[gdNGd\d8„d8ee&eIƒƒZLGd]d^„d^ee)ed^ƒZMe d8d_d`œdadb„ƒZNe dPdcd`œdddb„ƒZNdedfd`œdgdb„ZNe OeK¡dPdhdiœdjdk„ƒZPe OeL¡d8dhdiœdldm„ƒZQdS)oé)Ú annotationsN)ÚAny)Ú AsyncIterator)ÚCallable)ÚDict)Ú    Generator)ÚNoReturn)ÚOptional)Úoverload)ÚTuple)ÚType)Ú TYPE_CHECKING)ÚTypeVar)ÚUnioné)Úexc)Úasyncstartablecontext)ÚGeneratorStartableContext)ÚProxyComparable)ÚStartableContext)Ú_ensure_sync_result)Ú AsyncResult)ÚAsyncScalarResulté)Ú
inspection)Úutil)Ú
Connection)Ú create_engine)Úcreate_pool_from_url)ÚEngine)ÚNestedTransaction)Ú Transaction)Úgreenlet_spawn)Ú CursorResult)Ú_CoreAnyExecuteParams)Ú_CoreSingleExecuteParams)Ú_DBAPIAnyExecuteParams)Ú_ExecuteOptions)ÚCompiledCacheType)ÚCoreExecuteOptionsParameter)ÚDialect)ÚIsolationLevel)ÚSchemaTranslateMapType)Ú ScalarResult)ÚURL)ÚPool)ÚPoolProxiedConnection)Ú    _InfoType)Ú
Executable)ÚTypedReturnsRowsÚ_T)ÚboundzUnion[str, URL]rÚ AsyncEngine)ÚurlÚkwÚreturncKs2| dd¡rt d¡‚d|d<t|f|Ž}t|ƒS)aECreate a new async engine instance.
 
    Arguments passed to :func:`_asyncio.create_async_engine` are mostly
    identical to those passed to the :func:`_sa.create_engine` function.
    The specified dialect must be an asyncio-compatible dialect
    such as :ref:`dialect-postgresql-asyncpg`.
 
    .. versionadded:: 1.4
 
    Zserver_side_cursorsFz}Can't set server_side_cursors for async engine globally; use the connection.stream() method for an async streaming result setTÚ    _is_async)ÚgetÚ    async_excZAsyncMethodRequiredÚ_create_enginer6)r7r8Ú sync_engine©r?úTd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/ext/asyncio/engine.pyÚcreate_async_engineBs ÿ rAú sqlalchemy.zDict[str, Any]Ústr)Ú configurationÚprefixÚkwargsr9c s>‡fdd„| ¡Dƒ}d|d<| |¡| d¡}t|f|ŽS)a¬Create a new AsyncEngine instance using a configuration dictionary.
 
    This function is analogous to the :func:`_sa.engine_from_config` function
    in SQLAlchemy Core, except that the requested dialect must be an
    asyncio-compatible dialect such as :ref:`dialect-postgresql-asyncpg`.
    The argument signature of the function is identical to that
    of :func:`_sa.engine_from_config`.
 
    .. versionadded:: 1.4.29
 
    cs,i|]$\}}| ˆ¡r|tˆƒd…|“qS©N)Ú
startswithÚlen)Ú.0ÚkeyÚvalue©rEr?r@Ú
<dictcomp>gs
þz,async_engine_from_config.<locals>.<dictcomp>TZ_coerce_configr7)ÚitemsÚupdateÚpoprA)rDrErFÚoptionsr7r?rMr@Úasync_engine_from_configYs
þ
 
rSr/)r7rFr9cKsd|d<t|f|ŽS)aVCreate a new async engine instance.
 
    Arguments passed to :func:`_asyncio.create_async_pool_from_url` are mostly
    identical to those passed to the :func:`_sa.create_pool_from_url` function.
    The specified dialect must be an asyncio-compatible dialect
    such as :ref:`dialect-postgresql-asyncpg`.
 
    .. versionadded:: 2.0.10
 
    Tr:)Ú_create_pool_from_url)r7rFr?r?r@Úcreate_async_pool_from_urlrs rUc@s"eZdZdZeddœdd„ƒZdS)ÚAsyncConnectable)Z_slots_dispatchÚ __weakref__r©r9cCs tdƒ‚dS)Nz asynchronous events are not implemented at this time.  Apply synchronous listeners to the AsyncEngine.sync_engine or AsyncConnection.sync_connection attributes.)ÚNotImplementedError)Úclsr?r?r@Ú_no_async_engine_events„sÿz(AsyncConnectable._no_async_engine_eventsN)Ú__name__Ú
__module__Ú __qualname__Ú    __slots__Ú classmethodr[r?r?r?r@rVsrVz:class:`_engine.Connection`z!:class:`_asyncio.AsyncConnection`ÚclosedÚ invalidatedÚdialectÚdefault_isolation_level)Z classmethodsÚmethodsÚ
attributesc@s"eZdZUdZdZdˆdddœdd„Zded    <d
ed <ed dd œdd„ƒZd‰dddœdd„Z    e
ddœdd„ƒZ ddœdd„Z e jddœdd„ƒZe jd dœdd „ƒZd!dœd"d#„Zd!dœd$d%„ZdŠd&d'd(œd)d*„Zd+dœd,d-„Zddœd.d/„Zddœd0d1„Zd2dœd3d4„Zd2dœd5d6„Zed7d7d7ddd7d7d7d7d8œ    d9d:d+ddd;d;d;d<d=dd>œ d?d@„ƒZed=ddAœdBd@„ƒZd=ddAœdCd@„Zd'dœdDdE„Zd'dœdFdG„Zd'dœdHdI„Zd‹d:dJdKdLdMœdNdO„ZedŒddPœdQdRdKdSdMœdTdU„ƒZedddPœdVdRdKdWdMœdXdU„ƒZe dŽddPœdVdRdKdYdMœdZdU„ƒZedddPœdQdRdKd[dMœd\d]„ƒZ!edddPœdVdRdKdLdMœd^d]„ƒZ!d‘ddPœdVdRdKdLdMœd_d]„Z!ed’ddPœd`dadKdbdMœdcdd„ƒZ"ed“ddPœdVdadKd=dMœdedd„ƒZ"d”ddPœdVdadKd=dMœdfdd„Z"ed•ddPœd`dRdKdgdMœdhdi„ƒZ#ed–ddPœdVdRdKdjdMœdkdi„ƒZ#d—ddPœdVdRdKdjdMœdldi„Z#ed˜ddPœd`dadKdmdMœdndo„ƒZ$ed™ddPœdVdadKdpdMœdqdo„ƒZ$e dšddPœdVdadKdrdMœdsdo„ƒZ$dtd=d=d=duœdvdw„Z%dxdœdydz„Z&d=d=d=d'd{œd|d}„Z'e
d=dœd~d„ƒZ(e
d=dœd€d„ƒZ)e
d=dœd‚dƒ„ƒZ*e*j+d=d'd„œd…dƒ„ƒZ*e
d=dœd†d‡„ƒZ,dS)›ÚAsyncConnectionaàAn asyncio proxy for a :class:`_engine.Connection`.
 
    :class:`_asyncio.AsyncConnection` is acquired using the
    :meth:`_asyncio.AsyncEngine.connect`
    method of :class:`_asyncio.AsyncEngine`::
 
        from sqlalchemy.ext.asyncio import create_async_engine
        engine = create_async_engine("postgresql+asyncpg://user:pass@host/dbname")
 
        async with engine.connect() as conn:
            result = await conn.execute(select(table))
 
    .. versionadded:: 1.4
 
    )Úenginer>Úsync_connectionNr6zOptional[Connection])Ú async_enginericCs||_|j|_| |¡|_dSrG)rhr>Ú_assign_proxiedri)Úselfrjrir?r?r@Ú__init__ºszAsyncConnection.__init__rirr>r©Útargetr9cCstt |j¡|ƒSrG)rgr6Ú_retrieve_proxy_for_targetrh©rZror?r?r@Ú_regenerate_proxy_for_targetÜs
ÿz,AsyncConnection._regenerate_proxy_for_targetFÚbool©Ú is_ctxmanagerr9cÃs.|jrt d¡‚| t|jjƒIdH¡|_|S)zzStart this :class:`_asyncio.AsyncConnection` object's context
        outside of using a Python ``with:`` block.
 
        zconnection is already startedN)rirÚInvalidRequestErrorrkr"r>Úconnect©rlrur?r?r@Ústartäs 
ÿzAsyncConnection.startrrXcCst d¡‚dS)zeNot implemented for async; call
        :meth:`_asyncio.AsyncConnection.get_raw_connection`.
        z¡AsyncConnection.connection accessor is not implemented as the attribute may need to reconnect on an invalidated connection.  Use the get_raw_connection() method.N)rrv©rlr?r?r@Ú
connectionðsÿzAsyncConnection.connectionr0cÃstt|jdƒIdHS)aReturn the pooled DBAPI-level connection in use by this
        :class:`_asyncio.AsyncConnection`.
 
        This is a SQLAlchemy connection-pool proxied connection
        which then has the attribute
        :attr:`_pool._ConnectionFairy.driver_connection` that refers to the
        actual driver connection. Its
        :attr:`_pool._ConnectionFairy.dbapi_connection` refers instead
        to an :class:`_engine.AdaptedConnection` instance that
        adapts the driver connection to the DBAPI protocol.
 
        r{N)r"ÚgetattrÚ_proxiedrzr?r?r@Úget_raw_connectionûsz"AsyncConnection.get_raw_connectionr1cCs|jjS)aReturn the :attr:`_engine.Connection.info` dictionary of the
        underlying :class:`_engine.Connection`.
 
        This dictionary is freely writable for user-defined state to be
        associated with the database connection.
 
        This attribute is only available if the :class:`.AsyncConnection` is
        currently connected.   If the :attr:`.AsyncConnection.closed` attribute
        is ``True``, then accessing this attribute will raise
        :class:`.ResourceClosedError`.
 
        .. versionadded:: 1.4.0b2
 
        )r}Úinforzr?r?r@r szAsyncConnection.infocCs|js| ¡|jSrG)riÚ_raise_for_not_startedrzr?r?r@r}szAsyncConnection._proxiedÚAsyncTransactioncCs|js
t‚t|ƒS)z1Begin a transaction prior to autobegin occurring.©r}ÚAssertionErrorrrzr?r?r@Úbegin#s
zAsyncConnection.begincCs|js
t‚t|ddS)z;Begin a nested transaction and return a transaction handle.T)Únestedr‚rzr?r?r@Ú begin_nested(s
zAsyncConnection.begin_nestedzOptional[BaseException]ÚNone)Ú    exceptionr9cÃst|jj|dIdHS)zÔInvalidate the underlying DBAPI connection associated with
        this :class:`_engine.Connection`.
 
        See the method :meth:`_engine.Connection.invalidate` for full
        detail on this method.
 
        )rˆN)r"r}Ú
invalidate)rlrˆr?r?r@r‰-s ÿzAsyncConnection.invalidater+cÃst|jjƒIdHSrG)r"r}Úget_isolation_levelrzr?r?r@rŠ=sz#AsyncConnection.get_isolation_levelcCs
|j ¡S)z,Return True if a transaction is in progress.)r}Úin_transactionrzr?r?r@r‹@szAsyncConnection.in_transactioncCs
|j ¡S)zYReturn True if a transaction is in progress.
 
        .. versionadded:: 1.4.0b2
 
        )r}Úin_nested_transactionrzr?r?r@rŒEsz%AsyncConnection.in_nested_transactionzOptional[AsyncTransaction]cCs$|j ¡}|dk    rt |¡SdSdS)a‡Return an :class:`.AsyncTransaction` representing the current
        transaction, if any.
 
        This makes use of the underlying synchronous connection's
        :meth:`_engine.Connection.get_transaction` method to get the current
        :class:`_engine.Transaction`, which is then proxied in a new
        :class:`.AsyncTransaction` object.
 
        .. versionadded:: 1.4.0b2
 
        N)r}Úget_transactionrrp©rlZtransr?r?r@rMs
 
zAsyncConnection.get_transactioncCs$|j ¡}|dk    rt |¡SdSdS)a¡Return an :class:`.AsyncTransaction` representing the current
        nested (savepoint) transaction, if any.
 
        This makes use of the underlying synchronous connection's
        :meth:`_engine.Connection.get_nested_transaction` method to get the
        current :class:`_engine.Transaction`, which is then proxied in a new
        :class:`.AsyncTransaction` object.
 
        .. versionadded:: 1.4.0b2
 
        N)r}Úget_nested_transactionrrprŽr?r?r@r`s
 
z&AsyncConnection.get_nested_transaction.)    Úcompiled_cacheÚ logging_tokenÚisolation_levelÚ no_parametersÚstream_resultsÚmax_row_bufferÚ    yield_perÚinsertmanyvalues_page_sizeÚschema_translate_mapúOptional[CompiledCacheType]rCÚintú Optional[SchemaTranslateMapType]r) rr‘r’r“r”r•r–r—r˜Úoptr9c     ËsdSrGr?) rlrr‘r’r“r”r•r–r—r˜rœr?r?r@Úexecution_optionsssz!AsyncConnection.execution_options©rœr9cËsdSrGr?©rlrœr?r?r@r„scËs*|j}t|jf|ŽIdH}||ks&t‚|S)a'Set non-SQL options for the connection which take effect
        during execution.
 
        This returns this :class:`_asyncio.AsyncConnection` object with
        the new options added.
 
        See :meth:`_engine.Connection.execution_options` for full details
        on this method.
 
        N)r}r"rrƒ)rlrœÚconnÚc2r?r?r@rˆs  cÃst|jjƒIdHdS)aÓCommit the transaction that is currently in progress.
 
        This method commits the current transaction if one has been started.
        If no transaction was started, the method has no effect, assuming
        the connection is in a non-invalidated state.
 
        A transaction is begun on a :class:`_engine.Connection` automatically
        whenever a statement is first executed, or when the
        :meth:`_engine.Connection.begin` method is called.
 
        N©r"r}Úcommitrzr?r?r@r£™s zAsyncConnection.commitcÃst|jjƒIdHdS)a&Roll back the transaction that is currently in progress.
 
        This method rolls back the current transaction if one has been started.
        If no transaction was started, the method has no effect.  If a
        transaction was started and the connection is in an invalidated state,
        the transaction is cleared using this method.
 
        A transaction is begun on a :class:`_engine.Connection` automatically
        whenever a statement is first executed, or when the
        :meth:`_engine.Connection.begin` method is called.
 
 
        N©r"r}Úrollbackrzr?r?r@r¥§szAsyncConnection.rollbackcÃst|jjƒIdHdS)z•Close this :class:`_asyncio.AsyncConnection`.
 
        This has the effect of also rolling back the transaction if one
        is in place.
 
        N©r"r}Úcloserzr?r?r@r§·szAsyncConnection.closez Optional[_DBAPIAnyExecuteParams]z%Optional[CoreExecuteOptionsParameter]zCursorResult[Any])Ú    statementÚ
parametersrr9cÃs.t|jj|||ddIdH}t||jƒIdHS)zaExecutes a driver-level SQL string and return buffered
        :class:`_engine.Result`.
 
        T)Ú_require_awaitN)r"r}Úexec_driver_sqlr©rlr¨r©rÚresultr?r?r@r«Às û zAsyncConnection.exec_driver_sql©rzTypedReturnsRows[_T]zOptional[_CoreAnyExecuteParams]z*GeneratorStartableContext[AsyncResult[_T]]cCsdSrGr?©rlr¨r©rr?r?r@ÚstreamÕszAsyncConnection.streamr2z+GeneratorStartableContext[AsyncResult[Any]]cCsdSrGr?r¯r?r?r@r°ßszAsyncIterator[AsyncResult[Any]]c    Cs€t|jj||tj |ddi¡ddIdH}|jjs6t‚t    |ƒ}z
|VWnt
k
r\Yn Xt   |  ¡¡}t  |¡IdHdS)aLExecute a statement and return an awaitable yielding a
        :class:`_asyncio.AsyncResult` object.
 
        E.g.::
 
            result = await conn.stream(stmt):
            async for row in result:
                print(f"{row}")
 
        The :meth:`.AsyncConnection.stream`
        method supports optional context manager use against the
        :class:`.AsyncResult` object, as in::
 
            async with conn.stream(stmt) as result:
                async for row in result:
                    print(f"{row}")
 
        In the above pattern, the :meth:`.AsyncResult.close` method is
        invoked unconditionally, even if the iterator is interrupted by an
        exception throw.   Context manager use remains optional, however,
        and the function may be called in either an ``async with fn():`` or
        ``await fn()`` style.
 
        .. versionadded:: 2.0.0b3 added context manager support
 
 
        :return: an awaitable object that will yield an
         :class:`_asyncio.AsyncResult` object.
 
        .. seealso::
 
            :meth:`.AsyncConnection.stream_scalars`
 
        r”T©rrªN)r"r}ÚexecuterÚ
EMPTY_DICTZ
merge_withÚcontextZ_is_server_siderƒrÚ GeneratorExitÚasyncioÚ create_taskr§Úshield)rlr¨r©rr­ÚarÚtaskr?r?r@r°és$+ÿù      
zCursorResult[_T]cÃsdSrGr?r¯r?r?r@r²'szAsyncConnection.executecÃsdSrGr?r¯r?r?r@r²1scÃs.t|jj|||ddIdH}t||jƒIdHS)a»Executes a SQL statement construct and return a buffered
        :class:`_engine.Result`.
 
        :param object: The statement to be executed.  This is always
         an object that is in both the :class:`_expression.ClauseElement` and
         :class:`_expression.Executable` hierarchies, including:
 
         * :class:`_expression.Select`
         * :class:`_expression.Insert`, :class:`_expression.Update`,
           :class:`_expression.Delete`
         * :class:`_expression.TextClause` and
           :class:`_expression.TextualSelect`
         * :class:`_schema.DDL` and objects which inherit from
           :class:`_schema.ExecutableDDLElement`
 
        :param parameters: parameters which will be bound into the statement.
         This may be either a dictionary of parameter names to values,
         or a mutable sequence (e.g. a list) of dictionaries.  When a
         list of dictionaries is passed, the underlying statement execution
         will make use of the DBAPI ``cursor.executemany()`` method.
         When a single dictionary is passed, the DBAPI ``cursor.execute()``
         method will be used.
 
        :param execution_options: optional dictionary of execution options,
         which will be associated with the statement execution.  This
         dictionary can provide a subset of the options that are accepted
         by :meth:`_engine.Connection.execution_options`.
 
        :return: a :class:`_engine.Result` object.
 
        Tr±N)r"r}r²rr¬r?r?r@r²;s&û zTypedReturnsRows[Tuple[_T]]z"Optional[_CoreSingleExecuteParams]z Optional[_T]cÃsdSrGr?r¯r?r?r@ÚscalarjszAsyncConnection.scalarcÃsdSrGr?r¯r?r?r@r»tscÃs|j|||dIdH}| ¡S)auExecutes a SQL statement construct and returns a scalar object.
 
        This method is shorthand for invoking the
        :meth:`_engine.Result.scalar` method after invoking the
        :meth:`_engine.Connection.execute` method.  Parameters are equivalent.
 
        :return: a scalar Python value representing the first column of the
         first row returned.
 
        r®N)r²r»r¬r?r?r@r»~s ÿ zScalarResult[_T]cÃsdSrGr?r¯r?r?r@Úscalars”szAsyncConnection.scalarszScalarResult[Any]cÃsdSrGr?r¯r?r?r@r¼žscÃs|j|||dIdH}| ¡S)aiExecutes a SQL statement construct and returns a scalar objects.
 
        This method is shorthand for invoking the
        :meth:`_engine.Result.scalars` method after invoking the
        :meth:`_engine.Connection.execute` method.  Parameters are equivalent.
 
        :return: a :class:`_engine.ScalarResult` object.
 
        .. versionadded:: 1.4.24
 
        r®N)r²r¼r¬r?r?r@r¼¨s ÿ z0GeneratorStartableContext[AsyncScalarResult[_T]]cCsdSrGr?r¯r?r?r@Ústream_scalars¿szAsyncConnection.stream_scalarsz1GeneratorStartableContext[AsyncScalarResult[Any]]cCsdSrGr?r¯r?r?r@r½Ész%AsyncIterator[AsyncScalarResult[Any]]c
Cs8|j|||d4IdHš}| ¡VW5QIdHRXdS)afExecute a statement and return an awaitable yielding a
        :class:`_asyncio.AsyncScalarResult` object.
 
        E.g.::
 
            result = await conn.stream_scalars(stmt)
            async for scalar in result:
                print(f"{scalar}")
 
        This method is shorthand for invoking the
        :meth:`_engine.AsyncResult.scalars` method after invoking the
        :meth:`_engine.Connection.stream` method.  Parameters are equivalent.
 
        The :meth:`.AsyncConnection.stream_scalars`
        method supports optional context manager use against the
        :class:`.AsyncScalarResult` object, as in::
 
            async with conn.stream_scalars(stmt) as result:
                async for scalar in result:
                    print(f"{scalar}")
 
        In the above pattern, the :meth:`.AsyncScalarResult.close` method is
        invoked unconditionally, even if the iterator is interrupted by an
        exception throw.  Context manager use remains optional, however,
        and the function may be called in either an ``async with fn():`` or
        ``await fn()`` style.
 
        .. versionadded:: 2.0.0b3 added context manager support
 
        :return: an awaitable object that will yield an
         :class:`_asyncio.AsyncScalarResult` object.
 
        .. versionadded:: 1.4.24
 
        .. seealso::
 
            :meth:`.AsyncConnection.stream`
 
        r®N)r°r¼r¬r?r?r@r½Ós0ÿzCallable[..., Any])ÚfnÚargr8r9cÏst||jf|ž|ŽIdHS)aY    Invoke the given synchronous (i.e. not async) callable,
        passing a synchronous-style :class:`_engine.Connection` as the first
        argument.
 
        This method allows traditional synchronous SQLAlchemy functions to
        run within the context of an asyncio application.
 
        E.g.::
 
            def do_something_with_core(conn: Connection, arg1: int, arg2: str) -> str:
                '''A synchronous function that does not require awaiting
 
                :param conn: a Core SQLAlchemy Connection, used synchronously
 
                :return: an optional return value is supported
 
                '''
                conn.execute(
                    some_table.insert().values(int_col=arg1, str_col=arg2)
                )
                return "success"
 
 
            async def do_something_async(async_engine: AsyncEngine) -> None:
                '''an async function that uses awaiting'''
 
                async with async_engine.begin() as async_conn:
                    # run do_something_with_core() with a sync-style
                    # Connection, proxied into an awaitable
                    return_code = await async_conn.run_sync(do_something_with_core, 5, "strval")
                    print(return_code)
 
        This method maintains the asyncio event loop all the way through
        to the database connection by running the given callable in a
        specially instrumented greenlet.
 
        The most rudimentary use of :meth:`.AsyncConnection.run_sync` is to
        invoke methods such as :meth:`_schema.MetaData.create_all`, given
        an :class:`.AsyncConnection` that needs to be provided to
        :meth:`_schema.MetaData.create_all` as a :class:`_engine.Connection`
        object::
 
            # run metadata.create_all(conn) with a sync-style Connection,
            # proxied into an awaitable
            with async_engine.begin() as conn:
                await conn.run_sync(metadata.create_all)
 
        .. note::
 
            The provided callable is invoked inline within the asyncio event
            loop, and will block on traditional IO calls.  IO within this
            callable should only call into SQLAlchemy's asyncio database
            APIs which will be properly adapted to the greenlet context.
 
        .. seealso::
 
            :meth:`.AsyncSession.run_sync`
 
            :ref:`session_run_sync`
 
        N)r"r})rlr¾r¿r8r?r?r@Úrun_syncsAzAsyncConnection.run_syncz%Generator[Any, None, AsyncConnection]cCs | ¡ ¡SrG)ryÚ    __await__rzr?r?r@rÁKszAsyncConnection.__await__©Útype_rLÚ    tracebackr9cÃs"t | ¡¡}t |¡IdHdSrG)r¶r·r§r¸)rlrÃrLrÄrºr?r?r@Ú    __aexit__NszAsyncConnection.__aexit__cCs|jjS)zÜReturn True if this connection is closed.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Connection` class
            on behalf of the :class:`_asyncio.AsyncConnection` class.
 
        )r}rarzr?r?r@raWs zAsyncConnection.closedcCs|jjS)aTReturn True if this connection was invalidated.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Connection` class
            on behalf of the :class:`_asyncio.AsyncConnection` class.
 
        This does not indicate whether or not the connection was
        invalidated at the pool level, however
 
 
        )r}rbrzr?r?r@rbdszAsyncConnection.invalidatedcCs|jjS)z†Proxy for the :attr:`_engine.Connection.dialect` attribute
        on behalf of the :class:`_asyncio.AsyncConnection` class.
 
        ©r}rcrzr?r?r@rcuszAsyncConnection.dialect©Úattrr9cCs ||j_dSrGrÆ©rlrÈr?r?r@rc~scCs|jjS)a The initial-connection time isolation level associated with the
        :class:`_engine.Dialect` in use.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Connection` class
            on behalf of the :class:`_asyncio.AsyncConnection` class.
 
        This value is independent of the
        :paramref:`.Connection.execution_options.isolation_level` and
        :paramref:`.Engine.execution_options.isolation_level` execution
        options, and is determined by the :class:`_engine.Dialect` when the
        first connection is created, by performing a SQL query against the
        database for the current isolation level before any additional commands
        have been emitted.
 
        Calling this accessor does not invoke any new SQL queries.
 
        .. seealso::
 
            :meth:`_engine.Connection.get_isolation_level`
            - view current actual isolation level
 
            :paramref:`_sa.create_engine.isolation_level`
            - set per :class:`_engine.Engine` isolation level
 
            :paramref:`.Connection.execution_options.isolation_level`
            - set per :class:`_engine.Connection` isolation level
 
 
        )r}rdrzr?r?r@rd‚s"z'AsyncConnection.default_isolation_level)N)F)N)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)-r\r]r^Ú__doc__r_rmÚ__annotations__r`rrryÚpropertyr{r~rÚro_non_memoized_propertyrr}r„r†r‰rŠr‹rŒrrr
rr£r¥r§r«r°rr²r»r¼r½rÀrÁrÅrarbrcÚsetterrdr?r?r?r@rgs
    ý       
ÿõ( üýû    ýû    ýû=ýû    ýû ýû/ýû    ýû ýûýû    ýû ýûýû    ýû    ýû4C     rgz:class:`_engine.Engine`z:class:`_asyncio.AsyncEngine`Úclear_compiled_cacheÚupdate_execution_optionsÚget_execution_optionsr7ÚpoolrhÚnameÚdriverÚechoc
@sôeZdZUdZdZeZded<ded<ddœdd„Ze    j
dd    œd
d „ƒZ e ddd œd d„ƒZ ejdd    œdd„ƒZdd    œdd„Zdd    œdd„Zeddddddœdddddddd œd!d"„ƒZeddd#œd$d"„ƒZddd#œd%d"„ZdJd'd(d)œd*d+„Zd(d    œd,d-„Zdd(d#œd.d/„Zd0d    œd1d2„Zed3d    œd4d5„ƒZejd3d(d6œd7d5„ƒZed8d    œd9d:„ƒZejd8d(d6œd;d:„ƒZed<d    œd=d>„ƒZejd<d(d6œd?d>„ƒZedd    œd@dA„ƒZedd    œdBdC„ƒZedd    œdDdE„ƒZ edd    œdFdG„ƒZ!e!jdd(d6œdHdG„ƒZ!dIS)Kr6aPAn asyncio proxy for a :class:`_engine.Engine`.
 
    :class:`_asyncio.AsyncEngine` is acquired using the
    :func:`_asyncio.create_async_engine` function::
 
        from sqlalchemy.ext.asyncio import create_async_engine
        engine = create_async_engine("postgresql+asyncpg://user:pass@host/dbname")
 
    .. versionadded:: 1.4
 
    r>zType[AsyncConnection]Ú_connection_clsr©r>cCs.|jjst d|jj›d¡‚| |¡|_dS)NzFThe asyncio extension requires an async driver to be used. The loaded z is not async.)rcZis_asyncrrvrÔrkr>)rlr>r?r?r@rmÖs
ÿzAsyncEngine.__init__rXcCs|jSrGr×rzr?r?r@r}ÞszAsyncEngine._proxiedrncCst|ƒSrG)r6rqr?r?r@rrâsz(AsyncEngine._regenerate_proxy_for_targetzAsyncIterator[AsyncConnection]c CsR| ¡}|4IdHš.| ¡4IdHš |VW5QIdHRXW5QIdHRXdS)a¹Return a context manager which when entered will deliver an
        :class:`_asyncio.AsyncConnection` with an
        :class:`_asyncio.AsyncTransaction` established.
 
        E.g.::
 
            async with async_engine.begin() as conn:
                await conn.execute(
                    text("insert into table (x, y, z) values (1, 2, 3)")
                )
                await conn.execute(text("my_special_procedure(5)"))
 
 
        N)rwr„)rlr r?r?r@r„æszAsyncEngine.beginrgcCs
| |¡S)aReturn an :class:`_asyncio.AsyncConnection` object.
 
        The :class:`_asyncio.AsyncConnection` will procure a database
        connection from the underlying connection pool when it is entered
        as an async context manager::
 
            async with async_engine.connect() as conn:
                result = await conn.execute(select(user_table))
 
        The :class:`_asyncio.AsyncConnection` may also be started outside of a
        context manager by invoking its :meth:`_asyncio.AsyncConnection.start`
        method.
 
        )rÖrzr?r?r@rwüszAsyncEngine.connectr0cÃst|jjƒIdHS)zReturn a "raw" DBAPI connection from the connection pool.
 
        .. seealso::
 
            :ref:`dbapi_connections`
 
        N)r"r>Úraw_connectionrzr?r?r@rØszAsyncEngine.raw_connection.)rr‘r’r—r˜r™rCr+ršr›r)rr‘r’r—r˜rœr9cKsdSrGr?)rlrr‘r’r—r˜rœr?r?r@rs zAsyncEngine.execution_optionsržcKsdSrGr?rŸr?r?r@r%scKst|jjf|ŽƒS)aReturn a new :class:`_asyncio.AsyncEngine` that will provide
        :class:`_asyncio.AsyncConnection` objects with the given execution
        options.
 
        Proxied from :meth:`_engine.Engine.execution_options`.  See that
        method for details.
 
        )r6r>rrŸr?r?r@r)s
Trsr‡)r§r9cÃst|jj|dIdHdS)aEDispose of the connection pool used by this
        :class:`_asyncio.AsyncEngine`.
 
        :param close: if left at its default of ``True``, has the
         effect of fully closing all **currently checked in**
         database connections.  Connections that are still checked out
         will **not** be closed, however they will no longer be associated
         with this :class:`_engine.Engine`,
         so when they are closed individually, eventually the
         :class:`_pool.Pool` which they are associated with will
         be garbage collected and they will be closed out fully, if
         not already closed on checkin.
 
         If set to ``False``, the previous connection pool is de-referenced,
         and otherwise not touched in any way.
 
        .. seealso::
 
            :meth:`_engine.Engine.dispose`
 
        )r§N)r"r>Údispose)rlr§r?r?r@rÙ5szAsyncEngine.disposecCs
|j ¡S)a*Clear the compiled cache associated with the dialect.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class on
            behalf of the :class:`_asyncio.AsyncEngine` class.
 
        This applies **only** to the built-in cache that is established
        via the :paramref:`_engine.create_engine.query_cache_size` parameter.
        It will not impact any dictionary caches that were passed via the
        :paramref:`.Connection.execution_options.query_cache` parameter.
 
        .. versionadded:: 1.4
 
 
        )r}rÏrzr?r?r@rÏTsz AsyncEngine.clear_compiled_cachecKs|jjf|ŽS)a Update the default execution_options dictionary
        of this :class:`_engine.Engine`.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class on
            behalf of the :class:`_asyncio.AsyncEngine` class.
 
        The given keys/values in \**opt are added to the
        default execution options that will be used for
        all connections.  The initial contents of this dictionary
        can be sent via the ``execution_options`` parameter
        to :func:`_sa.create_engine`.
 
        .. seealso::
 
            :meth:`_engine.Connection.execution_options`
 
            :meth:`_engine.Engine.execution_options`
 
 
        )r}rÐrŸr?r?r@rÐhsz$AsyncEngine.update_execution_optionsr'cCs
|j ¡S)aUGet the non-SQL options which will take effect during execution.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class on
            behalf of the :class:`_asyncio.AsyncEngine` class.
 
        .. versionadded: 1.3
 
        .. seealso::
 
            :meth:`_engine.Engine.execution_options`
 
        )r}rÑrzr?r?r@rтsz!AsyncEngine.get_execution_optionsr.cCs|jjS)zzProxy for the :attr:`_engine.Engine.url` attribute
        on behalf of the :class:`_asyncio.AsyncEngine` class.
 
        ©r}r7rzr?r?r@r7”szAsyncEngine.urlrÇcCs ||j_dSrGrÚrÉr?r?r@r7sr/cCs|jjS)z{Proxy for the :attr:`_engine.Engine.pool` attribute
        on behalf of the :class:`_asyncio.AsyncEngine` class.
 
        ©r}rÒrzr?r?r@rÒ¡szAsyncEngine.poolcCs ||j_dSrGrÛrÉr?r?r@rÒªsr*cCs|jjS)z~Proxy for the :attr:`_engine.Engine.dialect` attribute
        on behalf of the :class:`_asyncio.AsyncEngine` class.
 
        rÆrzr?r?r@rc®szAsyncEngine.dialectcCs ||j_dSrGrÆrÉr?r?r@rc·scCs|jjS)aIReturns this :class:`.Engine`.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class
            on behalf of the :class:`_asyncio.AsyncEngine` class.
 
        Used for legacy schemes that accept :class:`.Connection` /
        :class:`.Engine` objects within the same variable.
 
 
        )r}rhrzr?r?r@rh»szAsyncEngine.enginecCs|jjS)aString name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class
            on behalf of the :class:`_asyncio.AsyncEngine` class.
 
 
        )r}rÓrzr?r?r@rÓÌs zAsyncEngine.namecCs|jjS)aDriver name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class
            on behalf of the :class:`_asyncio.AsyncEngine` class.
 
 
        )r}rÔrzr?r?r@rÔÛs zAsyncEngine.drivercCs|jjS)a3When ``True``, enable log output for this element.
 
        .. container:: class_bases
 
            Proxied for the :class:`_engine.Engine` class
            on behalf of the :class:`_asyncio.AsyncEngine` class.
 
        This has the effect of setting the Python logging level for the namespace
        of this element's class and object reference.  A value of boolean ``True``
        indicates that the loglevel ``logging.INFO`` will be set for the logger,
        whereas the string value ``debug`` will set the loglevel to
        ``logging.DEBUG``.
 
        ©r}rÕrzr?r?r@rÕêszAsyncEngine.echocCs ||j_dSrGrÜrÉr?r?r@rÕýsN)T)"r\r]r^rÊr_rgrÖrËrmrrÍr}r`rrÚ
contextlibÚasynccontextmanagerr„rwrØr
rrÙrÏrÐrÑrÌr7rÎrÒrcrhrÓrÔrÕr?r?r?r@r6©sb
 
ù   c@sÜeZdZUdZdZded<ded<ded<d'ddd
œd d „Zed ddœdd„ƒZe    j
d dœdd„ƒZ e ddœdd„ƒZ e ddœdd„ƒZddœdd„Zddœdd„Zddœdd„Zd(dddœd d!„Zd"d"d"dd#œd$d%„Zd&S))rz4An asyncio proxy for a :class:`_engine.Transaction`.©r{Úsync_transactionr…zOptional[Transaction]ràrgr{rsr…F)r{r…cCs||_d|_||_dSrGrß)rlr{r…r?r?r@rmszAsyncTransaction.__init__r!rncCsP|j}|}t|tƒ}t |¡}|dk    s*t‚| |¡}||_| |¡|_||_    |SrG)
r{Ú
isinstancer rgrprƒÚ__new__rkràr…)rZroriràr…Zasync_connectionÚobjr?r?r@rrs
ÿ 
 z-AsyncTransaction._regenerate_proxy_for_targetrXcCs|js| ¡|jSrG)ràr€rzr?r?r@r}'szAsyncTransaction._proxiedcCs|jjSrG)r}Úis_validrzr?r?r@rä-szAsyncTransaction.is_validcCs|jjSrG)r}Ú    is_activerzr?r?r@rå1szAsyncTransaction.is_activer‡cÃst|jjƒIdHdS)a@Close this :class:`.AsyncTransaction`.
 
        If this transaction is the base transaction in a begin/commit
        nesting, the transaction will rollback().  Otherwise, the
        method returns.
 
        This is used to cancel a Transaction without affecting the scope of
        an enclosing transaction.
 
        Nr¦rzr?r?r@r§5s zAsyncTransaction.closecÃst|jjƒIdHdS)z*Roll back this :class:`.AsyncTransaction`.Nr¤rzr?r?r@r¥BszAsyncTransaction.rollbackcÃst|jjƒIdHdS)z'Commit this :class:`.AsyncTransaction`.Nr¢rzr?r?r@r£FszAsyncTransaction.commitrtcÃs>| t|jr|jjjn|jjjƒIdH¡|_|r:|j ¡|S)z{Start this :class:`_asyncio.AsyncTransaction` object's context
        outside of using a Python ``with:`` block.
 
        N)    rkr"r…r{r}r†r„ràÚ    __enter__rxr?r?r@ryKsÿ ýÿ
zAsyncTransaction.startrrÂcÃst|jj|||ƒIdHdSrG)r"r}Ú__exit__)rlrÃrLrÄr?r?r@rÅ\szAsyncTransaction.__aexit__N)F)F)r\r]r^rÊr_rËrmr`rrrrÍr}rÌrärår§r¥r£ryrÅr?r?r?r@rs&
 rr)rjr9cCsdSrGr?©rjr?r?r@Ú_get_sync_engine_or_connection`srércCsdSrGr?rèr?r?r@réesz#Union[AsyncEngine, AsyncConnection]zUnion[Engine, Connection]c
CsPt|tƒr|jSz|jWStk
rJ}zt d|¡|‚W5d}~XYnXdS)NzAsyncEngine expected, got %r)rárgr}r>ÚAttributeErrorrÚ ArgumentError)rjÚer?r?r@réls
ÿþr)Úsubjectr9cCstjddd‚dS)Nz©Inspection on an AsyncConnection is currently not supported. Please use ``run_sync`` to pass a callable where it's possible to call ``inspect`` on the passed connection.Úxd3s©Úcode©rZNoInspectionAvailable©rír?r?r@Ú_no_insp_for_async_conn_yetzsürócCstjddd‚dS)NzÃInspection on an AsyncEngine is currently not supported. Please obtain a connection then use ``conn.run_sync`` to pass a callable where it's possible to call ``inspect`` on the passed connection.rîrïrñròr?r?r@Ú_no_insp_for_async_engine_xyet„sûrô)rB)RÚ
__future__rr¶rÝÚtypingrrrrrrr    r
r r r rrÚrr<Úbaserrrrr­rrrrrrhrrr=rrTrZ engine.baser r!Zutil.concurrencyr"Z engine.cursorr#Zengine.interfacesr$r%r&r'r(r)r*r+r,Z engine.resultr-Z
engine.urlr.rÒr/r0Z sql._typingr1Zsql.baser2Zsql.selectabler3r4rArSrUrVZcreate_proxy_methodsrgr6rréZ    _inspectsrórôr?r?r?r@Ú<module>sÖ                                                  ÿ üú
ýýö Q
ÿ\