ó
    øÞ j€¥  ã                  óŽ  • S SK Jr  S SKrS SKJrJr  S SKrS SKrS SKrS SK	r	S SK
Jr  S SKJrJrJ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  \R,                  " \5      r " S S\5      r " S S\R6                  \SS9r " S S5      r " S S5      r " S S5      rSSSSSSSSSS\R@                  \RB                  S.S jjr"g)é    )ÚannotationsN)Ú	AwaitableÚCallable)ÚTracebackType)ÚAnyÚOptionalÚTypeé   )Úcompat©Ú
connection)Ú
exceptions)Úprotocolc                  óf   ^ • \ rS rSrSS.         SU 4S jjjr\      SS j5       rSrU =r$ )	ÚPoolConnectionProxyMetaé   F)Úwrapc               óâ  >• U(       aØ  [        [        R                  5       H˜  nUR                  S5      (       d  XS;   a  M   [	        [        R                  U5      n[
        R                  " U5      (       d  MW  [
        R                  " U5      nU R                  XW5      n[        R                  " X†5      nXƒU'   Mš     SU;  a  [        R                  R                  US'   [        T	U ]5  XX#5      $ )NÚ_Ú__doc__)Údirr   Ú
ConnectionÚ
startswithÚgetattrÚinspectÚ
isfunctionÚiscoroutinefunctionÚ_wrap_connection_methodÚ	functoolsÚupdate_wrapperr   ÚsuperÚ__new__)
ÚmclsÚnameÚbasesÚdctr   ÚattrnameÚmethÚiscoroutineÚwrapperÚ	__class__s
            €ÚF/var/www/html/gaurav/venv/lib/python3.13/site-packages/asyncpg/pool.pyr"   ÚPoolConnectionProxyMeta.__new__   sÂ   ø€ ö Ü¤
× 5Ñ 5Ö6�Ø×&Ñ& s×+Ñ+¨x«Ùäœz×4Ñ4°hÓ?�Ü×)Ò)¨$×/Ñ/Ùä%×9Ò9¸$Ó?�Ø×6Ñ6°xÓM�Ü#×2Ò2°7ÓA�Ø '�H“ñ 7ð  Ó#Ü!+×!6Ñ!6×!>Ñ!>��I‘ä‰w‰˜t¨5Ó6Ð6ó    c                óR   ^ • SU 4S jjnU(       a  [         R                  " U5        U$ )Nc                óÔ   >• U R                   c%  [        R                  " SR                  T5      5      e[	        U R                   R
                  T5      nU" U R                   /UQ70 UD6$ )NzJcannot call Connection.{}(): connection has been released back to the pool)Ú_conr   ÚInterfaceErrorÚformatr   r+   )ÚselfÚargsÚkwargsr(   Ú	meth_names       €r,   Úcall_con_methodÚHPoolConnectionProxyMeta._wrap_connection_method.<locals>.call_con_method=   se   ø€ à�y‰yÑ Ü ×/Ò/ðDßDJÁFØ!óE#ó$ð $ô
 ˜4Ÿ9™9×.Ñ.°	Ó:ˆDÙ˜Ÿ	™	Ð3 DÒ3¨FÑ3Ð3r.   )r4   r   r5   r   r6   r   Úreturnr   )r   Úmarkcoroutinefunction)r7   r)   r8   s   `  r,   r   Ú/PoolConnectionProxyMeta._wrap_connection_method9   s!   ø€ ÷		4ö Ü×(Ò(¨Ô9àÐr.   © )
r$   Ústrr%   ztuple[Type[Any], ...]r&   zdict[str, Any]r   Úboolr:   r   )r7   r>   r)   r?   r:   zCallable[..., Any])	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r"   Ústaticmethodr   Ú__static_attributes__Ú__classcell__)r+   s   @r,   r   r      sn   ø† ð ñ7àð7ð %ð7ð ð	7ð ð7ð 
!÷7ð 7ð6 ðØðØ%)ðà	óó ör.   r   c                  óL   • \ rS rSrSr      SS jrS	S jrS
S jrSS jrSr	g)ÚPoolConnectionProxyéN   )r1   Ú_holderc                ó>   • X l         Xl        UR                  U 5        g ©N)r1   rJ   Ú
_set_proxy)r4   ÚholderÚcons      r,   Ú__init__ÚPoolConnectionProxy.__init__T   s   € ð Œ	ØŒØ�‰�tÕr.   c                ó.   • [        U R                  U5      $ rL   )r   r1   )r4   Úattrs     r,   Ú__getattr__ÚPoolConnectionProxy.__getattr__[   s   € ä�t—y‘y $Ó'Ð'r.   c                ój   • U R                   c  g U R                   S sol         UR                  S 5        U$ rL   )r1   rM   )r4   rO   s     r,   Ú_detachÚPoolConnectionProxy._detach_   s/   € Ø�9‰9ÑØàŸ™ DˆˆŒYØ�‰�tÔØˆ
r.   c                óæ   • U R                   c-  SR                  U R                  R                  [	        U 5      S9$ SR                  U R                  R                  U R                   [	        U 5      S9$ )Nz <{classname} [released] {id:#x}>)Ú	classnameÚidz<{classname} {con!r} {id:#x}>)rZ   rO   r[   )r1   r3   r+   r@   r[   ©r4   s    r,   Ú__repr__ÚPoolConnectionProxy.__repr__g   sn   € Ø�9‰9ÑØ5×<Ñ<ØŸ.™.×1Ñ1´b¸³hð =ð @ð @ð 3×9Ñ9ØŸ.™.×1Ñ1°t·y±yÄRÈÃXð :ð Oð Or.   N)rN   ÚPoolConnectionHolderrO   zconnection.Connectionr:   ÚNone)rS   r>   r:   r   )r:   zOptional[connection.Connection])r:   r>   )
r@   rA   rB   rC   Ú	__slots__rP   rT   rW   r]   rE   r=   r.   r,   rH   rH   N   s6   † ð $€IðØ*ðØ1Fðà	ôô(ô÷Or.   rH   T)Ú	metaclassr   c                  ó¸   • \ rS rSrSr          SS jrSS jrSS jrSS jrSS jr	SS jr
SS	 jrSS
 jrSS jrSS jrSS jrSS jrSS jrSS jrSrg)r_   ép   )r1   Ú_poolÚ_loopÚ_proxyÚ_max_queriesÚ_setupÚ_max_inactive_timeÚ_in_useÚ_inactive_callbackÚ_timeoutÚ_generationc               óˆ   • Xl         S U l        S U l        X l        X@l        X0l        S U l        S U l        S U l        S U l	        g rL   )
re   r1   rg   rh   rj   ri   rl   rk   rm   rn   )r4   ÚpoolÚmax_queriesÚsetupÚmax_inactive_times        r,   rP   ÚPoolConnectionHolder.__init__x   sF   € ð Œ
Ø59ˆŒ	Ø59ˆŒà'ÔØ"3ÔØŒØ6:ˆÔØ15ˆŒØ)-ˆŒØ*.ˆÕr.   c                ój   • U R                   S L=(       a    U R                   R                  5       (       + $ rL   )r1   Ú	is_closedr\   s    r,   Úis_connectedÚ!PoolConnectionHolder.is_connected�   s&   € Ø�y‰y Ð$×B¨T¯Y©Y×-@Ñ-@Ó-BÔ)BÐBr.   c                ó$   • U R                   (       + $ rL   ©rk   r\   s    r,   Úis_idleÚPoolConnectionHolder.is_idle�   s   € Ø—<‘<ÔÐr.   c              ƒ  ó  #   • U R                   b  [        R                  " S5      eU R                  R	                  5       I S h  v•N U l         U R                  R
                  U l        U R                  5         U R                  5         g  NE7f)NzMPoolConnectionHolder.connect() called while another connection already exists)r1   r   ÚInternalClientErrorre   Ú_get_new_connectionrn   Ú_maybe_cancel_inactive_callbackÚ_setup_inactive_callbackr\   s    r,   ÚconnectÚPoolConnectionHolder.connect“   so   é € Ø�9‰9Ñ Ü×0Ò0ð,ó-ð -ð Ÿ*™*×8Ñ8Ó:×:ˆŒ	ØŸ:™:×1Ñ1ˆÔØ×,Ñ,Ô.Ø×%Ñ%Õ'ñ ;ùs   ‚ABÁB	ÁABc              ƒ  óZ  #   • U R                   b  U R                   R                  5       (       a   S U l         U R                  5       I S h  v•N   O‰U R                  U R                  R                  :w  ae  U R                  R
                  R                  U R                   R                  U R                  S95        S U l         U R                  5       I S h  v•N   U R                  5         [        X R                   5      =U l        nU R                  b   U R                  U5      I S h  v•N   U R                  R
                  R!                  5       U l        U$  GN N… N4! [        [        R                  4 a1  n U R                   R                  5       I S h  v•N    Ue! Ue= fS nAff = f7f)N©Útimeout)r1   rv   r‚   rn   re   rf   Úcreate_taskÚcloserm   r€   rH   rg   ri   Ú	ExceptionÚasyncioÚCancelledErrorÚcreate_futurerk   )r4   ÚproxyÚexs      r,   ÚacquireÚPoolConnectionHolder.acquirež   sE  é € Ø�9‰9Ñ §	¡	× 3Ñ 3× 5Ñ 5ØˆDŒIØ—,‘,“.× Ñ à×Ñ §¡×!7Ñ!7Ó7à�J‰J×Ñ×(Ñ(Ø—	‘	—‘¨¯©�Ð6ô8àˆDŒIØ—,‘,“.× Ð à×,Ñ,Ô.ä1°$¿	¹	ÓBÐBˆŒ�eà�;‰;Ñ"ðØ—k‘k %Ó(×(Ð(ð —z‘z×'Ñ'×5Ñ5Ó7ˆŒàˆòA !ñ !ñ )øÜœw×5Ñ5Ð6ó ð
ð
 Ÿ)™)Ÿ/™/Ó+×+Ñ+à�Hø˜"�Hþðüsy   ‚AF+Á	EÁ
B	F+ÃEÃ=F+ÄE Ä&EÄ'E Ä+,F+ÅF+ÅE ÅF(Å8FÆFÆFÆF#ÆF Æ F#Æ#F(Æ(F+c              ƒ  ó   #   • U R                   c  [        R                  " S5      eU R                  R	                  5       (       a  g S U l        U R                  R                  R                  U R                  :¼  a"  U R                  R                  US9I S h  v•N   g U R                  U R                  R                  :w  a"  U R                  R                  US9I S h  v•N   g  UnU R                  R                  R                  5       (       at  [        R                  " 5       n[        R                   " U R                  R                  R#                  5       U5      I S h  v•N   Ub  U[        R                  " 5       U-
  -  nU R                  R$                  b  [        R&                  " U5       IS h  v•N   U R                  R%                  5       I S h  v•N   U R                  R%                  U R                  5      I S h  v•N   S S S 5      IS h  v•N   O"U R                  R)                  US9I S h  v•N    U R3                  5         U R5                  5         g  GNÅ GN‚ GN N° N� Ne NW! , IS h  v•N  (       d  f       NI= f NQ! [*        [,        R.                  4 a(  n U R                  R1                  5         Ue! Ue= fS nAff = f7f)NzAPoolConnectionHolder.release() called on a free connection holderr…   )rk   r   r~   r1   rv   rm   Ú	_protocolÚqueries_countrh   rˆ   rn   re   Ú_is_cancellingÚtimeÚ	monotonicr   Úwait_forÚ_wait_for_cancellationÚ_resetr†   Úresetr‰   rŠ   r‹   Ú	terminateÚ_releaser�   )r4   r†   ÚbudgetÚstartedrŽ   s        r,   ÚreleaseÚPoolConnectionHolder.releaseÃ   s/  é € Ø�<‰<ÑÜ×0Ò0ð+ó,ð ,ð �9‰9×Ñ× Ñ ð àˆŒà�9‰9×Ñ×,Ñ,°×0AÑ0AÓAð —)‘)—/‘/¨'�/Ð2×2Ð2Øà×Ñ˜tŸz™z×5Ñ5Ó5ð —)‘)—/‘/¨'�/Ð2×2Ð2Øð	ØˆFà�y‰y×"Ñ"×1Ñ1×3Ñ3ô Ÿ.š.Ó*�Ü—o’oØ—I‘I×'Ñ'×>Ñ>Ó@Øó÷ ð ð Ñ%ØœdŸnšnÓ.°Ñ8Ñ8�Fà�z‰z× Ñ Ñ,Ü!Ÿ>š>¨&×1Õ1ØŸ)™)×*Ñ*Ó,×,Ð,ØŸ*™*×+Ñ+¨D¯I©IÓ6×6Ð6÷ 2×1Ð1ð —i‘i—o‘o¨f�oÐ5×5Ñ5ð 	�‰Œð 	×%Ñ%Õ'ò[ 3ò 3òñ 2Ù,Ù6÷ 2×1×1Ð1úñ 6øÜœ7×1Ñ1Ð2ó 		ðð —	‘	×#Ñ#Ô%à�ø�b�þð		üsÿ   ‚BKÂIÂAKÃIÃKÃ$A<J	 Å I"Å!AJ	 Æ4I%Æ5J	 Æ8I-ÇI'Ç,I-ÈI)ÈI-ÈJ	 ÈI+ÈJ	 ÈKÈJ	 È5JÈ6J	 È:#KÉKÉ"J	 É%J	 É'I-É)I-É+J	 É-JÉ3I6É4JÊ J	 ÊKÊJ	 Ê	KÊ$K Ê>KË KËKËKËKc              ƒ  óT   #   • U R                   c  g U R                   I S h  v•N   g  N7frL   rz   r\   s    r,   Úwait_until_releasedÚ(PoolConnectionHolder.wait_until_released  s   é € Ø�<‰<ÑØà—,‘,×Óùs   ‚( &¡(c              ƒ  óp   #   • U R                   b#  U R                   R                  5       I S h  v•N   g g  N7frL   )r1   rˆ   r\   s    r,   rˆ   ÚPoolConnectionHolder.close  s/   é € Ø�9‰9Ñ ð —)‘)—/‘/Ó#×#Ñ#ð !ñ $ùs   ‚+6­4®6c                óT   • U R                   b  U R                   R                  5         g g rL   )r1   r›   r\   s    r,   r›   ÚPoolConnectionHolder.terminate  s#   € Ø�9‰9Ñ ð �I‰I×ÑÕ!ð !r.   c                óì   • U R                   b  [        R                  " S5      eU R                  (       a@  U R                  R
                  R                  U R                  U R                  5      U l         g g )Nz/pool connection inactivity timer already exists)rl   r   r~   rj   re   rf   Ú
call_laterÚ_deactivate_inactive_connectionr\   s    r,   r�   Ú-PoolConnectionHolder._setup_inactive_callback  se   € Ø×"Ñ"Ñ.Ü×0Ò0ØAóCð Cð ×"×"Ø&*§j¡j×&6Ñ&6×&AÑ&AØ×'Ñ'¨×)MÑ)Mó'OˆDÕ#ð #r.   c                ób   • U R                   b"  U R                   R                  5         S U l         g g rL   )rl   Úcancelr\   s    r,   r€   Ú4PoolConnectionHolder._maybe_cancel_inactive_callback  s-   € Ø×"Ñ"Ñ.Ø×#Ñ#×*Ñ*Ô,Ø&*ˆDÕ#ð /r.   c                óº   • U R                   b  [        R                  " S5      eU R                  b+  U R                  R	                  5         U R                  5         g g )Nz/attempting to deactivate an acquired connection)rk   r   r~   r1   r›   Ú_release_on_closer\   s    r,   rª   Ú4PoolConnectionHolder._deactivate_inactive_connection"  sU   € Ø�<‰<Ñ#Ü×0Ò0ØAóCð Cð �9‰9Ñ ð �I‰I×ÑÔ!ð ×"Ñ"Õ$ð !r.   c                óR   • U R                  5         U R                  5         S U l        g rL   )r€   rœ   r1   r\   s    r,   r°   Ú&PoolConnectionHolder._release_on_close0  s   € Ø×,Ñ,Ô.Ø�‰ŒØˆ�	r.   c                óH  • U R                   c  gU R                   R                  5       (       d  U R                   R                  S5        SU l         U R                  b!  U R                  R	                  5         SU l        U R
                  R                  R                  U 5        g)zRelease this connection holder.N)rk   ÚdoneÚ
set_resultrg   rW   re   Ú_queueÚ
put_nowaitr\   s    r,   rœ   ÚPoolConnectionHolder._release5  sx   € à�<‰<Ñàà�|‰|× Ñ ×"Ñ"Ø�L‰L×#Ñ# DÔ)ØˆŒð �;‰;Ñ"Ø�K‰K×ÑÔ!ØˆDŒKð 	�
‰
×Ñ×$Ñ$ TÕ*r.   )
r1   rn   rk   rl   rj   rh   re   rg   ri   rm   N)
rp   z'Pool'rq   Úfloatrr   z:Optional[Callable[[PoolConnectionProxy], Awaitable[None]]]rs   rº   r:   r`   )r:   r?   )r:   r`   )r:   rH   )r†   úOptional[float]r:   r`   )r@   rA   rB   rC   ra   rP   rw   r{   r‚   r�   rŸ   r¢   rˆ   r›   r�   r€   rª   r°   rœ   rE   r=   r.   r,   r_   r_   p   s„   † ð €Ið/àð/ð ð	/ð
 Jð/ð !ð/ð 
ô/ô*Cô ô	(ô#ôJ=(ô~ô$ô"ôOô+ô
%ô÷
+r.   r_   c                  óÆ  • \ rS rSrSrSrSSSSS.S jrS rS rS	 r	S
 r
S rS rS rS0S jrS rSS.     S1S jjrSS.   S2S jjrSSS. S3S jjrSSS.S jrSSS.S jrSSS.S jrSSSSSSSSSSSSS.S jrSSSSSSSSSSS.
S jrSSSSSSSSSSSSSSSSS.S jrSSSSS .S! jrSS.S" jrS# rSS.S$ jrS% rS& rS' rS( r S) r!S* r"S+ r#S, r$S- r%S. r&S/r'g)4ÚPooliI  au  A connection pool.

Connection pool can be used to manage a set of connections to the database.
Connections are first acquired from the pool, then used, and then released
back to the pool.  Once a connection is released, it's reset to close all
open cursors and other resources *except* prepared statements.

Pools are created by calling :func:`~asyncpg.pool.create_pool`.
)r·   rf   Ú_minsizeÚ_maxsizeÚ_initÚ_connectr™   Ú_connect_argsÚ_connect_kwargsÚ_holdersÚ_initializedÚ_initializingÚ_closingÚ_closedÚ_connection_classÚ_record_classrn   ri   rh   Ú!_max_inactive_connection_lifetimeN)r‚   rr   Úinitrš   c               ó:  • [        U5      S:”  a  [        R                  " S[        SS9  U	c  [        R
                  " 5       n	X�l        US::  a  [        S5      eUS:  a  [        S5      eX:”  a  [        S5      eUS::  a  [        S	5      eUS:  a  [        S
5      e[        U
[        R                  5      (       d  [        SR                  U
5      5      e[        U[        R                  5      (       d  [        SR                  U5      5      eXl        X l        / U l        SU l        SU l        S U l        X l        X°l        SU l        SU l        SU l        Ub  UO[        R4                  U l        XÀl        XÐl        X`l        Xpl        X€l         X0l!        UU l"        g )Nr
   z°Passing multiple positional arguments to asyncpg.Pool constructor is deprecated and will be removed in asyncpg 0.17.0.  The non-deprecated form is asyncpg.Pool(<dsn>, **kwargs)é   )Ú
stacklevelr   z,max_size is expected to be greater than zeroz3min_size is expected to be greater or equal to zeroz!min_size is greater than max_sizez/max_queries is expected to be greater than zerozKmax_inactive_connection_lifetime is expected to be greater or equal to zerozMconnection_class is expected to be a subclass of asyncpg.Connection, got {!r}zErecord_class is expected to be a subclass of asyncpg.Record, got {!r}F)#ÚlenÚwarningsÚwarnÚDeprecationWarningrŠ   Úget_event_looprf   Ú
ValueErrorÚ
issubclassr   r   Ú	TypeErrorr3   r   ÚRecordr¾   r¿   rÄ   rÅ   rÆ   r·   rÉ   rÊ   rÇ   rÈ   rn   r‚   rÁ   rÂ   rÃ   ri   rÀ   r™   rh   rË   )r4   Úmin_sizeÚmax_sizerq   Ú max_inactive_connection_lifetimer‚   rr   rÌ   rš   ÚloopÚconnection_classÚrecord_classÚconnect_argsÚconnect_kwargss                 r,   rP   ÚPool.__init__\  s£  € ô ˆ|Ó˜qÓ Ü�MŠMð0ô #¨qò2ð ‰<Ü×)Ò)Ó+ˆDØŒ
à�q‹=ÜÐKÓLÐLà�a‹<ÜØEóGð Gð ÓÜÐ@ÓAÐAà˜!ÓÜÐNÓOÐOà+¨aÓ/Üð#ó$ð $ô Ð*¬J×,AÑ,A×BÑBÜð/ß/5©vÐ6FÓ/GóIð Iô ˜,¬¯©×8Ñ8Üð+ß+1©6°,Ó+?óAð Að !ŒØ ŒàˆŒØ!ˆÔØ"ˆÔØˆŒà!1ÔØ)ÔàˆŒØˆŒØˆÔà#*Ñ#6™¼J×<NÑ<NˆŒØ)ÔØ-ÔàŒØŒ
ØŒà'Ôà,ð 	Õ.r.   c              ƒ  óV  #   • U R                   (       a  U $ U R                  (       a  [        R                  " S5      eU R                  (       a  [        R                  " S5      eSU l         U R                  5       I S h  v•N   U SU l        SU l         $  N! SU l        SU l         f = f7f)Nz)pool is being initialized in another taskúpool is closedTF)rÅ   rÆ   r   r2   rÈ   Ú_initializer\   s    r,   Ú_async__init__ÚPool._async__init__­  s•   é € Ø××ØˆKØ××Ü×+Ò+Ø;ó=ð =à�<�<Ü×+Ò+Ð,<Ó=Ð=Ø!ˆÔð	%Ø×"Ñ"Ó$×$Ð$Øà!&ˆDÔØ $ˆDÕñ	 %øð "'ˆDÔØ $ˆDÕüs0   ‚A)B)Á,B Á?BÂ B ÂB)ÂB ÂB&Â&B)c              ƒ  óÚ  #   • [         R                  " U R                  S9U l        [	        U R                  5       Hc  n[        U U R                  U R                  U R                  S9nU R                  R                  U5        U R                  R                  U5        Me     U R                  (       a³  U R                  S   nUR                  5       I S h  v•N   U R                  S:”  a{  / n[        [        U R                  S S 5      5       H8  u  pRXPR                  S-
  :¼  a    O#UR                  UR                  5       5        M:     [         R                   " U6 I S h  v•N   g g g  N‘ N	7f)N)Úmaxsize)rq   rs   rr   éÿÿÿÿr
   )rŠ   Ú	LifoQueuer¿   r·   Úranger_   rh   rË   ri   rÄ   Úappendr¸   r¾   r‚   Ú	enumerateÚreversedÚgather)r4   r   ÚchÚfirst_chÚconnect_tasksÚis         r,   rä   ÚPool._initialize½  s&  é € Ü×'Ò'°·±Ñ>ˆŒÜ�t—}‘}Ö%ˆAÜ%ØØ ×-Ñ-Ø"&×"HÑ"HØ—k‘kñ	#ˆBð �M‰M× Ñ  Ô$Ø�K‰K×"Ñ" 2Ö&ñ &ð �=�=ð —}‘} RÑ(ˆHØ×"Ñ"Ó$×$Ð$à�}‰}˜qÓ Ø "�Ü&¤x°·±¸c¸rÐ0BÓ'CÖD‘E�AàŸM™M¨AÑ-Ó-ÙØ!×(Ñ(¨¯©«Ö6ñ	 Eô —n’n mÐ4×4Ñ4ð !ð ñ %ñ 5ùs%   ‚CE+ÃE'ÃB	E+ÅE)Å E+Å)E+c                ó@   • U R                   =(       d    U R                  $ )zOReturn ``True`` if the pool is closing or is closed.

.. versionadded:: 0.28.0
)rÈ   rÇ   r\   s    r,   Ú
is_closingÚPool.is_closingÞ  s   € ð
 �|‰|×,˜tŸ}™}Ð,r.   c                ó:   • [        S U R                   5       5      $ )zQReturn the current number of connections in this pool.

.. versionadded:: 0.25.0
c              3  ó>   #   • U H  oR                  5       v •  M     g 7frL   )rw   ©Ú.0Úhs     r,   Ú	<genexpr>Ú Pool.get_size.<locals>.<genexpr>ê  s   é € Ð;©]¨—>‘>×#Ð#ª]ùs   ‚©ÚsumrÄ   r\   s    r,   Úget_sizeÚPool.get_sizeå  s   € ô
 Ñ;¨T¯]ª]Ó;Ó;Ð;r.   c                ó   • U R                   $ )zQReturn the minimum number of connections in this pool.

.. versionadded:: 0.25.0
)r¾   r\   s    r,   Úget_min_sizeÚPool.get_min_sizeì  ó   € ð
 �}‰}Ðr.   c                ó   • U R                   $ )zYReturn the maximum allowed number of connections in this pool.

.. versionadded:: 0.25.0
)r¿   r\   s    r,   Úget_max_sizeÚPool.get_max_sizeó  r  r.   c                ó:   • [        S U R                   5       5      $ )zVReturn the current number of idle connections in this pool.

.. versionadded:: 0.25.0
c              3  ól   #   • U H+  oR                  5       =(       a    UR                  5       v •  M-     g 7frL   )rw   r{   rú   s     r,   rý   Ú%Pool.get_idle_size.<locals>.<genexpr>ÿ  s#   é € ÐK¹]¸—>‘>Ó#×3¨¯	©	«Ô3º]ùs   ‚24rÿ   r\   s    r,   Úget_idle_sizeÚPool.get_idle_sizeú  s   € ô
 ÑK¸T¿]º]ÓKÓKÐKr.   c                ó    • U/U l         X l        g)aZ  Set the new connection arguments for this pool.

The new connection arguments will be used for all subsequent
new connection attempts.  Existing connections will remain until
they expire. Use :meth:`Pool.expire_connections()
<asyncpg.pool.Pool.expire_connections>` to expedite the connection
expiry.

:param str dsn:
    Connection arguments specified using as a single string in
    the following format:
    ``postgres://user:pass@host:port/database?option=value``.

:param \*\*connect_kwargs:
    Keyword arguments for the :func:`~asyncpg.connection.connect`
    function.

.. versionadded:: 0.16.0
N)rÂ   rÃ   )r4   Údsnrà   s      r,   Úset_connect_argsÚPool.set_connect_args  s   € ð* "˜UˆÔØ-Õr.   c              ƒ  óÒ  #   • U R                   " U R                  U R                  U R                  U R                  S.U R
                  D6I S h  v•N n[        XR                  5      (       d‡  U R                  nUR                   SUR                   3n[        U5      nUR                  S:X  a  UR                  nOUR                   SUR                   3n[        R                  " SU SU S35      eU R                  b   U R                  U5      I S h  v•N   U$ U$  NÐ N
! [        [        R                  4 a'  n UR!                  5       I S h  v•N    Ue! Ue= fS nAff = f7f)N)rÜ   rÝ   rÞ   Ú.Úbuiltinsz9expected pool connect callback to return an instance of 'z', got 'Ú')rÁ   rÂ   rf   rÉ   rÊ   rÃ   Ú
isinstancerA   r@   Útyper   r2   rÀ   r‰   rŠ   r‹   rˆ   )r4   rO   ÚgoodÚgood_nÚbadÚbad_nrŽ   s          r,   r   ÚPool._get_new_connection  sT  é € Ø—M’MØ×ÑØ—‘Ø!×3Ñ3Ø×+Ñ+ñ	
ð
 ×"Ñ"ñ
÷ 
ˆô ˜#×5Ñ5×6Ñ6Ø×)Ñ)ˆDØŸ™Ð(¨¨$¯-©-¨Ð9ˆFÜ�s“)ˆCØ�~‰~ Ó+ØŸ™‘àŸ>™>Ð*¨!¨C¯L©L¨>Ð:�Ü×+Ò+ðØ�8˜<¨ w¨að1óð ð
 �:‰:Ñ!ðØ—j‘j “o×%Ð%ð ˆ
ˆsˆ
ñK
ñ, &øÜœw×5Ñ5Ð6ó ð
ð
 Ÿ)™)›+×%Ñ%à�Hø˜"�Hþðüsg   ‚AE'ÁDÁB2E'ÄD# ÄD!ÄD# ÄE'Ä!D# Ä#E$Ä>EÅEÅEÅEÅEÅEÅE$Å$E'r…   c             ‡  óÚ   #   • U R                  5        ISh  v•N nUR                  " U/UQ7SU06I Sh  v•N sSSS5      ISh  v•N   $  N3 N N	! , ISh  v•N  (       d  f       g= f7f)zîExecute an SQL command (or commands).

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.execute() <asyncpg.connection.Connection.execute>`.

.. versionadded:: 0.10.0
Nr†   )r�   Úexecute)r4   Úqueryr†   r5   rO   s        r,   r  ÚPool.executeA  sD   é € ð —<‘<—>”> SØŸš UÐC¨TÒC¸7ÑC×C÷ "—>“>ÙC÷ "—>—>�>üóS   ‚A+—A˜A+›AµA¶A¹A+ÁAÁA+ÁAÁA+ÁA(ÁAÁA(Á$A+c             ƒ  óÎ   #   • U R                  5        ISh  v•N nUR                  XUS9I Sh  v•N sSSS5      ISh  v•N   $  N- N N	! , ISh  v•N  (       d  f       g= f7f)a  Execute an SQL *command* for each sequence of arguments in *args*.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.executemany()
<asyncpg.connection.Connection.executemany>`.

.. versionadded:: 0.10.0
Nr…   )r�   Úexecutemany)r4   Úcommandr5   r†   rO   s        r,   r$  ÚPool.executemanyR  s>   é € ð  —<‘<—>”> SØŸ™¨À˜ÐH×H÷ "—>“>ÙH÷ "—>—>�>üóR   ‚A%—A˜A%›A¯A°A³A%¿A	Á A%ÁAÁ	A%ÁA"ÁAÁA"ÁA%©r†   rÞ   c             ‡  óÜ   #   • U R                  5        ISh  v•N nUR                  " U/UQ7UUS.6I Sh  v•N sSSS5      ISh  v•N   $  N4 N N	! , ISh  v•N  (       d  f       g= f7f)a  Run a query and return the results as a list of :class:`Record`.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.fetch() <asyncpg.connection.Connection.fetch>`.

.. versionadded:: 0.10.0
Nr(  )r�   Úfetch©r4   r   r†   rÞ   r5   rO   s         r,   r*  Ú
Pool.fetche  sV   é € ð —<‘<—>”> SØŸšØðàñð  Ø)ò	÷ ÷ "—>“>ñ÷ "—>—>�>üóS   ‚A,—A˜A,›A¶A·AºA,ÁAÁA,ÁAÁA,ÁA)ÁAÁA)Á%A,r   ©Úcolumnr†   c             ‡  óÚ   #   • U R                  5        ISh  v•N nUR                  " U/UQ7X#S.6I Sh  v•N sSSS5      ISh  v•N   $  N3 N N	! , ISh  v•N  (       d  f       g= f7f)zûRun a query and return a value in the first row.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.fetchval()
<asyncpg.connection.Connection.fetchval>`.

.. versionadded:: 0.10.0
Nr.  )r�   Úfetchval)r4   r   r/  r†   r5   rO   s         r,   r1  ÚPool.fetchval|  sQ   é € ð —<‘<—>”> SØŸšØð>Øñ>Ø%+ò>÷ >÷ "—>“>ñ>÷ "—>—>�>ür"  c             ‡  óÜ   #   • U R                  5        ISh  v•N nUR                  " U/UQ7UUS.6I Sh  v•N sSSS5      ISh  v•N   $  N4 N N	! , ISh  v•N  (       d  f       g= f7f)zðRun a query and return the first row.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.fetchrow() <asyncpg.connection.Connection.fetchrow>`.

.. versionadded:: 0.10.0
Nr(  )r�   Úfetchrowr+  s         r,   r4  ÚPool.fetchrowŠ  sV   é € ð —<‘<—>”> SØŸšØðàñð  Ø)ò	÷ ÷ "—>“>ñ÷ "—>—>�>ür-  c             ƒ  óÎ   #   • U R                  5        ISh  v•N nUR                  XX4S9I Sh  v•N sSSS5      ISh  v•N   $  N- N N	! , ISh  v•N  (       d  f       g= f7f)a6  Run a query for each sequence of arguments in *args*
and return the results as a list of :class:`Record`.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.fetchmany()
<asyncpg.connection.Connection.fetchmany>`.

.. versionadded:: 0.30.0
Nr(  )r�   Ú	fetchmany)r4   r   r5   r†   rÞ   rO   s         r,   r7  ÚPool.fetchmany›  sH   é € ð —<‘<—>”> SØŸ™Ø Wð 'ð ÷ ÷ "—>“>ñ÷ "—>—>�>ür'  )ÚcolumnsÚschema_namer†   r3   ÚoidsÚ	delimiterÚnullÚheaderÚquoteÚescapeÚforce_quoteÚencodingc             ƒ  óæ   #   • U R                  5        ISh  v•N nUR                  UUUUUUUUU	U
UUUUS9I Sh  v•N sSSS5      ISh  v•N   $  N9 N N	! , ISh  v•N  (       d  f       g= f7f)a  Copy table contents to a file or file-like object.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.copy_from_table()
<asyncpg.connection.Connection.copy_from_table>`.

.. versionadded:: 0.24.0
N)Úoutputr9  r:  r†   r3   r;  r<  r=  r>  r?  r@  rA  rB  )r�   Úcopy_from_table)r4   Ú
table_namerD  r9  r:  r†   r3   r;  r<  r=  r>  r?  r@  rA  rB  rO   s                   r,   rE  ÚPool.copy_from_table«  so   é € ð6 —<‘<—>”> SØ×,Ñ,ØØØØ'ØØØØ#ØØØØØ'Ø!ð -ð ÷ ÷ "—>“>ñ÷ "—>—>�>üsS   ‚A1—A˜A1› A»A¼A¿A1ÁAÁA1ÁAÁA1ÁA.ÁA ÁA.Á*A1)
r†   r3   r;  r<  r=  r>  r?  r@  rA  rB  c             ‡  óî   #   • U R                  5        ISh  v•N nUR                  " U/UQ7UUUUUUUU	U
UUS.6I Sh  v•N sSSS5      ISh  v•N   $  N= N N	! , ISh  v•N  (       d  f       g= f7f)a  Copy the results of a query to a file or file-like object.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.copy_from_query()
<asyncpg.connection.Connection.copy_from_query>`.

.. versionadded:: 0.24.0
N)rD  r†   r3   r;  r<  r=  r>  r?  r@  rA  rB  )r�   Úcopy_from_query)r4   r   rD  r†   r3   r;  r<  r=  r>  r?  r@  rA  rB  r5   rO   s                  r,   rI  ÚPool.copy_from_queryØ  ss   é € ð2 —<‘<—>”> SØ×,Ò,Øðàñð ØØØØ#ØØØØØ'Ø!ò÷ ÷ "—>“>ñ÷ "—>—>�>üóU   ‚A5—A˜A5›$A¿AÁ AÁA5ÁAÁA5ÁAÁA5ÁA2Á!A$Á"A2Á.A5)r9  r:  r†   r3   r;  Úfreezer<  r=  r>  r?  r@  rA  Úforce_not_nullÚ
force_nullrB  Úwherec             ƒ  óî   #   • U R                  5        ISh  v•N nUR                  UUUUUUUUU	U
UUUUUUUUS9I Sh  v•N sSSS5      ISh  v•N   $  N= N N	! , ISh  v•N  (       d  f       g= f7f)zöCopy data to the specified table.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.copy_to_table()
<asyncpg.connection.Connection.copy_to_table>`.

.. versionadded:: 0.24.0
N)Úsourcer9  r:  r†   r3   r;  rL  r<  r=  r>  r?  r@  rA  rM  rN  rB  rO  )r�   Úcopy_to_table)r4   rF  rQ  r9  r:  r†   r3   r;  rL  r<  r=  r>  r?  r@  rA  rM  rN  rB  rO  rO   s                       r,   rR  ÚPool.copy_to_table  s{   é € ð> —<‘<—>”> SØ×*Ñ*ØØØØ'ØØØØØ#ØØØØØ'Ø-Ø%Ø!Øð% +ð ÷ ÷ "—>“>ñ÷ "—>—>�>ürK  )r9  r:  r†   rO  c          
   ƒ  óÖ   #   • U R                  5        ISh  v•N nUR                  UUUUUUS9I Sh  v•N sSSS5      ISh  v•N   $  N1 N N	! , ISh  v•N  (       d  f       g= f7f)a%  Copy a list of records to the specified table using binary COPY.

