
    i;             y       
   d dl Z d dlZd dlZd dlmZmZmZmZmZm	Z	 d dl
Z
ddlmZmZmZmZmZ ddlmZ ddlmZmZmZ ddlmZ ddlmZ dd	lmZmZmZmZ dd
lm Z  ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4  e j5        dg d          Z6 G d de          Z7 G d de7          Z8dede8f         dede8f         fdZ9e9	 d`dde8ddddddddddddddddddddddddddddddddddddddddddddddddddddddd9dee:         d ed!         d"ee:         d#ee8         d$ee          d%ee:         d&ee:         d'ee:         d(ee:         d)ee:         d*ee	e:e;ef                  d+ee:         d,ee<         d-ee:         d.ee:         d/ee<         d0ee:         d1ee:         d2ee:         d3ee:         d4ee:         d5ee
j=                 d6ee<         d7ee<         d8ee<         d9ee>         d:ee?         d;ee:         d<ee:         d=ee?         d>ee?         d?ee
j@                 d@ee?         dAee<         dBee:         dCee:         dDee?         dEee:         dFeeA         dGeeA         dHeeA         dIee:         dJee:         dKee         dLee<         dMee:         dNee?         dOeejB                 dPee:         dQee:         dRee:         dSee:         dTee:         dUee?         dVee?         dWeeC         dXee:         dYee<         de8fvdZ            ZD G d[ d\e7          ZEdedeEf         dedeEf         fd]ZFeF	 d`ddeEddddddddddddddddddddddddddddddddddddddddddddddddddddddd9dee:         d ed^         d"ee:         d#eeE         d$ee          d%ee:         d&ee:         d'ee:         d(ee:         d)ee:         d*ee	e:e;ef                  d+ee:         d,ee<         d-ee:         d.ee:         d/ee<         d0ee:         d1ee:         d2ee:         d3ee:         d4ee:         d5ee
j=                 d6ee<         d7ee<         d8ee<         d9ee>         d:ee?         d;ee:         d<ee:         d=ee?         d>ee?         d?ee
j@                 d@ee?         dAee<         dBee:         dCee:         dDee?         dEee:         dFeeA         dGeeA         dHeeA         dIee:         dJee:         dKee         dLee<         dMee:         dNee?         dOeejB                 dPee:         dQee:         dRee:         dSee:         dTee:         dUee?         dVee?         dWeeC         dXee:         dYee<         deEfvd_            ZGdS )a    N)AnyCallableIteratorTypeOptionalUnion   )	base_impldriver_modeerrors
thick_impl	thin_impl)pool)
AsyncQueueQueueMessageProperties)ArrowSchemaImpl)BaseMetaClass)DB_TYPE_BLOBDB_TYPE_CLOBDB_TYPE_NCLOBDbType)ConnectParams)AsyncCursorCursor)	DataFrame)DbObjectTypeDbObject)AsyncLOBLOB)PipelinePipelineOpResult)SodaDatabase)Subscription)$normalize_sessionless_transaction_idXid)	format_idglobal_transaction_idbranch_qualifierc                   @   e Zd ZdZd Zd ZdVdZdeddfdZe	de
fd            Zej        d	e
ddfd
            Ze	defd            Zej        d	eddfd            Z	 	 	 dWdeee
ef                  dededefdZe	defd            Zej        d	eddfd            ZdVdZe	de
fd            Zej        d	e
ddfd            Ze	de
fd            Zej        d	e
ddfd            Ze	de
fd            Zej        d	e
ddfd            Ze	de
fd            Ze	de
fd            Ze	de
fd            Zej        d	e
ddfd            Zd edefd!Ze	de
fd"            Ze	de
fd#            Zej        d	e
ddfd$            Ze	de
fd%            Z d	edefd&Z!e	de
fd'            Z"e"j        d	e
ddfd(            Z"e	de#fd)            Z$e$j        d	e#ddfd*            Z$e	de
fd+            Z%e	de
fd,            Z&e&j        d	e
ddfd-            Z&defd.Z'e	defd/            Z(e	defd0            Z)e	defd1            Z*e	de
fd2            Z+e+j        d	e
ddfd3            Z+	 	 	 	 	 	 	 dXd4eeee
e,f                  d5ee
         d6ee         d7ee
         d8ee         d9ee         d:ee-         de.fd;Z/	 dYdd<d=e
d>eee0e
f                  d?ee0         dee1e2f         fd@Z3e	de#fdA            Z4e4j        d	e#ddfdB            Z4e	dee
df         fdC            Z5	 	 dZdee
ef         dededefdDZ6e	defdE            Z7e	defdF            Z8e	de
fdG            Z9e	defdH            Z:e	defdI            Z;e;j        d	eddfdJ            Z;e	de
fdK            Z<e<j        d	e
ddfdL            Z<e	defdM            Z=e	defdN            Z>e	de
fdO            Z?e	de
fdP            Z@e	deeAjB        df         fdQ            ZCdRedSeee
f         dTeee
f         defdUZDdS )[BaseConnectionNc                     d | _         d S N)_versionselfs    c/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/oracledb/connection.py__init__zBaseConnection.__init__D   s        c                 z    | j         j        }| j        d| dS | j        d| dS d| d| j         d| j         dS )N<z disconnected>z to externally identified user>z to @>)	__class___public_name_implusernamedsn)r0   cls_names     r1   __repr__zBaseConnection.__repr__G   sc    >.:/x////]"@x@@@@<8<<<<<<<<r3   returnc                 T    | j          t          j        t          j                   dS dS )zz
        Verifies that the connection is connected to the database. If it is
        not, an exception is raised.
        N)r:   r   
_raise_errERR_NOT_CONNECTEDr/   s    r1   _verify_connectedz BaseConnection._verify_connectedO   s.    
 :f677777 r3   xidc                 R    t          |t                    sd}t          |          dS )zH
        Verifies that the supplied xid is of the correct type.
        z+expecting transaction id created with xid()N)
isinstancer&   	TypeError)r0   rD   messages      r1   _verify_xidzBaseConnection._verify_xidW   s3     #s## 	%CGG$$$	% 	%r3   c                      t          d          )z
        This write-only attribute sets the ACTION column in the V$SESSION view.
        It is a string attribute but the value *None* is accepted and treated
        as an empty string.
        zaction is not readableAttributeErrorr/   s    r1   actionzBaseConnection.action_        5666r3   valuec                 b    |                                   | j                            |           d S r-   )rC   r:   
set_actionr0   rO   s     r1   rM   zBaseConnection.actionh   0       
e$$$$$r3   c                 B    |                                   | j        j        S )z
        This read-write attribute determines whether autocommit mode is on or
        off.  When autocommit mode is on, all statements are committed as soon
        as they have completed executing.
        rC   r:   
autocommitr/   s    r1   rV   zBaseConnection.autocommitm   s!     	   z$$r3   c                 F    |                                   || j        _        d S r-   rU   rR   s     r1   rV   zBaseConnection.autocommitw   s$        %
r3   <   Ftransaction_idtimeoutdefer_round_tripc                     |                                   t          |          }t          |t                    r|dk    rt	          d          | j                            |||           |S )a`  
        Begins a new sessionless transaction. This method returns the
        transaction identifier specified by the user or generated by
        python-oracledb.

        The ``transaction_id`` parameter should be of type string or bytes. If
        specified, it represents a unique identifier for the transaction. If a
        string is passed, then it will be UTF-8 encoded to bytes. If this value
        is not specified, then python-oracledb generates a a random
        `universally-unique identifier (UUID)
        <https://www.rfc-editor.org/rfc/rfc4122.txt>`__ value.  An example is
        "36b8f84d-df4e-4d49-b662-bcde71a8764f". Any user-chosen value cannot
        exceed 64 bytes in length.

        The ``timeout`` parameter is the number of seconds that this
        transaction can stay suspended when
        :meth:`suspend_sessionless_transaction()` is later called,
        or if the transaction is automatically suspended when the
        ``suspend_on_success`` parameter is set to to *True* in
        :meth:`Cursor.execute()` or :meth:`Cursor.executemany()`. The default
        value is *60* seconds. If a transaction is not resumed within this
        specified duration, the transaction will be rolled back.

        The ``defer_round_trip`` parameter is a boolean that determines whether
        the request to start a transaction is to be sent immediately or with
        the next database operation. If set to *False*, the request is sent
        immediately. If set to *True*, the request is included with the next
        database operation on the connection. The default value is *False*.
        r   "timeout must be a positive integerrC   r%   rF   intrG   r:   begin_sessionless_transactionr0   rY   rZ   r[   normalized_txnids        r1   r`   z,BaseConnection.begin_sessionless_transaction|   sy    F 	   ?OO'3'' 	B7a<<@AAA
00g'7	
 	
 	
  r3   c                 \    |                                   | j                                        S )aq  
        This read-write attribute specifies the amount of time (in
        milliseconds) that a single round-trip to the database may take before
        a timeout will occur. A value of *0* means that no timeout will take
        place.

        In python-oracledb Thick mode, this attribute is only available in
        Oracle Client 18c or later.

        If a timeout occurs, the error ``DPI-1067`` will be returned if the
        connection is still usable.  Alternatively the error ``DPI-1080`` will
        be returned if the connection has become invalid and can no longer be
        used.

        For consistency and compliance with the PEP 8 naming style, the
        attribute ``callTimeout`` was renamed to ``call_timeout``. The old name
        will continue to work for a period of time.  The error ``DPI-1080`` was
        also introduced in this release.
        )rC   r:   get_call_timeoutr/   s    r1   call_timeoutzBaseConnection.call_timeout   s*    * 	   z**,,,r3   c                 b    |                                   | j                            |           d S r-   rC   r:   set_call_timeoutrR   s     r1   re   zBaseConnection.call_timeout   0       
##E*****r3   c                 `    |                                   | j                                         dS )z2
        Breaks a long-running statement.
        N)rC   r:   cancelr/   s    r1   rk   zBaseConnection.cancel   0     	   
r3   c                      t          d          )zl
        This write-only attribute sets the CLIENT_IDENTIFIER column in the
        V$SESSION view.
        z!client_identifier is not readablerK   r/   s    r1   client_identifierz BaseConnection.client_identifier   s     @AAAr3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_client_identifierrR   s     r1   rn   z BaseConnection.client_identifier   s0       
((/////r3   c                      t          d          )zf
        This write-only attribute sets the CLIENT_INFO column in the V$SESSION
        view.
        zclientinfo is not readablerK   r/   s    r1   
clientinfozBaseConnection.clientinfo   s     9:::r3   c                 b    |                                   | j                            |           dS )zJ
        Specifies the client_info column in the v$session table.
        N)rC   r:   set_client_inforR   s     r1   rr   zBaseConnection.clientinfo   s2    
 	   
""5)))))r3   c                 \    |                                   | j                                        S )a  
        This read-write attribute sets the current schema attribute for the
        session. Setting this value is the same as executing the SQL statement
        ``ALTER SESSION SET CURRENT_SCHEMA``. The attribute is set (and
        verified) on the next call that does a round trip to the server. The
        value is placed before unqualified database objects in SQL statements
        you then execute.
        )rC   r:   get_current_schemar/   s    r1   current_schemazBaseConnection.current_schema   s*     	   z,,...r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_current_schemarR   s     r1   rw   zBaseConnection.current_schema   s0       
%%e,,,,,r3   c                 \    |                                   | j                                        S )z
        This read-only attribute specifies the Oracle Database domain name
        associated with the connection. It is the same value returned by the
        SQL ``SELECT value FROM V$PARAMETER WHERE NAME = 'db_domain'``.
        )rC   r:   get_db_domainr/   s    r1   	db_domainzBaseConnection.db_domain   s*     	   z'')))r3   c                 \    |                                   | j                                        S )z
        This read-only attribute specifies the Oracle Database name associated
        with the connection. It is the same value returned by the SQL ``SELECT
        NAME FROM V$DATABASE``.
        )rC   r:   get_db_namer/   s    r1   db_namezBaseConnection.db_name  s*     	   z%%'''r3   c                      t          d          )z
        This write-only attribute sets the database operation that is to be
        monitored. This can be viewed in the DBOP_NAME column of the
        V$SQL_MONITOR view.
        zdbop is not readablerK   r/   s    r1   dbopzBaseConnection.dbop  s     3444r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_dboprR   s     r1   r   zBaseConnection.dbop  s0       
E"""""r3   datac                 ^    |                                   | j                            |          S )aJ  
        Decodes `OSON-encoded
        <https://www.oracle.com/pls/topic/lookup?ctx=dblatest
        &id=GUID-911D302C-CFAF-406B-B6A5-4E99DD38ABAD>`__ bytes and returns the
        object encoded in those bytes.  This is useful for fetching columns
        which have the check constraint ``IS JSON FORMAT OSON`` enabled.
        )rC   r:   decode_oson)r0   r   s     r1   r   zBaseConnection.decode_oson  s,     	   z%%d+++r3   c                 B    |                                   | j        j        S )z
        This read-only attribute returns the TNS entry of the database to which
        a connection has been established.
        )rC   r:   r<   r/   s    r1   r<   zBaseConnection.dsn*  s      	   z~r3   c                      t          d          )z
        This write-only attribute specifies the execution context id. This
        value can be found as the ECID column in the V$SESSION view and
        ECONTEXT_ID in the auditing tables. The maximum length is 64 bytes.
        zecontext_id is not readablerK   r/   s    r1   econtext_idzBaseConnection.econtext_id3  s     :;;;r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_econtext_idrR   s     r1   r   zBaseConnection.econtext_id<  s0       
""5)))))r3   c                 \    |                                   | j                                        S )z
        This read-only attribute gets the session edition and is only available
        with Oracle Database 11.2, or later.
        )rC   r:   get_editionr/   s    r1   editionzBaseConnection.editionA  s*     	   z%%'''r3   c                 ^    |                                   | j                            |          S )aF  
        Encodes a Python value into `OSON-encoded
        <https://www.oracle.com/pls/topic/lookup?ctx=dblatest
        &id=GUID-911D302C-CFAF-406B-B6A5-4E99DD38ABAD>`__ bytes and returns
        them. This is useful for inserting into columns which have the check
        constraint ``IS JSON FORMAT OSON`` enabled.
        )rC   r:   encode_osonrR   s     r1   r   zBaseConnection.encode_osonJ  s,     	   z%%e,,,r3   c                 \    |                                   | j                                        S )z
        This read-write attribute specifies the external name that is used by
        the connection when logging distributed transactions.
        )rC   r:   get_external_namer/   s    r1   external_namezBaseConnection.external_nameU  *     	   z++---r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_external_namerR   s     r1   r   zBaseConnection.external_name^  0       
$$U+++++r3   c                 B    |                                   | j        j        S )a  
        This read-write attribute specifies a method called for each value that
        is bound to a statement executed on any cursor associated with this
        connection.  The method signature is handler(cursor, value, arraysize)
        and the return value is expected to be a variable object or *None* in
        which case a default variable object will be created. If this attribute
        is *None*, the default behavior will take place for all values bound to
        statements.
        rC   r:   inputtypehandlerr/   s    r1   r   zBaseConnection.inputtypehandlerc  s!     	   z**r3   c                 F    |                                   || j        _        d S r-   r   rR   s     r1   r   zBaseConnection.inputtypehandlerq  s$       &+
