Ë
    V.j¦  ã                   óT  — d dl Z d dlZd dlZd dlZd dlZd dlZddlmZ ddlmZ ddlm	Z	 ddlm
Z
  ej                  e«      Z G d„ de«      Z G d	„ d
ej                   ed¬«      Z G d„ d«      Z G d„ d«      Z G d„ d«      Zddddddddddej*                  e
j,                  dœd„Zy)é    Né   )Úcompat©Ú
connection)Ú
exceptions)Úprotocolc                   ó4   ‡ — e Zd Zddœˆ fd„
Zed„ «       Zˆ xZS )ÚPoolConnectionProxyMetaF)Úwrapc                óº  •— |rÇt        t        j                  «      D ]Š  }|j                  d«      s||v rŒt	        t        j                  |«      }t        j                  |«      sŒIt        j                  |«      }| j                  ||«      }t        j                  ||«      }|||<   ŒŒ d|vrt        j                  j                  |d<   t        ‰	| �5  | |||«      S )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
            €úNC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\asyncpg/pool.pyr   zPoolConnectionProxyMeta.__new__   sÆ   ø€ ÙÜ¤
× 5Ñ 5Ö6�Ø×&Ñ& sÔ+¨x¸3©Øäœz×4Ñ4°hÓ?�Ü×)Ñ)¨$Ô/Øä%×9Ñ9¸$Ó?�Ø×6Ñ6°xÀÓM�Ü#×2Ñ2°7¸DÓA�Ø '��H’ð 7ð  Ñ#Ü!+×!6Ñ!6×!>Ñ!>��I‘ä‰w‰˜t T¨5°#Ó6Ð6ó    c                 ó@   ‡ — ˆ fd„}|rt        j                  |«       |S )Nc                 óÐ   •— | j                   €$t        j                  dj                  ‰«      «      ‚t	        | j                   j
                  ‰«      } || j                   g|¢­i |¤ŽS )NzJcannot call Connection.{}(): connection has been released back to the pool)Ú_conr   ÚInterfaceErrorÚformatr   r#   )ÚselfÚargsÚkwargsr    Ú	meth_names       €r$   Úcall_con_methodzHPoolConnectionProxyMeta._wrap_connection_method.<locals>.call_con_method0   se   ø€ à�y‰yÐ Ü ×/Ñ/ðDßDJÁFØ!óE#ó$ð $ô
 ˜4Ÿ9™9×.Ñ.°	Ó:ˆDÙ˜Ÿ	™	Ð3 DÒ3¨FÑ3Ð3r%   )r   Úmarkcoroutinefunction)r.   r!   r/   s   `  r$   r   z/PoolConnectionProxyMeta._wrap_connection_method.   s!   ø€ ô		4ñ Ü×(Ñ(¨Ô9àÐr%   )Ú__name__Ú
__module__Ú__qualname__r   Ústaticmethodr   Ú__classcell__)r#   s   @r$   r
   r
      s   ø„ à05ö 7ð( ñó ôr%   r
   c                   ó`   — e Zd ZdZdddej
                  fd„Zd„ Zdej
                  fd„Zd	„ Z	y
)ÚPoolConnectionProxy)r(   Ú_holderÚholderÚPoolConnectionHolderÚconc                 óB   — || _         || _        |j                  | «       y ©N)r(   r8   Ú
_set_proxy)r+   r9   r;   s      r$   Ú__init__zPoolConnectionProxy.__init__G   s   € àˆŒ	ØˆŒØ�‰�tÕr%   c                 ó.   — t        | j                  |«      S r=   )r   r(   )r+   Úattrs     r$   Ú__getattr__zPoolConnectionProxy.__getattr__M   s   € ä�t—y‘y $Ó'Ð'r%   Úreturnc                 ój   — | j                   €y | j                   d c}| _         |j                  d «       |S r=   )r(   r>   )r+   r;   s     r$   Ú_detachzPoolConnectionProxy._detachQ   s1   € Ø�9‰9ÐØàŸ™ DˆˆˆTŒYØ�‰�tÔØˆ
r%   c                 óð   — | j                   €0dj                  | j                  j                  t	        | «      ¬«      S dj                  | j                  j                  | j                   t	        | «      ¬«      S )Nz <{classname} [released] {id:#x}>)Ú	classnameÚidz<{classname} {con!r} {id:#x}>)rG   r;   rH   )r(   r*   r#   r1   rH   ©r+   s    r$   Ú__repr__zPoolConnectionProxy.__repr__Y   sn   € Ø�9‰9ÐØ5×<Ñ<ØŸ.™.×1Ñ1´b¸³hð =ó @ð @ð 3×9Ñ9ØŸ.™.×1Ñ1°t·y±yÄRÈÃXð :ó Oð Or%   N)
r1   r2   r3   Ú	__slots__r   r   r?   rB   rE   rJ   © r%   r$   r7   r7   A   sA   „ ð $€IðÐ5ð Ø ×+Ñ+óò(ð˜×.Ñ.ó óOr%   r7   T)Ú	metaclassr   c                   ój   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zdefd„Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)r:   )r(   Ú_poolÚ_loopÚ_proxyÚ_max_queriesÚ_setupÚ_max_inactive_timeÚ_in_useÚ_inactive_callbackÚ_timeoutÚ_generationc                ó�   — || _         d | _        d | _        || _        || _        || _        d | _        d | _        d | _        d | _	        y r=   )
rO   r(   rQ   rR   rT   rS   rV   rU   rW   rX   )r+   ÚpoolÚmax_queriesÚsetupÚmax_inactive_times        r$   r?   zPoolConnectionHolder.__init__j   sL   € àˆŒ
ØˆŒ	ØˆŒà'ˆÔØ"3ˆÔØˆŒØ"&ˆÔØˆŒØˆŒØˆÕr%   c                 óX   — | j                   d uxr | j                   j                  «        S r=   )r(   Ú	is_closedrI   s    r$   Úis_connectedz!PoolConnectionHolder.is_connectedx   s&   € Ø�y‰y Ð$ÒB¨T¯Y©Y×-@Ñ-@Ó-BÐ)BÐBr%   c                 ó   — | j                    S r=   ©rU   rI   s    r$   Úis_idlezPoolConnectionHolder.is_idle{   s   € Ø—<‘<ÐÐr%   c              ƒ   ó  K  — | j                   �t        j                  d«      ‚| j                  j	                  «       ƒ d {  –—† | _         | j                  j
                  | _        | j                  «        | j                  «        y 7 ŒE­w)NzMPoolConnectionHolder.connect() called while another connection already exists)r(   r   ÚInternalClientErrorrO   Ú_get_new_connectionrX   Ú_maybe_cancel_inactive_callbackÚ_setup_inactive_callbackrI   s    r$   ÚconnectzPoolConnectionHolder.connect~   sp   è ø€ Ø�9‰9Ð Ü×0Ñ0ð,ó-ð -ð Ÿ*™*×8Ñ8Ó:×:ˆŒ	ØŸ:™:×1Ñ1ˆÔØ×,Ñ,Ô.Ø×%Ñ%Õ'ð ;ús   ‚?B	ÁBÁAB	rC   c              ƒ   óP  K  — | j                   �| j                   j                  «       r d | _         | j                  «       ƒ d {  –—†  n‹| j                  | j                  j                  k7  rh| j                  j
                  j                  | j                   j                  | j                  ¬«      «       d | _         | j                  «       ƒ d {  –—†  | j                  «        t        | | j                   «      x| _        }| j                  �	 | j                  |«      ƒ d {  –—†  | j                  j
                  j!                  «       | _        |S 7 �Œ7 Œ…7 Œ4# t        t        j                  f$ r1}	 | j                   j                  «       ƒ d {  –—†7   |‚# |‚xY wd }~ww xY w­w)N©Útimeout)r(   r_   ri   rX   rO   rP   Úcreate_taskÚcloserW   rg   r7   rQ   rS   Ú	ExceptionÚasyncioÚCancelledErrorÚcreate_futurerU   )r+   ÚproxyÚexs      r$   ÚacquirezPoolConnectionHolder.acquire‰   sG  è ø€ Ø�9‰9Ð §	¡	× 3Ñ 3Ô 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#Å3FÆFÆFÆFÆFÆFÆF#Æ#F&c              ƒ   óz  K  — | j                   €t        j                  d«      ‚| j                  j	                  «       ry d | _        | j                  j                  j                  | j                  k\  r%| j                  j                  |¬«      ƒ d {  –—†  y | j                  | j                  j                  k7  r%| j                  j                  |¬«      ƒ d {  –—†  y 	 |}| j                  j                  j                  «       rpt        j                  «       }t        j                   | j                  j                  j#                  «       |«      ƒ d {  –—†  |�|t        j                  «       |z
  z  }| j                  j$                  �~t        j&                  |«      4 ƒd {  –—†  | j                  j%                  «       ƒ d {  –—†  | j                  j%                  | j                  «      ƒ d {  –—†  d d d «      ƒd {  –—†  n$| j                  j)                  |¬«      ƒ d {  –—†  | j3                  «        | j5                  «        y 7 �Œ¾7 �Œy7 Œÿ7 Œ±7 Œ‘7 Œf7 ŒX# 1 ƒd {  –—†7  sw Y   ŒCxY w7 ŒJ# t*        t,        j.                  f$ r(}	 | j                  j1                  «        |‚# |‚xY wd }~ww xY w­w)NzAPoolConnectionHolder.release() called on a free connection holderrk   )rU   r   re   r(   r_   rW   Ú	_protocolÚqueries_countrR   rn   rX   rO   Ú_is_cancellingÚtimeÚ	monotonicr   Úwait_forÚ_wait_for_cancellationÚ_resetrl   Úresetro   rp   rq   Ú	terminateÚ_releaserh   )r+   rl   ÚbudgetÚstartedrt   s        r$   ÚreleasezPoolConnectionHolder.release®   s1  è ø€ Ø�<‰<ÐÜ×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ô Ÿ.™.Ó*�Ü—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J;ÂIÂAJ;ÃIÃJ;Ã!A5I7 ÅIÅAI7 Æ&IÆ'I7 Æ*I ÇIÇ	,I Ç5IÇ6I Ç:I7 ÈIÈ$I7 È*I5È+I7 È/"J;ÉJ;ÉI7 ÉI7 ÉI ÉI ÉI7 É I2É&I)É'I2É.I7 É7J8ÊJ-Ê+J3Ê-J0Ê0J3Ê3J8Ê8J;c              ƒ   óR   K  — | j                   €y | j                   ƒ d {  –—†  y 7 Œ­wr=   rb   rI   s    r$   Úwait_until_releasedz(PoolConnectionHolder.wait_until_releasedí   s    è ø€ Ø�<‰<ÐØà—,‘,×Òús   ‚'Ÿ% 'c              ƒ   ón   K  — | j                   �#| j                   j                  «       ƒ d {  –—†  y y 7 Œ­wr=   )r(   rn   rI   s    r$   rn   zPoolConnectionHolder.closeó   s0   è ø€ Ø�9‰9Ð ð —)‘)—/‘/Ó#×#Ñ#ð !ð $ús   ‚*5¬3­5c                 óR   — | j                   �| j                   j                  «        y y r=   )r(   r€   rI   s    r$   r€   zPoolConnectionHolder.terminateù   s#   € Ø�9‰9Ð ð �I‰I×ÑÕ!ð !r%   c                 óÞ   — | j                   �t        j                  d«      ‚| j                  r@| j                  j
                  j                  | j                  | j                  «      | _         y y )Nz/pool connection inactivity timer already exists)rV   r   re   rT   rO   rP   Ú
call_laterÚ_deactivate_inactive_connectionrI   s    r$   rh   z-PoolConnectionHolder._setup_inactive_callbackÿ   se   € Ø×"Ñ"Ð.Ü×0Ñ0ØAóCð Cð ×"Ò"Ø&*§j¡j×&6Ñ&6×&AÑ&AØ×'Ñ'¨×)MÑ)Mó'OˆDÕ#ð #r%   c                 ó`   — | j                   �"| j                   j                  «        d | _         y y r=   )rV   ÚcancelrI   s    r$   rg   z4PoolConnectionHolder._maybe_cancel_inactive_callback  s-   € Ø×"Ñ"Ð.Ø×#Ñ#×*Ñ*Ô,Ø&*ˆDÕ#ð /r%   c                 ó´   — | j                   �t        j                  d«      ‚| j                  �+| j                  j	                  «        | j                  «        y y )Nz/attempting to deactivate an acquired connection)rU   r   re   r(   r€   Ú_release_on_closerI   s    r$   r‹   z4PoolConnectionHolder._deactivate_inactive_connection  sU   € Ø�<‰<Ð#Ü×0Ñ0ØAóCð Cð �9‰9Ð ð �I‰I×ÑÔ!ð ×"Ñ"Õ$ð !r%   c                 óR   — | j                  «        | j                  «        d | _        y r=   )rg   r�   r(   rI   s    r$   r�   z&PoolConnectionHolder._release_on_close  s   € Ø×,Ñ,Ô.Ø�‰ŒØˆ�	r%   c                 ó:  — | j                   €y| j                   j                  «       s| j                   j                  d«       d| _         | j                  �!| j                  j	                  «        d| _        | j
                  j                  j                  | «       y)zRelease this connection holder.N)rU   ÚdoneÚ