Pool performs this operation using one of its connections.  Other than
that, it behaves identically to
:meth:`Connection.copy_records_to_table()
<asyncpg.connection.Connection.copy_records_to_table>`.

.. versionadded:: 0.24.0
N)Úrecordsr9  r:  r†   rO  )r�   Úcopy_records_to_table)r4   rF  rU  r9  r:  r†   rO  rO   s           r,   rV  ÚPool.copy_records_to_table7  sW   é € ð& —<‘<—>”> SØ×2Ñ2ØØØØ'ØØð 3ð ÷ ÷ "—>“>ñ÷ "—>—>�>üsS   ‚A)—A	˜A)›A³A´A·A)ÁAÁA)ÁAÁA)ÁA&ÁAÁA&Á"A)c               ó   • [        X5      $ )aä  Acquire a database connection from the pool.

:param float timeout: A timeout for acquiring a Connection.
:return: An instance of :class:`~asyncpg.connection.Connection`.

Can be used in an ``await`` expression or with an ``async with`` block.

.. code-block:: python

    async with pool.acquire() as con:
        await con.execute(...)

Or:

.. code-block:: python

    con = await pool.acquire()
    try:
        await con.execute(...)
    finally:
        await pool.release(con)
)ÚPoolAcquireContext)r4   r†   s     r,   r�   ÚPool.acquireT  s   € ô. " $Ó0Ð0r.   c              ƒ  óú   ^ ^#   • U U4S jnT R                   (       a  [        R                  " S5      eT R                  5         Tc  U" 5       I S h  v•N $ [        R
                  " U" 5       TS9I S h  v•N $  N& N7f)Nc               “  ó  >#   • TR                   R                  5       I S h  v•N n  U R                  5       I S h  v•N nTU l        U$  N& N! [        [
        R                  4 a    TR                   R                  U 5        e f = f7frL   )r·   Úgetr�   rm   r‰   rŠ   r‹   r¸   )rð   r�   r4   r†   s     €€r,   Ú_acquire_implÚ$Pool._acquire.<locals>._acquire_impln  sp   øé € Ø—{‘{—‘Ó(×(ˆBð	Ø Ÿj™j›l×*�ð &�”Ø�ñ )á*øÜœw×5Ñ5Ð6ó Ø—‘×&Ñ& rÔ*Øðüs5   ƒB¡A¢B§A ºA
»A ¿
BÁ
A Á7BÂBzpool is closingr…   )rÇ   r   r2   Ú_check_initr   r—   )r4   r†   r^  s   `` r,   Ú_acquireÚPool._acquirem  si   ùé € ö	ð �=�=Ü×+Ò+Ð,=Ó>Ð>Ø×ÑÔà‰?Ù&›×(Ð(äŸšÙ“¨ñ2÷ 2ð 2ñ )ñ2ùs$   „AA;ÁA7Á!A;Á2A9Á3A;Á9A;c             ƒ  óª  #   • [        U5      [        Ld  UR                  R                  U La#  [        R
                  " SR                  US95      eUR                  c  gU R                  5         UR                  R                  5         UR                  nUc  UR                  n[        R                  " UR                  U5      5      I Sh  v•N $  N7f)a©  Release a database connection back to the pool.

:param Connection connection:
    A :class:`~asyncpg.connection.Connection` object to release.
:param float timeout:
    A timeout for releasing the connection.  If not specified, defaults
    to the timeout provided in the corresponding call to the
    :meth:`Pool.acquire() <asyncpg.pool.Pool.acquire>` method.

.. versionchanged:: 0.14.0
    Added the *timeout* parameter.
zWPool.release() received invalid connection: {connection!r} is not a member of this poolr   N)r  rH   rJ   re   r   r2   r3   r1   r`  Ú_on_releaserm   rŠ   ÚshieldrŸ   )r4   r   r†   rð   s       r,   rŸ   ÚPool.release…  sº   é € ô �ÓÔ$7Ò7Ø×"Ñ"×(Ñ(°Ò4Ü×+Ò+ð>ß>D¹fØ)ð ?Eð ?+ó,ð ,ð
 �?‰?Ñ"àà×ÑÔð 	�‰×#Ñ#Ô%à×ÑˆØ‰?Ø—k‘kˆGô
 —^’^ B§J¡J¨wÓ$7Ó8×8Ð8Ñ8ùs   ‚C
CÃCÃCc              ƒ  óÆ  #   • U R                   (       a  gU R                  5         SU l        Sn U R                  R	                  SU R
                  5      nU R                   Vs/ sH  o"R                  5       PM     nn[        R                  " U6 I Sh  v•N   U R                   Vs/ sH  o"R                  5       PM     nn[        R                  " U6 I Sh  v•N    Ub  UR                  5         SU l         SU l        gs  snf  Nos  snf  N3! [        [        R                  4 a    U R                  5         e f = f! Ub  UR                  5         SU l         SU l        f = f7f)a2  Attempt to gracefully close all connections in the pool.

Wait until all pool connections are released, close them and
shut down the pool.  If any error (including cancellation) occurs
in ``close()`` the pool will terminate by calling
:meth:`Pool.terminate() <pool.Pool.terminate>`.

It is advisable to use :func:`python:asyncio.wait_for` to set
a timeout.

.. versionchanged:: 0.16.0
    ``close()`` now waits until all pool connections are released
    before closing them and the pool.  Errors raised in ``close()``
    will cause immediate pool termination.
NTé<   F)rÈ   r`  rÇ   rf   r©   Ú_warn_on_long_closerÄ   r¢   rŠ   rï   rˆ   r‰   r‹   r›   r­   )r4   Úwarning_callbackrð   Úrelease_corosÚclose_coross        r,   rˆ   Ú
Pool.close«  s@  é € ð  �<�<ØØ×ÑÔàˆŒàÐð	"Ø#Ÿz™z×4Ñ4Ø�D×,Ñ,ó .Ðð 48·=²=óBÙ3@¨R×&Ñ&Ö(±=ð ð Bä—.’. -Ð0×0Ð0ð &*§]¢]ó4Ù%2˜r—‘–
¡]ð ð 4ä—.’. +Ð.×.Ñ.ð  Ñ+Ø ×'Ñ'Ô)ØˆDŒLØ!ˆD�Mùò!Bá0ùò4á.øäœ7×1Ñ1Ð2ó 	Ø�N‰NÔØð	ûð
  Ñ+Ø ×'Ñ'Ô)ØˆDŒLØ!ˆD�Müsd   ‚,E!¯4D Á#C>Á;D ÂDÂD Â&DÂ>D ÃD
