
    e?1i                     B    d Z ddlZddlmZ ddlmZ  G d de      ZeZy)	a4  
.. dialect:: oracle+oracledb
    :name: python-oracledb
    :dbapi: oracledb
    :connectstring: oracle+oracledb://user:pass@hostname:port[/dbname][?service_name=<service>[&key=value&key=value...]]
    :url: https://oracle.github.io/python-oracledb/

python-oracledb is released by Oracle to supersede the cx_Oracle driver.
It is fully compatible with cx_Oracle and features both a "thin" client
mode that requires no dependencies, as well as a "thick" mode that uses
the Oracle Client Interface in the same way as cx_Oracle.

.. seealso::

    :ref:`cx_oracle` - all of cx_Oracle's notes apply to the oracledb driver
    as well.

Thick mode support
------------------

By default the ``python-oracledb`` is started in thin mode, that does not
require oracle client libraries to be installed in the system. The
``python-oracledb`` driver also support a "thick" mode, that behaves
similarly to ``cx_oracle`` and requires that Oracle Client Interface (OCI)
is installed.

To enable this mode, the user may call ``oracledb.init_oracle_client``
manually, or by passing the parameter ``thick_mode=True`` to
:func:`_sa.create_engine`. To pass custom arguments to ``init_oracle_client``,
like the ``lib_dir`` path, a dict may be passed to this parameter, as in::

    engine = sa.create_engine("oracle+oracledb://...", thick_mode={
        "lib_dir": "/path/to/oracle/client/lib", "driver_name": "my-app"
    })

.. seealso::

    https://python-oracledb.readthedocs.io/en/latest/api_manual/module.html#oracledb.init_oracle_client


.. versionadded:: 2.0.0 added support for oracledb driver.

    N   )OracleDialect_cx_oracle   )excc                   X     e Zd ZdZdZ	 	 	 	 	 d fd	Zed        Zed        Zd Z	 xZ
S )OracleDialect_oracledbToracledbc                     t        |   ||||fi | | j                  D|st        |t              r1t        |t              r|ni } | j                  j
                  di | y y y )N )super__init__dbapi
isinstancedictinit_oracle_client)	selfauto_convert_lobscoerce_to_decimal	arraysizeencoding_errors
thick_modekwargskw	__class__s	           m/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/oracledb.pyr   zOracleDialect_oracledb.__init__=   sq     			

 	
 ::!*Z6)*d;B)DJJ))/B/ 7 "    c                     dd l }|S )Nr   )r	   )clsr	   s     r   import_dbapiz#OracleDialect_oracledb.import_dbapiT   s
    r   c                 B    |j                   j                  j                  S N)
connectiondbapi_connectionthin)r   r"   s     r   is_thin_modez#OracleDialect_oracledb.is_thin_modeZ   s    $$55:::r   c                    d}|Et        j                  d|j                        }|r#t        d |j	                  ddd      D              }|| _        | j
                  dk  r%| j
                  dkD  rt        j                  d      y y )	N)r   r   r   z(\d+)\.(\d+)(?:\.(\d+))?c              3   8   K   | ]  }|t        |        y wr!   )int).0xs     r   	<genexpr>z7OracleDialect_oracledb._load_version.<locals>.<genexpr>c   s        CF s   r      r   )r   z*oracledb version 1 and above are supported)rematchversiontuplegrouporacledb_verr   InvalidRequestError)r   dbapi_moduler/   ms       r   _load_versionz$OracleDialect_oracledb._load_version^   s    #4l6J6JKA  $%GGAq!$4   $t#(9(9I(E))<  )F#r   )TT2   NN)__name__
__module____qualname__supports_statement_cachedriverr   classmethodr   r%   r6   __classcell__)r   s   @r   r   r   9   sQ    #F 0.  
 ; ;r   r   )	__doc__r-   	cx_oracler   _OracleDialect_cx_oracle r   r   dialectr   r   r   <module>rD      s+   *V 
 J 15 1h !r   