+
    ýäûj‚5  ã                  óä  € R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RI
Ht ^ RI
Ht ^ R	I
Ht ^ R
I
Ht ^ RI
Ht ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ]'       d%   ^RIH t  ^RI!H"t" ^RI!H#t# ^RI!H$t$ ^RI%H&t& ^RI'H(t(  ! R R]4      t) ! R R]4      t* ! R  R!]]4      t+ ! R" R#]4      t, ! R$ R%]4      t- ! R& R']4      t.].t/R# )(u>  

.. dialect:: sqlite+aiosqlite
    :name: aiosqlite
    :dbapi: aiosqlite
    :connectstring: sqlite+aiosqlite:///file_path
    :url: https://pypi.org/project/aiosqlite/

The aiosqlite dialect provides support for the SQLAlchemy asyncio interface
running on top of pysqlite.

aiosqlite is a wrapper around pysqlite that uses a background thread for
each connection.   It does not actually use non-blocking IO, as SQLite
databases are not socket-based.  However it does provide a working asyncio
interface that's useful for testing and prototyping purposes.

Using a special asyncio mediation layer, the aiosqlite dialect is usable
as the backend for the :ref:`SQLAlchemy asyncio <asyncio_toplevel>`
extension package.

This dialect should normally be used only with the
:func:`_asyncio.create_async_engine` engine creation function::

    from sqlalchemy.ext.asyncio import create_async_engine

    engine = create_async_engine("sqlite+aiosqlite:///filename")

The URL passes through all arguments to the ``pysqlite`` driver, so all
connection arguments are the same as they are for that of :ref:`pysqlite`.

.. _aiosqlite_udfs:

User-Defined Functions
----------------------

aiosqlite extends pysqlite to support async, so we can create our own user-defined functions (UDFs)
in Python and use them directly in SQLite queries as described here: :ref:`pysqlite_udfs`.

.. _aiosqlite_serializable:

Serializable isolation / Savepoints / Transactional DDL (asyncio version)
-------------------------------------------------------------------------

A newly revised version of this important section is now available
at the top level of the SQLAlchemy SQLite documentation, in the section
:ref:`sqlite_transactions`.


.. _aiosqlite_pooling:

Pooling Behavior
----------------

The SQLAlchemy ``aiosqlite`` DBAPI establishes the connection pool differently
based on the kind of SQLite database that's requested:

* When a ``:memory:`` SQLite database is specified, the dialect by default
  will use :class:`.StaticPool`. This pool maintains a single
  connection, so that all access to the engine
  use the same ``:memory:`` database.
* When a file-based database is specified, the dialect will use
  :class:`.AsyncAdaptedQueuePool` as the source of connections.

  .. versionchanged:: 2.0.38

    SQLite file database engines now use :class:`.AsyncAdaptedQueuePool` by default.
    Previously, :class:`.NullPool` were used.  The :class:`.NullPool` class
    may be used by specifying it via the
    :paramref:`_sa.create_engine.poolclass` parameter.

As with the pysqlite dialect, this selection is made based on the database
name alone, and the ``mode=memory`` query string argument is deprecated as
a means of influencing it; see :ref:`pysqlite_threading_pooling` for
background.

.. _aiosqlite_memory:

Using a Memory Database with Multiple Coroutines
-------------------------------------------------

The default :class:`.StaticPool` used for ``:memory:`` databases forces all
coroutines to share a single DBAPI connection.  Because SQLite maintains only
one transaction state per connection, concurrent coroutines can interfere
with each other â€” a ``ROLLBACK`` in one coroutine will also discard
uncommitted work from any other coroutine using the same engine.

For async workloads where multiple :class:`.AsyncSession` or
:class:`.AsyncConnection` objects may be active simultaneously, use SQLite's
shared-cache URI mode instead.  This gives each checkout its own DBAPI
connection with independent transaction state while still sharing one
in-memory database::

    engine = create_async_engine(
        "sqlite+aiosqlite:///file::memory:?cache=shared&uri=true"
    )

Because this URL form is treated as a file-based database by the dialect,
:class:`.AsyncAdaptedQueuePool` is used automatically and no additional
configuration is needed.