ÃD Ã"E!Ã>D ÄD Ä,D8Ä8D; Ä;#EÅE!c                ó.   • [         R                  S5        g )Nz Pool.close() is taking over 60 seconds to complete. Check if you have any unreleased connections left. Use asyncio.wait_for() to set a timeout for Pool.close().)ÚloggerÚwarningr\   s    r,   ri  ÚPool._warn_on_long_closeØ  s   € Ü�‰ð 'õ 	(r.   c                óœ   • U R                   (       a  gU R                  5         U R                   H  nUR                  5         M     SU l         g)z&Terminate all connections in the pool.NT)rÈ   r`  rÄ   r›   ©r4   rð   s     r,   r›   ÚPool.terminateÞ  s6   € à�<�<ØØ×ÑÔØ—-”-ˆBØ�L‰LŽNñ  àˆ�r.   c              ƒ  ó6   #   • U =R                   S-  sl         g7f)z®Expire all currently open connections.

Cause all currently open connections to get replaced on the
next :meth:`~asyncpg.pool.Pool.acquire()` call.

.. versionadded:: 0.16.0
r
   N)rn   r\   s    r,   Úexpire_connectionsÚPool.expire_connectionsç  s   é € ð 	×Ò˜AÑÖùs   ‚c                óî   • U R                   (       d=  U R                  (       a  [        R                  " S5      e[        R                  " S5      eU R                  (       a  [        R                  " S5      eg )Nzipool is being initialized, but not yet ready: likely there is a race between creating a pool and using itzpool is not initializedrã   )rÅ   rÆ   r   r2   rÈ   r\   s    r,   r`  ÚPool._check_initñ  s^   € Ø× × Ø×!×!Ü ×/Ò/ðó ð  ô ×+Ò+Ð,EÓFÐFØ�<�<Ü×+Ò+Ð,<Ó=Ð=ð r.   c                ó|   • U R                    H,  nUR                  c  M  UR                  R                  5         M.     g rL   )rÄ   r1   Ú_drop_local_statement_cachers  s     r,   Ú_drop_statement_cacheÚPool._drop_statement_cacheü  s*   € à—-”-ˆBØ�w‰wÓ"Ø—‘×3Ñ3Ö5ò  r.   c                ó|   • U R                    H,  nUR                  c  M  UR                  R                  5         M.     g rL   )rÄ   r1   Ú_drop_local_type_cachers  s     r,   Ú_drop_type_cacheÚPool._drop_type_cache  s*   € à—-”-ˆBØ�w‰wÓ"Ø—‘×.Ñ.Ö0ò  r.   c                ó>   • U R                  5       R                  5       $ rL   )rå   Ú	__await__r\   s    r,   rƒ  ÚPool.__await__  s   € Ø×"Ñ"Ó$×.Ñ.Ó0Ð0r.   c              ƒ  óB   #   • U R                  5       I S h  v•N   U $  N7frL   )rå   r\   s    r,   Ú
__aenter__ÚPool.__aenter__  s!   é € Ø×!Ñ!Ó#×#Ð#Øˆñ 	$ùs   ‚–—c              ‡  ó@   #   • U R                  5       I S h  v•N   g  N7frL   )rˆ   )r4   Úexcs     r,   Ú	__aexit__ÚPool.__aexit__  s   é € Ø�j‰j‹l×Óùs   ‚–—)rÈ   rÇ   rÁ   rÂ   rÃ   rÉ   rn   rÄ   rÀ   rÅ   rÆ   rf   rË   rh   r¿   r¾   r·   rÊ   r™   ri   rL   )r   r>   r†   r»   r:   r>   )r%  r>   r†   r»   )r:   Úlist)(r@   rA   rB   rC   r   ra   rP   rå   rä   rö   r  r  r  r  r  r   r  r$  r*  r1  r4  r7  rE  rI  rR  rV  r�   ra  rŸ   rˆ   ri  r›   rv  r`  r|  r€  rƒ  r†  rŠ  rE   r=   r.   r,   r½   r½   I  sÁ  † ñð€Ið ØØØõO-òb%ò 5òB-ò<òòòLô.ò0&ðX "&ñ	DàðDð !ð	Dð
 
õDð, "&ñIàðIð
 !õIð. Øñð 
õð. 34¸Tõ >ð 48Àdõ ð" 7;Èõ ð* ØØØØØØØØØØØõ!+ðd ØØØØØØØØØõ(ð^ ØØØØØØØØØØØØØØØõ)3ðt ØØØõð: "&õ 1ò22ð0 48õ $9òL+"òZ(òòò	>ò6ò1ò1òõr.   r½   c                  óP   • \ rS rSrSrS	S jrS r   S
       SS jjrS rSr	g)rY  i  )r†   r   rµ   rp   c                ó8   • Xl         X l        S U l        SU l        g )NF)rp   r†   r   rµ   )r4   rp   r†   s      r,   rP   ÚPoolAcquireContext.__init__  s   € ØŒ	ØŒØˆŒØˆ�	r.   c              ƒ  óò   #   • U R                   c  U R                  (       a  [        R                  " S5      eU R                  R                  U R                  5      I S h  v•N U l         U R                   $  N7f)Nz a connection is already acquired)r   rµ   r   r2   rp   ra  r†   r\   s    r,   r†  ÚPoolAcquireContext.__aenter__  sT   é € Ø�?‰?Ñ&¨$¯)¯)Ü×+Ò+Ð,NÓOÐOØ $§	¡	× 2Ñ 2°4·<±<Ó @×@ˆŒØ�‰Ðñ Aùs   ‚AA7ÁA5Á A7Nc              ƒ  óŠ   #   • SU l         U R                  nS U l        U R                  R                  U5      I S h  v•N   g  N7f©NT)rµ   r   rp   rŸ   )r4   Úexc_typeÚexc_valÚexc_tbrO   s        r,   rŠ  ÚPoolAcquireContext.__aexit__#  s6   é € ð ˆŒ	Ø�o‰oˆØˆŒØ�i‰i×Ñ Ó$×$Ó$ùs   ‚9A»A¼Ac                óv   • SU l         U R                  R                  U R                  5      R	                  5       $ r“  )rµ   rp   ra  r†   rƒ  r\   s    r,   rƒ  ÚPoolAcquireContext.__await__.  s+   € ØˆŒ	Ø�y‰y×!Ñ! $§,¡,Ó/×9Ñ9Ó;Ð;r.   )r   rµ   rp   r†   )rp   r½   r†   r»   r:   r`   )NNN)r”  zOptional[Type[BaseException]]r•  zOptional[BaseException]r–  zOptional[TracebackType]r:   r`   )