set_resultrQ   rE   rO   Ú_queueÚ
put_nowaitrI   s    r$   r�   zPoolConnectionHolder._release   su   € à�<‰<Ðàà�|‰|× Ñ Ô"Ø�L‰L×#Ñ# DÔ)ØˆŒð �;‰;Ð"Ø�K‰K×ÑÔ!ØˆDŒKð 	�
‰
×Ñ×$Ñ$ TÕ*r%   N)r1   r2   r3   rK   r?   r`   rc   ri   r7   ru   r„   r†   rn   r€   rh   rg   r‹   r�   r�   rL   r%   r$   r:   r:   b   s[   „ ð €Iò òCò ò	(ð#Ð2ó #òJ=(ò~ò$ò"òOò+ò
%òó
+r%   r:   c                   ó¢  — e Zd ZdZdZdddddœd„Zd„ Zd„ Zd„ Zd	„ Z	d
„ Z
d„ Zd„ Zd2d„Zd„ Zddœdededefd„Zddœdedefd„Zdddœdefd„Zdddœd„Zdddœd„Zdddœd„Zdddddddddddddœd„Zdddddddddddœ
d „Zddddddddddddddddd!œd"„Zddddd#œd$„Zddœd%„Zd&„ Zddœd'„Zd(„ Zd)„ Z d*„ Z!d+„ Z"d,„ Z#d-„ Z$d.„ Z%d/„ Z&d0„ Z'd1„ Z(y)3ÚPoola�  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”   rP   Ú_minsizeÚ_maxsizeÚ_initÚ_connectr~   Ú_connect_argsÚ_connect_kwargsÚ_holdersÚ_initializedÚ_initializingÚ_closingÚ_closedÚ_connection_classÚ_record_classrX   rS   rR   Ú!_max_inactive_connection_lifetimeN)ri   r\   Úinitr   c                ó0  — t        |«      dkD  rt        j                  dt        d¬«       |	€t	        j
                  «       }	|	| _        |dk  rt        d«      ‚|dk  rt        d«      ‚||kD  rt        d«      ‚|dk  rt        d	«      ‚|dk  rt        d
«      ‚t        |
t        j                  «      st        dj                  |
«      «      ‚t        |t        j                  «      st        dj                  |«      «      ‚|| _        || _        g | _        d| _        d| _        d | _        |
| _        || _        d| _        d| _        d| _        |�|nt        j4                  | _        || _        || _        || _        || _        || _         || _!        || _"        y )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ÚDeprecationWarningrp   Úget_event_looprP   Ú
ValueErrorÚ
issubclassr   r   Ú	TypeErrorr*   r   ÚRecordr˜   r™   rž   rŸ   r    r”   r£   r¤   r¡   r¢   rX   ri   r›   rœ   r�   rS   rš   r~   rR   r¥   )r+   Úmin_sizeÚmax_sizer[   Ú max_inactive_connection_lifetimeri   r\   r¦   r   ÚloopÚconnection_classÚrecord_classÚconnect_argsÚconnect_kwargss                 r$   r?   zPool.__init__G  sµ  € ô ˆ|Ó˜qÒ Ü�M‰Mð0ô #¨qõ2ð ˆ<Ü×)Ñ)Ó+ˆDØˆŒ
à�qŠ=ÜÐKÓLÐLà�aŠ<ÜØEóGð Gð �hÒÜÐ@ÓAÐAà˜!ÒÜÐNÓOÐOà+¨aÒ/Üð#ó$ð $ô Ð*¬J×,AÑ,AÔBÜð/ß/5©vÐ6FÓ/GóIð Iô ˜,¬¯©Ô8Üð+ß+1©6°,Ó+?óAð Að !ˆŒØ ˆŒàˆŒØ!ˆÔØ"ˆÔØˆŒà!1ˆÔØ)ˆÔàˆŒØˆŒØˆÔà#*Ð#6™¼J×<NÑ<NˆŒØ)ˆÔØ-ˆÔàˆŒØˆŒ
ØˆŒà'ˆÔà,ð 	Õ.r%   c              ƒ   ó4  K  — | j                   r| S | j                  rt        j                  d«      ‚| j                  rt        j                  d«      ‚d| _        	 | j                  «       ƒ d {  –—†  | d| _        d| _         S 7 Œ# d| _        d| _         w xY w­w)Nz)pool is being initialized in another taskúpool is closedTF)rŸ   r    r   r)   r¢   Ú_initializerI   s    r$   Ú_async__init__zPool._async__init__˜  s–   è ø€ Ø×ÒØˆKØ×ÒÜ×+Ñ+Ø;ó=ð =à�<Š<Ü×+Ñ+Ð,<Ó=Ð=Ø!ˆÔð	%Ø×"Ñ"Ó$×$Ð$Øà!&ˆDÔØ $ˆDÕð	 %ùð "'ˆDÔØ $ˆDÕüs0   ‚ABÁB Á.BÁ/B Á4BÂB ÂBÂBc              ƒ   óÐ  K  — t        j                  | j                  ¬«      | _        t	        | j                  «      D ]e  }t        | | j                  | j                  | j                  ¬«      }| j                  j                  |«       | j                  j                  |«       Œg | j                  r°| j                  d   }|j                  «       ƒ d {  –—†  | j                  dkD  ryg }t        t        | j                  d d «      «      D ]8  \  }}|| j                  dz
  k\  r n!|j                  |j                  «       «       Œ: t        j                   |Ž ƒ d {  –—†  y y y 7 ŒŽ7 Œ	­w)N)Úmaxsize)r[   r]   r\   éÿÿÿÿr   )rp   Ú	LifoQueuer™   r”   Úranger:   rR   r¥   rS   rž   Úappendr•   r˜   ri   Ú	enumerateÚreversedÚgather)r+   r   ÚchÚfirst_chÚconnect_tasksÚis         r$   r½   z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�rà˜DŸM™M¨AÑ-Ò-ÙØ!×(Ñ(¨¯©«Õ6ð	 Eô —n‘n mÐ4×4Ñ4ð !ð ð %øð 5ús%   ‚CE&ÃE"ÃBE&ÅE$ÅE&Å$E&c                 ó6   — | j                   xs | j                  S )z_Return ``True`` if the pool is closing or is closed.

        .. versionadded:: 0.28.0
        )r¢   r¡   rI   s    r$   Ú
is_closingzPool.is_closingÉ  s   € ð
 �|‰|Ò,˜tŸ}™}Ð,r%   c                 ó:   — t        d„ | j                  D «       «      S )zaReturn the current number of connections in this pool.

        .. versionadded:: 0.25.0
        c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr=   )r`   ©Ú.0Úhs     r$   Ú	<genexpr>z Pool.get_size.<locals>.<genexpr>Õ  s   è ø€ Ð;©]¨�1—>‘>×#©]ùs   ‚©Úsumrž   rI   s    r$   Úget_sizezPool.get_sizeÐ  s   € ô
 Ñ;¨T¯]ª]Ó;Ó;Ð;r%   c                 ó   — | j                   S )zaReturn the minimum number of connections in this pool.

        .. versionadded:: 0.25.0
        )r˜   rI   s    r$   Úget_min_sizezPool.get_min_size×  ó   € ð
 �}‰}Ðr%   c                 ó   — | j                   S )ziReturn the maximum allowed number of connections in this pool.

        .. versionadded:: 0.25.0
        )r™   rI   s    r$   Úget_max_sizezPool.get_max_sizeÞ  rÙ   r%   c                 ó:   — t        d„ | j                  D «       «      S )zfReturn the current number of idle connections in this pool.

        .. versionadded:: 0.25.0
        c              3   ó`   K  — | ]&  }|j                  «       xr |j                  «       –— Œ( y ­wr=   )r`   rc   rÐ   s     r$   rÓ   z%Pool.get_idle_size.<locals>.<genexpr>ê  s&   è ø€ ÐK¹]¸�1—>‘>Ó#Ò3¨¯	©	«Ó3¹]ùs   ‚,.rÔ   rI   s    r$   Úget_idle_sizezPool.get_idle_sizeå  s   € ô
 ÑK¸T¿]º]ÓKÓKÐKr%   c                 ó"   — |g| _         || _        y)aÊ  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�   )r+   Údsnrº   s      r$   Úset_connect_argszPool.set_connect_argsì  s   € ð* "˜UˆÔØ-ˆÕr%   c              ƒ   óÂ  K  —  | j                   | j                  | j                  | j                  | j                  dœ| j
                  ¤Žƒ d {  –—† }t        || j                  «      s…| j                  }|j                  › d|j                  › �}t        |«      }|j                  dk(  r|j                  }n|j                  › d|j                  › �}t        j                  d|› d|› d�«      ‚| j                  �	 | j                  |«      ƒ d {  –—†  |S |S 7 ŒÉ7 Œ
# t        t        j                  f$ r'}	 |j!                  «       ƒ d {  –—†7   |‚# |‚xY wd }~ww xY w­w)N)r¶   r·   r¸   Ú.Úbuiltinsz9expected pool connect callback to return an instance of 'z', got 'Ú')r›   rœ   rP   r£   r¤   r�   Ú
isinstancer2   r1   Útyper   r)   rš   ro   rp   rq   rn   )r+   r;   ÚgoodÚgood_nÚbadÚbad_nrt   s          r$   rf   zPool._get_new_connection  sW  è ø€ Ø!�D—M‘MØ×ÑØ—‘Ø!×3Ñ3Ø×+Ñ+ñ	
ð
 ×"Ñ"ñ