Note that a shared-cache database is discarded once its last connection is
closed, so that operations such as :meth:`_asyncio.AsyncEngine.dispose` or
the use of :paramref:`_sa.create_engine.pool_recycle` will destroy its
contents; see :ref:`pysqlite_shared_cache_lifespan` for background and for
how to hold such a database open.

See the pysqlite documentation at
:ref:`pysqlite_uri_shared_cache` for full details on shared-cache memory
databases, including how to use named databases to maintain multiple
independent in-memory databases within the same process.

)ÚannotationsN)Úpartial)ÚThread)Ú
ModuleType)ÚAny)Úcast)ÚNoReturn)ÚOptional)ÚTYPE_CHECKING)ÚUnion)ÚSQLiteExecutionContext)ÚSQLiteDialect_pysqlite)Úpool)Úutil)ÚAsyncAdapt_dbapi_connection)ÚAsyncAdapt_dbapi_cursor)ÚAsyncAdapt_dbapi_module)ÚAsyncAdapt_dbapi_ss_cursor)ÚAsyncAdapt_terminate)Úawait_)ÚAsyncIODBAPIConnection)ÚDBAPIConnection)ÚDBAPICursor)ÚDBAPIModule)ÚURL)ÚPoolProxiedConnectionc                  ó   € ] tR t^›tRtRtR# )ÚAsyncAdapt_aiosqlite_cursor© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	__slots__Ú__static_attributes__r   ó    Ú`C:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.pyr   r   ›   ó   † Ø„Ir&   r   c                  ó   € ] tR t^ŸtRtRtR# )ÚAsyncAdapt_aiosqlite_ss_cursorr   Nr   r   r&   r'   r*   r*   Ÿ   r(   r&   r*   c                  óØ   a € ] tR t^£tRt]t]t]	R R l4       t
]
P                  R R l4       t
R R ltR V 3R lltR	 V 3R
 lltR R lt]R V 3R ll4       tR R ltR R ltRtV ;t# )ÚAsyncAdapt_aiosqlite_connectionc               ó   € V ^8„  d   QhRR/# )é   ÚreturnúOptional[str]r   )Úformats   "r'   Ú__annotate__Ú,AsyncAdapt_aiosqlite_connection.__annotate__¬   s   € ÷ ;ñ ; ñ ;r&   c                	óJ   € \        \        V P                  P                  4      # ©N)r   ÚstrÚ_connectionÚisolation_level©Úselfs   &r'   r8   Ú/AsyncAdapt_aiosqlite_connection.isolation_level«   s   € ä”C˜×)Ñ)×9Ñ9Ó:Ð:r&   c               ó    € V ^8„  d   QhRRRR/# )r.   Úvaluer0   r/   ÚNoner   )r1   s   "r'   r2   r3   °   s   € ÷ *ñ * ]ð *°tñ *r&   c                	óP  € R  R lp\        W P                  P                  V4      p\        P                  ! 4       P                  4       pV P                  P                  P                  WC34        \        V4       R#   \         d   pT P                  T4        Rp?R# Rp?ii ; i)c               ó$   € V ^8„  d   QhRRRRRR/# )r.   Ú
connectionr,   r=   r0   r/   r>   r   )r1   s   "r'   r2   ÚEAsyncAdapt_aiosqlite_connection.isolation_level.<locals>.__annotate__¶   s$   € ÷ 	/ñ 	/Ø7ð	/Ø@Mð	/àñ	/r&   c                ó   € Wn         R # r5   )r8   )rA   r=   s   &&r'   Úset_isoÚ@AsyncAdapt_aiosqlite_connection.isolation_level.<locals>.set_iso¶   s
   € ð */Ö&r&   N)r   r7   Ú_connÚasyncioÚget_event_loopÚcreate_futureÚ_txÚ