###r3   c                 \    |                                   | j                                        S )z
        This read-only attribute specifies the Oracle Database instance name
        associated with the connection. It is the same value as the SQL
        expression ``sys_context('userenv', 'instance_name')``.
        )rC   r:   get_instance_namer/   s    r1   instance_namezBaseConnection.instance_namev  s*     	   z++---r3   c                 \    |                                   | j                                        S )z
        This read-write attribute specifies the internal name that is used by
        the connection when logging distributed transactions.
        )rC   r:   get_internal_namer/   s    r1   internal_namezBaseConnection.internal_name  r   r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_internal_namerR   s     r1   r   zBaseConnection.internal_name  r   r3   c                 F    | j         duo| j                                         S )a   
        This function returns a boolean indicating the health status of a
        connection.

        Connections may become unusable in several cases, such as, if the
        network socket is broken, if an Oracle error indicates the connection
        is unusable, or, after receiving a planned down notification from the
        database.

        This function is best used before starting a new database request on an
        existing :ref:`standalone connections <standaloneconnection>`. For
        pooled connections, the :meth:`ConnectionPool.acquire()` method
        internally performs this check before returning a connection to the
        application, see :ref:`poolhealth`.

        If this function returns *False*, the connection should be not be used
        by the application and a new connection should be established instead.

        This function performs a local check. To fully check a connection's
        health, use :meth:`ping()` which performs a round-trip to
        the database.
        N)r:   get_is_healthyr/   s    r1   
is_healthyzBaseConnection.is_healthy  s$    . z%E$**C*C*E*EEr3   c                 \    |                                   | j                                        S )a  
        This read-only attribute returns the logical transaction id for the
        connection. It is used within Oracle Transaction Guard as a means of
        ensuring that transactions are not duplicated. See :ref:`tg` for more
        information.

        This is only available with Oracle Database 12.1 or later. In
        python-oracledb Thick mode, it also requires Oracle Client libraries
        12.1 or later.
        )rC   r:   	get_ltxidr/   s    r1   ltxidzBaseConnection.ltxid  s*     	   z##%%%r3   c                 \    |                                   | j                                        S )au  
        This read-only attribute specifies the maximum database identifier
        length in bytes supported by the database to which the connection has
        been established.  See `Database Object Naming Rules
        <https://www.oracle.com/pls/topic/lookup?ctx=dblatest&
        id=GUID-75337742-67FD-4EC0-985F-741C93D918DA>`__. The value may be
        *None*, *30*, or *128*. The value *None* indicates the size cannot be
        reliably determined by python-oracledb, which occurs when using Thick
        mode with Oracle Client libraries 12.1 (or older) to connect to Oracle
        Database 12.2, or later.
        )rC   r:   get_max_identifier_lengthr/   s    r1   max_identifier_lengthz$BaseConnection.max_identifier_length  s*     	   z33555r3   c                 \    |                                   | j                                        S )ae  
        This read-only attribute specifies the maximum number of cursors that
        the database can have open concurrently. It is the same value returned
        by the SQL ``SELECT VALUE FROM V$PARAMETER WHERE NAME =
        'open_cursors'``. When using python-oracledb Thick mode, Oracle Client
        libraries 12.1 (or later) are required.
        )rC   r:   get_max_open_cursorsr/   s    r1   max_open_cursorszBaseConnection.max_open_cursors  s*     	   z..000r3   c                      t          d          )z
        This write-only attribute sets the MODULE column in the V$SESSION view.
        The maximum length for this string is 48 and if you exceed this length
        you will get ``ORA-24960``.
        zmodule is not readablerK   r/   s    r1   modulezBaseConnection.module  rN   r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   
set_modulerR   s     r1   r   zBaseConnection.module  rS   r3   payloadcorrelationdelay
exceptionq
expirationpriority
recipientsc                     | j                                         }t          j        |          }	|||	_        |||	_        |||	_        |||	_        |||	_        |||	_	        |||	_
        |	S )z
        Returns an object specifying the properties of messages used in
        advanced queuing.

        Each of the parameters are optional. If specified, they act as a
        shortcut for setting each of the equivalently named properties.
        )r:   create_msg_props_implr   
_from_implr   r   r   r   r   r   r   )
r0   r   r   r   r   r   r   r   implpropss
             r1   msgpropertieszBaseConnection.msgproperties  s    " z//11!,T22#EM" +EEK!)E!)E%EN!)Er3   )payloadTypenamepayload_typer   c                   |                                   d}d}|%|!t          j        t          j        dd           |}|4|dk    rd}n+t	          |t
                    st          d          |j        }| j                                        }|	                    | j        |||           | 
                    |          S )	a  
        Creates a queue which is used to enqueue and dequeue messages in
        Advanced Queuing.

        The ``name`` parameter is expected to be a string identifying the queue
        in which messages are to be enqueued or dequeued.

        The ``payload_type`` parameter, if specified, is expected to be an
        :ref:`object type <dbobjecttype>` that identifies the type of payload
        the queue expects. If the string "JSON" is specified, JSON data is
        enqueued and dequeued. If not specified, RAW data is enqueued and
        dequeued.

        For consistency and compliance with the PEP 8 naming style, the
        parameter ``payloadType`` was renamed to ``payload_type``. The old name
        will continue to work as a keyword parameter for a period of time.
        NFr   r   deprecated_namenew_nameJSONTzexpecting DbObjectType)rC   r   rA   ERR_DUPLICATED_PARAMETERrF   r   rG   r:   create_queue_impl
initialize_create_queue)r0   r   r   r   payload_type_implis_jsonr   s          r1   queuezBaseConnection.queue  s    0 	    "'!3$1+   
 'L#v%%l;; 7 8999$0$6!z++--