÷ 
ˆô ˜#˜t×5Ñ5Ô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ÁB+EÃ;D ÄDÄD ÄEÄD ÄEÄ6EÅ	EÅ
EÅEÅEÅEÅEÅErk   Úqueryrl   rC   c             ‡   óÐ   K  — | j                  «       4 ƒd{  –—† } |j                  |g|¢­d|iŽƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ37 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)a  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
        Nrl   )ru   Úexecute)r+   rì   rl   r,   r;   s        r$   rî   zPool.execute,  sJ   è ø€ ð —<‘<—>”> SØ$˜Ÿ™ UÐC¨TÒC¸7ÑC×C÷ "—>’>øØCøð "ø—>—>‘>üsS   ‚A&—A˜A&›AµA¶A¹A&ÁAÁA&ÁAÁA&ÁA#ÁAÁA#ÁA&Úcommandc             ƒ   óÌ   K  — | j                  «       4 ƒd{  –—† }|j                  |||¬«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ17 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)aC  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
        Nrk   )ru   Úexecutemany)r+   rï   r,   rl   r;   s        r$   rñ   zPool.executemany8  sD   è ø€ ð —<‘<—>”> SØŸ™¨°$À˜ÓH×H÷ "—>’>øØHøð "ø—>—>‘>üsS   ‚A$—A	˜A$›A³A´A·A$ÁAÁA$ÁAÁA$ÁA!ÁAÁA!ÁA$©rl   r¸   c             ‡   óÒ   K  — | j                  «       4 ƒd{  –—† } |j                  |g|¢­||dœŽƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ47 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)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ò   )ru   Úfetch©r+   rì   rl   r¸   r,   r;   s         r$   rô   z