r@   rA   rB   rC   ra   rP   r†  rŠ  rƒ  rE   r=   r.   r,   rY  rY    sL   † à9€Iôòð 37Ø+/Ø*.ð		%à/ð	%ð )ð	%ð (ð		%ð
 
õ	%õ<r.   rY  é
   iPÃ  g     Àr@)rÙ   rÚ   rq   rÛ   r‚   rr   rÌ   rš   rÜ   rÝ   rÞ   c               ó2   • [        U 4U
UUUUU	UUUUUS.UD6$ )at  Create a connection pool.

Can be used either with an ``async with`` block:

.. code-block:: python

    async with asyncpg.create_pool(user='postgres',
                                   command_timeout=60) as pool:
        await pool.fetch('SELECT 1')

Or to perform multiple operations on a single connection:

.. code-block:: python

    async with asyncpg.create_pool(user='postgres',
                                   command_timeout=60) as pool:
        async with pool.acquire() as con:
            await con.execute('''
               CREATE TABLE names (
                  id serial PRIMARY KEY,
                  name VARCHAR (255) NOT NULL)
            ''')
            await con.fetch('SELECT 1')

Or directly with ``await`` (not recommended):

.. code-block:: python

    pool = await asyncpg.create_pool(user='postgres', command_timeout=60)
    con = await pool.acquire()
    try:
        await con.fetch('SELECT 1')
    finally:
        await pool.release(con)