put_nowaitr   Ú	ExceptionÚ_handle_exception)r:   r=   rD   ÚfunctionÚfutureÚerrors   &&    r'   r8   r;   ¯   s‚   € õ	/ô
 ˜7×$4Ñ$4×$:Ñ$:¸EÓBˆÜ×'Ò'Ó)×7Ñ7Ó9ˆà×Ñ×Ñ×'Ñ'¨Ð(:Ô;ð	*Ü�6ŽNøÜô 	*Ø×"Ñ" 5×)Ò)ûð	*ús   Á1A> Á>B%Â	B Â B%c               ó$   € V ^8„  d   QhRRRRRR/# )r.   Úargsr   Úkwr/   r>   r   )r1   s   "r'   r2   r3   Å   s!   € ÷ *ñ * Sð *°ð *¸ñ *r&   c                	ó¦   €  \        V P                  P                  ! V/ VB 4       R #   \         d   pT P	                  T4        R p?R # R p?ii ; ir5   )r   r7   Úcreate_functionrL   rM   )r:   rR   rS   rP   s   &*, r'   rU   Ú/AsyncAdapt_aiosqlite_connection.create_functionÅ   sF   € ð	*Ü�4×#Ñ#×3Ò3°TÐ@¸RÑ@ÖAøÜô 	*Ø×"Ñ" 5×)Ò)ûð	*ús   ‚%) ©A´AÁAc               ó   € V ^8„  d   QhRR/# ©r.   r/   r>   r   )r1   s   "r'   r2   r3   Ë   s   € ÷ ñ ˜$ñ r&   c                	ó`   <€ V P                   P                   '       d   \        SV `	  4        R # R # r5   )r7   ÚsuperÚrollback©r:   Ú	__class__s   &€r'   r[   Ú(AsyncAdapt_aiosqlite_connection.rollbackË   s%   ø€ Ø×Ñ×'×'Ð'Ü‰GÑÖñ (r&   c               ó   € V ^8„  d   QhRR/# rX   r   )r1   s   "r'   r2   r3   Ï   s   € ÷ ñ ˜ñ r&   c                	ó`   <€ V P                   P                   '       d   \        SV `	  4        R # R # r5   )r7   rZ   Úcommitr\   s   &€r'   ra   Ú&AsyncAdapt_aiosqlite_connection.commitÏ   s$   ø€ Ø×Ñ×'×'Ð'Ü‰G‰NÖñ (r&   c               ó   € V ^8„  d   QhRR/# rX   r   )r1   s   "r'   r2   r3   Ó   s   € ÷ *ñ *�tñ *r&   c                	ó¼   €  \        V P                  P                  4       4       R #   \         d     R # \         d   pT P                  T4        R p?R # R p?ii ; ir5   )r   r7   ÚcloseÚ