D*;WEEE!!$'''r3   c                 B    |                                   | j        j        S )a  
        This read-write attribute specifies a method called for each column
        that is going to be fetched from any cursor associated with this
        connection. The method signature is ``handler(cursor, metadata)`` and
        the return value is expected to be a :ref:`variable object<varobj>` or
        *None* in which case a default variable object will be created. If this
        attribute is *None*, the default behavior will take place for all
        columns fetched from cursors.
        rC   r:   outputtypehandlerr/   s    r1   r   z BaseConnection.outputtypehandler1  s!     	   z++r3   c                 F    |                                   || j        _        d S r-   r   rR   s     r1   r   z BaseConnection.outputtypehandler?  s$       ',
$$$r3   c                 B    |                                   | j        j        S )z
        This read-only attribute returns the name of the user which was used as
        a proxy when creating the connection to the database.
        )rC   r:   
proxy_userr/   s    r1   r   zBaseConnection.proxy_userD  s!     	   z$$r3   c                     |                                   |t          d          t          |          }t          |t                    r|dk    st          d          | j                            |||           |S a  
        Resumes an existing sessionless transaction using the specified
        transaction identifier. This method returns the transaction identifier
        used to resume the sessionless transaction.

        The ``transaction_id`` parameter should be a string or bytes value that
        uniquely identifies an existing sessionless transaction that is to be
        resumed.

        The ``timeout`` parameter is the number of seconds that the current
        connection waits to resume a transaction if another connection is using
        it.  When ``defer_round_trip`` is set to *False*, the wait happens in
        the ``resume_sessionless_transaction()`` call itself, and the function
        blocks until the transaction becomes available or the timeout expires.
        When ``defer_round_trip`` is set to *True*, the resume is deferred and
        the wait occurs at the time of the next database operation instead. At
        the start of the wait period, if the transaction is not in use by any
        other connection, the resume happens immediately. If the transaction
        remains in use by the other connection after the timeout period, the
        error `ORA-25351
        <https://docs.oracle.com/en/error-help/db/ora-25351>`__ is raised. If
        another connection completes the transaction, the error `ORA-24756
        <https://docs.oracle.com/en/error-help/db/ora-24756>`__ is raised.
        These error messages are only thrown for non-RAC instances. For
        information on using Oracle RAC, see :ref:`Sessionless Transactions
        with Oracle RAC <sessionlesstxnswithrac>`.  The default value is *60*
        seconds.

        The ``defer_round_trip`` parameter is a boolean that determines whether
        the request to resume a transaction is to be sent immediately or with
        the next database operation. If set to *False*, the request is sent
        immediately. If set to *True*, the request is included with the next
        database operation on the connection. The default value is *False*.
        Nz'transaction_id is required for resumingr   z&timeout must be a non-negative integerrC   
ValueErrorr%   rF   r_   rG   r:   resume_sessionless_transactionra   s        r1   r   z-BaseConnection.resume_sessionless_transactionM  s    P 	   !FGGG?OO7C(( 	FW\\DEEE
11g'7	
 	
 	
  r3   c                 \    |                                   | j                                        S )a  
        This read-only attribute specifies the size of the Session Data Unit
        (SDU) that is being used by the connection. The value will be the
        lesser of the requested python-oracledb size and the maximum size
        allowed by the database network configuration. It is available only in
        python-oracledb Thin mode. To set the SDU in Thick mode, use a
        connection string SDU parameter or set a value for DEFAULT_SDU_SIZE in
        a sqlnet.ora configuration file.
        )rC   r:   get_sdur/   s    r1   sduzBaseConnection.sdu  s*     	   z!!###r3   c                 \    |                                   | j                                        S )au  
        This read-only attribute specifies the session serial number associated
        with the connection. It is the same value returned by the SQL ``SELECT
        SERIAL# FROM V$SESSION WHERE SID=SYS_CONTEXT('USERENV', 'SID')``.  It
        is available only in python-oracledb Thin mode.

        For applications using :ref:`drcp`, the ``serial_num`` attribute may
        not contain the current session state until a round-trip is made to the
        database after acquiring a session.  It is recommended to not use this
        attribute if your application uses DRCP but may not perform a
        round-trip.
        )rC   r:   get_serial_numr/   s    r1   
serial_numzBaseConnection.serial_num  *     	   z((***r3   c                 \    |                                   | j                                        S )z
        This read-only attribute specifies the Oracle Database service name
        associated with the connection.  This is the same value returned by the
        SQL ``SELECT SYS_CONTEXT('USERENV', 'SERVICE_NAME') FROM DUAL``.
        )rC   r:   get_service_namer/   s    r1   service_namezBaseConnection.service_name  s*     	   z**,,,r3   c                 \    |                                   | j                                        S )aZ  
        This read-only attribute specifies the session identifier associated
        with the connection. It is the same value returned by the SQL ``SELECT
        SYS_CONTEXT('USERENV', 'SID') FROM DUAL``. It is available only in
        python-oracledb Thin mode.

        For applications using :ref:`drcp`, the ``session_id`` attribute may
        not contain the current session state until a round-trip is made to the
        database after acquiring a session.  It is recommended to not use this
        attribute if your application uses DRCP but may not perform a
        round-trip.
        )rC   r:   get_session_idr/   s    r1   
session_idzBaseConnection.session_id  r   r3   c                 \    |                                   | j                                        S )a  
        This read-write attribute specifies the size of the statement cache.
        This value can make a significant difference in performance if you have
        a small number of statements that you execute repeatedly.

        The default value is *20*.
        )rC   r:   get_stmt_cache_sizer/   s    r1   stmtcachesizezBaseConnection.stmtcachesize  s*     	   z--///r3   c                 b    |                                   | j                            |           d S r-   )rC   r:   set_stmt_cache_sizerR   s     r1   r   zBaseConnection.stmtcachesize  s0       
&&u-----r3   c                 B    |                                   | j        j        S )a  
        This read-write attribute initially contains the actual tag of the
        session that was acquired from a pool by
        :meth:`ConnectionPool.acquire()`. If the connection was not acquired
        from a pool or no tagging parameters were specified (``tag`` and
        ``matchanytag``) when the connection was acquired from the pool, this
        value will be None. If the value is changed, it must be a string
        containing name=value pairs like "k1=v1;k2=v2".

        If this value is not *None* when the connection is released back to the
        pool it will be used to retag the session. This value can be overridden
        in the call to :meth:`ConnectionPool.release()`.
        rC   r:   tagr/   s    r1   r   zBaseConnection.tag  s      	   z~r3   c                 F    |                                   || j        _        d S r-   r   rR   s     r1   r   zBaseConnection.tag  s!       
r3   c                 B    |                                   | j        j        S )z
        This read-only attribute returns a boolean indicating if
        python-oracledb is in Thin mode (*True*) or Thick mode (*False*).
        )rC   r:   thinr/   s    r1   r   zBaseConnection.thin  s      	   zr3   c                 \    |                                   | j                                        S )z
        This read-only attribute specifies whether a transaction is currently
        in progress on the database associated with the connection.
        )rC   r:   get_transaction_in_progressr/   s    r1   transaction_in_progressz&BaseConnection.transaction_in_progress  s*     	   z55777r3   c                 B    |                                   | j        j        S )z
        This read-only attribute returns the name of the user which established
        the connection to the database.
        )rC   r:   r;   r/   s    r1   r;   zBaseConnection.username  s!     	   z""r3   c                     | j         B|                                  d                    d | j        j        D                       | _         | j         S )z
        This read-only attribute returns the version of the database to which a
        connection has been established.
        N.c              3   4   K   | ]}t          |          V  d S r-   )str).0cs     r1   	<genexpr>z)BaseConnection.version.<locals>.<genexpr>  s(      $O$OSVV$O$O$O$O$O$Or3   )r.   rC   joinr:   server_versionr/   s    r1   versionzBaseConnection.version   sM     = ""$$$HH$O$OTZ5N$O$O$OOODM}r3   c                 B    |                                   | j        j        S )aB  
        This read-only attribute provides an
        :ref:`oracledb._Error<exchandling>` object giving information about any
        database warnings (such as the password being in the grace period, or
        the pool being created with a smaller than requested size due to
        database resource restrictions) that were generated during connection
        establishment or by :meth:`oracledb.create_pool()`. The attribute will
        be present if there was a warning, but creation otherwise completed
        successfully. The connection will be usable despite the warning.

        For :ref:`standalone connections <standaloneconnection>`,
        ``Connection.warning`` will be present for the lifetime of the
        connection.

        For :ref:`pooled connections <connpooling>`, ``Connection.warning``
        will be cleared when a connection is released to the pool such as with
        :meth:`ConnectionPool.release()`.

        In python-oracledb Thick mode, warnings may be generated during pool
        creation itself.  These warnings will be placed on new connections
        created by the pool, provided no warnings were generated by the
        individual connection creations, in which case those connection
        warnings will be returned.

        If no warning was generated the value *None* is returned.
        )rC   r:   warningr/   s    r1   r  zBaseConnection.warning  s!    8 	   z!!r3   r'   r(   r)   c                 $    t          |||          S )a6  
        Returns a global transaction identifier (xid) that can be used with the
        Two-Phase Commit (TPC) functions.

        The ``xid`` contains a format identifier, a global transaction
        identifier, and a branch identifier. There are no checks performed at
        the Python level. The values are checked by ODPI-C when they are passed
        to the relevant functions.  .. When this functionality is also
        supported in the thin driver the checks will be performed at the Python
        level as well.

        The ``format_id`` parameter should be a positive 32-bit integer. This
        value identifies the format of the ``global_transaction_id`` and
        ``branch_qualifier`` parameters and the value is determined by the
        Transaction Manager (TM), if one is in use.

        The ``global_transaction_id`` and ``branch_qualifier`` parameters
        should be of type bytes or string. If a value of type string is passed,
        then this value will be UTF-8 encoded to bytes. The values cannot
        exceed 64 bytes in length.
        )r&   )r0   r'   r(   r)   s       r1   rD   zBaseConnection.xid*  s    6 935EFFFr3   r?   NNrX   F)NNNNNNNr-   rX   F)E__name__
__module____qualname__r:   r2   r>   rC   r&   rI   propertyr   rM   setterboolrV   r   r   bytesr_   r`   re   rk   rn   rr   rw   r|   r   r   r   r   r<   r   r   r   r   r   r   r   r   r   r   r   r   r   r   listr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r;   r   r   _Errorr  rD    r3   r1   r+   r+   A   s       E  = = =8 8 8 8%s %t % % % % 7 7 7 7 X7 ]%C %D % % % ]% %D % % % X% & & & & & & 7;!&	,  ,  sEz!23,  ,  	, 
 
,  ,  ,  , \ -c - - - X-. +# +$ + + + +    B3 B B B XB 0s 0t 0 0 0 0 ;C ; ; ; X; * * * * * * 
/ 
/ 
/ 
/ X
/ -C -D - - - - *3 * * * X* ( ( ( ( X( 5c 5 5 5 X5 
[## #$ # # # [#	, 	,# 	, 	, 	, 	, S    X <S < < < X< * * * * * * ( ( ( ( X(	- 	- 	- 	- 	- 	- .s . . . X. ,3 ,4 , , , , +( + + + X+ ,h ,4 , , , , .s . . . X. .s . . . X. ,3 ,4 , , , ,FD F F F F2 &u & & & X& 6s 6 6 6 X6 	1# 	1 	1 	1 X	1 7 7 7 7 X7 ]%C %D % % % ]% :>%)#$($("&%)! !%sH 456! c]! }	!
 SM! SM! 3-! TN! 
! ! ! !L <@,(
 /3,( ,( ,(,( u\3%678,(
 l+,( 
uj 	!,( ,( ,( ,(\ ,8 , , , X, -x -D - - - - %E#t), % % % X% !&	4  4 c5j)4  4  	4 
 
4  4  4  4 l $S $ $ $ X$ +C + + + X+  -c - - - X- +C + + + X+  	0s 	0 	0 	0 X	0 .3 .4 . . . . S    X" 	Z     Z d    X 8 8 8 8 X8 ## # # # X#     X "v}d23 " " " X"<GG  %UCZ0G  s
+	G
 
G G G G G Gr3   r+   )	metaclassc            (       :    e Zd Z	 dfddddee         ded         dee         ddf fdZd	 Zd
 Zd Z	dgdZ
d ZdedededefdZdededededdf
dZ	 	 	 dhdedededdfdZedefd            Zej        deddfd            ZdededdfdZdid Zdid!Z	 dfd"ed#eeeef                  defd$Zdgd%edefd&Zd'd(d)ed*ed+ee         d#ed,eddfd-Z 	 	 djddd.d/ed0eeee!e"f                  d1ee         d2ee         d3ee         de#fd4Z$	 	 djddd.d/ed0eeee!e"f                  d5ee         d2ee         d3ee         de%e#         fd6Z&de'fd7Z(d8ede)fd9Z*edefd:            Z+edefd;            Z,did<Z-defd=Z.did>Z/dkd@eddfdAZ0	 	 	 dldBedCedDee         ddfdEZ1e2j3        e2j4        dd?e2j5        d?e2j6        de2j7        d?e2j8        ddfde2j7        d?e2j8        ddFdGedHedIee9         dJedKedLedMedNee         dOedPedQed8ee         dRedSee         dTedUedVedWede:f&dXZ;didYZ<e2j=        d?fdZe>d[edJeddfd\Z?	 dmdZee>         d]eddfd^Z@de2jA        fdZee>         d[eddfd_ZBdZe>ddfd`ZCdfdZee>         defdaZDdefdbZEdfdZee>         ddfdcZFdde:ddfdeZG xZHS )n
ConnectionN)r   paramsr<   r   pool_module.ConnectionPoolr  r?   c                   t                                                       || _        t          j                    5 }|j        }|t          j                    }nMt          |t                    st          j        t          j                   n|j                                        }|                    |||          }|d}n|                                 |j        }|rr|j        |j        !t          j        t          j        dd           ||                    |          }	nVt+          j        ||          }	|	                    |           n+t1          j        ||          }	|	                    ||           |	| _        |	j        r?|=|j        6t9          |j                  r"|                    | |j                   d|	_        ddd           dS # 1 swxY w Y   dS )zH
        Constructor for creating a connection to the database.
        Nshardingthick)featuredriver_typeF)superr2   _poolr   get_managerr   r
   ConnectParamsImplrF   r   r   rA   ERR_INVALID_CONNECT_PARAMSr:   copyprocess_args_verify_openshardingkeysupershardingkeyERR_FEATURE_NOT_SUPPORTEDacquirer   ThinConnImplconnectr   ThickConnImplinvoke_session_callbacksession_callbackcallabler   )r0   r<   r   r  kwargsmode_mgrr   params_impl	pool_implr   r8   s             r1   r2   zConnection.__init__J  s1    	
 $&& 0	5(=D ~'9;;66 2!&"CDDDD$l//11**3==C | 		!!### J	  5+7"3?%8 *$+   
 #$,,[99DD$1#{CCDLL----!/[AA[)444DJ ,5$)5T233 6 %%dKO<<</4,a0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5 0	5s   FGGGc                 D    | j         |                     d           d S d S )NT)in_delr:   _closer/   s    r1   __del__zConnection.__del__  s,    :!KKtK$$$$$ "!r3   c                 .    |                                   | S )ze
        The entry point for the connection as a context manager. It returns
        itself.
        )rC   r/   s    r1   	__enter__zConnection.__enter__  s    
 	   r3   c                 @    | j         |                                  dS dS )z
        The exit point for the connection as a context manager. This will close
        the connection and roll back any uncommitted transaction.
        Nr3  )r0   exc_type	exc_valueexc_tbs       r1   __exit__zConnection.__exit__  s%    
 :!KKMMMMM "!r3   Fc                     | j         *| j         j        }||                    | j        |           n| j                            |           d| _        dS z
        Closes the connection and makes it unusable for further operations. An
        Error exception will be raised if any operation is attempted with this
        connection after this method completes successfully.
        Nr  r:   return_connectioncloser0   r2  r0  s      r1   r4  zConnection._close  sV     :!
(I$++DJ???JV$$$


r3   c                 ,    t          j        | |          S zg
        Returns a queue object that the user can use to dequeue and enqueue
        messages.
        )r   r   r0   r   s     r1   r   zConnection._create_queue  s    
 d+++r3   handle_typeattr_num	attr_typec                 b    |                                   | j                            |||          S )z
        Returns the value of the specified OCI attribute from the internal
        handle. This is only supported in python-oracledb thick mode and should
        only be used as directed by Oracle.
        )rC   r:   _get_oci_attr)r0   rF  rG  rH  s       r1   rJ  zConnection._get_oci_attr  s0     	   z''XyIIIr3   rO   c                 h    |                                   | j                            ||||           dS )z
        Sets the value of the specified OCI attribute on the internal handle.
        This is only supported in python-oracledb thick mode and should only
        be used as directed by Oracle.
        N)rC   r:   _set_oci_attr)r0   rF  rG  rH  rO   s        r1   rL  zConnection._set_oci_attr  s8     	   
  h	5IIIIIr3    r'   rY   	branch_idc                 j    |dk    r,|                      |                     |||                     dS dS )a  
        Explicitly begins a new transaction. Without parameters, this
        explicitly begins a local transaction; otherwise, this explicitly
        begins a distributed (global) transaction with the given parameters.
        See the Oracle documentation for more details.

        Note that in order to make use of global (distributed) transactions,
        the :attr:`~Connection.internal_name` and
        :attr:`~Connection.external_name` attributes must be set.
        rM  N)	tpc_beginrD   )r0   r'   rY   rO  s       r1   beginzConnection.begin  s<      ??NN488I~yIIJJJJJ ?r3   c                     | j         S )z@
        Deprecated. Use property call_timeout instead.
        )re   r/   s    r1   callTimeoutzConnection.callTimeout  s    
   r3   c                 b    |                                   | j                            |           d S r-   rg   rR   s     r1   rT  zConnection.callTimeout  ri   r3   old_passwordnew_passwordc                 d    |                                   | j                            ||           dS zY
        Changes the password for the user to which the connection is connected.
        NrC   r:   change_passwordr0   rV  rW  s      r1   changepasswordzConnection.changepassword  s4     	   
""<>>>>>r3   c                 V    |                                   |                                  dS )a  
        Closes the connection now and makes it unusable for further operations.
        An Error exception will be raised if any operation is attempted with
        this connection after this method is completed successfully.

        All open cursors and LOBs created by the connection will be closed and
        will also no longer be usable.

        Internally, references to the connection are held by cursor objects,
        LOB objects, subscription objects, etc. Once all of these references
        are released, the connection itself will be closed automatically.
        Either control references to these related objects carefully or
        explicitly close connections in order to ensure sufficient resources
        are available.
        NrC   r4  r/   s    r1   rA  zConnection.close  s'      	   r3   c                 `    |                                   | j                                         dS )zC
        Commits any pending transactions to the database.
        NrC   r:   commitr/   s    r1   rb  zConnection.commit  rl   r3   lob_typer   c                    |                                   |t          t          t          fvrd}t	          |          | j                            |          }t          j        |          }|r|	                    |           |S )aa  
        Creates and returns a new temporary LOB object of the specified type.
        The ``lob_type`` parameter should be one of
        :data:`oracledb.DB_TYPE_CLOB`, :data:`oracledb.DB_TYPE_BLOB`, or
        :data:`oracledb.DB_TYPE_NCLOB`.

        If data is supplied, it will be written to the temporary LOB before it
        is returned.
        aparameter should be one of oracledb.DB_TYPE_CLOB, oracledb.DB_TYPE_BLOB or oracledb.DB_TYPE_NCLOB)
rC   r   r   r   rG   r:   create_temp_lob_implr    r   writer0   rc  r   rH   r   lobs         r1   	createlobzConnection.createlob  s     	   L-FFFB  G$$$z..x88nT"" 	IIdOOO
r3   
scrollablec                 J    |                                   t          | |          S )zV
        Returns a new :ref:`cursor object <cursorobj>` using the connection.
        )rC   r   r0   rk  s     r1   cursorzConnection.cursor$  s&     	   dJ'''r3       
batch_sizeschema_name
table_namecolumn_namesrq  c                j    |                                   | j                            |||||           dS a%  
        Load data into Oracle Database using the Direct Path Load interface.
        It is available only in python-oracledb Thin mode.

        The ``data`` parameter can be a list of sequences, a DataFrame, or a
        third-party DataFrame instance that supports the Apache Arrow PyCapsule
        Interface.

        The ``batch_size`` parameter is used to split large data sets into
        smaller pieces for sending to the database. It is the number of records
        in each batch. This parameter can be used to tune performance.
        NrC   r:   direct_path_loadr0   rr  rs  rt  r   rq  s         r1   rx  zConnection.direct_path_load+  sE    * 	   
##\4	
 	
 	
 	
 	
r3   fetch_decimalsrequested_schema	statement
parameters	arraysizer{  r|  c                   |                                  }d|j        _        |t          j        |          |j        _        |||_        |j        |_        |                    |||           |j        	                    |          S )a  
        Fetches all rows of the SQL query ``statement``, returning them in a
        :ref:`DataFrame <oracledataframeobj>` object. An empty DataFrame is
        returned if there are no rows available.

        The ``parameters`` parameter can be a list of tuples, where each tuple
        item maps to one :ref:`bind variable placeholder <bind>` in
        ``statement``. It can also be a list of dictionaries, where the keys
        match the bind variable placeholder names in ``statement``.

        The ``arraysize`` parameter can be specified to tune performance of
        fetching data across the network. It defaults to
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`. Internally,
        the ``fetch_df_all()``'s :attr:`Cursor.prefetchrows` size is always set
        to the value of the explicit or default ``arraysize`` parameter value.

        The ``fetch_decimals`` parameter specifies whether to return decimal
        values when fetching columns of type ``NUMBER`` that are capable of
        being represented in Apache Arrow Decimal128 format. The default value
        is :data:`oracledb.defaults.fetch_decimals <Defaults.fetch_decimals>`.

        The ``requested_schema`` parameter specifies an object that implements
        the Apache Arrow PyCapsule schema interface. The DataFrame returned by
        ``fetch_df_all()`` will have the data types and names of the schema.

        Any LOB fetched must be less than 1 GB.
        TNr{  
rn  r:   fetching_arrowr   from_arrow_schemaschema_implr  prefetchrowsexecutefetch_df_allr0   r}  r~  r  r{  r|  rn  s          r1   r  zConnection.fetch_df_allE  s    H &*#''6'H ( (FL$  (F$.) 	 	
 	
 	

 |((000r3   sizec             #   h  K   |                                  }d|j        _        |t          j        |          |j        _        |||_        |j        |_        |                    |||           ||j        	                    |          V  dS |j        
                    ||          E d{V  dS )a  
        This returns an iterator yielding the next ``size`` rows of the SQL
        query ``statement`` in each iteration as a :ref:`DataFrame
        <oracledataframeobj>` object. An empty DataFrame is returned if there
        are no rows available.

        The ``parameters`` parameter can be a list of tuples, where each tuple
        item maps to one :ref:`bind variable placeholder <bind>` in
        ``statement``. It can also be a list of dictionaries, where the keys
        match the bind variable placeholder names in ``statement``.

        The ``size`` parameter controls the number of records fetched in each
        batch. It defaults to
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`. Internally,
        the ``fetch_df_batches()``'s :attr:`Cursor.arraysize` and
        :attr:`Cursor.prefetchrows` sizes are always set to the value of the
        explicit or default ``size`` parameter value.

        The ``fetch_decimals`` parameter specifies whether to return decimal
        values when fetching columns of type ``NUMBER`` that are capable of
        being represented in Apache Arrow Decimal128 format. The default value
        is :data:`oracledb.defaults.fetch_decimals <Defaults.fetch_decimals>`.

        The ``requested_schema`` parameter specifies an object that implements
        the Apache Arrow PyCapsule schema interface. The DataFrame returned by
        ``fetch_df_all()`` will have the data types and names of the schema.

        Any LOB fetched must be less than 1 GB.
        TNr  rp  rn  r:   r  r   r  r  r  r  r  r  fetch_df_batches)r0   r}  r~  r  r{  r|  rn  s          r1   r  zConnection.fetch_df_batchesy  s      L &*#''6'H ( (FL$ #F$.) 	 	
 	
 	

 <,++F3333333|44V4MMMMMMMMMMMr3   c                     |                                   | j                            |           }t          j        | |          S )a  
        Returns a SodaDatabase object for Simple Oracle Document Access (SODA).
        All SODA operations are performed either on the returned SodaDatabase
        object or from objects created by the returned SodaDatabase object. See
        `here <https://www.oracle.com/pls/topic/lookup?
        ctx=dblatest&id=GUID-BE42F8D3-B86B-43B4-B2A3-5760A4DF79FB>`__ for
        additional information on SODA.
        )rC   r:   create_soda_database_implr#   r   )r0   db_impls     r1   getSodaDatabasezConnection.getSodaDatabase  s>     	   *66t<<&tW555r3   r   c                     |                                   | j                            | |          }t          j        |          S )
        Returns a type object given its name. This can then be used to create
        objects which can be bound to cursors created by this connection.
        rC   r:   get_typer   r   r0   r   obj_type_impls      r1   gettypezConnection.gettype  s>    
 	   