.. warning::
    Prepared statements and cursors returned by
    :meth:`Connection.prepare() <asyncpg.connection.Connection.prepare>`
    and :meth:`Connection.cursor() <asyncpg.connection.Connection.cursor>`
    become invalid once the connection is released.  Likewise, all
    notification and log listeners are removed, and ``asyncpg`` will
    issue a warning if there are any listener callbacks registered on a
    connection that is being released to the pool.

:param str dsn:
    Connection arguments specified using as a single string in
    the following format:
    ``postgres://user:pass@host:port/database?option=value``.

:param \*\*connect_kwargs:
    Keyword arguments for the :func:`~asyncpg.connection.connect`
    function.

:param Connection connection_class:
    The class to use for connections.  Must be a subclass of
    :class:`~asyncpg.connection.Connection`.

:param type record_class:
    If specified, the class to use for records returned by queries on
    the connections in this pool.  Must be a subclass of
    :class:`~asyncpg.Record`.

:param int min_size:
    Number of connection the pool will be initialized with.

:param int max_size:
    Max number of connections in the pool.

:param int max_queries:
    Number of queries after a connection is closed and replaced
    with a new connection.

:param float max_inactive_connection_lifetime:
    Number of seconds after which inactive connections in the
    pool will be closed.  Pass ``0`` to disable this mechanism.

