
    ,h[                       S r SSKJr  SSKJr  SSKrSSKrSSKJr  SSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK
Jr  SSK
Jr  SSKJr  SSKJr  SSK J!r!  SSK J"r"  \	(       a  SSKJ#r#  SSK$J%r%  \RL                  " S5      r' " S S\RP                  5      r) " S S \5      r* " S! S"\5      r+ " S# S$\5      r, " S% S&\R*                  RZ                  5      r. " S' S(\R*                  R^                  5      r0 " S) S*\5      r1 " S+ S,\5      r2 " S- S.\Rf                  5      r4 " S/ S0\Rj                  5      r6 " S1 S2\Rn                  5      r8 " S3 S4\Rr                  5      r: " S5 S6\Rv                  5      r< " S7 S8\Rz                  5      r> " S9 S:\R~                  5      r@ " S; S<\R                  5      rB " S= S>\R                  5      rD " S? S@\R                  5      rF " SA SB\5      rG " SC SD\5      rH " SE SF\5      rISG rJ " SH SI\5      rK " SJ SK5      rL " SL SM\L5      rM " SN SO\5      rN " SP SQ\N5      rO " SR SS5      rP " ST SU\K5      rQ\KrR\QrSg)Vau  
.. dialect:: postgresql+psycopg
    :name: psycopg (a.k.a. psycopg 3)
    :dbapi: psycopg
    :connectstring: postgresql+psycopg://user:password@host:port/dbname[?key=value&key=value...]
    :url: https://pypi.org/project/psycopg/

``psycopg`` is the package and module name for version 3 of the ``psycopg``
database driver, formerly known as ``psycopg2``.  This driver is different
enough from its ``psycopg2`` predecessor that SQLAlchemy supports it
via a totally separate dialect; support for ``psycopg2`` is expected to remain
for as long as that package continues to function for modern Python versions,
and also remains the default dialect for the ``postgresql://`` dialect
series.

The SQLAlchemy ``psycopg`` dialect provides both a sync and an async
implementation under the same dialect name. The proper version is
selected depending on how the engine is created:

* calling :func:`_sa.create_engine` with ``postgresql+psycopg://...`` will
  automatically select the sync version, e.g.::

    from sqlalchemy import create_engine

    sync_engine = create_engine(
        "postgresql+psycopg://scott:tiger@localhost/test"
    )

* calling :func:`_asyncio.create_async_engine` with
  ``postgresql+psycopg://...`` will automatically select the async version,
  e.g.::

    from sqlalchemy.ext.asyncio import create_async_engine

    asyncio_engine = create_async_engine(
        "postgresql+psycopg://scott:tiger@localhost/test"
    )

The asyncio version of the dialect may also be specified explicitly using the
``psycopg_async`` suffix, as::

    from sqlalchemy.ext.asyncio import create_async_engine

    asyncio_engine = create_async_engine(
        "postgresql+psycopg_async://scott:tiger@localhost/test"
    )

.. seealso::

    :ref:`postgresql_psycopg2` - The SQLAlchemy ``psycopg``
    dialect shares most of its behavior with the ``psycopg2`` dialect.
    Further documentation is available there.

Using a different Cursor class
------------------------------

One of the differences between ``psycopg`` and the older ``psycopg2``
is how bound parameters are handled: ``psycopg2`` would bind them
client side, while ``psycopg`` by default will bind them server side.

It's possible to configure ``psycopg`` to do client side binding by
specifying the ``cursor_factory`` to be ``ClientCursor`` when creating
the engine::

    from psycopg import ClientCursor

    client_side_engine = create_engine(
        "postgresql+psycopg://...",
        connect_args={"cursor_factory": ClientCursor},
    )

Similarly when using an async engine the ``AsyncClientCursor`` can be
specified::

    from psycopg import AsyncClientCursor

    client_side_engine = create_async_engine(
        "postgresql+psycopg://...",
        connect_args={"cursor_factory": AsyncClientCursor},
    )

.. seealso::

    `Client-side-binding cursors <https://www.psycopg.org/psycopg3/docs/advanced/cursors.html#client-side-binding-cursors>`_

    )annotations)dequeN)cast)TYPE_CHECKING   )ranges)_PGDialect_common_psycopg)"_PGExecutionContext_common_psycopg)INTERVAL)