++D$77&}555r3   c                 \    |                                   | j                                        S )aP  
        This read-only attribute returns the Oracle Call Interface (OCI)
        service context handle for the connection. It is primarily provided to
        facilitate testing the creation of a connection using the OCI service
        context handle.

        This property is only relevant to python-oracledb's thick mode.
        )rC   r:   
get_handler/   s    r1   handlezConnection.handle  s*     	   z$$&&&r3   c                     dS )z?
        Deprecated. Use the constant value 4 instead.
           r  r/   s    r1   maxBytesPerCharacterzConnection.maxBytesPerCharacter  s	    
 qr3   c                 `    |                                   | j                                         dS )aP  
        Pings the database to verify if the connection is valid. An exception
        is thrown if it is not, in which case the connection should not be used
        by the application and a new connection should be established instead.

        This function performs a :ref:`round-trip <roundtrips>` to the
        database, so it should not be used unnecessarily.

        Note connection pools will perform the same health check automatically,
        based on configuration settings. See :ref:`poolhealth`.

        Also, see :meth:`is_healthy()` for a lightweight alternative.
        NrC   r:   pingr/   s    r1   r  zConnection.ping  s.     	   
r3   c                 *    |                                  S )z
        Prepares the distributed (global) transaction for commit. Returns a
        boolean indicating if a transaction was actually prepared in order to
        avoid the error ``ORA-24756 (transaction does not exist)``.
        )tpc_preparer/   s    r1   preparezConnection.prepare  s     !!!r3   c                 `    |                                   | j                                         dS )z6
        Rolls back any pending transactions.
        NrC   r:   rollbackr/   s    r1   r  zConnection.rollback  s0     	   
r3   r   modec                 b    |                                   | j                            |           dS )a	  
        Shuts down the database. In order to do this the connection must be
        connected as :data:`~oracledb.SYSDBA` or :data:`~oracledb.SYSOPER`. Two
        calls must be made unless the mode specified is
        :data:`~oracledb.DBSHUTDOWN_ABORT`.
        N)rC   r:   shutdown)r0   r  s     r1   r  zConnection.shutdown  s2     	   
D!!!!!r3   forcerestrictpfilec                 f    |                                   | j                            |||           dS )a  
        Starts up the database. This is equivalent to the SQL*Plus command
        ``startup nomount``. The connection must be connected as
        :data:`~oracledb.SYSDBA` or :data:`~oracledb.SYSOPER` with the
        :data:`~oracledb.PRELIM_AUTH` option specified for this to work.

        The ``pfile`` parameter, if specified, is expected to be a string
        identifying the location of the parameter file (PFILE) which will be
        used instead of the stored parameter file (SPFILE).
        N)rC   r:   startup)r0   r  r  r  s       r1   r  zConnection.startup  s6      	   