Pool.fetchE  s\   è ø€ ð —<‘<—>”> SØ"˜Ÿ™Øðàñð  Ø)ò	÷ ÷ "—>’>øðøð "ø—>—>‘>üóS   ‚A'—A˜A'›A¶A·AºA'ÁAÁA'ÁAÁA'ÁA$ÁAÁA$Á A'r   ©Úcolumnrl   c             ‡   óÒ   K  — | j                  «       4 ƒd{  –—† } |j                  |g|¢­||dœŽƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ47 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)a+  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÷   )ru   Úfetchval)r+   rì   rø   rl   r,   r;   s         r$   rú   zPool.fetchval\  sY   è ø€ ð —<‘<—>”> SØ%˜Ÿ™Øð>Øñ>Ø%+°Wò>÷ >÷ "—>’>øð>øð "ø—>—>‘>ürö   c             ‡   óÒ   K  — | j                  «       4 ƒd{  –—† } |j                  |g|¢­||dœŽƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ47 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)a  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ò   )ru   Úfetchrowrõ   s         r$   rü   zPool.fetchrowj  s\   è ø€ ð —<‘<—>”> SØ%˜Ÿ™Øðàñð  Ø)ò	÷ ÷ "—>’>øðøð "ø—>—>‘>ürö   c             ƒ   óÎ   K  — | j                  «       4 ƒd{  –—† }|j                  ||||¬«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ27 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)an  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ò   )ru   Ú	fetchmany)r+   rì   r,   rl   r¸   r;   s         r$   rþ   zPool.fetchmany{  sP   è ø€ ð —<‘<—>”> SØŸ™Ø�t W¸<ð 'ó ÷ ÷ "—>’>øðøð "ø—>—>‘>üsS   ‚A%—A
˜A%›A´AµA¸A%ÁAÁA%ÁAÁA%ÁA"ÁAÁA"ÁA%)ÚcolumnsÚschema_namerl   r*   ÚoidsÚ	delimiterÚnullÚheaderÚquoteÚescapeÚforce_quoteÚencodingc             ƒ   óâ   K  — | j                  «       4 ƒd{  –—† }|j                  |||||||||	|
||||¬«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ<7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)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)Úoutputrÿ   r   rl   r*   r  r  r  r  r  r  r  r  )ru   Úcopy_from_table)r+   Ú
table_namer
  rÿ   r   rl   r*   r  r  r  r  r  r  r  r  r;   s                   r$   r  zPool.copy_from_table‹  ss   è ø€ ð6 —<‘<—>”> SØ×,Ñ,ØØØØ'ØØØØ#ØØØØØ'Ø!ð -ó ÷ ÷ "—>’>øðøð "ø—>—>‘>üsT   ‚A/—A˜A/›#A¾A¿AÁA/ÁAÁA/ÁAÁA/ÁA,Á A#Á!A,Á(A/)
