Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/firebird/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/firebird/__pycache__/fdb.cpython-311.pyc

�

�܋f���B�dZddlmZddlmZGd�de��ZeZdS)a	
.. dialect:: firebird+fdb
    :name: fdb
    :dbapi: pyodbc
    :connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...]
    :url: http://pypi.python.org/pypi/fdb/

    fdb is a kinterbasdb compatible DBAPI for Firebird.

    .. versionchanged:: 0.9 - The fdb dialect is now the default dialect
       under the ``firebird://`` URL space, as ``fdb`` is now the official
       Python driver for Firebird.

Arguments
----------

The ``fdb`` dialect is based on the
:mod:`sqlalchemy.dialects.firebird.kinterbasdb` dialect, however does not
accept every argument that Kinterbasdb does.

* ``enable_rowcount`` - True by default, setting this to False disables
  the usage of "cursor.rowcount" with the
  Kinterbasdb dialect, which SQLAlchemy ordinarily calls upon automatically
  after any UPDATE or DELETE statement.   When disabled, SQLAlchemy's
  ResultProxy will return -1 for result.rowcount.   The rationale here is
  that Kinterbasdb requires a second round trip to the database when
  .rowcount is called -  since SQLA's resultproxy automatically closes
  the cursor after a non-result-returning statement, rowcount must be
  called, if at all, before the result object is returned.   Additionally,
  cursor.rowcount may not return correct results with older versions
  of Firebird, and setting this flag to False will also cause the
  SQLAlchemy ORM to ignore its usage. The behavior can also be controlled on a
  per-execution basis using the ``enable_rowcount`` option with
  :meth:`_engine.Connection.execution_options`::

      conn = engine.connect().execution_options(enable_rowcount=True)
      r = conn.execute(stmt)
      print(r.rowcount)

* ``retaining`` - False by default.   Setting this to True will pass the
  ``retaining=True`` keyword argument to the ``.commit()`` and ``.rollback()``
  methods of the DBAPI connection, which can improve performance in some
  situations, but apparently with significant caveats.
  Please read the fdb and/or kinterbasdb DBAPI documentation in order to
  understand the implications of this flag.

  .. versionchanged:: 0.9.0 - the ``retaining`` flag defaults to ``False``.
     In 0.8 it defaulted to ``True``.

  .. seealso::

    http://pythonhosted.org/fdb/usage-guide.html#retaining-transactions
    - information on the "retaining" flag.

�)�FBDialect_kinterbasdb�)�utilc�B��eZdZd�fd�	Zed���Zd�Zd�Z�xZS)�
FBDialect_fdbTFc�N��tt|��jd||d�|��dS)N)�enable_rowcount�	retaining�)�superr�__init__)�selfr	r
�kwargs�	__class__s    ��s/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/firebird/fdb.pyr
zFBDialect_fdb.__init__EsE���+��m�T�"�"�+�	
�+�y�	
�	
�DJ�	
�	
�	
�	
�	
�c� �td��S)N�fdb)�
__import__)�clss r�dbapizFBDialect_fdb.dbapiJs���%� � � rc��|�d���}|�d��r|d�d|d��|d<|d=|�|j��t	j|dt��g|fS)N�user)�username�port�host�/�	type_conv)�translate_connect_args�get�update�queryr�coerce_kw_type�int)r�url�optss   r�create_connect_argsz!FBDialect_fdb.create_connect_argsNs����)�)�6�)�:�:���8�8�F���	�&*�6�l�l�l�D��L�L�A�D��L��V�����C�I������D�+�s�3�3�3��D�z�rc�h�d}|j}|�|��}|�|��S)z�Get the version of the Firebird server used by a connection.

        Returns a tuple of (`major`, `minor`, `build`), three integers
        representing the version of the attached server.
        �g)�
connection�db_info�_parse_version_info)rr*�isc_info_firebird_version�fbconn�versions     r�_get_server_version_infoz&FBDialect_fdb._get_server_version_infoYs8��%(�!��&���.�.�!:�;�;���'�'��0�0�0r)TF)	�__name__�
__module__�__qualname__r
�classmethodrr'r0�
__classcell__)rs@rrrDsv�������
�
�
�
�
�
�
�!�!��[�!�	�	�	�1�1�1�1�1�1�1rrN)�__doc__�kinterbasdbr�rr�dialectrrr�<module>r:sm��6�6�p/�.�.�.�.�.�������'1�'1�'1�'1�'1�)�'1�'1�'1�T���r

Hacked By AnonymousFox1.0, Coded By AnonymousFox