ValueErrorrL   rM   )r:   rP   s   & r'   re   Ú%AsyncAdapt_aiosqlite_connection.closeÓ   sL   € ð	*Ü�4×#Ñ#×)Ñ)Ó+Ö,øÜô 		ò Üô 	*Ø×"Ñ" 5×)Ò)ûð	*ús   ‚#' §AµA¾A¿AÁAc               ó$   € V ^8„  d   QhRRRRRR/# )r.   Údbapir   rP   rL   r/   r   r   )r1   s   "r'   r2   r3   ä   s)   € ÷ 	Bñ 	BØð	BØ )ð	Bà	ñ	Br&   c                	óø   <€ \        V\        4      '       dT   VP                  ^ ,          P                  4       R9   d.   VP                  P                  VP                  ^ ,          4      Vh\        SV `  W4       R# )é    N)úno active connectionúconnection closed)Ú
isinstancerf   rR   ÚlowerÚsqliteÚOperationalErrorrZ   Ú_handle_exception_no_connection)Úclsri   rP   r]   s   &&&€r'   rr   Ú?AsyncAdapt_aiosqlite_connection._handle_exception_no_connectionã   s^   ø€ ô �eœZ×(Ò(¨U¯Z©Z¸­]×-@Ñ-@Ó-Bð G
ô .
ð —,‘,×/Ñ/°·
±
¸1µÓ>ÀEÐIä‰GÑ3°EÖAr&   c               ó   € V ^8„  d   QhRR/# rX   r   )r1   s   "r'   r2   r3   ï   s   € ÷ 'ñ '°ñ 'r&   c              ƒ  óV   "  € V P                   P                  4       G Rj  x€L
  R#  L5i)z"Try to close connection gracefullyN)r7   re   r9   s   &r'   Ú_terminate_graceful_closeÚ9AsyncAdapt_aiosqlite_connection._terminate_graceful_closeï   s   é € à×Ñ×$Ñ$Ó&×&Ô&ùs   ‚) '¡)c               ó   € V ^8„  d   QhRR/# rX   r   )r1   s   "r'   r2   r3   ó   s   € ÷ ñ ¨ñ r&   c                ó€   €  V P                   P                  pV! 4        R#   \         d   p\        R4      ThRp?ii ; i)zTerminate the connectionz:terminate_force_close() not implemented by this DBAPI shimN)r7   ÚstopÚAttributeErrorÚNotImplementedError)r:   ÚmethÚaes   &  r'   Ú_terminate_force_closeÚ6AsyncAdapt_aiosqlite_connection._terminate_force_closeó   sD   € ð
	Ø×#Ñ#×(Ñ(ˆDñ ŽFøô ô 	Ü%ØLóàðûð	ús   ‚! ¡=¬8¸=r   )r    r!   r"   r#   r$   r   Ú_cursor_clsr*   Ú_ss_cursor_clsÚpropertyr8   ÚsetterrU   r[   ra   re   Úclassmethodrr   rw   r€   r%   Ú__classcell__©r]   s   @r'   r,   r,   £   sƒ   ø† ð €Ià-€KØ3€Nàô;ó ð;ð ×Ñô*ó ð*õ**÷ð ÷ð õ*ð  ÷	Bó ð	Bõ'÷ó r&   r,   c                  óF   a € ] tR tRtR V 3R lltR R ltR R ltRtV ;t# )	ÚAsyncAdapt_aiosqlite_dbapii  c               ó    € V ^8„  d   QhRRRR/# )r.   Ú	aiosqliter   rp   r   )r1   s   "r'   r2   Ú'AsyncAdapt_aiosqlite_dbapi.__annotate__  s   € ÷ &ñ & *ð &°jñ &r&   c                	ó¤   <€ \         SV `  WR 7       Wn        W n        RV n        \        VP                  R4      V n        V P                  4        R# ))Údbapi_moduleÚqmarkr{   N)	rZ   Ú__init__rŒ   rp   Ú
paramstyleÚhasattrÚ
ConnectionÚhas_stopÚ_init_dbapi_attributes)r:   rŒ   rp   r]   s   &&&€r'   r‘   Ú#AsyncAdapt_aiosqlite_dbapi.__init__  sD   ø€ Ü‰Ñ˜ÐÔ8Ø"ŒØŒØ!ˆŒÜ 	× 4Ñ 4°fÓ=ˆŒØ×#Ñ#Ö%r&   c               ó   € V ^8„  d   QhRR/# rX   r   )r1   s   "r'   r2   r�     s   € ÷ <ñ <¨ñ <r&   c           	     	óü   € R F#  p\        W\        V P                  V4      4       K%  	  R F#  p\        W\        V P                  V4      4       K%  	  R F#  p\        W\        V P                  V4      4       K%  	  R# )ÚDatabaseErrorN)rš   ÚErrorÚIntegrityErrorÚNotSupportedErrorrq   ÚProgrammingErrorÚsqlite_versionÚsqlite_version_info)ÚPARSE_COLNAMESÚPARSE_DECLTYPES)ÚBinary)ÚsetattrÚgetattrrŒ   rp   )r:   Únames   & r'   r–   Ú1AsyncAdapt_aiosqlite_dbapi._init_dbapi_attributes  sg   € ó	
ˆDô �D¤¨¯©¸Ó =Ö>ñ	
ó :ˆDÜ�D¤¨¯©°TÓ :Ö;ñ :ó  ˆDÜ�D¤¨¯©°TÓ :Ö;ó  r&   c               ó$   € V ^8„  d   QhRRRRRR/# )r.   Úargr   rS   r/   r,   r   )r1   s   "r'   r2   r�     s'   € ÷ Iñ I˜Cð I sð IÐ/Nñ Ir&   c                	ó  € VP                  R R4      pV'       d
   V! V/ VB pMKV P                  P                  ! V/ VB p\        V\        4      '       d	   RVn        MRVP                  n        \        V \        V4      4      # )Úasync_creator_fnNT)	ÚpoprŒ   Úconnectrn   r   ÚdaemonÚ_threadr,   r   )r:   r©   rS   Ú