rl   r*   r  r  r  r  r  r  r  r  c             ‡   óä   K  — | j                  «       4 ƒd{  –—† } |j                  |g|¢­||||||||	|
||dœŽƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ=7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)aC  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)r
  rl   r*   r  r  r  r  r  r  r  r  )ru   Úcopy_from_query)r+   rì   r
  rl   r*   r  r  r  r  r  r  r  r  r,   r;   s                  r$   r  zPool.copy_from_query¸  sy   è ø€ ð2 —<‘<—>”> SØ,˜×,Ñ,Øðàñð ØØØØ#ØØØØØ'Ø!ò÷ ÷ "—>’>øðøð "ø—>—>‘>üsU   ‚A0—A˜A0›$A¿AÁ AÁA0ÁAÁA0ÁAÁA0ÁA-Á!A$Á"A-Á)A0)rÿ   r   rl   r*   r  Úfreezer  r  r  r  r  r  Úforce_not_nullÚ
force_nullr  Úwherec             ƒ   óê   K  — | j                  «       4 ƒd{  –—† }|j                  |||||||||	|
||||||||¬«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ@7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)a&  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)Úsourcerÿ   r   rl   r*   r  r  r  r  r  r  r  r  r  r  r  r  )ru   Úcopy_to_table)r+   r  r  rÿ   r   rl   r*   r  r  r  r  r  r  r  r  r  r  r  r  r;   s                       r$   r  zPool.copy_to_tableâ  s   è ø€ ð> —<‘<—>”> SØ×*Ñ*ØØØØ'ØØØØØ#ØØØØØ'Ø-Ø%Ø!Øð% +ó ÷ ÷ "—>’>øðøð "ø—>—>‘>üsV   ‚A3—A˜A3›'AÁAÁAÁA3ÁAÁA3ÁAÁA3ÁA0Á$A'Á%A0Á,A3)rÿ   r   rl   r  c          	   ƒ   óÒ   K  — | j                  «       4 ƒd{  –—† }|j                  ||||||¬«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ47 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)aU  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)Úrecordsrÿ   r   rl   r  )ru   Úcopy_records_to_table)r+   r  r  rÿ   r   rl   r  r;   s           r$   r  zPool.copy_records_to_table  s[   è ø€ ð& —<‘<—>”> SØ×2Ñ2ØØØØ'ØØð 3ó ÷ ÷ "—>’>øðøð "ø—>—>‘>ürö   c                ó   — t        | |«      S )aT  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)r+   rl   s     r$   ru   zPool.acquire4  s   € ô. " $¨Ó0Ð0r%   c              ƒ   óî   ‡ ‡K  — ˆ ˆfd„}‰ j                   rt        j                  d«      ‚‰ j                  «        ‰€ |«       ƒ d {  –—† S t	        j
                   |«       ‰¬«      ƒ d {  –—† S 7 Œ(7 Œ­w)Nc               “   ó  •K  — ‰j                   j                  «       ƒ d {  –—† } 	 | j                  «       ƒ d {  –—† }‰| _        |S 7 Œ&7 Œ# t        t
        j                  f$ r ‰j                   j                  | «       ‚ w xY w­wr=   )r”   Úgetru   rW   ro   rp   rq   r•   )rÈ   rs   r+   rl   s     €€r$   Ú_acquire_implz$Pool._acquire.<locals>._acquire_implN  sr   øè ø€ Ø—{‘{—‘Ó(×(ˆBð	Ø Ÿj™j›l×*�ð &�”Ø�ð )øà*ùÜœw×5Ñ5Ð6ò Ø—‘×&Ñ& rÔ*Øðüs5   ƒB¡A¢B§A ºA
»A ¿
BÁ
A Á6BÂBzpool is closingrk   )r¡   r   r)   Ú_check_initr   r|   )r+   rl   r  s   `` r$   Ú_acquirezPool._acquireM  sk   ùè ø€ õ	ð �=Š=Ü×+Ñ+Ð,=Ó>Ð>Ø×ÑÔàˆ?Ù&›×(Ð(äŸ™Ù“¨ô2÷ 2ð 2ð )øð2ús$   „AA5ÁA1Á	#A5Á,A3Á-A5Á3A5c             ƒ   ó¤  K  — t        |«      t        us|j                  j                  | ur%t	        j
                  dj                  |¬«      «      ‚|j                  €y| j                  «        |j                  j                  «        |j                  }|€|j                  }t        j                  |j                  |«      «      ƒ d{  –—† S 7 Œ­w)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ç   r7   r8   rO   r   r)   r*   r(   r  Ú_on_releaserW   rp   Úshieldr„   )r+   r   rl   rÈ   s       r$   r„   zPool.releasee  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              ƒ   ó®  K  — | j                   ry| j                  «        d| _        d}	 | j                  j	                  d| j
                  «      }| j                  D �cg c]  }|j                  «       ‘Œ }}t        j                  |Ž ƒ d{  –—†  | j                  D �cg c]  }|j                  «       ‘Œ }}t        j                  |Ž ƒ d{  –—†  	 |�|j                  «        d| _         d| _        yc c}w 7 Œlc c}w 7 Œ2# t        t        j                  f$ r | j                  «        ‚ w xY w# |�|j                  «        d| _         d| _        w xY w­w)aŠ  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¡   rP   rŠ   Ú_warn_on_long_closerž   r†   rp   rÇ   rn   ro   rq   r€   r�   )r+   Úwarning_callbackrÈ   Úrelease_corosÚclose_coross        r$   rn   z
