L5Xc@s ddlZddlmZddlmZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZdd lmZdd lmZmZmZmZmZmZmZdd lmZdd lmZdd l m!Z!ddl"Z"ddl#m$Z$ddlm%Z%ddl&Z&ddl'Z'dZ(yddl)m*Z*Wne+k rnXedZ,dej-fdYZ.e.Z/de0fdYZ1dZ2e2d\Z3Z4e2d\Z5Z6e2d\Z7Z8e2d\Z9Z:e2d\Z;Z<e2d\Z=Z>e2d\Z?Z@e2d\ZAZBe2d \ZCZDe2d!\ZEZFe2d"\ZGZHe2d#\ZIZJe2d$\ZKZLe%d%d&d' d&d'f\ZMZNd&d( d&d(f\ZOZPd&d) d&d)f\ZQZRd*eSfd+YZTd,eSfd-YZUd.eUfd/YZVd0eUfd1YZWd2eWfd3YZXd4eWfd5YZYd6eWfd7YZZd8eWfd9YZ[d:eWfd;YZ\d<eWfd=YZ]d>e]fd?YZ^d@e\fdAYZ_dBe\fdCYZ`dDe\fdEYZadFefdGYZbdHZcdIZddJZedKZfdLZgdMZhdNZierebZjnekZjdZldOZmedPZnedQedRfZodSZpejdTdOdOZqeqjrdUe/Zse!eqjtZuejjvZvd&d)dOZwdewdOZxdVZydWZzdXZ{dYZ|dZZ}d[Z~ejjjrdUe/ZejjjrdUe/Zd\Zd]Zd^Zd_Zd`ZdaZdbZdcZddZdeZdfZdgZer4dhZn diZdjZdkZedlZedmZdnZe3dZedmZdoZdpZdqfdrYZereje_nedsZedtZeduZedvZedwZedxZedyZedzZed{Zed|Zed}Zed~ZedZedZedZedZedZedZedZedZedZedZedZedyZedZeduZedZedzZedZed{Zee3dZee3dZee3dZee3dZeduZedZeduZed{ZedZedzZedZedZedZedZedZedZedZedtZedZedxZedyZeeeeedeedegdZde0fdYZde0fdYZidd6dd6dd6dd6Zied6ed6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6ZdZdZdZdZdZdZdS(iN(t timedelta(twarn(tpack(tmd5(tDecimal(tdequet defaultdict(tcounttislice(tmap(tbtPY2t integer_typestnextt text_typetut binary_type(tUUID(tdeepcopy(ttimegm(t LooseVersion(tStructsMathieu Fenniak(tloadsitUTCcBs#eZdZdZdZRS(cCstS(N(tZERO(tselftdt((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt utcoffset?scCsdS(NR((RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttznameBscCstS(N(R(RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytdstEs(t__name__t __module__RRR(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR=s  tIntervalcBseZdZddddZdZdZdZedeZedeZ edeZ d Z d Z d Z RS( s An Interval represents a measurement of time. In PostgreSQL, an interval is defined in the measure of months, days, and microseconds; as such, the pg8000 interval type represents the same information. Note that values of the :attr:`microseconds`, :attr:`days` and :attr:`months` properties are independently measured and cannot be converted to each other. A month may be 28, 29, 30, or 31 days, and a day may occasionally be lengthened slightly by a leap second. .. attribute:: microseconds Measure of microseconds in the interval. The microseconds value is constrained to fit into a signed 64-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. .. attribute:: days Measure of days in the interval. The days value is constrained to fit into a signed 32-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. .. attribute:: months Measure of months in the interval. The months value is constrained to fit into a signed 32-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. icCs||_||_||_dS(N(t microsecondstdaystmonths(RR!R"R#((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__init__ns  cCsVt|tstdn4t|ko5tknsItdn ||_dS(Ns$microseconds must be an integer types6microseconds must be representable as a 64-bit integer(t isinstanceR t TypeErrortmin_int8tmax_int8t OverflowErrort _microseconds(Rtvalue((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt_setMicrosecondsss  cCsVt|tstdn4t|ko5tknsItdn ||_dS(Nsdays must be an integer types.days must be representable as a 32-bit integer(R%R R&tmin_int4tmax_int4R)t_days(RR+((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt_setDays|s  cCsVt|tstdn4t|ko5tknsItdn ||_dS(Nsmonths must be an integer types0months must be representable as a 32-bit integer(R%R R&R-R.R)t_months(RR+((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt _setMonthss  cCs|jS(N(R*(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytscCs|jS(N(R/(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs|jS(N(R1(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCsd|j|j|jfS(Ns,(R#R"R!(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__repr__scCsO|dk oNt|toN|j|jkoN|j|jkoN|j|jkS(N(tNoneR%R R#R"R!(Rtother((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__eq__s$cCs|j| S(N(R7(RR6((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__neq__s(RRt__doc__R$R,R0R2tpropertyR!R"R#R4R7R8(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR Ks!   cCs td|}|j|jfS(Nt!(RRt unpack_from(tfmttstruc((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt pack_funcsstithtqtdtftiiitiitqiitdiitihihihtcitbhtccccs!iiiii?tWarningcBseZdZRS(sGeneric exception raised for important database warnings like data truncations. This exception is not currently used by pg8000. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRMstErrorcBseZdZRS(sGeneric exception that is the base exception of all other error exceptions. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRNstInterfaceErrorcBseZdZRS(siGeneric exception raised for errors that are related to the database interface rather than the database itself. For example, if the interface attempts to use an SSL connection but the server refuses, an InterfaceError will be raised. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyROst DatabaseErrorcBseZdZRS(sGeneric exception raised for errors that are related to the database. This exception is currently never raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRPst DataErrorcBseZdZRS(sGeneric exception raised for errors that are due to problems with the processed data. This exception is not currently raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRQstOperationalErrorcBseZdZRS(s= Generic exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer. This exception is currently never raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRRstIntegrityErrorcBseZdZRS(s Generic exception raised when the relational integrity of the database is affected. This exception is not currently raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRSst InternalErrorcBseZdZRS(sNGeneric exception raised when the database encounters an internal error. This is currently only raised when unexpected state occurs in the pg8000 interface itself, and is typically the result of a interface bug. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRTstProgrammingErrorcBseZdZRS(s&Generic exception raised for programming errors. For example, this exception is raised if more parameter fields are in a query string than there are available parameters. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRUstNotSupportedErrorcBseZdZRS(sGeneric exception raised in case a method or database API was used which is not supported by the database. This exception is part of the `DBAPI 2.0 specification `_. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRVstArrayContentNotSupportedErrorcBseZdZRS(s Raised when attempting to transmit an array where the base type is not supported for binary data transfer by the interface. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRW%stArrayContentNotHomogenousErrorcBseZdZRS(sl Raised when attempting to transmit an array that doesn't contain only a single type of object. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRX-stArrayContentEmptyErrorcBseZdZRS(sRaised when attempting to transmit an empty array. The type oid of an empty array cannot be determined, and so sending them is not permitted. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRY5st!ArrayDimensionsNotConsistentErrorcBseZdZRS(sf Raised when attempting to transmit an array that has inconsistent multi-dimension sizes. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRZ<stByteacBseZdZRS(sBytea is a str-derived class that is mapped to a PostgreSQL byte array. This class is only used in Python 2, the built-in ``bytes`` type is used in Python 3. (RRR9(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR[DscCstj|||S(sConstuct an object holding a date value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.date` (tdatetimetdate(tyeartmonthtday((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytDateLscCstj|||S(sConstruct an object holding a time value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.time` (R\ttime(thourtminutetsecond((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytTimeWscCstj||||||S(sConstruct an object holding a timestamp value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.datetime` (R\(R^R_R`RcRdRe((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt TimestampbscCsttj|d S(sConstruct an object holding a date value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.date` i(RaRbt localtime(tticks((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt DateFromTicksms cCsttj|dd!S(sConstruct an objet holding a time value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.time` ii(RfRbRh(Ri((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt TimeFromTicksys cCsttj|d S(s Construct an object holding a timestamp value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.datetime` i(RgRbRh(Ri((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytTimestampFromTickss cCstrt|S|SdS(sConstruct an object holding binary data. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`pg8000.types.Bytea` for Python 2, otherwise :class:`bytes` N(R R[(R+((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytBinarys it tALTERtCREATEcsGd}d}d}d}d}t}t}gg} tdtd} |} d} xt|D]\} }| dt|kr|| d}nd}| |krY|dkr| j|| dkr|} qV|} q|d kr| j||} q|d kr3|d kr3| jt| q|d kr[|d kr[| jdq|dkr|d kr|} jdq|dkr|dkr|dkr|} jdq|d!krI|dkrId}|rt}| j|qV|dkrt}qV|dkr:|} | jt| qVt dq| j|n| |kr|dkr| j||rt}q|dkrt}q|} q|d"kr |dkr |rt}| j|q|dkrt}qt d|dq| j|n| |kr|d krI|} | j|q|d#kr|dkr|r}t}| j|q|dkrt}qt d|dq| j|nJ| |krc|dkr| dkr| j||} q|d$krS|dkrS|r't}| j|q`|dkr<t}q`t d|dq| j|n| |kr|dkr,dc|7<|dks|j r|dkr|} y?j ddd}| jdt |dd=Wq)t k r%| jdt tq)Xqq|dkr| dkr|dkr|} y?j ddd}| jdt |dd=Wqt k r| jdt tqXq|dkrqdc|7Ms(ttuple(R(t placeholders(RsIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRLs(sformatR}(R}sformat(R}sformat(R}sformat(snumericRwsformat(tFalseR RR5t enumeratetlentappendR tTrueROtisalnumtindexRrt ValueErrortjoin(tstyletquerytOUTSIDEt INSIDE_SQt INSIDE_QIt INSIDE_ESt INSIDE_PNtin_quote_escapetin_param_escapet output_queryt param_idxtstatetprev_cR@tctnext_ctpidxR((RsIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytconvert_paramstyles          $                        %  '   $      ittzinfocCstt||d}yttd|SWnEtk ro}|tkrPtjjS|tkrftjjS|nXdS(NiR!( tq_unpacktEPOCHRR)tINFINITY_MICROSECONDSR\tmaxtMINUS_INFINITY_MICROSECONDStmin(tdatatoffsettlengthtmicroste((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamp_recv_integer\s    cCsttt||dS(Ni(tutcfromtimestampt EPOCH_SECONDStd_unpack(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamp_recv_floatjscCsg|tjjkrt}nB|tjjkr6t}n'tt|jtd|j }t |S(Ng.A( R\RRRRtintRt timetupleRt microsecondtq_pack(tvR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamp_send_integeros  $cCs%tt|j|jdtS(Ng.A(td_packRRRR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamp_send_float{scCst|jtjddS(NR(Rt astimezonetutctreplaceR5(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamptz_send_integerscCst|jtjddS(NR(RRRRR5(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamptz_send_floatscCsht||d}yttd|SWn9tk rc}|tkrJtS|tkrZtS|nXdS(NiR!(RtEPOCH_TZRR)RtDATETIME_MAX_TZRtDATETIME_MIN_TZ(RRRRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamptz_recv_integers  cCst|||jdtS(NR(RRR(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttimestamptz_recv_floatscCsr|j}y|t|jd7}Wntk r7nXy |j}Wntk r^d}nXt||j|S(Ng.Ai(R!RtsecondstAttributeErrorR#tqii_packR"(RR!R#((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinterval_send_integers     cCsp|jdd}y||j7}Wntk r5nXy |j}Wntk r\d}nXt||j|S(Ng@@i(R!RRR#tdii_packR"(RRR#((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinterval_send_floats    cCs`t||\}}}|dkrLt|d\}}tj|||St|||SdS(Nig.A(t qii_unpacktdivmodR\RR (RRRR!R"R#RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinterval_recv_integers  cCsnt||\}}}|dkrLt|d\}}tj|||Stt|dd||SdS(Nig.Ai(t dii_unpackRR\RR R(RRRRR"R#tsecsR!((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinterval_recv_floats  cCst||dS(Ni(R(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt int8_recvscCst||dS(Ni(th_unpack(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt int2_recvscCst||dS(Ni(ti_unpack(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt int4_recvscCst||dS(Ni(tf_unpack(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt float4_recvscCst||dS(Ni(R(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt float8_recvscCs|S(N((R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt bytea_sendscCst||||!S(N(R[(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt bytea_recvscCs||||!S(N((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRscCs|jS(N(tbytes(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt uuid_sendscCstd||||!S(NR(R(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt uuid_recvsstcCs|r tStS(N(tTRUEtFALSE(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt bool_sendscCstS(N(tNULL(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt null_sendscCst||||!S(N(R(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytint_in stCursorcBseZdZdZedZedZedZdZdddZ dZ dZ dd Z d Zd Zd Zd ZddZdZRS(s<A cursor object is returned by the :meth:`~Connection.cursor` method of a connection. It has the following attributes and methods: .. attribute:: arraysize This read/write attribute specifies the number of rows to fetch at a time with :meth:`fetchmany`. It defaults to 1. .. attribute:: connection This read-only attribute contains a reference to the connection object (an instance of :class:`Connection`) on which the cursor was created. This attribute is part of a DBAPI 2.0 extension. Accessing this attribute will generate the following warning: ``DB-API extension cursor.connection used``. .. attribute:: rowcount This read-only attribute contains the number of rows that the last ``execute()`` or ``executemany()`` method produced (for query statements like ``SELECT``) or affected (for modification statements like ``UPDATE``). The value is -1 if: - No ``execute()`` or ``executemany()`` method has been performed yet on the cursor. - There was no rowcount associated with the last ``execute()``. - At least one of the statements executed as part of an ``executemany()`` had no row count associated with it. - Using a ``SELECT`` query statement on PostgreSQL server older than version 9. - Using a ``COPY`` query statement on PostgreSQL server version 8.1 or older. This attribute is part of the `DBAPI 2.0 specification `_. .. attribute:: description This read-only attribute is a sequence of 7-item sequences. Each value contains information describing one result column. The 7 items returned for each column are (name, type_code, display_size, internal_size, precision, scale, null_ok). Only the first two values are provided by the current implementation. This attribute is part of the `DBAPI 2.0 specification `_. cCsF||_d|_d|_d|_t|_d|_t|_ dS(Nii( t_ct arraysizeR5tpst _row_countRt _cached_rowst portal_nameRtportal_suspended(Rt connection((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR$Es      cCstddd|jS(Ns'DB-API extension cursor.connection usedt stackleveli(RR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRNscCs|jS(N(R(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytrowcountSscCs |jS(N(t_getDescription(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3Wsc Cs{|jdkrdS|jd}t|dkr6dSg}x8|D]0}|j|d|ddddddfqCW|S(Ntrow_descitnamettype_oid(RR5RR(RRtcolumnstcol((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRYs  (cCsyi|jjW||_|jj rL|jj rL|jj|ddn|jj|||WdQXWnXtk r}|jdkrtdq|jj dkrtdq|nXdS(seExecutes a database operation. Parameters may be provided as a sequence, or as a mapping, depending upon the value of :data:`pg8000.paramstyle`. This method is part of the `DBAPI 2.0 specification `_. :param operation: The SQL statement to execute. :param args: If :data:`paramstyle` is ``qmark``, ``numeric``, or ``format``, this argument should be an array of parameters to bind into the statement. If :data:`paramstyle` is ``named``, the argument should be a dict mapping of parameters. If the :data:`paramstyle` is ``pyformat``, the argument value may be either an array or a mapping. :param stream: This is a pg8000 extension for use with the PostgreSQL `COPY `_ command. For a COPY FROM the parameter must be a readable file-like object, and for COPY TO it must be writable. .. versionadded:: 1.9.11 sbegin transactionNs Cursor closedsconnection is closed( Rt_locktstreamtin_transactiont autocommittexecuteR5RROt_sock(Rt operationtargsRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRjs   cCs\g}x.|D]&}|j|||j|jq Wd|krIdn t||_dS(s1Prepare a database operation, and then execute it against all parameter sequences or mappings provided. This method is part of the `DBAPI 2.0 specification `_. :param operation: The SQL statement to execute :param parameter_sets: A sequence of parameters to execute the statement with. The values in the sequence should be sequences or mappings of parameters, the same as the args argument of the :meth:`execute` method. iN(RRRtsum(RRt param_setst rowcountst parameters((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt executemanys  cCs_yt|SWnJtk r"dStk r>tdntk rZtdnXdS(s Fetch the next row of a query result set. This method is part of the `DBAPI 2.0 specification `_. :returns: A row as a sequence of field values, or ``None`` if no more rows are available. s#attempting to use unexecuted cursorN(R t StopIterationR5R&RUR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytfetchones    cCsPy,tt||dkr!|jn|SWntk rKtdnXdS(sFetches the next set of rows of a query result. This method is part of the `DBAPI 2.0 specification `_. :param size: The number of rows to fetch when called. If not provided, the :attr:`arraysize` attribute value is used instead. :returns: A sequence, each entry of which is a sequence of field values making up a row. If no more rows are available, an empty sequence will be returned. s#attempting to use unexecuted cursorN(RRR5RR&RU(Rtnum((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt fetchmanys ) cCs2yt|SWntk r-tdnXdS(s$Fetches all remaining rows of a query result. This method is part of the `DBAPI 2.0 specification `_. :returns: A sequence, each entry of which is a sequence of field values making up a row. s#attempting to use unexecuted cursorN(RR&RU(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytfetchalls  cCs d|_dS(sCloses the cursor. This method is part of the `DBAPI 2.0 specification `_. N(R5R(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytclosescCs|S(soA cursor object is iterable to retrieve the rows from a query. This is a DBAPI 2.0 extension. ((R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__iter__scCsdS(sThis method is part of the `DBAPI 2.0 specification `_, however, it is not implemented by pg8000. N((Rtsizes((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt setinputsizesscCsdS(sThis method is part of the `DBAPI 2.0 specification `_, however, it is not implemented by pg8000. N((Rtsizetcolumn((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt setoutputsizesc Cs|jjy|jjSWntk r |jr|jj||jjt|jj |jj ||js|jj |qny|jjSWq tk r|j dkrtdqt|j ddkrtdqtq XnXWdQXdS(NsA query hasn't been issued.Ris no result set(RRRtpopleftt IndexErrorRt send_EXECUTEt_writetSYNC_MSGt_flushthandle_messagest close_portalRR5RURR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__next__s&      N(RRR9R$R:RRt descriptionRR5RRRRR R R R RR(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs 3  *        tNtRtStKtZtTRutDtCt1t2t3RtntttARtGtHtItBtPRtXitMtWtFtLs[] 'us{}itMulticastDelegatecBs5eZdZdZdZdZdZRS(cCs g|_dS(N(t delegates(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR$ZscCs|j||S(N(tadd(Rtdelegate((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__iadd__]s cCs|jj|dS(N(R4R(RR6((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR5ascCs|jj||S(N(R4tremove(RR6((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__isub__dscOs%x|jD]}|||q WdS(N(R4(RRtkwargsRC((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt__call__hs(RRR$R7R5R9R;(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3Ys     t ConnectioncBs'eZdZedZedZedZedZedZedZ edZ edZ ed Z d Z ee Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/d+Z0d,Z1d-Z2d.Z3d/Z4d0Z5d1Z6e7d2Z8e7d3Z9d4Z:RS(5s2 A connection object is returned by the :func:`pg8000.connect` function. It represents a single physical connection to a PostgreSQL database. .. attribute:: Connection.notifies A list of server-side notifications received by this database connection (via the LISTEN/NOTIFY PostgreSQL commands). Each list element is a two-element tuple containing the PostgreSQL backend PID that issued the notify, and the notification name. PostgreSQL will only send notifications to a client between transactions. The contents of this property are generally only populated after a commit or rollback of the current transaction. This list can be modified by a client application to clean out notifications as they are handled. However, inspecting or modifying this collection should only be done while holding the :attr:`notifies_lock` lock in order to guarantee thread-safety. This attribute is not part of the DBAPI standard; it is a pg8000 extension. .. versionadded:: 1.07 .. attribute:: Connection.notifies_lock A :class:`threading.Lock` object that should be held to read or modify the contents of the :attr:`notifies` list. This attribute is not part of the DBAPI standard; it is a pg8000 extension. .. versionadded:: 1.07 .. attribute:: Connection.autocommit Following the DB-API specification, autocommit is off by default. It can be turned on by setting this boolean pg8000-specific autocommit property to True. .. versionadded:: 1.9 .. exception:: Connection.Error Connection.Warning Connection.InterfaceError Connection.DatabaseError Connection.InternalError Connection.OperationalError Connection.ProgrammingError Connection.IntegrityError Connection.DataError Connection.NotSupportedError All of the standard database exception types are accessible via connection instances. This is a DBAPI 2.0 extension. Accessing any of these attributes will generate the warning ``DB-API extension connection.DatabaseError used``. cCs |jtS(N(t _getErrorRM(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RN(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RO(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RP(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RS(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RT(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RU(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3scCs |jtS(N(R=RV(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3sidcCstd|jdd|S(Ns#DB-API extension connection.%s usedRi(RR(Rterror((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR=sc # s d_tdtdtdtdtdtdtdf_tj_|dkrytjd _ Wqt k rytjd _ Wqt k rt d qXqXn |_ t j t rj jd_ n|_t_d_td _d _d _y|dkrv|dk rvtjtjtj_nT|dk rttdst dntjtjtj_n tdt r|dk rjj|n|dkr!|dk r!jj ||fn|dk r@jj |n|rjyqddl!} jj"t#ddjj$d} | tdkr| j%j_n t dWnt&k rt dnXWdQXnjj'dd_(Wn2tj)k r7} jj*t d| nXj(j+_,j(j-_.j(j/_0d_1t2_3t2_4t2_5j4j67_4fd} fd} fd}fd}t7t8t9t:t;dt;d it<d!6fd"}fd#}fd$}trzfd%d&}fd'}n'fd(d)}fd*}fd+}fd,}fd-}fd.}tfd/i&t=|fd06t=t>fd16t=fd26t=t?fd36t=t@fd46tA|fd56t=tBfd66t=fd76tAtCfd86tAtCfd96tA|fd:6t=tDfd;6t=tEfd<6t=fd=6tAfd>6t=|fd?6t=|fd@6t=|fdA6t=|fdB6t=|fdC6t=|fdD6t=|fdE6t=|fdF6t=|fdG6t=|fdH6t=fdI6t=fdJ6tA|fdK6tA|fdL6t=tFfdM6t=tGfdN6t=tHfdO6tA|fdP6t=|fdQ6tA|fdR6t=fdS6t=tIfdT6tA|fdU6_Ji dt=tKftLd6d0t=tMftN6d=tA|ftO6d<t=tPftQ6dKtA|ftRjS6dLtA| ftRjT6dMt=tUfdM6dNt=tVfdN6dOt=tWftRjX6dOt=tWftY6dRtA|ft<6dTt=tZft[6_\ij]tRjR6j^t_6j^t`6_atrId1t=tbfj\tcscs^|tjjkr"djjS|tjjkrDdjjS|jjjSdS(Ntinfinitys -infinity(R\R]RRMRNRRP(R(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytdate_outAs cst|jjS(N(RrRMRN(R(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt unknown_outIss{}s[]Rcsg}d}x||||!jjjjtdtdD]i}|d kry|d kry|jdn(|d kr|dkr|jd n|j||}qKWtd j |S(NRR5t[t]t,Rs Decimal('Rs')R|(RURVRWR(RURW(RVRW(RURVRWR( R5tdecodeRNt translateRRtextendRtevalR(RtidxRtarrRR(tglblsRt trans_tab(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytarray_inOs %  c s9||}t||\}}}|d7}j|d}g}x8t|D]*} |jt||d|d7}qPWg} xk||krt||\} |d7}| dkr| jdq| j|||| || 7}qWx@t|dD].}tt tt t | g|} qW| S(Ni iiiii( t iii_unpacktpg_typestrangeRt ii_unpackRR5treversedtlistR tziptiter( RR\Rt final_idxtdimthasnullttypeoidt conversiont dim_lengthsR@tvaluest element_len(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt array_recv^s&    ,cs5td||||!jjjdddS(NRURnRWRV(R[RXRNR(RR\R(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt vector_in~scst||||!jS(N(tunicodeRN(RRR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt text_recvscSs||dkS(Ns((RCtotl((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt bool_recvscs!tt||||!jS(N(RRsRN(RRR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytjson_inscst||||!jS(N(RrRN(RRR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRtscSs||dkS(Ni((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRwscs!tt||||!jS(N(RRrRN(RRR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRxscst|||d!}t||d|d!}t||d||!jj}tj||t|t|t|dS(Niiiii@B(RRRXRNR\Rb(RRRRcRdtsec(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyttime_ins $cs|||d!jj}|dkr3tjjS|dkrItjjStjt|t||d|d!t||d|d!SdS(Nitinfis-infiiii (RXRNR\R]RRR(RRRtyear_str(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytdate_ins    !cs!t||||!jjS(N(RRXRN(RRR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt numeric_inscst|jjS(N(RrRMRN(RC(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt numeric_outscs tfS(N(tFC_TEXT((Rt(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR3siiiiiiiiiiiriiii=iiiiiiiiiiiii:i;iZiiiiiii i(t ip_addresst IPv4Addresst IPv6Addresst ip_networkt IPv4Networkt IPv6Networkcst|jjS(N(RrRMRN(R(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinet_outscsD||||!jj}d|kr6|tS|SdS(Nt/(RXRNR(RRRtinet_str(RRR(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytinet_ins    ieitusert databaseii(RNR t_commands_with_countt threadingtLockRR5tostenvirontusertKeyErrorROR%RRMtpasswordRRt_xidRt_cacheststatement_numbert portal_numbertsockettAF_INETt SOCK_STREAMt_usockthasattrRJRUR t settimeouttconnecttssltsendalltii_packtrecvt wrap_sockett ImportErrortmakefileRR>R tflushRtreadt_readtwriteRt_backend_key_dataR3tNoticeReceivedtParameterStatusReceivedtNotificationReceivedthandle_PARAMETER_STATUSRIRgR tordRRt FC_BINARYRRRRRRRRRRRRRbRttypeRtboolRRtfloatR\R]RbRRRRR RRtpy_typestinspect_datetimet array_inspectRfRt inspect_funcsRR[RrtlongRt ipaddressRRRRRRthandle_NOTICE_RESPONSEtNOTICE_RESPONSEthandle_AUTHENTICATION_REQUESTtAUTHENTICATION_REQUESTtPARAMETER_STATUSthandle_BACKEND_KEY_DATAtBACKEND_KEY_DATAthandle_READY_FOR_QUERYtREADY_FOR_QUERYthandle_ROW_DESCRIPTIONtROW_DESCRIPTIONthandle_ERROR_RESPONSEtERROR_RESPONSEthandle_EMPTY_QUERY_RESPONSEtEMPTY_QUERY_RESPONSEthandle_DATA_ROWtDATA_ROWthandle_COMMAND_COMPLETEtCOMMAND_COMPLETEthandle_PARSE_COMPLETEtPARSE_COMPLETEthandle_BIND_COMPLETEt BIND_COMPLETEthandle_CLOSE_COMPLETEtCLOSE_COMPLETEthandle_PORTAL_SUSPENDEDtPORTAL_SUSPENDEDthandle_NO_DATAtNO_DATAthandle_PARAMETER_DESCRIPTIONtPARAMETER_DESCRIPTIONthandle_NOTIFICATION_RESPONSEtNOTIFICATION_RESPONSEthandle_COPY_DONEt COPY_DONEthandle_COPY_DATAt COPY_DATAthandle_COPY_IN_RESPONSEtCOPY_IN_RESPONSEthandle_COPY_OUT_RESPONSEtCOPY_OUT_RESPONSEt message_typest bytearrayti_packt NULL_BYTERZRRtcursort_cursort ci_unpackt Exceptiont_closeRtnotifiest notifies_lock(#RRthostt unix_socktporttdatabaseRRttimeoutt sslmoduletrespRRORQRSRTR`RqRrRwRxRzR}R~RRRRRRRtprotocoltvaltcodetdata_len((R^RRRRtR_sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR$s $$                  *                                            .                     $      %   csvtfd|jtD}t|}|tdkrStd_nttd|D_dS(Nc3s2|](}|dd!|djjfVqdS(iiN(RXRN(RR(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys Tst28000s"md5 password authentication failedcss|]\}}|VqdS(N((RtkR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys Zs(RtsplitRRIt RESPONSE_CODEROR>RU(RRRt responsestmsg_dict((RsIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRRs  cCstd|_dS(Nsquery was empty(RUR>(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR\scCsdS(N((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR_scCsdS(N((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRbscCsdS(N((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRgscCs t|_dS(N(RR(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRjscCsdS(N((RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRmscCs t|_dS(N(Rt _copy_done(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRuscCs4t|\}}|jdkr0tdndS(Ns7An output stream is required for the COPY OUT response.(t bh_unpackRR5RO(RRRt is_binarytnum_cols((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRxscCs|jj|dS(N(RR(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRscCsHt|\}}|jjs't|jdkrEtdntrxtr|jj d}|spPn|j t t t |d|j ||jqNWnqtd}xbtr|jj|}|dkrPn|j t t |d|j || |jqW|j t|j t|jdS(Ns5An input stream is required for the COPY IN response.i ii(RRtlockedtAssertionErrorRR5ROR RRRRRRRRtreadintot COPY_DONE_MSGR(RRRRRtbffrt bytes_read((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs0  !      cCs|j|t|d}d}|jt||}||||!jd}||d7}|jt||}|j|jj||fWdQXdS(Niitasciii(RRtfindRRXRRR(RRRt backend_pidR\tnullt condition((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs  cCs t|S(sCreates a :class:`Cursor` object bound to this connection. This function is part of the `DBAPI 2.0 specification `_. (R(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRscCs*|j|j|jddWdQXdS(sCommits the current database transaction. This function is part of the `DBAPI 2.0 specification `_. tcommitN(RRRR5(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs cCs*|j|j|jddWdQXdS(sRolls back the current database transaction. This function is part of the `DBAPI 2.0 specification `_. trollbackN(RRRR5(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs cCszy(|jt|j|jjWn`tk rJtdnDtk rftdn(tj k r}t t |nXWd|j jd|_XdS(Nsconnection is closed(Rt TERMINATE_MSGRRR RRORRR>RRRrRR5(RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs     cCs|j|jWdQXdS(sCloses the database connection. This function is part of the `DBAPI 2.0 specification `_. N(RR(R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR s cCs|jjstt|d}|dkr4nT|dkr|jdkr^tdn|jt|jj dt |j n|dkrEt dj t|d}|jdkrtdnt d tt|jj d|jjj d|jj d}|jt|t |j nC|dkrntdt|dntdt|ddS(NiisGserver requesting password authentication, but no password was providedR iR|isKserver requesting MD5 password authentication, but no password was providedRiiiii sAuthentication method s not supported by pg8000.s not recognized by pg8000.(iiiiii (RRRRRR5ROt _send_messagetPASSWORDRMRRR Rt cccc_unpackRRt hexdigestRr(RRRt auth_codetsalttpwd((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs8       %      cCs|tk|_dS(N(tIDLER(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR-scCs ||_dS(N(R(RRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR1scCs)|jdkr|jdS|jdSdS(NiZi(RR5R(RR+((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR4s cCsg}x|D]}t|}y|j|j|Wq tk ry|j|j||Wqtk r}tdt|dqXq Xq Wt|S(Nstype snot mapped to pg type(RRRRRRVRrR(RRotparamsR+ttypR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt make_params:s   #c Cst|d}d}xt|D]}|||jt|!}|t|d7}ttdt||}||d <|d 7}|jd j ||j |d\|d <|dqst param_funcscss|]}|dVqdS(iN((RRs((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys usiisconnection is closedc3s$|]}j|ddVqdS(RiN(Rb(RRD(R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys scss|]}|dVqdS(R"N((RRD((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys st input_funcsR;RAtbind_1tbind_2tpg8000_portal_sWith autocommit on, it's not possible to retrieve more rows than the pg8000 cache size, as the portal is closed when the transaction is closed.((2R5tpg8000t paramstyleRRRRRRrRRMRRRRZRNth_packRRRtPARSEtDESCRIBEt STATEMENTRRRRRRORR>RRRRRtclearRRRtportal_name_binR<t_row_cache_size_bint execute_msgRgRtBINDRRRR(RRRRR-tcacheR%RRRtkeyRtstatement_nametstatement_name_bint param_fcsRtoidtfct send_funcRt output_fctretvalR+((RsIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRXs           )   ."             cCsyH|j||jtt|d|j||jtWnVtk r}t|dkr{tdq|ntk rtdnXdS(Niswrite to closed filesconnection is closed(RRRt FLUSH_MSGRRrROR(RRRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs    cCs t|_|jt|jdS(N(RRRtEXECUTER5(RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs cCsdS(N((RtmsgR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRscCs|d jt}|d}||jkrit|d}|jdkrW||_qi|j|7_n|tkrx)|jD]}|j|djqWndS(NiiR(Rt BINARY_SPACERRRt DDL_COMMANDSRR2(RRRRotcommandt row_countR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs   cCsd}g}xq|jdD]b}t||d}|d7}|dkrY|jdq|j||||||7}qW|jj|dS(NiR(iii(RRRR5R(RRRtdata_idxtrowR"tvlen((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRs  cCsd}|_ySxL|tkr^t|jd\}}|j||j|d|qWWn|jnX|jdk r|jndS(Nii(R5R>RRRRR(RRRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR"s ) cCs?|jtt|j|jt|j|j|dS(N(RtCLOSEtPORTALR3RRRR(RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR4s  cCs0td|jtD}|j|dS(Ncss&|]}|dd!|dfVqdS(iiN((RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pys @s(RIRRR(RRRR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR?scCs|jt}|| ||dd!}}|tdkrj|jdj}tj|||_n$|tdkr|tdkr%dtt f|j dR(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt send_arrays"      csxQt|D]C\}}}t|tdfs tdtq q Wt|t|}xOt|D]A\}}}|dkrd||R(sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR`s    (tarray_find_first_elementR5RYRt issubclassR RR\tmin_int2tmax_int2RR-R.R'R(RR.RRRWRtpg_array_typesRRrRV( RR+t first_elementtint2_oktint4_oktint8_okRt array_oidR=R`((R<R>RsIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRps\           cCs |||fS(s)Create a Transaction IDs (only global_transaction_id is used in pg) format_id and branch_qualifier are not used in postgres global_transaction_id may be any string identifier supported by postgres returns a tuple (format_id, global_transaction_id, branch_qualifier)((Rt format_idtglobal_transaction_idtbranch_qualifier((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pytxidscCs/||_|jr+|j|jddndS(s.Begins a TPC transaction with the given transaction ID xid. This method should be called outside of a transaction (i.e. nothing may have executed since the last .commit() or .rollback()). Furthermore, it is an error to call .commit() or .rollback() within the TPC transaction. A ProgrammingError is raised, if the application calls .commit() or .rollback() during an active TPC transaction. This function is part of the `DBAPI 2.0 specification `_. sbegin transactionN(RRRRR5(RRp((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt tpc_begins  cCs.d|jdf}|j|j|ddS(sPerforms the first phase of a transaction started with .tpc_begin(). A ProgrammingError is be raised if this method is called outside of a TPC transaction. After calling .tpc_prepare(), no statements can be executed until .tpc_commit() or .tpc_rollback() have been called. This function is part of the `DBAPI 2.0 specification `_. sPREPARE TRANSACTION '%s';iN(RRRR5(RRB((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt tpc_prepares cCs|dkr|j}n|dkr3tdnzV|j}t|_||jkr~|j|jd|dfdn |jWd||_Xd|_dS(s%When called with no arguments, .tpc_commit() commits a TPC transaction previously prepared with .tpc_prepare(). If .tpc_commit() is called prior to .tpc_prepare(), a single phase commit is performed. A transaction manager may choose to do this if only a single resource is participating in the global transaction. When called with a transaction ID xid, the database commits the given transaction. If an invalid transaction ID is provided, a ProgrammingError will be raised. This form should be called outside of a transaction, and is intended for use in recovery. On return, the TPC transaction is ended. This function is part of the `DBAPI 2.0 specification `_. s.Cannot tpc_commit() without a TPC transaction!sCOMMIT PREPARED '%s';iN( R5RRURRt tpc_recoverRRR(RRptprevious_autocommit_mode((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt tpc_commits        cCs|dkr|j}n|dkr3tdnzV|j}t|_||jkr~|j|jd|dfdn |jWd||_Xd|_dS(sDWhen called with no arguments, .tpc_rollback() rolls back a TPC transaction. It may be called before or after .tpc_prepare(). When called with a transaction ID xid, it rolls back the given transaction. If an invalid transaction ID is provided, a ProgrammingError is raised. This form should be called outside of a transaction, and is intended for use in recovery. On return, the TPC transaction is ended. This function is part of the `DBAPI 2.0 specification `_. s9Cannot tpc_rollback() without a TPC prepared transaction!sROLLBACK PREPARED '%s';iN( R5RRURRRsRRR(RRpRt((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyt tpc_rollback s        cCsjzY|j}t|_|j}|jdg|D]}|jd|dd^q5SWd||_XdS(sReturns a list of pending transaction IDs suitable for use with .tpc_commit(xid) or .tpc_rollback(xid). This function is part of the `DBAPI 2.0 specification `_. s!select gid FROM pg_prepared_xactsiR|N(RRRRRp(RRttcursRI((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRsC s    .(;RRR9R:RMRNRORPRRRSRTRURVt_row_cache_sizeRR4R=R$RRRRRRRRRRRRRRRRR RRRRRRRRRRRRRRRRRRpRqRrR5RuRvRs(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR<msp<            #   :           - a    ' $iiiiiiiit mule_internalteuc_twtgb2312teuc_cntis8859_5t iso_8859_5tis8859_6t iso_8859_6tis8859_7t iso_8859_7tis8859_8t iso_8859_8tkoi8_rtkoi8s iso8859-1tlatin1t iso8859_2tlatin2t iso8859_3tlatin3t iso8859_4tlatin4t iso8859_9tlatin5t iso8859_10tlatin6t iso8859_13tlatin7t iso8859_14tlatin8t iso8859_15tlatin9R t sql_asciitcp886twin866tcp874twin874tcp1250twin1250tcp1251twin1251tcp1252twin1252tcp1253twin1253tcp1254twin1254tcp1255twin1255tcp1256twin1256tcp1257twin1257tcp1258twin1258sutf-8Rsccsoxht|D]Z\}}t|trYx<t|D]\}}}|||fVq5Wq |||fVq WdS(N(RR%RfRW(R]R@RR]ti2tv2((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRW s cCs+x$t|D]}|dk r |Sq WdS(N(R\R5(R]R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRc s ccsHxA|D]9}t|tr;x!t|D] }|Vq)Wq|VqWdS(N(R%RfR\(R]RR((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyR\ s   cCs|d}t|trt|}t|}xG|D]?}t|}t||ksh||kr8tdq8q8W|g}|j||Sx,|D]$}t|trtdqqWgSdS(Nisarray dimensions not consistent(R%RfRRXRZRZ(R]tv0treq_lentreq_inner_lengthsRt inner_lengthsR@((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRX s"        cCs+x$t|D]}|dkr tSq WtS(N(R\R5RR(R]R((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRY s cCsO|d}t|tr>t|g}|jt|n t|gS|S(Ni(R%RfRRZRZ(R]RR@((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyRZ s   (R\RtwarningsRRRtstructRthashlibRtdecimalRt collectionsRRt itertoolsRRt six.movesR tsixR R R R RRRtuuidRtcopyRtcalendarRRtdistutils.versionRRRbR,t __author__tjsonRRRRRRtobjectR R?RRR.RRRRRtf_packRR[RaRRdRRRRt ihihih_packR#tci_packRtbh_packRt cccc_packRReRfR-R.R'R(RRMRNRORPRQRRRSRTRURVRWRXRYRZR[RaRfRgRjRkRlRmtBINARYRRRRDRERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR6R/RBtFLUSHtSYNCRR0t TERMINATERKRARRRR1RLtRESPONSE_SEVERITYRt RESPONSE_MSGtRESPONSE_DETAILt RESPONSE_HINTtRESPONSE_POSITIONtRESPONSE__POSITIONtRESPONSE__QUERYtRESPONSE_WHEREt RESPONSE_FILEt RESPONSE_LINEtRESPONSE_ROUTINERtIDLE_IN_TRANSACTIONtIDLE_IN_FAILED_TRANSACTIONRIRgRRfR5RaR3R<RgRRRWRcR\RXRYRZ(((sIc:\users\saunak\appdata\local\temp\pip-build-difb2t\pg8000\pg8000\core.pyts   4      T                                                                                         ;