creator_fnrA   s   &*,  r'   r­   Ú"AsyncAdapt_aiosqlite_dbapi.connect  sw   € Ø—V‘VÐ.°Ó5ˆ
ßÙ# SÐ/¨BÑ/‰JàŸ™×/Ò/°Ð;¸Ñ;ˆJô ˜*¤f×-Ò-à$(�
Õ!ð -1�
×"Ñ"Ô)ä.¨t´V¸JÓ5GÓHÐHr&   )rŒ   r•   r’   rp   )	r    r!   r"   r#   r‘   r–   r­   r%   r‡   rˆ   s   @r'   rŠ   rŠ     s   ø† ÷&ð &õ<÷&Ió Ir&   rŠ   c                  ó"   € ] tR tRtR R ltRtR# )Ú SQLiteExecutionContext_aiosqlitei0  c               ó   € V ^8„  d   QhRR/# )r.   r/   r   r   )r1   s   "r'   r2   Ú-SQLiteExecutionContext_aiosqlite.__annotate__1  s   € ÷ ?ñ ?¨;ñ ?r&   c                	ó:   € V P                   P                  R R7      # )T)Úserver_side)Ú_dbapi_connectionÚcursorr9   s   &r'   Úcreate_server_side_cursorÚ:SQLiteExecutionContext_aiosqlite.create_server_side_cursor1  s   € Ø×%Ñ%×,Ñ,¸Ð,Ó>Ð>r&   r   N)r    r!   r"   r#   rº   r%   r   r&   r'   r³   r³   0  s   † ÷?ñ ?r&   r³   c                  ó¨   a € ] tR tRtRtRtRtRtRt]	t
R V 3R llt]R R l4       tR R	 lt]R
 R l4       tR V 3R lltR R ltR R ltRtV ;t# )ÚSQLiteDialect_aiosqlitei5  rŒ   Tc               ó   € V ^8„  d   QhRR/# )r.   Úkwargsr   r   )r1   s   "r'   r2   Ú$SQLiteDialect_aiosqlite.__annotate__@  s   € ÷ 'ñ ' ñ 'r&   c                	óš   <€ \         SV `  ! R/ VB  V P                  '       d(   V P                  P                  '       g
   R V n        R# R# R# )FNr   )rZ   r‘   ri   r•   Úhas_terminate)r:   r¿   r]   s   &,€r'   r‘   Ú SQLiteDialect_aiosqlite.__init__@  s:   ø€ Ü‰ÒÑ"˜6Ò"Ø�:�:ˆ:˜dŸj™j×1×1Ð1Ø!&ˆDÖñ 2‰:r&   c               ó   € V ^8„  d   QhRR/# )r.   r/   rŠ   r   )r1   s   "r'   r2   rÀ   F  s   € ÷ 
ñ 
Ð7ñ 
r&   c                	ó>   € \        \        R 4      \        R4      4      # )rŒ   Úsqlite3)rŠ   Ú
__import__)rs   s   &r'   Úimport_dbapiÚ$SQLiteDialect_aiosqlite.import_dbapiE  s   € ä)Ü�{Ó#¤Z°	Ó%:ó
ð 	
r&   c               ó    € V ^8„  d   QhRRRR/# )r.   ri   r   r/   zutil.VersionInfor   )r1   s   "r'   r2   rÀ   K  s   € ÷ 
ñ 
¨Kð 
Ð<Lñ 
r&   c                	ó^   € \        VR R4      p\        P                  ! \        VRR4      4      # )rŒ   NÚ__version__)r¥   r   Úparse_version_string)r:   ri   rŒ   s   && r'   Úretrieve_dbapi_versionÚ.SQLiteDialect_aiosqlite.retrieve_dbapi_versionK  s1   € ô ˜E ;°Ó5ˆ	Ü×(Ò(Ü�I˜}¨dÓ3ó
ð 	
r&   c               ó    € V ^8„  d   QhRRRR/# )r.   Úurlr   r/   ztype[pool.Pool]r   )r1   s   "r'   r2   rÀ   T  s   € ÷ #ñ # ð #¨ñ #r&   c                	óÎ   € V P                  V4      '       d   \        P                  # V P                  V\        P                  \        P                  4       \        P                  # r5   )Ú_is_url_file_dbr   ÚAsyncAdaptedQueuePoolÚ _warn_memory_mode_pool_selectionÚ
StaticPool)rs   rÑ   s   &&r'   Úget_pool_classÚ&SQLiteDialect_aiosqlite.get_pool_classS  sJ   € à×Ñ˜s×#Ò#Ü×-Ñ-Ð-à×0Ñ0Ø”T—_‘_¤d×&@Ñ&@ôô —?‘?Ð"r&   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r.   ÚezDBAPIModule.ErrorrA   z7Optional[Union[PoolProxiedConnection, DBAPIConnection]]r¹   zOptional[DBAPICursor]r/   Úboolr   )r1   s   "r'   r2   rÀ   ]  s3   € ÷ <ñ <àð<ð Lð<ð &ð	<ð
 
