
    i0                     \    d dl mZ d dl mZ d dlmZ  G d de          Z e            ZdS )   )	base_impl)errors)BaseMetaClassc                   2   e Zd ZdZddZedefd            Zej        defd            Zede	fd            Z
e
j        de	fd	            Z
edefd
            Zej        defd            Zedefd            Zej        defd            Zedefd            Zej        defd            Zedefd            Zej        defd            Zede	fd            Zej        de	fd            Zede	fd            Zej        de	fd            Zede	fd            Zej        de	fd            Zede	fd            Zej        de	fd            Zede	fd            Zej        de	fd            Zedefd            Zej        de	fd            ZdS )Defaultsz
    A singleton Defaults object contains attributes to adjust default
    behaviors of python-oracledb. It is accessed using the :data:`defaults`
    attribute of the imported module.
    returnNc                 (    t           j        | _        d S N)r   DEFAULTS_implselfs    a/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/oracledb/defaults.py__init__zDefaults.__init__,   s    '


    c                     | j         j        S )a  
        This read-write attribute specifies the default arraysize to use when
        cursors are created.

        It is an attribute for tuning the performance of fetching rows from
        Oracle Database. It does not affect data insertion.

        This value is the default for :attr:`Cursor.arraysize` and
        :attr:`AsyncCursor.arraysize`.

        This attribute has an initial value of *100*.
        r   	arraysizer   s    r   r   zDefaults.arraysize/   s     z##r   valuec                     || j         _        d S r
   r   r   r   s     r   r   zDefaults.arraysize?   s    $
r   c                     | j         j        S )a  
        This read-write attribute specifies the directory in which the optional
        configuration file ``tnsnames.ora`` will be read in python-oracledb
        Thin mode. It is also used in Thick mode if
        :attr:`Defaults.thick_mode_dsn_passthrough` is *False*.

        At time of ``import oracledb`` the value of
        ``oracledb.defaults.config_dir`` will be set to (first one wins):

        - the value of ``$TNS_ADMIN``, if ``TNS_ADMIN`` is set.

        - ``$ORACLE_HOME/network/admin``, if ``$ORACLE_HOME`` is set.

        Otherwise, ``oracledb.defaults.config_dir`` will not be set.

        At completion of a call to :meth:`oracledb.init_oracle_client()` in
        python-oracledb Thick mode, the value of ``config_dir`` may get
        changed.
        r   
config_dirr   s    r   r   zDefaults.config_dirC   s    * z$$r   c                     || j         _        d S r
   r   r   s     r   r   zDefaults.config_dirZ        %
r   c                     | j         j        S )a  
        This read-write attribute specifies whether queries that contain LOBs
        should return LOB objects or their contents instead.

        When the value of this attribute is *True*, then queries to LOB columns
        return LOB locators. When the value of this attribute is *False*, then
        CLOBs and NCLOBs are fetched as strings, and BLOBs are fetched as
        bytes. If LOBs are larger than 1 GB, then this attribute should be set
        to *True* and the LOBs should be streamed.

        The value of ``oracledb.defaults.fetch_lobs`` does not affect LOBs
        returned as OUT binds.

        The value of ``fetch_lobs`` can be overridden at statement execution by
        passing an equivalent parameter.

        An output type handler such as the one previously required in the
        obsolete cx_Oracle driver can alternatively be used to adjust the
        returned type.  If a type handler exists and returns a variable (that
        is, `cursor.var(...)`), then that return variable is used. If the type
        handler returns *None*, then the value of
        ``oracledb.defaults.fetch_lobs`` is used.

        This attribute has an initial value of *True*.
        r   