5(E22222r3   )	ipAddressgroupingClassgroupingValuegroupingTypeclientInitiated	namespaceprotocolcallbackrZ   
operationsportqos
ip_addressgrouping_classgrouping_valuegrouping_typeclient_initiatedr  r  r  r  r  c                   |                                   |%|!t          j        t          j        dd           |}|t          j        k    r3|	t          j        k    r!t          j        t          j        dd           |}	|dk    r)|
dk    r!t          j        t          j        dd	           |}
|t          j        k    r3|t          j        k    r!t          j        t          j        d
d           |}|r%|r!t          j        t          j        dd           |}| j                            | ||||||||||	|
||          }t          j
        |          }|                    || j                   |S )a  
        Returns a new subscription object that receives notifications for
        events that take place in the database that match the given parameters.

        The ``namespace`` parameter specifies the namespace the subscription
        uses.  It can be one of :data:`oracledb.SUBSCR_NAMESPACE_DBCHANGE` or
        :data:`oracledb.SUBSCR_NAMESPACE_AQ`.

        The ``protocol`` parameter specifies the protocol to use when
        notifications are sent. Currently the only valid value is
        :data:`oracledb.SUBSCR_PROTO_OCI`.

        The ``callback`` is expected to be a callable that accepts a single
        parameter. A :ref:`message object <msgobjects>` is passed to this
        callback whenever a notification is received.

        The ``timeout`` value specifies that the subscription expires after the
        given time in seconds. The default value of *0* indicates that the
        subscription never expires.

        The ``operations`` parameter enables filtering of the messages that are
        sent (insert, update, delete). The default value will send
        notifications for all operations. This parameter is only used when the
        namespace is set to :data:`oracledb.SUBSCR_NAMESPACE_DBCHANGE`.

        The ``port`` parameter specifies the listening port for callback
        notifications from the database server. If not specified, an unused
        port will be selected by the Oracle Client libraries.

        The ``qos`` parameter specifies quality of service options. It should
        be one or more of the following flags, OR'ed together:
        :data:`oracledb.SUBSCR_QOS_RELIABLE`,
        :data:`oracledb.SUBSCR_QOS_DEREG_NFY`,
        :data:`oracledb.SUBSCR_QOS_ROWIDS`, :data:`oracledb.SUBSCR_QOS_QUERY`,
        :data:`oracledb.SUBSCR_QOS_BEST_EFFORT`.

        The ``ip_address`` parameter specifies the IP address (*IPv4* or
        *IPv6*) in standard string notation to bind for callback notifications
        from the database server. If not specified, the client IP address will
        be determined by the Oracle Client libraries.

        The ``grouping_class`` parameter specifies what type of grouping of
        notifications should take place. Currently, if set, this value can only
        be set to the value :data:`oracledb.SUBSCR_GROUPING_CLASS_TIME`, which
        will group notifications by the number of seconds specified in the
        ``grouping_value`` parameter. The ``grouping_type`` parameter should be
        one of the values :data:`oracledb.SUBSCR_GROUPING_TYPE_SUMMARY` (the
        default) or :data:`oracledb.SUBSCR_GROUPING_TYPE_LAST`.

        The ``name`` parameter is used to identify the subscription and is
        specific to the selected namespace. If the namespace parameter is
        :data:`oracledb.SUBSCR_NAMESPACE_DBCHANGE` then the name is optional
        and can be any value. If the namespace parameter is
        :data:`oracledb.SUBSCR_NAMESPACE_AQ`, however, the name must be in the
        format '<QUEUE_NAME>' for single consumer queues and
        '<QUEUE_NAME>:<CONSUMER_NAME>' for multiple consumer queues, and
        identifies the queue that will be monitored for messages. The queue
        name may include the schema, if needed.

        The ``client_initiated`` parameter is used to determine if client
        initiated connections or server initiated connections (the default)
        will be established. Client initiated connections are only available in
        Oracle Client 19.4 and Oracle Database 19.4 and higher.

        For consistency and compliance with the PEP 8 naming style, the
        parameter ``ipAddress`` was renamed to ``ip_address``, the parameter
        ``groupingClass`` was renamed to ``grouping_class``, the parameter
        ``groupingValue`` was renamed to ``grouping_value``, the parameter
        ``groupingType`` was renamed to ``grouping_type`` and the parameter
        ``clientInitiated`` was renamed to ``client_initiated``. The old names
        will continue to work as keyword parameters for a period of time.
        Nr  r  r   r  r  r   r  r  r  r  r  r  )rC   r   rA   r   oracledbSUBSCR_GROUPING_CLASS_NONESUBSCR_GROUPING_TYPE_SUMMARYr:   create_subscr_implr$   r   	subscribe)r0   r  r  r  rZ   r  r  r  r  r  r  r  r   r  r  r  r  r  r  r   subscrs                        r1   r  zConnection.subscribe  s   | 	    %!3$/)   
 #JH???!DDD!3$3-   
 +NA""!3$3-   
 +N8@@@ EEE!3$2,   
 )M 	/ !3$5/   
  /z,,
 
  (..vtz***r3   c                 `    |                                   | j                                         dS )a  
        Suspends the currently active sessionless transaction immediately.

        This detaches the transaction from the connection, allowing it to be
        resumed later with the transaction identifier that was specified during
        creation of the sessionless transaction. The ``timeout`` previously
        passed to :meth:`begin_sessionless_transaction()` determines how long
        the transaction can stay suspended before it is automatically rolled
        back.
        NrC   r:   suspend_sessionless_transactionr/   s    r1   r  z*Connection.suspend_sessionless_transaction  s0     	   
2244444r3   rD   flagsc                 ,   |                                   |                     |           |t          j        t          j        t          j        t          j        fvrt          j        t          j	                   | j
                            |||           dS )a  
        Begins a Two-Phase Commit (TPC) on a global transaction using the
        specified transaction identifier (xid).

        The ``xid`` parameter should be an object returned by the
        :meth:`xid()` method.

        The ``flags`` parameter is one of the constants
        :data:`oracledb.TPC_BEGIN_JOIN`, :data:`oracledb.TPC_BEGIN_NEW`,
        :data:`oracledb.TPC_BEGIN_PROMOTE`, or
        :data:`oracledb.TPC_BEGIN_RESUME`.  The default is
        :data:`oracledb.TPC_BEGIN_NEW`.

        The ``timeout`` parameter is the number of seconds to wait for a
        transaction to become available for resumption when
        :data:`~oracledb.TPC_BEGIN_RESUME` is specified in the ``flags``
        parameter.  When :data:`~oracledb.TPC_BEGIN_NEW` is specified in the
        ``flags`` parameter, the ``timeout`` parameter indicates the number of
        seconds the transaction can be inactive before it is automatically
        terminated by the system. A transaction is inactive between the time it
        is detached with :meth:`tpc_end()` and the time it is resumed with
        :meth:`tpc_begin()`.The default is *0* seconds.
        NrC   rI   r  TPC_BEGIN_NEWTPC_BEGIN_JOINTPC_BEGIN_RESUMETPC_BEGIN_PROMOTEr   rA   ERR_INVALID_TPC_BEGIN_FLAGSr:   rQ  r0   rD   r  rZ   s       r1   rQ  zConnection.tpc_begin  s    4 	   "#%&	
 
 
 f@AAA
S%11111r3   	one_phasec                     |                                   ||                     |           | j                            ||           dS )a  
        Commits a global transaction. When called with no arguments, this
        method commits a transaction previously prepared with
        :meth:`tpc_begin()` and optionally prepared with :meth:`tpc_prepare()`.
        If :meth:`tpc_prepare()` is not called, 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.

        If an ``xid`` parameter is passed, then an object should be returned by
        the :meth:`xid()` function. This form should be called outside of a
        transaction and is intended for use in recovery.

        The ``one_phase`` parameter is a boolean identifying whether to perform
        a one-phase or two-phase commit. If ``one_phase`` parameter is *True*,
        a single-phase commit is performed. The default value is *False*. This
        parameter is only examined if a value is provided for the ``xid``
        parameter. Otherwise, the driver already knows whether
        :meth:`tpc_prepare()` was called for the transaction and whether a
        one-phase or two-phase commit is required.
        NrC   rI   r:   
tpc_commitr0   rD   r  s      r1   r  zConnection.tpc_commit  sM    . 	   ?S!!!
c9-----r3   c                    |                                   ||                     |           |t          j        t          j        fvrt          j        t
          j                   | j        	                    ||           dS )a  
        Ends or suspends work on a global transaction. This function is only
        intended for use by transaction managers.

        If an ``xid`` parameter is passed, then an object should be returned by
        the :meth:`xid()` function. If no xid parameter is passed, then the
        transaction identifier used by the previous :meth:`tpc_begin()` is
        used.

        The ``flags`` parameter is one of the constants
        :data:`oracledb.TPC_END_NORMAL` or :data:`oracledb.TPC_END_SUSPEND`.
        The default is :data:`oracledb.TPC_END_NORMAL`.

        If the flag is :data:`oracledb.TPC_END_SUSPEND` then the transaction
        may be resumed later by calling :meth:`tpc_begin()` with the flag
        :data:`oracledb.TPC_BEGIN_RESUME`.
        N
rC   rI   r  TPC_END_NORMALTPC_END_SUSPENDr   rA   ERR_INVALID_TPC_END_FLAGSr:   tpc_endr0   rD   r  s      r1   r  zConnection.tpc_end  sw    ( 	   ?S!!!0(2JKKKf>???
3&&&&&r3   c                     |                                   |                     |           | j                            |           dS a.  
        Causes the database to forget a heuristically completed TPC
        transaction.  This function is only intended to be called by
        transaction managers.

        The ``xid`` parameter is mandatory and should be an object should be
        returned by the :meth:`xid()` function.
        NrC   rI   r:   
tpc_forgetr0   rD   s     r1   r  zConnection.tpc_forget  sF     	   
c"""""r3   c                     |                                   ||                     |           | j                            |          S )  
        Prepares a two-phase transaction for commit. After this function is
        called, no further activity should take place on this connection until
        either :meth:`tpc_commit()` or :meth:`tpc_rollback()` have been called.

        Returns a boolean indicating whether a commit is needed or not. If you
        attempt to commit when not needed, then it results in the error
        ``ORA-24756: transaction does not exist``.

        If an ``xid`` parameter is passed, then an object should be returned by
        the :meth:`xid()` function. If an ``xid`` parameter is not passed, then
        the transaction identifier used by the previous :meth:`tpc_begin()` is
        used.
        rC   rI   r:   r  r  s     r1   r  zConnection.tpc_prepare+  sE     	   ?S!!!z%%c***r3   c                     |                                  5 }|                    d           t          |_        |                                cddd           S # 1 swxY w Y   dS )a  
        Returns a list of pending transaction identifiers that require
        recovery.  Objects of type ``Xid`` (as returned by the
        :meth:`xid()` function) are returned and these can be passed to
        :meth:`tpc_commit()` or :meth:`tpc_rollback()` as needed.

        This function queries the DBA_PENDING_TRANSACTIONS view and requires
        "SELECT" privilege on that view.
        
                    select
                        formatid,
                        globalid,
                        branchid
                    from dba_pending_transactionsNrn  r  r&   
rowfactoryfetchallr0   rn  s     r1   tpc_recoverzConnection.tpc_recover?  s     [[]] 
	%fNN5   !$F??$$
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	% 
	%s   5AAAc                     |                                   ||                     |           | j                            |           dS )a  
        If an ``xid`` parameter is not passed, then it rolls back the
        transaction that was previously started with
        :meth:`tpc_begin()`.

        If an ``xid`` parameter is passed, then an object should be returned by
        :meth:`xid()` and the specified transaction is rolled back.  This form
        should be called outside of a transaction and is intended for use in
        recovery.
        NrC   rI   r:   tpc_rollbackr  s     r1   r  zConnection.tpc_rollbackU  sK     	   ?S!!!
$$$$$r3   r  c                     |                                   t          |t                    st          d          |j                            | j                   dS )a5  
        Unsubscribe from events in the database that were originally subscribed
        to using :meth:`subscribe()`. The connection used to unsubscribe should
        be the same one used to create the subscription, or should access the
        same database and be connected as the same user name.
        zexpecting subscriptionN)rC   rF   r$   rG   r:   unsubscribe)r0   r  s     r1   r  zConnection.unsubscribee  sU     	   &,// 	64555  ,,,,,r3   r-   F)rM  rN  rN  r  NN)r   )FFNNF)Ir  r  r	  r   r   r   r2   r5  r7  r<  r4  r   r_   r   rJ  rL  rR  r
  rT  r  r]  rA  rb  r   r   r  r    rj  r  r   rn  r  rx  tupledictr   r  r   r  r#   r  r   r  r  r  r  r  r  r  r  r  SUBSCR_NAMESPACE_DBCHANGESUBSCR_PROTO_CALLBACKOPCODE_ALLOPSSUBSCR_QOS_DEFAULTr  r  r   r$   r  r  r  r&   rQ  r  r  r  r  r  r  r  r  __classcell__r8   s   @r1   r  r  H  s        "@5 8<*.@5 @5 @5c]@5 34	@5
 '@5 
@5 @5 @5 @5 @5 @5D% % %       , , ,	J	J*-	J:=	J		J 	J 	J 	J	J	J*-	J:=	JFI	J		J 	J 	J 	J  	K KK K 	K
 
K K K K& !S ! ! ! X! + + + + + +?3 ?c ?d ? ? ? ?   &    EI &.uS%Z/@&A	   2( ( (& ( ( ( ( $
 
 

 
 3i	

 
 
 

 
 
 
: :>#'	21 *.*.21 21 2121 U4#45621 C=	21 !21 #3-21 
21 21 21 21n :>"	7N *.*.7N 7N 7N7N U4#4567N sm	7N !7N #3-7N 
)	7N 7N 7N 7Nr6 6 6 6 66C 6L 6 6 6 6 
' 
' 
' 
' X
' c    X   "" " " " "   " "S " " " " " #	3 33 3 }	3
 
3 3 3 3* "; 6'+"0.$(&A%B"!&Y  $(%@$A %)Y Y YY Y 8$	Y
 Y Y Y Y SMY Y Y Y smY Y  C=!Y" #Y$ %Y& 'Y( )Y* 
+Y Y Y Yv5 5 5 5 &.%;A#2 #2#2"#2FI#2	#2 #2 #2 #2L <A. .C=.48.	. . . .: $(h6M' 'C='03'	' ' ' '6#c #d # # # #+ +x} + + + + +(%T % % % %,% % % % % % % 
-, 
-4 
- 
- 
- 
- 
- 
- 
- 
-r3   r  f.r?   c                     t          j                   	 dddt          dddt          t                   dt          d         dt          t                   dt
          t                   dt          t                   d	t          f fd
            }|S )aE  
    Decorator which checks the validity of the supplied keyword parameters by
    calling the original function (which does nothing), then creates and
    returns an instance of the requested Connection class. The base Connection
    class constructor does not check the validity of the supplied keyword
    parameters.
    Nr   
pool_alias
conn_classr  r<   r   r  r  r  r  r?   c          	          d| ||||d| t          |t                    st          j        t          j                   |#|!t          j        t          j        dd           |Ft          j        j        	                    |          }| t          j        t          j
        |           |+t          |t          j                  sd}t          |           |d| ||d|S )	Nr<   r   r  r  r  r   r  r   aliasz3pool must be an instance of oracledb.ConnectionPool)r<   r   r  r  )
issubclassr  r   rA   ERR_INVALID_CONN_CLASSr   pool_modulenamed_poolspoolsgetERR_NAMED_POOL_MISSINGrF   ConnectionPoolrG   r<   r   r  r  r  r-  rH   r  s          r1   r(  z$_connection_factory.<locals>.connect}  s1    	
 	
!!	
 	
 	
 	
 	
 *j11 	=f;<<<
 6/ &%   
 !*044Z@@D|!1    J+,%
 %
 LGG$$$zFcVFFvFFFr3   r-   )	functoolswrapsr  r   r   r   r   )r  r(  s   ` r1   _connection_factoryr  r  s     _Q!$G 8<$('1*.$G $G $Gc]$G 34$G SM	$G
 $$G '$G 
$G $G $G $G $G $GL Nr3   )9r   r  r  r  userr   passwordnewpasswordwallet_passwordaccess_tokenhostr  r  https_proxyhttps_proxy_portr   r   sidserver_typecclasspurityexpire_timeretry_countretry_delaytcp_connect_timeoutssl_server_dn_matchssl_server_cert_dnwallet_locationeventsexternalauthr  disable_oobr   r   r   matchanytag
config_dir
appcontextr#  r$  
debug_jdwpconnection_id_prefixssl_contextr   pool_boundaryuse_tcp_fast_openssl_versionprogrammachineterminalosuserdriver_nameuse_snithick_mode_dsn_passthroughextra_auth_params	pool_namer  r<   r   r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r   r   r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r  r(  r   r   r   r)  r*  r+  r#  r$  r,  r-  r.  r   r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  r  c       9             dS )a84  
    Factory function which creates a connection to the database and returns it.

    The ``dsn`` parameter (data source name) can be a string in the format
    user/password@connect_string or can simply be the connect string (in
    which case authentication credentials such as the username and password
    need to be specified separately). See the documentation on connection
    strings for more information.

    The ``pool`` parameter is expected to be a pool object. This parameter was
    deprecated in python-oracledb 3.0.0. Use :meth:`ConnectionPool.acquire()`
    instead since the use of this parameter is the equivalent of calling this
    method.

    The ``conn_class`` parameter is expected to be Connection or a subclass of
    Connection.

    The ``params`` parameter is expected to be of type ConnectParams and
    contains connection parameters that will be used when establishing the
    connection. See the documentation on ConnectParams for more information.
    If this parameter is not specified, the additional keyword parameters will
    be used to create an instance of ConnectParams. If both the ``params``
    parameter and additional keyword parameters are specified, the values in
    the keyword parameters have precedence. Note that if a ``dsn`` is also
    supplied, then in python-oracledb Thin mode, the values of the parameters
    specified (if any) within the ``dsn`` will override the values passed as
    additional keyword parameters, which themselves override the values set in
    the ``params`` parameter object.

    The following parameters are all optional. A brief description of each
    parameter follows:

    - ``user``: the name of the database user to connect to
      (default: None)

    - ``proxy_user``: the name of the proxy user to connect to. If this value
      is not specified, it will be parsed out of user if user is in the form
      "user[proxy_user]"
      (default: None)

    - ``password``: the password for the database user
      (default: None)

    - ``newpassword``: a new password for the database user. The new password
      will take effect immediately upon a successful connection to the database
      (default: None)

    - ``wallet_password``: the password to use to decrypt the wallet, if it is
      encrypted. This is not the database password. For Oracle Autonomous
      Database this is the password created when downloading the wallet. This
      value is only used in python-oracledb Thin mode.
      (default: None)

    - ``access_token``: a string, or a 2-tuple, or a callable. If it is a
      string, it specifies an Entra ID OAuth2 token used for Open Authorization
      (OAuth 2.0) token based authentication. If it is a 2-tuple, it specifies
      the token and private key strings used for Oracle Cloud Infrastructure
      (OCI) Identity and Access Management (IAM) token based authentication. If
      it is a callable, it returns either a string or a 2-tuple used for OAuth
      2.0 or OCI IAM token based authentication and is useful when the pool
      needs to expand and create new connections but the current authentication
      token has expired
      (default: None)

    - ``host``: the hostname or IP address of the machine hosting the database
      or the database listener
      (default: None)

    - ``port``: the port number on which the database listener is listening
      (default: 1521)

    - ``protocol``: one of the strings "tcp" or "tcps" indicating whether to
      use unencrypted network traffic or encrypted network traffic (TLS)
      (default: "tcp")

    - ``https_proxy``: the hostname or IP address of a proxy host to use for
      tunneling secure connections
      (default: None)

    - ``https_proxy_port``: the port on which to communicate with the proxy
      host
      (default: 0)

    - ``service_name``: the service name of the database
      (default: None)

    - ``instance_name``: the instance name of the database
      (default: None)

    - ``sid``: the system identifier (SID) of the database. Note using a
      service_name instead is recommended
      (default: None)

    - ``server_type``: the type of server connection that should be
      established. If specified, it should be one of strings "dedicated",
      "shared" or "pooled"
      (default: None)

    - ``cclass``: the connection class to use for Database Resident Connection
      Pooling (DRCP)
      (default: None)

    - ``purity``: the connection purity to use for Database Resident Connection
      Pooling (DRCP)
      (default: :attr:`oracledb.PURITY_DEFAULT`)

    - ``expire_time``: the number of minutes between the sending of keepalive
      probes. If this parameter is set to a value greater than zero it enables
      keepalive
      (default: 0)

    - ``retry_count``: the number of times that initial connection
      establishment should be retried before the connection attempt is
      terminated
      (default: 0)

    - ``retry_delay``: the number of seconds to wait before retrying to
      establish a connection
      (default: 1)

    - ``tcp_connect_timeout``: a float indicating the maximum number of seconds
      to wait when establishing a connection to the database host
      (default: 20.0)

    - ``ssl_server_dn_match``: a boolean indicating whether the server
      certificate distinguished name (DN) should be matched in addition to the
      regular certificate verification that is performed. Note that if the
      ssl_server_cert_dn parameter is not privided, host name matching is
      performed instead
      (default: True)

    - ``ssl_server_cert_dn``: the distinguished name (DN) which should be
      matched with the server. This value is ignored if the ssl_server_dn_match
      parameter is not set to the value True. If specified this value is used
      for any verfication. Otherwise the hostname will be used
      (default: None)

    - ``wallet_location``: the directory where the wallet can be found. In
      python-oracledb Thin mode this must be the directory containing the PEM-
      encoded wallet file ewallet.pem. In python-oracledb Thick mode this must
      be the directory containing the file cwallet.sso
      (default: None)

    - ``events``: a boolean specifying whether events mode should be enabled.
      This value is only used in python-oracledb Thick mode and is needed for
      continuous query notification and high availability event notifications
      (default: False)

    - ``externalauth``: a boolean indicating whether to use external
      authentication
      (default: False)

    - ``mode``: the authorization mode to use. One of the constants
      :data:`oracledb.AUTH_MODE_DEFAULT`, :data:`oracledb.AUTH_MODE_PRELIM`,
      :data:`oracledb.AUTH_MODE_SYSASM`, :data:`oracledb.AUTH_MODE_SYSBKP`,
      :data:`oracledb.AUTH_MODE_SYSDBA`, :data:`oracledb.AUTH_MODE_SYSDGD`,
      :data:`oracledb.AUTH_MODE_SYSKMT`, :data:`oracledb.AUTH_MODE_SYSOPER`, or
      :data:`oracledb.AUTH_MODE_SYSRAC`
      (default: :attr:`oracledb.AUTH_MODE_DEFAULT`)

    - ``disable_oob``: a boolean indicating whether out-of-band breaks should
      be disabled. This value is only used in python-oracledb Thin mode. It has
      no effect on Windows which does not support this functionality
      (default: False)

    - ``stmtcachesize``: the size of the statement cache
      (default: :attr:`oracledb.defaults.stmtcachesize
      <Defaults.stmtcachesize>`)

    - ``edition``: edition to use for the connection. This parameter cannot be
      used simultaneously with the cclass parameter
      (default: None)

    - ``tag``: identifies the type of connection that should be returned from a
      pool. This value is only used in python-oracledb Thick mode
      (default: None)

    - ``matchanytag``: a boolean specifying whether any tag can be used when
      acquiring a connection from the pool. This value is only used in python-
      oracledb Thick mode
      (default: False)

    - ``config_dir``: a directory in which the optional tnsnames.ora
      configuration file is located. This value is only used in python-oracledb
      Thin mode. For python-oracledb Thick mode, it is used if
      :attr:`oracledb.defaults.thick_mode_dsn_passthrough
      <Defaults.thick_mode_dsn_passthrough>` is *False*. Otherwise in Thick
      mode use the ``config_dir`` parameter of
      :meth:`oracledb.init_oracle_client()`
      (default: :attr:`oracledb.defaults.config_dir
      <Defaults.config_dir>`)

    - ``appcontext``: application context used by the connection. It should be
      a list of 3-tuples (namespace, name, value) and each entry in the tuple
      should be a string
      (default: None)

    - ``shardingkey``: a list of strings, numbers, bytes or dates that identify
      the database shard to connect to. This value is only used in python-
      oracledb Thick mode
      (default: None)

    - ``supershardingkey``: a list of strings, numbers, bytes or dates that
      identify the database shard to connect to. This value is only used in
      python-oracledb Thick mode
      (default: None)

    - ``debug_jdwp``: a string with the format "host=<host>;port=<port>" that
      specifies the host and port of the PL/SQL debugger. This value is only
      used in python-oracledb Thin mode.  For python-oracledb Thick mode set
      the ORA_DEBUG_JDWP environment variable
      (default: None)

    - ``connection_id_prefix``: an application specific prefix that is added to
      the connection identifier used for tracing
      (default: None)

    - ``ssl_context``: an SSLContext object used for connecting to the database
      using TLS.  This SSL context will be modified to include the private key
      or any certificates found in a separately supplied wallet. This parameter
      should only be specified if the default SSLContext object cannot be used
      (default: None)

    - ``sdu``: the requested size of the Session Data Unit (SDU), in bytes. The
      value tunes internal buffers used for communication to the database.
      Bigger values can increase throughput for large queries or bulk data
      loads, but at the cost of higher memory use. The SDU size that will
      actually be used is negotiated down to the lower of this value and the
      database network SDU configuration value
      (default: 8192)

    - ``pool_boundary``: one of the values "statement" or "transaction"
      indicating when pooled DRCP connections can be returned to the pool. This
      requires the use of DRCP with Oracle Database 23.4 or higher
      (default: None)

    - ``use_tcp_fast_open``: a boolean indicating whether to use TCP fast open.
      This is an Oracle Autonomous Database Serverless (ADB-S) specific
      property for clients connecting from within OCI Cloud network. Please
      refer to the ADB-S documentation for more information
      (default: False)

    - ``ssl_version``: one of the values ssl.TLSVersion.TLSv1_2 or
      ssl.TLSVersion.TLSv1_3 indicating which TLS version to use
      (default: None)

    - ``program``: a string recorded by Oracle Database as the program from
      which the connection originates
      (default: :attr:`oracledb.defaults.program
      <Defaults.program>`)

    - ``machine``: a string recorded by Oracle Database as the name of the
      machine from which the connection originates
      (default: :attr:`oracledb.defaults.machine
      <Defaults.machine>`)

    - ``terminal``: a string recorded by Oracle Database as the terminal
      identifier from which the connection originates
      (default: :attr:`oracledb.defaults.terminal
      <Defaults.terminal>`)

    - ``osuser``: a string recorded by Oracle Database as the operating system
      user who originated the connection
      (default: :attr:`oracledb.defaults.osuser
      <Defaults.osuser>`)

    - ``driver_name``: a string recorded by Oracle Database as the name of the
      driver which originated the connection
      (default: :attr:`oracledb.defaults.driver_name
      <Defaults.driver_name>`)

    - ``use_sni``: a boolean indicating whether to use the TLS SNI extension to
      bypass the second TLS neogiation that would otherwise be required
      (default: False)

    - ``thick_mode_dsn_passthrough``: a boolean indicating whether to pass the
      connect string to the Oracle Client libraries unchanged without parsing
      by the driver. Setting this to False makes python-oracledb Thick and Thin
      mode applications behave similarly regarding connection string parameter
      handling and locating any optional tnsnames.ora configuration file
      (default: :attr:`oracledb.defaults.thick_mode_dsn_passthrough
      <Defaults.thick_mode_dsn_passthrough>`)

    - ``extra_auth_params``: a dictionary containing configuration parameters
      necessary for Oracle Database authentication using plugins, such as the
      Azure and OCI cloud-native authentication plugins
      (default: None)

    - ``pool_name``: the name of the DRCP pool when using multi-pool DRCP with
      Oracle Database 23.4, or higher
      (default: None)

    - ``handle``: an integer representing a pointer to a valid service context
      handle. This value is only used in python-oracledb Thick mode. It should
      be used with extreme caution
      (default: 0)
    Nr  :r<   r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r   r   r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r  r(  r   r   r   r)  r*  r+  r#  r$  r,  r-  r.  r   r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  r  s:                                                             r1   r(  r(    
    N 	Dr3   c                       e Zd Zdedej        dededdf
 fdZd Z	d	 Z
d
 ZdPdZd Zd ZdededefdZ	 	 	 dQdeeeef                  dededefdZ	 	 dRdededeeeef                  dee         def
dZ	 	 dRdedeeeef                  dee         defdZdededdfdZdSdZdSdZ	 dTd ed!eeeef                  defd"Z dPd#ede!fd$Z"	 dTd%edeeeeef                  ddfd&Z#d%eedf         deddfd'Z$	 	 	 dUddd(d%edeeeeef                  d)ee         d*ee%         d+ee         d,ee         defd-Z&d.d/d0ed1ed2ee         d!ed3eddfd4Z'	 	 dRddd5d%edeeeeef                  d)ee         d,ee         d6ee         de(fd7Z)	 	 dRddd5d%edeeeeef                  d8ee         d,ee         d6ee         de*e(         fd9Z+	 	 	 dUddd(d%edeeeeef                  d:ee         d*ee%         d+ee         d,ee         defd;Z,	 	 dRddd(d%edeeeeef                  d*ee%         d+ee         d,ee         defd<Z-dede.fd=Z/dSd>Z0	 	 dVdeeef         dededefd?Z1dSd@Z2	 dPdAe3dBedee4         fdCZ5dSdDZ6e7j8        dEfdFe9dGededdfdHZ:	 dWdFee9         dIeddfdJZ;de7j<        fdFee9         dGeddfdKZ=dFe9ddfdLZ>dTdFee9         defdMZ?defdNZ@dTdFee9         ddfdOZA xZBS )XAsyncConnectionr<   r   r  r-  r?   Nc                     t                                                       || _        |                     ||||          | _        dS )zV
        Constructor for creating an asynchronous connection to the database.
        N)r  r2   r  _connect_connect_coroutine)r0   r<   r   r  r-  r8   s        r1   r2   zAsyncConnection.__init__  sB     	