:param coroutine connect:
    A coroutine that is called instead of
    :func:`~asyncpg.connection.connect` whenever the pool needs to make a
    new connection.  Must return an instance of type specified by
    *connection_class* or :class:`~asyncpg.connection.Connection` if
    *connection_class* was not specified.

:param coroutine setup:
    A coroutine to prepare a connection right before it is returned
    from :meth:`Pool.acquire()`.  An example use
    case would be to automatically set up notifications listeners for
    all connections of a pool.

:param coroutine init:
    A coroutine to initialize a connection when it is created.
    An example use case would be to setup type codecs with
    :meth:`Connection.set_builtin_type_codec() <\
    asyncpg.connection.Connection.set_builtin_type_codec>`
    or :meth:`Connection.set_type_codec() <\
    asyncpg.connection.Connection.set_type_codec>`.

:param coroutine reset:
    A coroutine to reset a connection before it is returned to the pool by
    :meth:`Pool.release()`.  The function is supposed
    to reset any changes made to the database session so that the next
    acquirer gets the connection in a well-defined state.

    The default implementation calls :meth:`Connection.reset() <\
    asyncpg.connection.Connection.reset>`, which runs the following::

        SELECT pg_advisory_unlock_all();
        CLOSE ALL;
        UNLISTEN *;
        RESET ALL;

    The exact reset query is determined by detected server capabilities,
    and a custom *reset* implementation can obtain the default query
    by calling :meth:`Connection.get_reset_query() <\
    asyncpg.connection.Connection.get_reset_query>`.