fetch_lobsr   s    r   r   zDefaults.fetch_lobs^   s    6 z$$r   c                     || j         _        d S r
   r   r   s     r   r   zDefaults.fetch_lobs{   r   r   c                     | j         j        S )a  
        This read-write attribute specifies whether queries that contain
        numbers should be fetched as Python decimal.Decimal objects or floating
        point numbers. This can help avoid issues with converting numbers from
        Oracle Database's decimal format to Python's binary format.

        The value of ``fetch_decimals`` can be overridden at statement
        execution by passing an equivalent parameter.

        An output type handler such as previously required in the obsolete
        cx_Oracle driver can alternatively be used to adjust the returned type.
        If a type handler exists and returns a variable (that is,
        ``cursor.var(...)``), then that return variable is used. If the type
        handler returns *None*, then the value of
        ``oracledb.defaults.fetch_decimals`` is used to determine whether to
        return ``decimal.Decimal`` values.

        This attribute has an initial value of *False*.
        r   fetch_decimalsr   s    r   r#   zDefaults.fetch_decimals   s    * z((r   c                     || j         _        d S r
   r"   r   s     r   r#   zDefaults.fetch_decimals   s    $)
!!!r   c                     | j         j        S )a  
        This read-write attribute specifies the default number of rows to
        prefetch when cursors are executed.

        This is an attribute for tuning the performance of fetching rows from
        Oracle Database. It does not affect data insertion.

        This value is the default for :attr:`Cursor.prefetchrows` and
        :attr:`AsyncCursor.prefetchrows`.

        This attribute is ignored when using :meth:`Connection.fetch_df_all()`
        or :meth:`Connection.fetch_df_batches()` since these methods always set
        the internal prefetch size to their relevant ``arraysize`` or ``size``
        parameter value.

        This attribute has an initial value of *2*.
        r   prefetchrowsr   s    r   r'   zDefaults.prefetchrows   s    & z&&r   c                     || j         _        d S r
   r&   r   s     r   r'   zDefaults.prefetchrows   s    "'
r   c                     | j         j        S )a  
        This read-write attribute specifies the default size of the statement
        cache.

        This is an attribute for tuning statement execution performance when a
        statement is executed more than once.

        This value is the default for :attr:`Connection.stmtcachesize`,
        :attr:`ConnectionPool.stmtcachesize`,
        :attr:`AsyncConnection.stmtcachesize`, and
        :attr:`AsyncConnectionPool.stmtcachesize`.

        This attribute has an initial value of *20*.
        r   stmtcachesizer   s    r   r+   zDefaults.stmtcachesize   s      z''r   c                     || j         _        d S r
   r*   r   s     r   r+   zDefaults.stmtcachesize   s    #(
   r   c                     | j         j        S )a  
        This read-write attribute is a string recorded by Oracle Database
        as the program from which the connection originates.  This is the value
        used in the PROGRAM column of the V$SESSION view.

        This attribute has an initial value that is populated by
        `sys.executable <https://docs.python.org/3/library/sys.html#
        sys.executable>`__.

        This attribute is only used in python-oracledb Thin mode.
        )r   programr   s    r   r.   zDefaults.program   s     z!!r   c                     t          j        |          |k    r t          j        t          j        d           || j        _        d S )Nr.   name)r   sanitizer   
_raise_errERR_INVALID_NETWORK_NAMEr   r.   r   s     r   r.   zDefaults.program   A    e$$--f=INNNN"
r   c                     | j         j        S )a  
        This read-write attribute is a string recorded by Oracle Database as
        the name of machine from which the connection originates. This is the
        value used in the MACHINE column of the V$SESSION view.

        This attribute takes the host name where the application is running as
        its initial value.

        This attribute is only used in python-oracledb Thin mode.
        )r   machiner   s    r   r7   zDefaults.machine   s     z!!r   c                     t          j        |          |k    r t          j        t          j        d           || j        _        d S )Nr7   r0   )r   r2   r   r3   r4   r   r7   r   s     r   r7   zDefaults.machine   r5   r   c                     | j         j        S )aF  
        This read-write attribute specifies the terminal identifier from which
        the connection originates. This is the value used in the TERMINAL
        column of the V$SESSION view.

        This attribute has an initial value of "unknown".

        This attribute is only used in python-oracledb Thin mode.
        r   terminalr   s    r   r;   zDefaults.terminal   s     z""r   c                     || j         _        d S r
   r:   r   s     r   r;   zDefaults.terminal   s    #