"&--T66"J"Jr3   c                 F    | j         }d | _         |                                S r-   )rB  	__await__)r0   	coroutines     r1   rD  zAsyncConnection.__await__!  s$    +	"&""$$$r3   c                 \   K   | j         | j          d{V  n|                                  | S )zr
        The entry point for the asynchronous connection as a context manager.
        It returns itself.
        N)rB  rC   r/   s    r1   
__aenter__zAsyncConnection.__aenter__&  sF      
 ".)))))))))""$$$r3   c                 P   K   | j         |                                  d{V  dS dS )z
        The exit point for the asynchronous connection as a context manager.
        This will close the connection and roll back any uncommitted
        transaction.
        Nr3  )r0   exc_infos     r1   	__aexit__zAsyncConnection.__aexit__1  s>       :!++-- "!r3   Fc                    K   | j         0| j         j        }|!|                    | j        |           d{V  n | j                            |           d{V  d| _        dS r>  r?  rB  s      r1   r4  zAsyncConnection._close:  s~       :!
(I$11$*fEEEEEEEEE*""6*********


r3   c                   K   dt           j        _        |t          j                    }nMt          |t                    st          j        t          j	                   n|j
                                        }|                    ||d          }|d}nFt          |t          j                  sd}t          |          |                                 |j
        }||                    |           d{V }n0t%          j        ||          }|                    |           d{V  || _
        |j        rE|C|j        <t/          |j                  r(|                    | |j                   d{V  d|_        | S )zf
        Internal method for establishing a connection to the database using
        asyncio.
        TN)r   8pool must be an instance of oracledb.AsyncConnectionPoolF)r   manager	thin_moder
   r  rF   r   r   rA   r  r:   r   r!  r	  AsyncConnectionPoolrG   r"  r&  r   AsyncThinConnImplr(  r*  r+  r,  r   )	r0   r<   r   r  r-  r/  r0  rH   r   s	            r1   rA  zAsyncConnection._connectH  s      )-% >#577KKFM22 	.f?@@@@ ,++--K&&sF&>> <IID+"ABB 	#J  G$$$
I "**;77777777DD.sK@@D,,{+++++++++
 (	1 %1.// 2 ''ko>>>>>>>>>+0D(r3   c                 ,    t          j        | |          S rD  )r   r   rE  s     r1   r   zAsyncConnection._create_queue|  s    
 $T4000r3   r~  keyword_parametersc                     |                                   |r"|rt          j        t          j                   |S |@t	          |t
          t          t          f          st          j        t          j                   |S )z
        Verifies that the connection can be used to execute
        Verifies that the connection is connected to the database. If it is
        not, an exception is raised.
        )	rC   r   rA   ERR_ARGS_AND_KEYWORD_ARGSrF   r  r  r  !ERR_WRONG_EXECUTE_PARAMETERS_TYPE)r0   r~  rS  s      r1   _verify_can_executez#AsyncConnection._verify_can_execute  s     	    	H D!&"BCCC%%#Jud+-
 -
# fFGGGr3   rX   rY   rZ   r[   c                    K   |                                   t          |          }t          |t                    r|dk    rt	          d          | j                            |||           d{V  |S )a  
        Begins a new sessionless transaction. This method returns the
        transaction identifier specified by the user or generated by
        python-oracledb.

        The ``transaction_id`` parameter should be of type string or bytes. If
        specified, it represents a unique identifier for the transaction. If a
        string is passed, then it will be UTF-8 encoded to bytes. If this value
        is not specified, then python-oracledb generates a a random
        `universally-unique identifier (UUID) <https://www.rfc-editor.org/rfc/
        rfc4122.txt>`__ value when this function is called. An example is
        "36b8f84d-df4e-4d49-b662-bcde71a8764f". The user-chosen value cannot
        exceed 64 bytes in length.

        The ``timeout`` parameter is the number of seconds that this
        transaction can stay suspended when
        :meth:`suspend_sessionless_transaction()` is later called, or if the
        transaction is automatically suspended when the ``suspend_on_success``
        parameter is set to to *True* in :meth:`AsyncCursor.execute()` or
        :meth:`AsyncCursor.executemany()`. The default value is *60* seconds.
        If a transaction is not resumed within this specified duration, the
        transaction will be rolled back.

        The ``defer_round_trip`` parameter is a boolean that determines whether
        the request to start a transaction is to be sent immediately or with
        the next database operation. If set to *False*, the request is sent
        immediately. If set to *True*, the request is included with the next
        database operation on the connection. The default value is *False*.
        r   r]   Nr^   ra   s        r1   r`   z-AsyncConnection.begin_sessionless_transaction  s      F 	   ?OO'3'' 	B7a<<@AAAj66g'7
 
 	
 	
 	
 	
 	
 	
 	
  r3   r   return_typec                    K   |                                  5 }|                    ||||           d{V cddd           S # 1 swxY w Y   dS )z
        Calls a PL/SQL function with the given name.

        This is a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.callfunc()`, and then :meth:`AsyncCursor.close()`.
        N)rn  callfunc)r0   r   rY  r~  rS  rn  s         r1   r[  zAsyncConnection.callfunc  s       [[]] 	fk:/A       	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   AA	Ac                    K   |                                  5 }|                    |||           d{V cddd           S # 1 swxY w Y   dS )z
        Calls a PL/SQL procedure with the given name.

        This is a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.callproc()`, and then :meth:`AsyncCursor.close()`.
        N)rn  callproc)r0   r   r~  rS  rn  s        r1   r]  zAsyncConnection.callproc  s       [[]] 	Ofz;MNNNNNNNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O   AAArV  rW  c                 t   K   |                                   | j                            ||           d{V  dS rY  rZ  r\  s      r1   r]  zAsyncConnection.changepassword  sJ       	   j((|DDDDDDDDDDDr3   c                 f   K   |                                   |                                  d{V  dS )z(
        Closes the connection.
        Nr_  r/   s    r1   rA  zAsyncConnection.close  s@       	   kkmmr3   c                 p   K   |                                   | j                                         d{V  dS )zB
        Commits any pending transaction to the database.
        Nra  r/   s    r1   rb  zAsyncConnection.commit  sF       	   j!!!!!!!!!!!r3   rc  r   c                 "  K   |                                   |t          t          t          fvrd}t	          |          | j                            |           d{V }t          j        |          }|r|	                    |           d{V  |S )zP
        Creates and returns a new temporary LOB of the specified type.
        re  N)
rC   r   r   r   rG   r:   rf  r   r   rg  rh  s         r1   rj  zAsyncConnection.createlob  s       	   L-FFFB  G$$$Z44X>>>>>>>>!$'' 	"))D//!!!!!!!
r3   rk  c                 J    |                                   t          | |          S )zo
        Returns an :ref:`AsyncCursor object <asynccursorobj>` associated with
        the connection.
        )rC   r   rm  s     r1   rn  zAsyncConnection.cursor	  s&    
 	   4,,,r3   r}  c                    K   |                                  5 }|                    ||           d{V  ddd           dS # 1 swxY w Y   dS )z
        Executes a statement against the database.

        This is a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.execute()`, and then :meth:`AsyncCursor.close()`
        N)rn  r  r0   r}  r~  rn  s       r1   r  zAsyncConnection.execute	  s       [[]] 	8f..J777777777	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8r^  c                    K   |                                  5 }|                    ||           d{V  ddd           dS # 1 swxY w Y   dS )a  
        Executes a SQL statement once using all bind value mappings or
        sequences found in the sequence parameters. This can be used to insert,
        update, or delete multiple rows in a table with a single
        python-oracledb call. It can also invoke a PL/SQL procedure multiple
        times.

        The ``parameters`` parameter can be a list of tuples, where each tuple
        item maps to one bind variable placeholder in ``statement``. It can
        also be a list of dictionaries, where the keys match the bind variable
        placeholder names in ``statement``. If there are no bind values, or
        values have previously been bound, the ``parameters`` value can be an
        integer specifying the number of iterations.

        This is a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.executemany()`, and then
        :meth:`AsyncCursor.close()`.
        N)rn  executemanyre  s       r1   rg  zAsyncConnection.executemany%	  s      * [[]] 	<f$$Y
;;;;;;;;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<r^  
fetch_lobsr{  r  r  ri  r{  c                  K   |                                  5 }|||_        |j        |_        |                    ||||           d{V  ||_        |                                 d{V cddd           S # 1 swxY w Y   dS )a  
        Executes a query and returns all of the rows.

        The default value for ``arraysize`` is
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`.

        Internally, this method's :attr:`AsyncCursor.prefetchrows` size is set
        to the value of the explicit or default ``arraysize`` parameter value.

        This is a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.fetchall()`, and then :meth:`AsyncCursor.close()`.
        Nrh  )rn  r  r  r  r  r  )r0   r}  r~  r  r  ri  r{  rn  s           r1   r  zAsyncConnection.fetchall=	  s      , [[]] 	+f$#, "("2F..%-	 !          !+F********	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+s   AA99A= A=ro  rp  rr  rs  rt  rq  c                z   K   |                                   | j                            |||||           d{V  dS rv  rw  ry  s         r1   rx  z AsyncConnection.direct_path_load`	  sg      * 	   j))\4
 
 	
 	
 	
 	
 	
 	
 	
 	
 	