Pool.close‹  sE  è ø€ ð  �<Š<ØØ×ÑÔàˆŒàÐð	"Ø#Ÿ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 ÁC4Á5D ÂC9ÂD ÂC;Â6D ÃD ÃD Ã!EÃ4D Ã;D Ä+D-Ä-D0 Ä0"EÅEc                 ó.   — t         j                  d«       y )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ÚwarningrI   s    r$   r&  zPool._warn_on_long_close¸  s   € Ü�‰ð 'õ 	(r%   c                 óŽ   — | j                   ry| j                  «        | j                  D ]  }|j                  «        Œ d| _         y)z&Terminate all connections in the pool.NT)r¢   r  rž   r€   ©r+   rÈ   s     r$   r€   zPool.terminate¾  s6   € à�<Š<ØØ×ÑÔØ—-”-ˆBØ�L‰L�Nð  àˆ�r%   c              ƒ   ó6   K  — | xj                   dz  c_         y­w)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)rX   rI   s    r$   Úexpire_connectionszPool.expire_connectionsÇ  s   è ø€ ð 	×Ò˜AÑÖùs   ‚c                 óÊ   — | j                   s6| j                  rt        j                  d«      ‚t        j                  d«      ‚| j                  rt        j                  d«      ‚y )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   r)   r¢   rI   s    r$   r  zPool._check_initÑ  s^   € Ø× Ò Ø×!Ò!Ü ×/Ñ/ðó ð  ô ×+Ñ+Ð,EÓFÐFØ�<Š<Ü×+Ñ+Ð,<Ó=Ð=ð r%   c                 ót   — | j                   D ])  }|j                  €Œ|j                  j                  «        Œ+ y r=   )rž   r(   Ú_drop_local_statement_cacher.  s     r$   Ú_drop_statement_cachezPool._drop_statement_cacheÜ  s*   € à—-”-ˆBØ�w‰wÑ"Ø—‘×3Ñ3Õ5ñ  r%   c                 ót   — | j                   D ])  }|j                  €Œ|j                  j                  «        Œ+ y r=   )rž   r(   Ú_drop_local_type_cacher.  s     r$   Ú_drop_type_cachezPool._drop_type_cacheâ  s*   € à—-”-ˆBØ�w‰wÑ"Ø—‘×.Ñ.Õ0ñ  r%   c                 ó>   — | j                  «       j                  «       S r=   )r¾   Ú	__await__rI   s    r$   r9  zPool.__await__è  s   € Ø×"Ñ"Ó$×.Ñ.Ó0Ð0r%   c              ƒ   óB   K  — | j                  «       ƒ d {  –—†  | S 7 Œ­wr=   )r¾   rI   s    r$   Ú
__aenter__zPool.__aenter__ë  s"   è ø€ Ø×!Ñ!Ó#×#Ð#Øˆð 	$ús   ‚–—c              ‡   ó@   K  — | j                  «       ƒ d {  –—†  y 7 Œ­wr=   )rn   )r+   Úexcs     r$   Ú	__aexit__zPool.__aexit__ï  s   è ø€ Ø�j‰j‹l×Òús   ‚–—r=   ))r1   r2   r3   r   rK   r?   r¾   r½   rÍ   rÖ   rØ   rÛ   rÞ   rá   rf   ÚstrÚfloatrî   rñ   Úlistrô   rú   rü   rþ   r  r  r  r  ru   r   r„   rn   r&  r€   r0  r  r4  r7  r9  r;  r>  rL   r%   r$   r—   r—   4  s¹  „ ñð€Ið ØØØôO-òb%ò 5òB-ò<òòòLó.ò0&ðP ?Cò 
D 3ð 
D¸ð 
DÀsó 
Dð GKò 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                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)r  )rl   r   r’   rZ   c                 ó<   — || _         || _        d | _        d| _        y )NF)rZ   rl   r   r’   )r+   rZ   rl   s      r$   r?   zPoolAcquireContext.__init__÷  s   € ØˆŒ	ØˆŒØˆŒØˆ�	r%   c              ƒ   óä   K  — | j                   €| j                  rt        j                  d«      ‚| j                  j                  | j                  «      ƒ d {  –—† | _         | j                   S 7 Œ­w)Nz a connection is already acquired)r   r’   r   r)   rZ   r   rl   rI   s    r$   r;  zPoolAcquireContext.__aenter__ý  sU   è ø€ Ø�?‰?Ð&¨$¯)ª)Ü×+Ñ+Ð,NÓOÐOØ $§	¡	× 2Ñ 2°4·<±<Ó @×@ˆŒØ�‰Ðð Aús   ‚AA0ÁA.ÁA0c              ‡   óŠ   K  — d| _         | j                  }d | _        | j                  j                  |«      ƒ d {  –—†  y 7 Œ­w©NT)r’   r   rZ   r„   )r+   r=  r;   s      r$   r>  zPoolAcquireContext.__aexit__  s5   è ø€ ØˆŒ	Ø�o‰oˆØˆŒØ�i‰i×Ñ Ó$×$Ò$ús   ‚9A»A¼Ac                 óv   — d| _         | j                  j                  | j                  «      j	                  «       S rF  )r’   rZ   r   rl   r9  rI   s    r$   r9  zPoolAcquireContext.__await__	  s+   € ØˆŒ	Ø�y‰y×!Ñ! $§,¡,Ó/×9Ñ9Ó;Ð;r%   N)r1   r2   r3   rK   r?   r;  r>  r9  rL   r%   r$   r  r  ó  s   „ à9€Iòòò%ó<r%   r  é
   iPÃ  g     Àr@)r³   r´   r[   rµ   ri   r\   r¦   r   r¶   r·   r¸   c                ó2   — t        | f|
|||||	|||||dœ|¤ŽS )a8  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´   r[   r¶   ri   r\   r¦   r   rµ   )r—   )rà   r³   r´   r[   rµ   ri   r\   r¦   r   r¶   r·   r¸   rº   s                r$   Úcreate_poolrJ    sE   € ô~ Øðà)Ø!ØØØØØØØØØ)Iñð ñð r%   r=   )rp   r   r   Úloggingrz   r«   Ú r   r   r   r   Ú	getLoggerr1   r+  rç   r
   Ú_ConnectionProxyr7   r:   r—   r  r   r²   rJ  rL   r%   r$   Ú<module>rO     s¼   ðó Û Û Û Û Û å Ý Ý Ý ð 
ˆ×	Ñ	˜8Ó	$€ô&˜dô &ôRO˜*×5Ñ5Ø$;Ø#õO÷BO+ñ O+÷d|
ñ |
÷~<ñ <ð6mØØØ!Ø16ØØØØØØ!+×!6Ñ!6Ø%Ÿ_™_õmr%   