ñ<r&   c                	óö   <€ \        R V P                  4      V n        \        WP                  P                  4      '       d*   \	        V4      P                  4       pRV9   g   RV9   d   R# \        SV `  WV4      # )r   rl   rm   T)r   ri   rn   rq   r6   ro   rZ   Úis_disconnect)r:   rÚ   rA   r¹   Ú	err_lowerr]   s   &&&& €r'   rÝ   Ú%SQLiteDialect_aiosqlite.is_disconnect]  s`   ø€ ô ˜-¨¯©Ó4ˆŒ
Ü�aŸ™×4Ñ4×5Ò5Ü˜A›Ÿ™›ˆIà&¨)Ô3Ø&¨)Ô3áä‰wÑ$ Q°FÓ;Ð;r&   c               ó    € V ^8„  d   QhRRRR/# )r.   rA   r   r/   r   r   )r1   s   "r'   r2   rÀ   n  s   € ÷ &ñ &Ø)ð&à	ñ&r&   c                	ó   € VP                   # r5   )r7   )r:   rA   s   &&r'   Úget_driver_connectionÚ-SQLiteDialect_aiosqlite.get_driver_connectionn  s   € ð ×%Ñ%Ð%r&   c               ó    € V ^8„  d   QhRRRR/# )r.   Údbapi_connectionr   r/   r>   r   )r1   s   "r'   r2   rÀ   s  s   € ÷ %ñ %¨_ð %Àñ %r&   c                	ó&   € VP                  4        R # r5   )Ú	terminate)r:   rå   s   &&r'   Údo_terminateÚ$SQLiteDialect_aiosqlite.do_terminates  s   € Ø×"Ñ"Ö$r&   )ri   rÂ   )r    r!   r"   r#   ÚdriverÚsupports_statement_cacheÚis_asyncrÂ   Úsupports_server_side_cursorsr³   Úexecution_ctx_clsr‘   r†   rÈ   rÎ   r×   rÝ   râ   rè   r%   r‡   rˆ   s   @r'   r½   r½   5  st   ø† Ø€FØ#Ðà€HØ€Mà#'Ð à8Ð÷'ð 'ð
 ô
ó ð
õ

ð ô#ó ð#÷<ð <õ"&÷
%ó %r&   r½   )0Ú__doc__Ú
__future__r   rG   Ú	functoolsr   Ú	threadingr   Útypesr   Útypingr   r   r   r	   r
   r   Úbaser   Úpysqliter   Ú r   r   Úconnectors.asyncior   r   r   r   r   Úutil.concurrencyr   r   Úengine.interfacesr   r   r   Ú
engine.urlr   Ú	pool.baser   r   r*   r,   rŠ   r³   r½   Údialectr   r&   r'   Ú<module>rþ      sÁ   ðñoõb #ã Ý Ý Ý Ý Ý Ý Ý Ý  Ý å (Ý ,Ý Ý Ý =Ý 9Ý 9Ý <Ý 6Ý &çÝ<Ý4Ý0Ý0Ý!Ý2ôÐ"9ô ôÐ%?ô ô\ØÐ5ô\ô~+IÐ!8ô +Iô\?Ð'=ô ?ô
?%Ð4ô ?%ðD "‚r&   