r3   rz  r|  c                ,  K   |                                  }d|j        _        |t          j        |          |j        _        |||_        |j        |_        |                    |||           d{V  |j        	                    |           d{V S )a  
        Fetches all rows of the SQL query ``statement``, returning them in a
        :ref:`DataFrame <oracledataframeobj>` object. An empty DataFrame is
        returned if there are no rows available.

        The ``parameters`` parameter can be a list of tuples, where each tuple
        item maps to one :ref:`bind variable placeholder <bind>` in
        ``statement``. It can also be a list of dictionaries, where the keys
        match the bind variable placeholder names in ``statement``.

        The ``arraysize`` parameter can be specified to tune performance of
        fetching data across the network. It defaults to
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`.  Internally,
        the ``fetch_df_all()``'s :attr:`Cursor.prefetchrows` size is always set
        to the value of the explicit or default ``arraysize`` parameter value.

        The ``fetch_decimals`` parameter specifies whether to return decimal
        values when fetching columns of type ``NUMBER`` that are capable of
        being represented in Apache Arrow Decimal128 format. The default value
        is :data:`oracledb.defaults.fetch_decimals <Defaults.fetch_decimals>`.

        The ``requested_schema`` parameter specifies an object that implements
        the Apache Arrow PyCapsule schema interface. The DataFrame returned by
        ``fetch_df_all()`` will have the data types and names of the schema.
        TNr  r  r  s          r1   r  zAsyncConnection.fetch_df_allz	  s      D &*#''6'H ( (FL$  (F$.nn)  
 
 	
 	
 	
 	
 	
 	
 	

 \..v666666666r3   r  c                 K   |                                  }d|j        _        |t          j        |          |j        _        |||_        |j        |_        |                    |||           d{V  |%|j        	                    |           d{V W V  dS |j        
                    ||          2 3 d{V }|W V  6 dS )a  
        This returns an iterator yielding the next ``size`` rows of the SQL
        query ``statement`` in each iteration as a :ref:`DataFrame
        <oracledataframeobj>` object. An empty DataFrame is returned if there
        are no rows available.

        The ``parameters`` parameter can be a list of tuples, where each tuple
        item maps to one :ref:`bind variable placeholder <bind>` in
        ``statement``. It can also be a list of dictionaries, where the keys
        match the bind variable placeholder names in ``statement``.

        The ``size`` parameter controls the number of records fetched in each
        batch. It defaults to
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`. Internally,
        the ``fetch_df_batches()``'s :attr:`Cursor.arraysize` and
        :attr:`Cursor.prefetchrows` sizes are always set to the value of the
        explicit or default ``size`` parameter value.

        The ``fetch_decimals`` parameter specifies whether to return
        decimal values when fetching columns of type ``NUMBER`` that are
        capable of being represented in Arrow Decimal128 format. The default
        value is
        :data:`oracledb.defaults.fetch_decimals <Defaults.fetch_decimals>`.

        The ``requested_schema`` parameter specifies an object that implements
        the Apache Arrow PyCapsule schema interface. The DataFrame returned by
        ``fetch_df_all()`` will have the data types and names of the schema.
        TNr  r  )r0   r}  r~  r  r{  r|  rn  dfs           r1   r  z AsyncConnection.fetch_df_batches	  s.     J &*#''6'H ( (FL$ #F$.nn)  
 
 	
 	
 	
 	
 	
 	
 	

 <11&99999999999999"L99&$GG       b HGGs   8Cnum_rowsc                <  K   |                                  5 }||j        }n|dk    rg cddd           S |x|_        |_        |                    ||||           d{V  ||_        |                    |           d{V cddd           S # 1 swxY w Y   dS )a  
        Executes a query and returns up to the specified number of rows.

        The default value for ``num_rows`` is the value of
        :attr:`oracledb.defaults.arraysize <Defaults.arraysize>`.

        Internally, this method's :attr:`AsyncCursor.prefetchrows` size is set
        to the value of the explicit or default ``num_rows`` parameter,
        allowing all rows to be fetched in one :ref:`round-trip <roundtrips>`

        Since only one fetch is performed for a query, consider adding a
        ``FETCH NEXT`` clause to the statement to prevent the database
        processing rows that will never be fetched, see :ref:`rowlimit`.

        This a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.fetchmany()`, and then :meth:`AsyncCursor.close()`.
        Nr   rh  )rn  r  r  r  r  	fetchmany)r0   r}  r~  ro  r  ri  r{  rn  s           r1   rq  zAsyncConnection.fetchmany	  s?     6 [[]] 	4f!+Q		4 	4 	4 	4 	4 	4 	4 	4
 6>=Fv2..%-	 !          !+F))(33333333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4s   BABBBc                   K   |                                  5 }dx|_        |_        |                    ||||           d{V  ||_        |                                 d{V cddd           S # 1 swxY w Y   dS )a  
        Executes a query and returns the first row of the result set if one
        exists (or *None* if no rows exist).

        Internally, this method's :attr:`Cursor.prefetchrows` and
        :attr:`Cursor.arraysize` sizes will be set to *1*.

        Since only one fetch is performed for a query, consider adding a
        ``WHERE`` condition or using a ``FETCH NEXT`` clause in the statement
        to prevent the database processing rows that will never be fetched, see
        :ref:`rowlimit`.

        This a shortcut for calling :meth:`cursor()`,
        :meth:`AsyncCursor.fetchone()`, and then :meth:`AsyncCursor.close()`.
        r	   rh  N)rn  r  r  r  r  fetchone)r0   r}  r~  r  ri  r{  rn  s          r1   rs  zAsyncConnection.fetchone
  s      0 [[]] 		+f566F&"2..%-	 !          !+F********		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+ 		+s   AA22A69A6c                    K   |                                   | j                            | |           d{V }t          j        |          S )r  Nr  r  s      r1   r  zAsyncConnection.gettype2
  sT      
 	   "j11$========&}555r3   c                 p   K   |                                   | j                                         d{V  dS )zJ
        Pings the database to verify if the connection is valid.
        Nr  r/   s    r1   r  zAsyncConnection.ping;
  sD       	   joor3   c                 
  K   |                                   |t          d          t          |          }t          |t                    r|dk    st          d          | j                            |||           d{V  |S r   r   ra   s        r1   r   z.AsyncConnection.resume_sessionless_transactionB
  s      P 	   !FGGG?OO7C(( 	FW\\DEEEj77g'7
 
 	
 	
 	
 	
 	
 	
 	
  r3   c                 p   K   |                                   | j                                         d{V  dS )z5
        Rolls back any pending transaction.
        Nr  r/   s    r1   r  zAsyncConnection.rollbackx
  sF       	   j!!###########r3   pipelinecontinue_on_errorc                 6  K   |                                   d |j        D             }| j                                        r6t	          |          dk    r#| j                            | ||           d{V  n"| j                            | ||           d{V  |S )a  
        Runs all of the operations in the pipeline and returns a list of
        PipelineOpResult, each entry corresponding to an operation executed in
        the pipeline.

        The ``continue_on_error`` parameter determines whether operations
        should continue to run after an error has occurred. If this parameter
        is set to *True*, then the :attr:`PipelineOpResult.error` attribute
        will be populated with an :ref:`_Error <exchandling>` instance which
        identifies the error that occurred. If this parameter is set to
        *False*, then an exception will be raised as soon as an error is
        detected and all subsequent operations will be terminated. The default
        value is *False*.
        c                 6    g | ]}|                                 S r  )_create_result)r   ops     r1   
<listcomp>z0AsyncConnection.run_pipeline.<locals>.<listcomp>
  s$    EEE22$$&&EEEr3   r	   N)rC   r  r:   supports_pipelininglenrun_pipeline_with_pipeliningrun_pipeline_without_pipelining)r0   rx  ry  resultss       r1   run_pipelinezAsyncConnection.run_pipeline
  s      & 	   EE1DEEE:))++ 	Gq0@0@*99g0          *<<g0         r3   c                 p   K   |                                   | j                                         d{V  dS )a  
        Suspends the currently active sessionless transaction immediately.

        This detaches the transaction from the connection, allowing it to be
        resumed later with the transaction identifier that was specified during
        creation of the sessionless transaction. The ``timeout`` previously
        passed to :meth:`AsyncConnection.begin_sessionless_transaction()`
        determines how long the transaction can stay suspended before it is
        automatically rolled back.
        Nr  r/   s    r1   r  z/AsyncConnection.suspend_sessionless_transaction
  sF       	   j88:::::::::::r3   r   rD   r  c                 <  K   |                                   |                     |           |t          j        t          j        t          j        t          j        fvrt          j        t          j	                   | j
                            |||           d{V  dS )a  
        Begins a Two-Phase Commit (TPC) on a global transaction using the
        specified transaction identifier (xid).

        The ``xid`` parameter should be an object returned by the
        :meth:`xid()` method.

        The ``flags`` parameter is one of the constants
        :data:`oracledb.TPC_BEGIN_JOIN`, :data:`oracledb.TPC_BEGIN_NEW`,
        :data:`oracledb.TPC_BEGIN_PROMOTE`, or
        :data:`oracledb.TPC_BEGIN_RESUME`.  The default is
        :data:`oracledb.TPC_BEGIN_NEW`.

        The ``timeout`` parameter is the number of seconds to wait for a
        transaction to become available for resumption when
        :data:`~oracledb.TPC_BEGIN_RESUME` is specified in the ``flags``
        parameter.  When :data:`~oracledb.TPC_BEGIN_NEW` is specified in the
        ``flags`` parameter, the ``timeout`` parameter indicates the number of
        seconds the transaction can be inactive before it is automatically
        terminated by the system. A transaction is inactive between the time it
        is detached with :meth:`AsyncConnection.tpc_end()` and the time it is
        resumed with :meth:`AsyncConnection.tpc_begin()`.The default is *0*
        seconds.
        Nr  r  s       r1   rQ  zAsyncConnection.tpc_begin
  s      6 	   "#%&	
 
 
 f@AAAj""3w77777777777r3   r  c                    K   |                                   ||                     |           | j                            ||           d{V  dS )a  
        Commits a global transaction. When called with no arguments, this
        method commits a transaction previously prepared with
        :meth:`~AsyncConnection.tpc_begin()` and optionally prepared with
        :meth:`~AsyncConnection.tpc_prepare()`. If
        :meth:`~AsyncConnection.tpc_prepare()` is not called, 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.

        If an ``xid`` parameter is passed, then an object should be returned by
        the :meth:`~Connection.xid()` function. This form should be called
        outside of a transaction and is intended for use in recovery.

        The ``one_phase`` parameter is a boolean identifying whether to perform
        a one-phase or two-phase commit. If ``one_phase`` parameter is *True*,
        a single-phase commit is performed.  The default value is *False*. This
        parameter is only examined if a value is provided for the ``xid``
        parameter. Otherwise, the driver already knows whether
        :meth:`tpc_prepare()` was called for the transaction and whether a
        one-phase or two-phase commit is required.
        Nr  r  s      r1   r  zAsyncConnection.tpc_commit
  sc      0 	   ?S!!!j##C33333333333r3   c                   K   |                                   ||                     |           |t          j        t          j        fvrt          j        t
          j                   | j        	                    ||           d{V  dS )a'  
        Ends or suspends work on a global transaction. This function is only
        intended for use by transaction managers.

        If an ``xid`` parameter is passed, then an object should be returned by
        the :meth:`~Connection.xid()` function. If no xid parameter is passed,
        then the transaction identifier used by the previous
        :meth:`~Connection.tpc_begin()` is used.

        The ``flags`` parameter is one of the constants
        :data:`oracledb.TPC_END_NORMAL` or :data:`oracledb.TPC_END_SUSPEND`.
        The default is :data:`oracledb.TPC_END_NORMAL`.

        If the flag is :data:`oracledb.TPC_END_SUSPEND` then the transaction
        may be resumed later by calling :meth:`AsyncConnection.tpc_begin()`
        with the flag :data:`oracledb.TPC_BEGIN_RESUME`.
        Nr  r  s      r1   r  zAsyncConnection.tpc_end
  s      ( 	   ?S!!!0(2JKKKf>???j  e,,,,,,,,,,,r3   c                    K   |                                   |                     |           | j                            |           d{V  dS r  r  r  s     r1   r  zAsyncConnection.tpc_forget
  s\       	   j##C(((((((((((r3   c                    K   |                                   ||                     |           | j                            |           d{V S )r  Nr  r  s     r1   r  zAsyncConnection.tpc_prepare  s[       	   ?S!!!Z++C000000000r3   c                    K   |                                  5 }|                    d           d{V  t          |_        |                                 d{V cddd           S # 1 swxY w Y   dS )a  
        Returns a list of pending transaction identifiers that require
        recovery.  Objects of type ``Xid`` (as returned by the
        :meth:`~Connection.xid()` function) are returned and these can be
        passed to :meth:`tpc_commit()` or :meth:`tpc_rollback()` as needed.

        This function queries the view ``DBA_PENDING_TRANSACTIONS`` and
        requires ``SELECT`` privilege on that view.
        r  Nr  r  s     r1   r  zAsyncConnection.tpc_recover+  s       [[]] 
	+f..5         !$F********
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+ 
	+s   AA%%A),A)c                    K   |                                   ||                     |           | j                            |           d{V  dS )a  
        Rolls back a global transaction.

        If an ``xid`` parameter is not passed, then it rolls back the
        transaction that was previously started with
        :meth:`~AsyncConnection.tpc_begin()`.

        If an ``xid`` parameter is passed, then an object should be returned by
        :meth:`~Connection.xid()` and the specified transaction is rolled back.
        This form should be called outside of a transaction and is intended for
        use in recovery.
        Nr  r  s     r1   r  zAsyncConnection.tpc_rollbackA  sa       	   ?S!!!j%%c***********r3   r  r  r  r  r-   )NNNr  r  )Cr  r  r	  r   r	  rP  r   r  r2   rD  rG  rJ  r4  rA  r   r   rW  r   r   r  r_   r  r`   r  r  r[  r]  r]  rA  rb  r   r   rj  r   rn  r  rg  r   r  rx  r   r  r   r  rq  rs  r   r  r  r   r  r!   r"   r  r  r  r  r&   rQ  r  r  r  r  r  r  r  r  r  s   @r1   r?  r?    s       KK -K 	K
 K 
K K K K K K% % %
	 	 	        2 2 2h1 1 136	   * 7;!&	,  ,  sEz!23,  ,  	, 
 
,  ,  ,  , d 48-1   U4;/0	
 %TN 
   * 48-1	O OO U4;/0O %TN	O
 
O O O OEE/2E	E E E E   " " " " EI &.uS%Z/@&A	   &- - -+ - - - - :>8 88 U4#4568 
	8 8 8 8<sDy)<7:<	< < < <6 :>#')-!+ &*)-!+ !+ !+!+ U4#456!+ C=	!+
 X&!+ TN!+ !!+ 
!+ !+ !+ !+T $
 
 

 
 3i	

 
 
 

 
 
 
: :>#'	07 *.*.07 07 0707 U4#45607 C=	07 !07 #3-07 
07 07 07 07j :>"	7 *.*.7 7 77 U4#4567 sm	7 !7 #3-7 
)	7 7 7 7x :>"&)-(4 &*)-(4 (4 (4(4 U4#456(4 3-	(4
 X&(4 TN(4 !(4 
(4 (4 (4 (4Z :>)-	!+ &*)-!+ !+ !+!+ U4#456!+ X&	!+ TN!+ !!+ 
!+ !+ !+ !+F6# 6, 6 6 6 6        !&	4  4 c5j)4  4  	4 
 
4  4  4  4 l$ $ $ $ #(    
		   >; ; ; ; &.%;A$8 $8$8"$8FI$8	$8 $8 $8 $8N <A4 4C=4484	4 4 4 4< $(h6M- -C=-03-	- - - -6)C )D ) ) ) )1 1Xc] 1d 1 1 1 1(+4 + + + +,+ +hsm +t + + + + + + + +r3   r?  c                     t          j                   	 dddt          dddt          t                   dt          d         dt          t                   dt
          t                   dt          t                   d	t          f fd
            }|S )z
    Decorator which checks the validity of the supplied keyword parameters by
    calling the original function (which does nothing), then creates and
    returns an instance of the requested AsyncConnection class.
    Nr   r<   r   pool_module.AsyncConnectionPoolr  r  r  r?   c          	      f    d| ||||d| t          |t                    st          j        t          j                   |#|!t          j        t          j        dd           |Ft          j        j        	                    |          }| t          j        t          j
        |           |+t          |t          j                  sd}t          |          |3t          |t                    st          j        t          j                   t!          j                      || |||          S )Nr  r   r  r   r  rM  r  )r  r?  r   rA   r  r   r	  r
  r  r  r  rF   rP  rG   r   r  r  enable_thin_moder  s          r1   connect_asyncz0_async_connection_factory.<locals>.connect_async]  sg    	
 	