:param loop:
    An asyncio event loop instance.  If ``None``, the default
    event loop will be used.

:return: An instance of :class:`~asyncpg.pool.Pool`.

.. versionchanged:: 0.10.0
   An :exc:`~asyncpg.exceptions.InterfaceError` will be raised on any
   attempted operation on a released connection.

.. versionchanged:: 0.13.0
   An :exc:`~asyncpg.exceptions.InterfaceError` will be raised on any
   attempted operation on a prepared statement or a cursor created
   on a connection that has been released to the pool.

.. versionchanged:: 0.13.0
   An :exc:`~asyncpg.exceptions.InterfaceWarning` will be produced
   if there are any active listeners (added via
   :meth:`Connection.add_listener()
   <asyncpg.connection.Connection.add_listener>`
   or :meth:`Connection.add_log_listener()
   <asyncpg.connection.Connection.add_log_listener>`) present on the
   connection at the moment of its release to the pool.

.. versionchanged:: 0.22.0
   Added the *record_class* parameter.

.. versionchanged:: 0.30.0
   Added the *connect* and *reset* parameters.
)rÝ   rÞ   rÙ   rÚ   rq   rÜ   r‚   rr   rÌ   rš   rÛ   )r½   )r  rÙ   rÚ   rq   rÛ   r‚   rr   rÌ   rš   rÜ   rÝ   rÞ   rà   s                r,   Úcreate_poolrœ  3  sE   € ô~ Øðà)Ø!ØØØØØØØØØ)Iñð ñð r.   rL   )#Ú
__future__r   rŠ   Úcollections.abcr   r   r   r   Úloggingr•   Útypesr   Útypingr   r   r	   rÑ   Ú r   r   r   r   Ú	getLoggerr@   ro  r  r   Ú_ConnectionProxyrH   r_   r½   rY  r   rØ   rœ  r=   r.   r,   Ú<module>r¥     sÊ   ðõ #ã ß /Û Û Û Û Ý ß &Ñ &Û å Ý Ý Ý ð 
×	Ò	˜8Ó	$€ô/˜dô /ôdO˜*×5Ñ5Ø$;Ø#òO÷DV+ñ V+÷rGñ G÷T<ñ <ð@mØØØ!Ø16ØØØØØØ!+×!6Ñ!6Ø%Ÿ_™_÷mr.   