PGCompiler)PGIdentifierPreparer)	REGCONFIG)JSON)JSONB)JSONPathType)CITEXT   )pool)util)AdaptedConnection)sqltypes)await_fallback)
await_only)Iterable)AsyncConnectionzsqlalchemy.dialects.postgresqlc                      \ rS rSrSrSrg)	_PGString   T N__name__
__module____qualname____firstlineno__render_bind_cast__static_attributes__r       ^/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/dialects/postgresql/psycopg.pyr   r          r'   r   c                      \ rS rSrSrSrg)_PGREGCONFIG   Tr   Nr    r   r'   r(   r+   r+      r)   r'   r+   c                       \ rS rSrS rS rSrg)_PGJSON   c                :    U R                  S UR                  5      $ N)_make_bind_processor_psycopg_Jsonselfdialects     r(   bind_processor_PGJSON.bind_processor   s    ((w/D/DEEr'   c                    g r1   r   r5   r6   coltypes      r(   result_processor_PGJSON.result_processor       r'   r   Nr!   r"   r#   r$   r7   r<   r&   r   r'   r(   r.   r.      s    Fr'   r.   c                       \ rS rSrS rS rSrg)_PGJSONB   c                :    U R                  S UR                  5      $ r1   )r2   _psycopg_Jsonbr4   s     r(   r7   _PGJSONB.bind_processor   s    ((w/E/EFFr'   c                    g r1   r   r:   s      r(   r<   _PGJSONB.result_processor   r>   r'   r   Nr?   r   r'   r(   rA   rA      s    Gr'   rA   c                      \ rS rSrSrSrSrg)_PGJSONIntIndexType   json_int_indexTr   Nr!   r"   r#   r$   __visit_name__r%   r&   r   r'   r(   rI   rI          %Nr'   rI   c                      \ rS rSrSrSrSrg)_PGJSONStrIndexType   json_str_indexTr   NrL   r   r'   r(   rP   rP      rN   r'   rP   c                      \ rS rSrSrg)_PGJSONPathType   r   Nr!   r"   r#   r$   r&   r   r'   r(   rT   rT          r'   rT   c                      \ rS rSrSrSrg)_PGInterval   Tr   Nr    r   r'   r(   rY   rY      r)   r'   rY   c                      \ rS rSrSrSrg)_PGTimeStamp   Tr   Nr    r   r'   r(   r\   r\      r)   r'   r\   c                      \ rS rSrSrSrg)_PGDate   Tr   Nr    r   r'   r(   r_   r_      r)   r'   r_   c                      \ rS rSrSrSrg)_PGTime   Tr   Nr    r   r'   r(   rb   rb      r)   r'   rb   c                      \ rS rSrSrSrg)
_PGInteger   Tr   Nr    r   r'   r(   re   re      r)   r'   re   c                      \ rS rSrSrSrg)_PGSmallInteger   Tr   Nr    r   r'   r(   rh   rh      r)   r'   rh   c                      \ rS rSrSrSrg)_PGNullType   Tr   Nr    r   r'   r(   rk   rk      r)   r'   rk   c                      \ rS rSrSrSrg)_PGBigInteger   Tr   Nr    r   r'   r(   rn   rn      r)   r'   rn   c                      \ rS rSrSrSrg)
_PGBoolean   Tr   Nr    r   r'   r(   rq   rq      r)   r'   rq   c                       \ rS rSrS rS rSrg)_PsycopgRange   c                H   ^ [        [        U5      R                  mU4S jnU$ )Nc                   > [        U [        R                  5      (       a3  T" U R                  U R                  U R
                  U R                  5      n U $ r1   )
isinstancer   Rangelowerupperboundsempty)valuepsycopg_Ranges    r(   to_range._PsycopgRange.bind_processor.<locals>.to_range   s>    %..%KKellEKK Lr'   )r   PGDialect_psycopg_psycopg_Range)r5   r6   r   r   s      @r(   r7   _PsycopgRange.bind_processor   s"    .8GG	 r'   c                    S nU$ )Nc                    U bW  [         R                  " U R                  U R                  U R                  (       a  U R                  OSU R                  (       + S9n U $ )N[)r|   r}   r   ry   _lower_upper_boundsr~   s    r(   r   0_PsycopgRange.result_processor.<locals>.to_range   sD     LLLL,1MM5==t#mm+	 Lr'   r   r5   r6   r;   r   s       r(   r<   _PsycopgRange.result_processor   s    	 r'   r   Nr?   r   r'   r(   rt   rt      s    
r'   rt   c                       \ rS rSrS rS rSrg)_PsycopgMultiRange   c                   ^^^ [        [        U5      R                  m[        [        U5      R                  m[	        S 5      mUUU4S jnU$ )Nc                   > [        U [        TT45      (       a  U $ T" [        SU 5       Vs/ s H6  nT" UR                  UR                  UR
                  UR                  5      PM8     sn5      $ s  snf )NzIterable[ranges.Range])rx   strr   rz   r{   r|   r}   )r~   elementNoneTypepsycopg_Multiranger   s     r(   r   3_PsycopgMultiRange.bind_processor.<locals>.to_range   s{    %#x1C!DEE% $((@%#H $I "	 $I
 
s   =A0)r   r   r   _psycopg_Multirangetype)r5   r6   r   r   r   r   s      @@@r(   r7   !_PsycopgMultiRange.bind_processor   sE    .8GG!w


 	 :	  r'   c                    S nU$ )Nc                D    U c  g [         R                  " S U  5       5      $ )Nc              3     #    U  H\  n[         R                  " UR                  UR                  UR                  (       a  UR                  OS UR                  (       + S9v   M^     g7f)r   r   Nr   ).0elems     r(   	<genexpr>H_PsycopgMultiRange.result_processor.<locals>.to_range.<locals>.<genexpr>  sK      ) !& LL/3||t||"&,,.	 !&s   A$A&)r   
MultiRanger   s    r(   r   5_PsycopgMultiRange.result_processor.<locals>.to_range  s,    }(( ) !&)  r'   r   r   s       r(   r<   #_PsycopgMultiRange.result_processor  s    	 r'   r   Nr?   r   r'   r(   r   r      s    4r'   r   c                      \ rS rSrSrg)PGExecutionContext_psycopgi  r   NrV   r   r'   r(   r   r     rW   r'   r   c                      \ rS rSrSrg)PGCompiler_psycopgi  r   NrV   r   r'   r(   r   r     rW   r'   r   c                      \ rS rSrSrg)PGIdentifierPreparer_psycopgi  r   NrV   r   r'   r(   r   r     rW   r'   r   c                Z    [         R                  SU R                  U R                  5        g )Nz%s: %s)loggerinfoseveritymessage_primary)
diagnostics    r(   _log_noticesr   !  s    
KK*--z/I/IJr'   c                    ^  \ rS rSrSrSrSrSrSr\	r
\r\rSrSrSr\R&                  " \R*                  0 \R.                  \_\\_\\_\\_\R6                  \_\\_\R6                  R@                  \!_\R6                  RD                  \#_\R6                  RH                  \%_\RL                  \'_\(\'_\RR                  \*_\RV                  \,_\RZ                  \._\R^                  \0_\Rb                  \2_\Rf                  \4_\5Rl                  \7\5Rp                  \90E5      rU 4S jr:U 4S jr;S	 r<U 4S
 jr=\>S 5       r?\>S 5       r@\R                  S 5       rB\R                  S 5       rC\R                  S 5       rD\R                  S 5       rE\R                  S 5       rF\R                  S 5       rGS rHU 4S jrIS rJS rKS rLS rMS rNSS jrO S S jrP S S jrQ\R                  S 5       rRSrSU =rT$ )!r   i%  psycopgTpyformat)r   r   Nc                  > [         TU ]  " S0 UD6  U R                  (       Gag  [        R                  " SU R                  R
                  5      nU(       a(  [        S UR                  SSS5       5       5      U l        U R                  S:  a  [        S5      eSS	K
Jn  U" U R                  R                  5      =U l        nU R                  S
L ad  SS KnUR!                  SUR"                  R$                  R&                  5        UR!                  SUR"                  R$                  R&                  5        U R(                  (       a  SSKJn  U" U R(                  U5        U R.                  (       a  SSKJn  U" U R.                  U5        g g g )Nz(\d+)\.(\d+)(?:\.(\d+))?c              3  @   #    U  H  oc  M  [        U5      v   M     g 7fr1   )int)r   xs     r(   r   -PGDialect_psycopg.__init__.<locals>.<genexpr>T  s      -$4qFCFF$4s   r      r   )r   r   r   z,psycopg version 3.0.2 or higher is required.r   )AdaptersMapFinetcidr)set_json_loads)set_json_dumpsr   )super__init__dbapirematch__version__tuplegrouppsycopg_versionImportErrorpsycopg.adaptr   adapters_psycopg_adapters_map_native_inet_typespsycopg.types.stringregister_loadertypesstring
TextLoader_json_deserializerpsycopg.types.jsonr   _json_serializerr   )	r5   kwargsmr   adapters_mapr   r   r   	__class__s	           r(   r   PGDialect_psycopg.__init__N  sG   "6":::4djj6L6LMA', -$%GGAq!$4- ($ ##i/!B  28C

##9 D& &&%/+,,GMM00;; ,,GMM00;; &&=t66E$$=t44lC %C r'   c                   > [         TU ]  U5      u  p#U R                  (       a  U R                  US'   U R                  b  U R                  US'   X#4$ )Ncontextclient_encoding)r   create_connect_argsr   r   )r5   urlcargscparamsr   s       r(   r   %PGDialect_psycopg.create_connect_argsw  sR    4S9%%!%!;!;GI+)-)=)=G%&~r'   c                Z    SSK Jn  UR                  UR                  R                  U5      $ Nr   )TypeInfo)psycopg.typesr   fetch
connectiondriver_connection)r5   r   namer   s       r(   _type_info_fetch"PGDialect_psycopg._type_info_fetch  s"    *~~j33EEtLLr'   c                  > [         TU ]  U5        U R                  (       d  SU l        U R                  (       a  U R                  US5      nUS LU l        U R                  (       a[  SSKJn  U R                  (       d   eU" X R                  5        UR                  (       d   eU" X!R                  R                  5        g g g )NFhstorer   )register_hstore)r   
initializeinsert_returninginsert_executemany_returninguse_native_hstorer   _has_native_hstorepsycopg.types.hstorer   r   r   r   )r5   r   r   r   r   s       r(   r   PGDialect_psycopg.initialize  s    :& $$05D-
 !!((X>D&*$&6D#&&@ 1111&@&@A ",,,,&;&;&M&MN ' "r'   c                    SS K nU$ )Nr   r   )clsr   s     r(   import_dbapiPGDialect_psycopg.import_dbapi  s
    r'   c                    [         $ r1   )PGDialectAsync_psycopg)r   r   s     r(   get_async_dialect_cls'PGDialect_psycopg.get_async_dialect_cls  s    %%r'   c                    U R                   R                  R                  U R                   R                  R                  U R                   R                  R                  U R                   R                  R
                  S.$ )N)zREAD COMMITTEDzREAD UNCOMMITTEDzREPEATABLE READSERIALIZABLE)r   IsolationLevelREAD_COMMITTEDREAD_UNCOMMITTEDREPEATABLE_READr  r5   s    r(   _isolation_lookup#PGDialect_psycopg._isolation_lookup  sZ     #jj77FF $

 9 9 J J#zz88HH JJ55BB	
 	
r'   c                &    SSK Jn  UR                  $ Nr   )json)r   r  Jsonr5   r  s     r(   r3   PGDialect_psycopg._psycopg_Json  s    &yyr'   c                &    SSK Jn  UR                  $ r  )r   r  Jsonbr  s     r(   rD    PGDialect_psycopg._psycopg_Jsonb  s    &zzr'   c                    SSK Jn  U$ )Nr   )TransactionStatus)
psycopg.pqr  )r5   r  s     r(   _psycopg_TransactionStatus,PGDialect_psycopg._psycopg_TransactionStatus  s    0  r'   c                    SSK Jn  U$ )Nr   )ry   )psycopg.types.rangery   )r5   ry   s     r(   r    PGDialect_psycopg._psycopg_Range  s
    -r'   c                    SSK Jn  U$ )Nr   )
Multirange)psycopg.types.multiranger  )r5   r  s     r(   r   %PGDialect_psycopg._psycopg_Multirange  s    7r'   c                    X!l         X1l        g r1   
autocommitisolation_levelr5   r   r#  r$  s       r(   _do_isolation_level%PGDialect_psycopg._do_isolation_level  s     *%4"r'   c                   > UR                   R                  n[        TU ]  U5      nX R                  R
                  :X  a  UR                  5         U$ r1   )r   transaction_statusr   get_isolation_levelr  IDLErollback)r5   dbapi_connectionstatus_beforer~   r   s       r(   r*  %PGDialect_psycopg.get_isolation_level  sI    (--@@+,<= ;;@@@%%'r'   c                p    US:X  a  U R                  USS S9  g U R                  USU R                  U   S9  g )N
AUTOCOMMITTr"  F)r&  r
  )r5   r-  levels      r(   set_isolation_level%PGDialect_psycopg.set_isolation_level  sM    L $$ T4 %  $$   $ 6 6u = % r'   c                    X!l         g r1   	read_onlyr5   r   r~   s      r(   set_readonlyPGDialect_psycopg.set_readonly  s    $r'   c                    UR                   $ r1   r6  r5   r   s     r(   get_readonlyPGDialect_psycopg.get_readonly  s    ###r'   c                j   ^ ^ S nU/mT R                   b  U 4S jnTR                  U5        U4S jnU$ )Nc                .    U R                  [        5        g r1   )add_notice_handlerr   )conns    r(   notices-PGDialect_psycopg.on_connect.<locals>.notices  s    ##L1r'   c                >   > TR                  U TR                  5        g r1   )r3  r$  )rB  r5   s    r(   
on_connect0PGDialect_psycopg.on_connect.<locals>.on_connect  s    ((t/C/CDr'   c                (   > T H  nU" U 5        M     g r1   r   )rB  fnfnss     r(   rF  rG    s    4 r'   )r$  append)r5   rC  rF  rJ  s   `  @r(   rF  PGDialect_psycopg.on_connect  s>    	2 i+E JJz"	 r'   c                    [        XR                  R                  5      (       a&  Ub#  UR                  (       d  UR                  (       a  gg)NTF)rx   r   Errorclosedbroken)r5   er   cursors       r(   is_disconnectPGDialect_psycopg.is_disconnect  s3    a))**z/E  J$5$5r'   c                   UR                   R                  nU(       d.  UR                  R                  U R                  R
                  :w  a  UR                  5         UR                  n U(       d  U R                  US5        UR                  U5        U(       d  U R                  XE5        g g ! U(       d  U R                  XE5        f f = f)NT)
r   r-  r   r)  r  r+  r,  r#  _do_autocommitexecute)r5   r   commandrecover
dbapi_connbefore_autocommits         r(   _do_prepared_twophase'PGDialect_psycopg._do_prepared_twophase  s    **;;
 11..334 !&11	C$##J5w'$##JB %$##JB %s   )*B- -Cc                t    U(       a  U R                  USU S3US9  g U R                  UR                  5        g )NzROLLBACK PREPARED ''rY  )r\  do_rollbackr   r5   r   xidis_preparedrY  s        r(   do_rollback_twophase&PGDialect_psycopg.do_rollback_twophase  sA     &&1#a8' '  Z223r'   c                t    U(       a  U R                  USU S3US9  g U R                  UR                  5        g )NzCOMMIT PREPARED 'r_  r`  )r\  	do_commitr   rb  s        r(   do_commit_twophase$PGDialect_psycopg.do_commit_twophase(  s?     &&/uA6 '  NN:001r'   c                    g)N;r   r	  s    r(   _dialect_specific_select_one.PGDialect_psycopg._dialect_specific_select_one2  s    r'   )r   r   r   r   )F)TF)Ur!   r"   r#   r$   driversupports_statement_cachesupports_server_side_cursorsdefault_paramstylesupports_sane_multi_rowcountr   execution_ctx_clsr   statement_compilerr   preparerr   r   r   r   update_copyr	   colspecsr   Stringr   r   r+   r   r.   r   r   rA   r   rT   JSONIntIndexTyperI   JSONStrIndexTyperP   IntervalrY   r   Dater_   DateTimer\   Timerb   Integerre   SmallIntegerrh   
BigIntegerrn   r   AbstractSingleRangert   AbstractMultiRanger   r   r   r   r   classmethodr   r  memoized_propertyr
  r3   rD   r  r   r   r&  r*  r3  r9  r=  rF  rS  r\  re  ri  rm  r&   __classcell__)r   s   @r(   r   r   %  s   F##' ##' 2++HO !**	
OOY	
|	
 '	
 F		

 MM7	
 8	
 MM&&	
 MM**,?	
 MM**,?	
 {	
 k	
 MM7	
 |	
 MM7	
 j	
  !!?!	
" #	
$ &&%%'9'	
H2'DRM
O4  
 & & 

 
 
 
 
 
 
! !
 
 
 
 
5
%$(C( :?4 :?2 
 r'   r   c                      \ rS rSrSrSrSS jrS r\S 5       r	\	R                  S 5       r	S rSS	 jrS
 rS rS rSS jrS rSrg)AsyncAdapt_psycopg_cursori7  )_cursorawait__rowsNc                :    Xl         X l        [        5       U l        g r1   )r  r  r   r  )r5   rR  r  s      r(   r   "AsyncAdapt_psycopg_cursor.__init__<  s    W
r'   c                .    [        U R                  U5      $ r1   )getattrr  r5   r   s     r(   __getattr__%AsyncAdapt_psycopg_cursor.__getattr__A  s    t||T**r'   c                .    U R                   R                  $ r1   r  	arraysizer	  s    r(   r  #AsyncAdapt_psycopg_cursor.arraysizeD  s    ||%%%r'   c                $    XR                   l        g r1   r  r5   r~   s     r(   r  r  H  s    !&r'   c                l    U R                   R                  5         U R                  R                  5         g r1   )r  clearr  _closer	  s    r(   closeAsyncAdapt_psycopg_cursor.closeL  s"    

r'   c                R   U R                  U R                  R                  " X40 UD65      nU R                  R                  nU(       a]  UR                  U R
                  R                  :X  a9  U R                  U R                  R                  5       5      n[        U5      U l	        U$ r1   )
r  r  rW  pgresultstatus_psycopg_ExecStatus	TUPLES_OKfetchallr   r  )r5   queryparamskwresultresrowss          r(   rW  !AsyncAdapt_psycopg_cursor.executeQ  sz    T\\11%F2FGll## 3::!9!9!C!CC;;t||4467DtDJr'   c                V    U R                  U R                  R                  X5      5      $ r1   )r  r  executemany)r5   r  
params_seqs      r(   r  %AsyncAdapt_psycopg_cursor.executemany]  s     {{4<<33EFGGr'   c              #     #    U R                   (       a0  U R                   R                  5       v   U R                   (       a  M/  g g 7fr1   r  popleftr	  s    r(   __iter__"AsyncAdapt_psycopg_cursor.__iter__`  s*     jj**$$&& jjjs   ?AAc                Z    U R                   (       a  U R                   R                  5       $ g r1   r  r	  s    r(   fetchone"AsyncAdapt_psycopg_cursor.fetchoned  s    ::::%%''r'   c                    Uc  U R                   R                  nU R                  n[        [	        U[        U5      5      5       Vs/ s H  o2R                  5       PM     sn$ s  snf r1   )r  r  r  rangeminlenr  )r5   sizerr_s       r(   	fetchmany#AsyncAdapt_psycopg_cursor.fetchmanyj  sM    <<<))DZZ&+Cc"g,>&?@&?

&?@@@s   A"c                d    [        U R                  5      nU R                  R                  5         U$ r1   )listr  r  )r5   retvals     r(   r  "AsyncAdapt_psycopg_cursor.fetchallq  s%    djj!

r'   )r  r  r  returnNoner1   )r!   r"   r#   r$   	__slots__r  r   r  propertyr  setterr  rW  r  r  r  r  r  r&   r   r'   r(   r  r  7  sj    .I
+ & & ' '

H'Ar'   r  c                  @    \ rS rSrS
S jrS rS rSS jrS rS r	S	r
g)AsyncAdapt_psycopg_ss_cursoriw  Nc                ^    U R                  U R                  R                  " X40 UD65        U $ r1   )r  r  rW  )r5   r  r  r  s       r(   rW  $AsyncAdapt_psycopg_ss_cursor.executex  s'    DLL((="=>r'   c                V    U R                  U R                  R                  5       5        g r1   )r  r  r  r	  s    r(   r  "AsyncAdapt_psycopg_ss_cursor.close|  s    DLL&&()r'   c                T    U R                  U R                  R                  5       5      $ r1   )r  r  r  r	  s    r(   r  %AsyncAdapt_psycopg_ss_cursor.fetchone      {{4<<00233r'   c                V    U R                  U R                  R                  U5      5      $ r1   )r  r  r  )r5   r  s     r(   r  &AsyncAdapt_psycopg_ss_cursor.fetchmany  s     {{4<<11$788r'   c                T    U R                  U R                  R                  5       5      $ r1   )r  r  r  r	  s    r(   r  %AsyncAdapt_psycopg_ss_cursor.fetchall  r  r'   c              #     #    U R                   R                  5       n  U R                  UR                  5       5      v   M$  ! [         a     g f = f7fr1   )r  	__aiter__r  	__anext__StopAsyncIteration)r5   iterators     r(   r  %AsyncAdapt_psycopg_ss_cursor.__iter__  sO     <<))+kk("4"4"677  & s(   A!A  A
AAAAr   r1   )r   )r!   r"   r#   r$   rW  r  r  r  r  r  r&   r   r'   r(   r  r  w  s     *494r'   r  c                      \ rS rSr% S\S'   Sr\" \5      rSS jr	S r
SS jrS	 rS
 rS rS r\S 5       r\R$                  S 5       rS rS rS rS rSrg)AsyncAdapt_psycopg_connectioni  r   _connectionr   c                    Xl         g r1   r  r<  s     r(   r   &AsyncAdapt_psycopg_connection.__init__  s    %r'   c                .    [        U R                  U5      $ r1   )r  r  r  s     r(   r  )AsyncAdapt_psycopg_connection.__getattr__  s    t''..r'   Nc                    U R                  U R                  R                  " X40 UD65      n[        X@R                   5      $ r1   )r  r  rW  r  )r5   r  r  r  rR  s        r(   rW  %AsyncAdapt_psycopg_connection.execute  s5    T--55eJrJK(==r'   c                    U R                   R                  " U0 UD6n[        US5      (       a  [        X0R                  5      $ [        X0R                  5      $ )Nr   )r  rR  hasattrr  r  r  )r5   argsr  rR  s       r(   rR  $AsyncAdapt_psycopg_connection.cursor  sH    !!(($5"566""/DD,V[[AAr'   c                V    U R                  U R                  R                  5       5        g r1   )r  r  commitr	  s    r(   r  $AsyncAdapt_psycopg_connection.commit  s    D$$++-.r'   c                V    U R                  U R                  R                  5       5        g r1   )r  r  r,  r	  s    r(   r,  &AsyncAdapt_psycopg_connection.rollback  s    D$$--/0r'   c                V    U R                  U R                  R                  5       5        g r1   )r  r  r  r	  s    r(   r  #AsyncAdapt_psycopg_connection.close  s    D$$**,-r'   c                .    U R                   R                  $ r1   )r  r#  r	  s    r(   r#  (AsyncAdapt_psycopg_connection.autocommit  s    ***r'   c                &    U R                  U5        g r1   set_autocommitr  s     r(   r#  r    s    E"r'   c                X    U R                  U R                  R                  U5      5        g r1   )r  r  r  r  s     r(   r  ,AsyncAdapt_psycopg_connection.set_autocommit      D$$33E:;r'   c                X    U R                  U R                  R                  U5      5        g r1   )r  r  r3  r  s     r(   r3  1AsyncAdapt_psycopg_connection.set_isolation_level  s    D$$88?@r'   c                X    U R                  U R                  R                  U5      5        g r1   )r  r  set_read_onlyr  s     r(   r  +AsyncAdapt_psycopg_connection.set_read_only  s    D$$2259:r'   c                X    U R                  U R                  R                  U5      5        g r1   )r  r  set_deferrabler  s     r(   r  ,AsyncAdapt_psycopg_connection.set_deferrable  r  r'   r  r  r1   )r!   r"   r#   r$   __annotations__r  staticmethodr   r  r   r  rW  rR  r  r,  r  r  r#  r  r  r3  r  r  r&   r   r'   r(   r  r    s~      I*%F&/>B/1. + + # #<A;<r'   r  c                  (    \ rS rSrSr\" \5      rSrg)%AsyncAdaptFallback_psycopg_connectioni  r   N)	r!   r"   r#   r$   r  r  r   r  r&   r   r'   r(   r  r    s    I.)Fr'   r  c                  $    \ rS rSrSS jrS rSrg)PsycopgAdaptDBAPIi  c                    Xl         U R                   R                  R                  5        H  u  p#US:w  d  M  X0R                  U'   M     g )Nconnect)r   __dict__items)r5   r   kvs       r(   r   PsycopgAdaptDBAPI.__init__  s9    LL))//1DAI~#$a  2r'   c           	     $   UR                  SS5      nUR                  SU R                  R                  R                  5      n[        R
                  " U5      (       a  [        [        U" U0 UD65      5      $ [        [        U" U0 UD65      5      $ )Nasync_fallbackFasync_creator_fn)
popr   r   r
  r   asboolr  r   r  r   )r5   argr  r  
creator_fns        r(   r
  PsycopgAdaptDBAPI.connect  s     0%8VV < < D D

 ;;~&&8z35"56  1:s1b12 r'   r   Nr  )r!   r"   r#   r$   r   r
  r&   r   r'   r(   r  r    s    %r'   r  c                  `    \ rS rSrSrSr\S 5       r\S 5       rS r	S r
S rS rS	 rS
 rSrg)r   i  Tc                B    SS K nSSKJn  U[        l        [        U5      $ )Nr   )
ExecStatus)r   r  r  r  r  r  )r   r   r  s      r(   r   #PGDialectAsync_psycopg.import_dbapi  s    )8B!5 ))r'   c                    UR                   R                  SS5      n[        R                  " U5      (       a  [        R
                  $ [        R                  $ )Nr  F)r  getr   r  r   FallbackAsyncAdaptedQueuePoolAsyncAdaptedQueuePool)r   r   r  s      r(   get_pool_class%PGDialectAsync_psycopg.get_pool_class  s>    '7?;;~&&555---r'   c                |    SSK Jn  UR                  nUR                  UR	                  UR
                  U5      5      $ r   )r   r   r   r  r   r   )r5   r   r   r   adapteds        r(   r   'PGDialectAsync_psycopg._type_info_fetch  s0    *''~~hnnW-F-FMNNr'   c                H    UR                  U5        UR                  U5        g r1   )r  r3  r%  s       r(   r&  *PGDialectAsync_psycopg._do_isolation_level  s    !!*-&&7r'   c                &    UR                  U5        g r1   r  r8  s      r(   rV  %PGDialectAsync_psycopg._do_autocommit      !!%(r'   c                &    UR                  U5        g r1   )r  r8  s      r(   r9  #PGDialectAsync_psycopg.set_readonly  s      'r'   c                &    UR                  U5        g r1   )r  r8  s      r(   r  %PGDialectAsync_psycopg.set_deferrable  r)  r'   c                    UR                   $ r1   r  r<  s     r(   get_driver_connection,PGDialectAsync_psycopg.get_driver_connection
  s    %%%r'   r   N)r!   r"   r#   r$   is_asyncrp  r  r   r   r   r&  rV  r9  r  r/  r&   r   r'   r(   r   r     sR    H#* * . .O8)()&r'   r   )T__doc__
__future__r   collectionsr   loggingr   typingr   r    r   _psycopg_commonr	   r
   baser   r   r   r   r  r   r   r   r   r   r   r   enginer   sqlr   util.concurrencyr   r   r   r   r   	getLoggerr   ry  r   r+   r.   rA   rz  rI   r{  rP   rT   rY   r~  r\   r}  r_   r  rb   r  re   r  rh   NullTyperk   r  rn   Booleanrq   AbstractSingleRangeImplrt   AbstractMultiRangeImplr   r   r   r   r   r   r  r  r  r  r  r   r6   dialect_asyncr   r'   r(   <module>rC     s)  Ul #   	     6 ?   &        '  . *'			;	< 9 d u (--88 (--88 	l 	( 8$$ hmm hmm !! h++ (## H'' !! F22 6*66 *Z	!C 		 		#7 	KO1 Od= =@#< 41<$5 1<h*,I *
 .*&. *&Z &r'   