!!	
 	
 	
 	
 	
 *o66 	=f;<<<
 6/ &%   
 !*044Z@@D|!1    J+1%
 %
 K  G$$$j&G&Gf?@@@ 	!###z#tVV444r3   r-   )r  r  r?  r   r   r   r   )r  r  s   ` r1   _async_connection_factoryr  T  s     _Q!.5 =A$(,;*..5 .5 .5c].5 89.5 SM	.5
 ).5 '.5 
.5 .5 .5 .5 .5 .5` r3   r  c       9             dS )a>4  
    Factory function which creates a connection to the database and returns it.

    The ``dsn`` parameter (data source name) can be a string in the format
    user/password@connect_string or can simply be the connect string (in
    which case authentication credentials such as the username and password
    need to be specified separately). See the documentation on connection
    strings for more information.

    The ``pool`` parameter is expected to be a pool object. This parameter was
    deprecated in python-oracledb 3.0.0. Use :meth:`ConnectionPool.acquire()`
    instead since the use of this parameter is the equivalent of calling this
    method.

    The ``conn_class`` parameter is expected to be AsyncConnection or a
    subclass of AsyncConnection.

    The ``params`` parameter is expected to be of type ConnectParams and
    contains connection parameters that will be used when establishing the
    connection. See the documentation on ConnectParams for more information. If
    this parameter is not specified, the additional keyword parameters will be
    used to create an instance of ConnectParams. If both the ``params``
    parameter and additional keyword parameters are specified, the values in
    the keyword parameters have precedence. Note that if a ``dsn`` is also
    supplied, then in python-oracledb Thin mode, the values of the parameters
    specified (if any) within the dsn will override the values passed as
    additional keyword parameters, which themselves override the values set in
    the ``params`` parameter object.

    The following parameters are all optional. A brief description of each
    parameter follows:

    - ``user``: the name of the database user to connect to
      (default: None)

    - ``proxy_user``: the name of the proxy user to connect to. If this value
      is not specified, it will be parsed out of user if user is in the form
      "user[proxy_user]"
      (default: None)

    - ``password``: the password for the database user
      (default: None)

    - ``newpassword``: a new password for the database user. The new password
      will take effect immediately upon a successful connection to the database
      (default: None)

    - ``wallet_password``: the password to use to decrypt the wallet, if it is
      encrypted. This is not the database password. For Oracle Autonomous
      Database this is the password created when downloading the wallet. This
      value is only used in python-oracledb Thin mode.
      (default: None)

    - ``access_token``: a string, or a 2-tuple, or a callable. If it is a
      string, it specifies an Entra ID OAuth2 token used for Open Authorization
      (OAuth 2.0) token based authentication. If it is a 2-tuple, it specifies
      the token and private key strings used for Oracle Cloud Infrastructure
      (OCI) Identity and Access Management (IAM) token based authentication. If
      it is a callable, it returns either a string or a 2-tuple used for OAuth
      2.0 or OCI IAM token based authentication and is useful when the pool
      needs to expand and create new connections but the current authentication
      token has expired
      (default: None)

    - ``host``: the hostname or IP address of the machine hosting the database
      or the database listener
      (default: None)

    - ``port``: the port number on which the database listener is listening
      (default: 1521)

    - ``protocol``: one of the strings "tcp" or "tcps" indicating whether to
      use unencrypted network traffic or encrypted network traffic (TLS)
      (default: "tcp")

    - ``https_proxy``: the hostname or IP address of a proxy host to use for
      tunneling secure connections
      (default: None)

    - ``https_proxy_port``: the port on which to communicate with the proxy
      host
      (default: 0)

    - ``service_name``: the service name of the database
      (default: None)

    - ``instance_name``: the instance name of the database
      (default: None)

    - ``sid``: the system identifier (SID) of the database. Note using a
      service_name instead is recommended
      (default: None)

    - ``server_type``: the type of server connection that should be
      established. If specified, it should be one of strings "dedicated",
      "shared" or "pooled"
      (default: None)

    - ``cclass``: the connection class to use for Database Resident Connection
      Pooling (DRCP)
      (default: None)

    - ``purity``: the connection purity to use for Database Resident Connection
      Pooling (DRCP)
      (default: :attr:`oracledb.PURITY_DEFAULT`)

    - ``expire_time``: the number of minutes between the sending of keepalive
      probes. If this parameter is set to a value greater than zero it enables
      keepalive
      (default: 0)

    - ``retry_count``: the number of times that initial connection
      establishment should be retried before the connection attempt is
      terminated
      (default: 0)

    - ``retry_delay``: the number of seconds to wait before retrying to
      establish a connection
      (default: 1)

    - ``tcp_connect_timeout``: a float indicating the maximum number of seconds
      to wait when establishing a connection to the database host
      (default: 20.0)

    - ``ssl_server_dn_match``: a boolean indicating whether the server
      certificate distinguished name (DN) should be matched in addition to the
      regular certificate verification that is performed. Note that if the
      ssl_server_cert_dn parameter is not privided, host name matching is
      performed instead
      (default: True)

    - ``ssl_server_cert_dn``: the distinguished name (DN) which should be
      matched with the server. This value is ignored if the ssl_server_dn_match
      parameter is not set to the value True. If specified this value is used
      for any verfication. Otherwise the hostname will be used
      (default: None)

    - ``wallet_location``: the directory where the wallet can be found. In
      python-oracledb Thin mode this must be the directory containing the PEM-
      encoded wallet file ewallet.pem. In python-oracledb Thick mode this must
      be the directory containing the file cwallet.sso
      (default: None)

    - ``events``: a boolean specifying whether events mode should be enabled.
      This value is only used in python-oracledb Thick mode and is needed for
      continuous query notification and high availability event notifications
      (default: False)

    - ``externalauth``: a boolean indicating whether to use external
      authentication
      (default: False)

    - ``mode``: the authorization mode to use. One of the constants
      :data:`oracledb.AUTH_MODE_DEFAULT`, :data:`oracledb.AUTH_MODE_PRELIM`,
      :data:`oracledb.AUTH_MODE_SYSASM`, :data:`oracledb.AUTH_MODE_SYSBKP`,
      :data:`oracledb.AUTH_MODE_SYSDBA`, :data:`oracledb.AUTH_MODE_SYSDGD`,
      :data:`oracledb.AUTH_MODE_SYSKMT`, :data:`oracledb.AUTH_MODE_SYSOPER`, or
      :data:`oracledb.AUTH_MODE_SYSRAC`
      (default: :attr:`oracledb.AUTH_MODE_DEFAULT`)

    - ``disable_oob``: a boolean indicating whether out-of-band breaks should
      be disabled. This value is only used in python-oracledb Thin mode. It has
      no effect on Windows which does not support this functionality
      (default: False)

    - ``stmtcachesize``: the size of the statement cache
      (default: :attr:`oracledb.defaults.stmtcachesize
      <Defaults.stmtcachesize>`)

    - ``edition``: edition to use for the connection. This parameter cannot be
      used simultaneously with the cclass parameter
      (default: None)

    - ``tag``: identifies the type of connection that should be returned from a
      pool. This value is only used in python-oracledb Thick mode
      (default: None)

    - ``matchanytag``: a boolean specifying whether any tag can be used when
      acquiring a connection from the pool. This value is only used in python-
      oracledb Thick mode
      (default: False)

    - ``config_dir``: a directory in which the optional tnsnames.ora
      configuration file is located. This value is only used in python-oracledb
      Thin mode. For python-oracledb Thick mode, it is used if
      :attr:`oracledb.defaults.thick_mode_dsn_passthrough
      <Defaults.thick_mode_dsn_passthrough>` is *False*. Otherwise in Thick
      mode use the ``config_dir`` parameter of
      :meth:`oracledb.init_oracle_client()`
      (default: :attr:`oracledb.defaults.config_dir
      <Defaults.config_dir>`)

    - ``appcontext``: application context used by the connection. It should be
      a list of 3-tuples (namespace, name, value) and each entry in the tuple
      should be a string
      (default: None)

    - ``shardingkey``: a list of strings, numbers, bytes or dates that identify
      the database shard to connect to. This value is only used in python-
      oracledb Thick mode
      (default: None)

    - ``supershardingkey``: a list of strings, numbers, bytes or dates that
      identify the database shard to connect to. This value is only used in
      python-oracledb Thick mode
      (default: None)

    - ``debug_jdwp``: a string with the format "host=<host>;port=<port>" that
      specifies the host and port of the PL/SQL debugger. This value is only
      used in python-oracledb Thin mode.  For python-oracledb Thick mode set
      the ORA_DEBUG_JDWP environment variable
      (default: None)

    - ``connection_id_prefix``: an application specific prefix that is added to
      the connection identifier used for tracing
      (default: None)

    - ``ssl_context``: an SSLContext object used for connecting to the database
      using TLS.  This SSL context will be modified to include the private key
      or any certificates found in a separately supplied wallet. This parameter
      should only be specified if the default SSLContext object cannot be used
      (default: None)

    - ``sdu``: the requested size of the Session Data Unit (SDU), in bytes. The
      value tunes internal buffers used for communication to the database.
      Bigger values can increase throughput for large queries or bulk data
      loads, but at the cost of higher memory use. The SDU size that will
      actually be used is negotiated down to the lower of this value and the
      database network SDU configuration value
      (default: 8192)

    - ``pool_boundary``: one of the values "statement" or "transaction"
      indicating when pooled DRCP connections can be returned to the pool. This
      requires the use of DRCP with Oracle Database 23.4 or higher
      (default: None)

    - ``use_tcp_fast_open``: a boolean indicating whether to use TCP fast open.
      This is an Oracle Autonomous Database Serverless (ADB-S) specific
      property for clients connecting from within OCI Cloud network. Please
      refer to the ADB-S documentation for more information
      (default: False)

    - ``ssl_version``: one of the values ssl.TLSVersion.TLSv1_2 or
      ssl.TLSVersion.TLSv1_3 indicating which TLS version to use
      (default: None)

    - ``program``: a string recorded by Oracle Database as the program from
      which the connection originates
      (default: :attr:`oracledb.defaults.program
      <Defaults.program>`)

    - ``machine``: a string recorded by Oracle Database as the name of the
      machine from which the connection originates
      (default: :attr:`oracledb.defaults.machine
      <Defaults.machine>`)

    - ``terminal``: a string recorded by Oracle Database as the terminal
      identifier from which the connection originates
      (default: :attr:`oracledb.defaults.terminal
      <Defaults.terminal>`)

    - ``osuser``: a string recorded by Oracle Database as the operating system
      user who originated the connection
      (default: :attr:`oracledb.defaults.osuser
      <Defaults.osuser>`)

    - ``driver_name``: a string recorded by Oracle Database as the name of the
      driver which originated the connection
      (default: :attr:`oracledb.defaults.driver_name
      <Defaults.driver_name>`)

    - ``use_sni``: a boolean indicating whether to use the TLS SNI extension to
      bypass the second TLS neogiation that would otherwise be required
      (default: False)

    - ``thick_mode_dsn_passthrough``: a boolean indicating whether to pass the
      connect string to the Oracle Client libraries unchanged without parsing
      by the driver. Setting this to False makes python-oracledb Thick and Thin
      mode applications behave similarly regarding connection string parameter
      handling and locating any optional tnsnames.ora configuration file
      (default: :attr:`oracledb.defaults.thick_mode_dsn_passthrough
      <Defaults.thick_mode_dsn_passthrough>`)

    - ``extra_auth_params``: a dictionary containing configuration parameters
      necessary for Oracle Database authentication using plugins, such as the
      Azure and OCI cloud-native authentication plugins
      (default: None)

    - ``pool_name``: the name of the DRCP pool when using multi-pool DRCP with
      Oracle Database 23.4, or higher
      (default: None)

    - ``handle``: an integer representing a pointer to a valid service context
      handle. This value is only used in python-oracledb Thick mode. It should
      be used with extreme caution
      (default: 0)
    Nr  r<  s:                                                             r1   r  r    r=  r3   r-   )Hcollectionsr  ssltypingr   r   r   r   r   r   r  rN  r
   r   r   r   r   r   r	  aqr   r   r   
arrow_implr   baser   r   r   r   r   connect_paramsr   rn  r   r   	dataframer   dbobjectr   r   ri  r   r    rx  r!   r"   sodar#   r  r$   utilsr%   
namedtupler&   r+   r  r  r   r  r_   Purityfloatr  AuthModer  
TLSVersionr  r(  r?  r  r  r  r3   r1   <module>r     s]  H         



 A A A A A A A A A A A A A A A A  C C C C C C C C C C C C C C ! ! ! ! ! ! 4 4 4 4 4 4 4 4 4 4 ' ' ' ' ' '       H H H H H H H H H H H H ) ) ) ) ) ) ' ' ' ' ' ' ' '             , , , , , , , ,         0 0 0 0 0 0 0 0                   7 7 7 7 7 7 k	EEE 
DG DG DG DG DG} DG DG DG DGNg- g- g- g- g- g- g- g-T2Z 2c:o2 2 2 2j f	 48 $#-&* $"!%%):>"!%&*"&#'!% (,!%!%!%+/*.(,%)!#'(,"&#'!"& $!%"&'+ $*.!%#'(,,0!!" !%"15(,# wf	 f	 f		#f	 /
0f	 	f	
 Z f	 ]#f	 3-f	 f	 smf	 #f	 c]f	 5eX!567f	 3-f	 3-f	 smf	  #!f	" sm#f	$ 3-%f	& C='f	( 
#)f	* #+f	, SM-f	. X_%/f	0 #1f	2 #3f	4 #5f	6 "%7f	8 "$9f	: !;f	< c]=f	> TN?f	@ 4.Af	B 8$
%Cf	D $Ef	F C=Gf	H c]If	J 
#Kf	L $Mf	N Of	P Qf	R $Sf	T tnUf	V Wf	X #3-Yf	Z #[f	\ 
#]f	^ C=_f	`  ~af	b #.)cf	d c]ef	f c]gf	h smif	j SMkf	l #mf	n d^of	p !)qf	r  ~sf	t }uf	v SMwf	x yf	 f	 f	 f	R@+ @+ @+ @+ @+n @+ @+ @+F:_$%:c?"#: : : :z f	 9= $(7&* $"!%%):>"!%&*"&#'!% (,!%!%!%+/*.(,%)!#'(,"&#'!"& $!%"&'+ $*.!%#'(,,0!!" !%"15(,# wf	 f	 f		#f	 4
5f	 	f	
 _%f	 ]#f	 3-f	 f	 smf	 #f	 c]f	 5eX!567f	 3-f	 3-f	 smf	  #!f	" sm#f	$ 3-%f	& C='f	( 
#)f	* #+f	, SM-f	. X_%/f	0 #1f	2 #3f	4 #5f	6 "%7f	8 "$9f	: !;f	< c]=f	> TN?f	@ 4.Af	B 8$
%Cf	D $Ef	F C=Gf	H c]If	J 
#Kf	L $Mf	N Of	P Qf	R $Sf	T tnUf	V Wf	X #3-Yf	Z #[f	\ 
#]f	^ C=_f	`  ~af	b #.)cf	d c]ef	f c]gf	h smif	j SMkf	l #mf	n d^of	p !)qf	r  ~sf	t }uf	v SMwf	x yf	 f	 f	 f	 f	 f	r3   