r   c                     | j         j        S )at  
        This read-write attribute is a string recorded by Oracle Database
        as the operating system user who originated the connection. This is the
        value used in the OSUSER column of the V$SESSION view.

        This attribute takes the login name of the user as its initial value.

        This attribute is only used in python-oracledb Thin mode.
        )r   osuserr   s    r   r>   zDefaults.osuser  s     z  r   c                     t          j        |          |k    r t          j        t          j        d           || j        _        d S )Nr>   r0   )r   r2   r   r3   r4   r   r>   r   s     r   r>   zDefaults.osuser  sA    e$$--f=HMMMM!
r   c                     | j         j        S )a  
        This read-write attribute is a string recorded by Oracle Database
        as the name of the driver which originated the connection. This is the
        value used in the CLIENT_DRIVER column of the V$SESSION_CONNECT_INFO
        view.

        This attribute has an initial value of *None*. It is used as required
        in python-oracledb Thick and Thin mode.

        In python-oracledb Thick mode, this attribute is used if the
        ``driver_name`` parameter is not specified in
        :meth:`oracledb.init_oracle_client()`. In Thin mode, this attribute is
        used if the ``driver_name`` parameter is not specified in
        :meth:`oracledb.connect()`, :meth:`oracledb.connect_async()`,
        :meth:`oracledb.create_pool()`, or
        :meth:`oracledb.create_pool_async()`. If the value of this attribute is
        *None*, the value set when connecting in python-oracledb Thick mode is
        like "python-oracledb thk : <version>" and in Thin mode is like
        "python-oracledb thn : <version>".
        r   driver_namer   s    r   rB   zDefaults.driver_name  s    , z%%r   c                     || j         _        d S r
   rA   r   s     r   rB   zDefaults.driver_name.  s    !&
r   c                     | j         j        S )a  
        This read-write attribute determines whether
        connection strings passed as the ``dsn`` parameter to
        :meth:`oracledb.connect()`, :meth:`oracledb.create_pool()`,
        :meth:`oracledb.connect_async()`, and
        :meth:`oracledb.create_pool_async()` in python-oracledb Thick mode will
        be parsed by Oracle Client libraries or by python-oracledb itself.

        The value of ``thick_mode_dsn_passthrough`` is ignored in
        python-oracledb Thin mode, which always parses all connect strings
        (including reading a tnsnames.ora file, if required).

        This attribute has an initial value of *True*.
        r   thick_mode_dsn_passthroughr   s    r   rF   z#Defaults.thick_mode_dsn_passthrough2  s      z44r   c                     || j         _        d S r
   rE   r   s     r   rF   z#Defaults.thick_mode_dsn_passthroughD  s    05
---r   )r   N)__name__
__module____qualname____doc__r   propertyintr   setterstrr   boolr   r#   r'   r+   r.   r7   r;   r>   rB   rF    r   r   r   r   %   s        ( ( ( ( $3 $ $ $ X$ %s % % % % %C % % % X%, & & & & & %D % % % X%8 & & & & & ) ) ) ) X), *D * * * * 'c ' ' ' X'( (# ( ( ( ( (s ( ( ( X(" )3 ) ) ) ) " " " " X" ^#S # # # ^#
 " " " " X" ^#S # # # ^#
 
## 
# 
# 
# X
# _$c $ $ $ _$ 
! 
! 
! 
! X
! ]"C " " " ]"
 &S & & & X&. ' ' ' ' ' 5D 5 5 5 X5"  &6 6 6 6 '&6 6 6r   r   )	metaclassN) r   r   baser   r   defaultsrQ   r   r   <module>rV      s   @                  a6 a6 a6 a6 a6 a6 a6 a6 a6H	 8::r   