ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/__pycache__/dml.cpython-311.pyc

�

�܋fX��	�j�dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZdd	l	mZdd
l	m
Z
ddl	mZddl	mZdd
lmZddlmZddlmZddlmZddlmZddlmZGd�deeeee��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZdS)zd
Provide :class:`_expression.Insert`, :class:`_expression.Update` and
:class:`_expression.Delete`.

�)�util)�
_from_objects)�_generative)�
DialectKWArgs)�
Executable)�_clone)�_column_as_key)�_literal_as_text)�and_)�
ClauseElement)�Null)�_interpret_as_from)�_interpret_as_select)�HasCTE)�HasPrefixes�)�excc���eZdZdZdZej�ddi��Zej	��Z
dZdZdZ
dZd�Zd	�Zd
�Zd�Zeee��Zed���Zedd���ZdS)�
UpdateBasezDForm the base for ``INSERT``, ``UPDATE``, and ``DELETE`` statements.�update_base�
autocommitTN�Fc������fd���jre|�ct|t��r|r*t|dt��st	d���d�|D���_t
|��dfSt|ttf��rU|rSt|dtttf��r+�jstj	d����fd�|D��dfS�|��dfS)	Nc���t|ttf��r1td�t	�jj|��D����S|S)Nc3�.K�|]\}}|j|fV��dS�N)�key)�.0�c�pvals   �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/dml.py�	<genexpr>zHUpdateBase._process_colparams.<locals>.process_single.<locals>.<genexpr>2s,����N�N�g�a��Q�U�D�M�N�N�N�N�N�N�)�
isinstance�list�tuple�dict�zip�tabler)�p�selfs �r!�process_singlez5UpdateBase._process_colparams.<locals>.process_single0sI����!�d�E�]�+�+�
��N�N��T�Z�\�1�9M�9M�N�N�N�N�N�N��r#�zOWhen preserve_parameter_order is True, values() only accepts a list of 2-tuplesc��g|]\}}|��Srr)rr�values   r!�
<listcomp>z1UpdateBase._process_colparams.<locals>.<listcomp>>s��'I�'I�'I�
��U��'I�'I�'Ir#Fz8This construct does not support multiple parameter sets.c�&��g|]
}�|����Srr)rr*r,s  �r!r0z1UpdateBase._process_colparams.<locals>.<listcomp>Ns#���:�:�:�!�N�N�1�%�%�:�:�:r#T)
�_preserve_parameter_orderr$r%r&�
ValueError�_parameter_orderingr'�_supports_multi_parametersr�InvalidRequestError)r+�
parametersr,s` @r!�_process_colparamszUpdateBase._process_colparams/s@����	�	�	�	�	��)�
	+�j�.D��j�$�/�/�
��
�#-�j��m�U�#C�#C�
�!�?����(J�'I�j�'I�'I�'I�D�$��
�#�#�U�*�*�
�z�D�%�=�1�1�	5��	5��:�a�=�4���*=�>�>�	5��2�
��-�/����
;�:�:�:�z�:�:�:�D�@�@�!�>�*�-�-�u�4�4r#c� �td���)z�Set the parameters for the statement.

        This method raises ``NotImplementedError`` on the base class,
        and is overridden by :class:`.ValuesBase` to provide the
        SET/VALUES clause of UPDATE and INSERT.

        z�params() is not supported for INSERT/UPDATE/DELETE statements. To set the values for an INSERT or UPDATE statement, use stmt.values(**parameters).)�NotImplementedError)r+�arg�kws   r!�paramszUpdateBase.paramsRs��"�
*�
�
�	
r#c�(�|jp|jjS)zuReturn a 'bind' linked to this :class:`.UpdateBase`
        or a :class:`_schema.Table` associated with it.

        )�_bindr)�bind)r+s r!r@zUpdateBase.bind`s��
�z�,�T�Z�_�,r#c��||_dSr)r?)r+r@s  r!�	_set_bindzUpdateBase._set_bindgs
����
�
�
r#c��|jrtjd���|jrt	jd��||_dS)a�Add a :term:`RETURNING` or equivalent clause to this statement.

        e.g.::

            stmt = table.update().\
                      where(table.c.data == 'value').\
                      values(status='X').\
                      returning(table.c.server_flag,
                                table.c.updated_timestamp)

            for server_flag, updated_timestamp in connection.execute(stmt):
                print(server_flag, updated_timestamp)

        The given collection of column expressions should be derived from the
        table that is the target of the INSERT, UPDATE, or DELETE.  While
        :class:`_schema.Column` objects are typical, the elements can also be
        expressions::

            stmt = table.insert().returning(
                (table.c.first_name + " " + table.c.last_name).
                label('fullname'))

        Upon compilation, a RETURNING clause, or database equivalent,
        will be rendered within the statement.   For INSERT and UPDATE,
        the values are the newly inserted/updated values.  For DELETE,
        the values are those of the rows which were deleted.

        Upon execution, the values of the columns to be returned are made
        available via the result set and can be iterated using
        :meth:`_engine.ResultProxy.fetchone` and similar.
        For DBAPIs which do not
        natively support returning values (i.e. cx_oracle), SQLAlchemy will
        approximate this behavior at the result level so that a reasonable
        amount of behavioral neutrality is provided.

        Note that not all databases/DBAPIs
        support RETURNING.   For those backends with no support,
        an exception is raised upon compilation and/or execution.
        For those who do support it, the functionality across backends
        varies greatly, including restrictions on executemany()
        and other statements which return multiple rows. Please
        read the documentation notes for the database in use in
        order to determine the availability of RETURNING.

        .. seealso::

          :meth:`.ValuesBase.return_defaults` - an alternative method tailored
          towards efficient fetching of server-side defaults and triggers
          for single-row INSERTs or UPDATEs.


        z9return_defaults() is already configured on this statementz�The returning() method does not currently support multiple additive calls.  The existing RETURNING clause being replaced by new columns.N)�_return_defaultsrr6�
_returningr�warn�r+�colss  r!�	returningzUpdateBase.returninglsZ��l� �	��)�K���
��?�	��I�+�
�
�
�
����r#�*c�^�|�|j}|j�||f|i��|_dS)aAdd a table hint for a single table to this
        INSERT/UPDATE/DELETE statement.

        .. note::

         :meth:`.UpdateBase.with_hint` currently applies only to
         Microsoft SQL Server.  For MySQL INSERT/UPDATE/DELETE hints, use
         :meth:`.UpdateBase.prefix_with`.

        The text of the hint is rendered in the appropriate
        location for the database backend in use, relative
        to the :class:`_schema.Table` that is the subject of this
        statement, or optionally to that of the given
        :class:`_schema.Table` passed as the ``selectable`` argument.

        The ``dialect_name`` option will limit the rendering of a particular
        hint to a particular backend. Such as, to add a hint
        that only takes effect for SQL Server::

            mytable.insert().with_hint("WITH (PAGLOCK)", dialect_name="mssql")

        :param text: Text of the hint.
        :param selectable: optional :class:`_schema.Table` that specifies
         an element of the FROM clause within an UPDATE or DELETE
         to be the subject of the hint - applies only to certain backends.
        :param dialect_name: defaults to ``*``, if specified as the name
         of a particular dialect, will apply these hints only when
         that dialect is in use.

        N)r)�_hints�union)r+�text�
selectable�dialect_names    r!�	with_hintzUpdateBase.with_hint�s7��@����J��k�'�'�*�l�)C�T�(J�K�K����r#)NrJ)�__name__�
__module__�__qualname__�__doc__�__visit_name__r�_execution_optionsrMr�
immutabledictrLr4�	_prefixes�named_with_columnrDr8r=r@rB�propertyrrIrQrr#r!rrs�������O�N�"�N�#�6�<�<�	�t����� �T�
�
!�
!�F����I�����!5�!5�!5�F
�
�
�-�-�-�����8�D�)�$�$�D��?�?��[�?�B�"L�"L�"L��[�"L�"L�"Lr#rc�\�eZdZdZdZdZdZdZdZdZ	d�Z
ed���Zed���Z
dS)�
ValuesBasezTSupplies support for :meth:`.ValuesBase.values` to
    INSERT and UPDATE constructs.�values_baseFNc��t|��|_|�|��\|_|_|r|�|��dSdSr)rr)r8r7�_has_multi_parameters�_setup_prefixes)r+r)�values�prefixess    r!�__init__zValuesBase.__init__�sa��'��.�.��
�6:�6M�6M��7
�7
�3����3��	+�� � ��*�*�*�*�*�	+�	+r#c�j�|j�tjd���|jr|rtjd���|r0t	|��dkrtjd���|d}ni}|j�#|�|��\|_|_n�|jrlt|j��|_|�|��\}|_|jstjd���|j�	|��np|j�
��|_|�|��\}|_|jrtjd���|j�|��|r7|jrtjd���|j�|��dSdS)	a&Specify a fixed VALUES clause for an INSERT statement, or the SET
        clause for an UPDATE.

        Note that the :class:`_expression.Insert` and
        :class:`_expression.Update` constructs support
        per-execution time formatting of the VALUES and/or SET clauses,
        based on the arguments passed to :meth:`_engine.Connection.execute`.
        However, the :meth:`.ValuesBase.values` method can be used to "fix" a
        particular set of parameters into the statement.

        Multiple calls to :meth:`.ValuesBase.values` will produce a new
        construct, each one with the parameter list modified to include
        the new parameters sent.  In the typical case of a single
        dictionary of parameters, the newly passed keys will replace
        the same keys in the previous construct.  In the case of a list-based
        "multiple values" construct, each new list of values is extended
        onto the existing list of values.

        :param \**kwargs: key value pairs representing the string key
          of a :class:`_schema.Column`
          mapped to the value to be rendered into the
          VALUES or SET clause::

                users.insert().values(name="some name")

                users.update().where(users.c.id==5).values(name="some name")

        :param \*args: As an alternative to passing key/value parameters,
         a dictionary, tuple, or list of dictionaries or tuples can be passed
         as a single positional argument in order to form the VALUES or
         SET clause of the statement.  The forms that are accepted vary
         based on whether this is an :class:`_expression.Insert` or an
         :class:`_expression.Update` construct.

         For either an :class:`_expression.Insert` or
         :class:`_expression.Update`
         construct, a single dictionary can be passed, which works the same as
         that of the kwargs form::

            users.insert().values({"name": "some name"})

            users.update().values({"name": "some new name"})

         Also for either form but more typically for the
         :class:`_expression.Insert` construct, a tuple that contains an
         entry for every column in the table is also accepted::

            users.insert().values((5, "some name"))

         The :class:`_expression.Insert` construct also supports being
         passed a list of dictionaries or full-table-tuples, which on the
         server will render the less common SQL syntax of "multiple values" -
         this syntax is supported on backends such as SQLite, PostgreSQL,
         MySQL, but not necessarily others::

            users.insert().values([
                                {"name": "some name"},
                                {"name": "some other name"},
                                {"name": "yet another name"},
                            ])

         The above form would render a multiple VALUES statement similar to::

                INSERT INTO users (name) VALUES
                                (:name_1),
                                (:name_2),
                                (:name_3)

         It is essential to note that **passing multiple values is
         NOT the same as using traditional executemany() form**.  The above
         syntax is a **special** syntax not typically used.  To emit an
         INSERT statement against multiple rows, the normal method is
         to pass a multiple values list to the
         :meth:`_engine.Connection.execute`
         method, which is supported by all database backends and is generally
         more efficient for a very large number of parameters.

           .. seealso::

               :ref:`execute_multiple` - an introduction to
               the traditional Core method of multiple parameter set
               invocation for INSERTs and other statements.

           .. versionchanged:: 1.0.0 an INSERT that uses a multiple-VALUES
              clause, even a list of length one,
              implies that the :paramref:`_expression.Insert.inline`
              flag is set to
              True, indicating that the statement will not attempt to fetch
              the "last inserted primary key" or other defaults.  The
              statement deals with an arbitrary number of rows, so the
              :attr:`_engine.ResultProxy.inserted_primary_key`
              accessor does not
              apply.

           .. versionchanged:: 1.0.0 A multiple-VALUES INSERT now supports
              columns with Python side default values and callables in the
              same way as that of an "executemany" style of invocation; the
              callable is invoked for each row.   See :ref:`bug_3288`
              for other details.

         The :class:`_expression.Update`
         construct supports a special form which is a
         list of 2-tuples, which when provided must be passed in conjunction
         with the
         :paramref:`_expression.update.preserve_parameter_order`
         parameter.
         This form causes the UPDATE statement to render the SET clauses
         using the order of parameters given to
         :meth:`_expression.Update.values`, rather
         than the ordering of columns given in the :class:`_schema.Table`.

           .. versionadded:: 1.0.10 - added support for parameter-ordered
              UPDATE statements via the
              :paramref:`_expression.update.preserve_parameter_order`
              flag.

           .. seealso::

              :ref:`updates_order_parameters` - full example of the
              :paramref:`_expression.update.preserve_parameter_order`
              flag

        .. seealso::

            :ref:`inserts_and_updates` - SQL Expression
            Language Tutorial

            :func:`_expression.insert` - produce an ``INSERT`` statement

            :func:`_expression.update` - produce an ``UPDATE`` statement

        Nz,This construct already inserts from a SELECTz3This construct already has multiple parameter sets.rzWOnly a single dictionary/tuple or list of dictionaries/tuples is accepted positionally.r-zDCan't mix single-values and multiple values formats in one statementz<Can't pass kwargs and multiple parameter sets simultaneously)�selectrr6r`�len�
ArgumentErrorr7r8r%�extend�copy�update)r+�args�kwargs�vr*s     r!rbzValuesBase.values�s��L�;�"��)�>���
��%�	�&�	��)�E���
��	��4�y�y�1�}�}��'�D�����Q��A�A��A��?�"��'�'��*�*�
����*�*��)�
*�"&�t��"7�"7���04�0G�0G��0J�0J�-��4�-��1���+�3����
��&�&�q�)�)�)�)�"&�/�"6�"6�"8�"8���04�0G�0G��0J�0J�-��4�-��-���+�3������&�&�q�)�)�)��	/��)�
/��'�%����
��&�&�v�.�.�.�.�.�	/�	/r#c�N�|jrtjd���|pd|_dS)a�Make use of a :term:`RETURNING` clause for the purpose
        of fetching server-side expressions and defaults.

        E.g.::

            stmt = table.insert().values(data='newdata').return_defaults()

            result = connection.execute(stmt)

            server_created_at = result.returned_defaults['created_at']

        When used against a backend that supports RETURNING, all column
        values generated by SQL expression or server-side-default will be
        added to any existing RETURNING clause, provided that
        :meth:`.UpdateBase.returning` is not used simultaneously.  The column
        values will then be available on the result using the
        :attr:`_engine.ResultProxy.returned_defaults` accessor as
        a dictionary,
        referring to values keyed to the :class:`_schema.Column`
        object as well as
        its ``.key``.

        This method differs from :meth:`.UpdateBase.returning` in these ways:

        1. :meth:`.ValuesBase.return_defaults` is only intended for use with
           an INSERT or an UPDATE statement that matches exactly one row.
           While the RETURNING construct in the general sense supports
           multiple rows for a multi-row UPDATE or DELETE statement, or for
           special cases of INSERT that return multiple rows (e.g. INSERT from
           SELECT, multi-valued VALUES clause),
           :meth:`.ValuesBase.return_defaults` is intended only for an
           "ORM-style" single-row INSERT/UPDATE statement.  The row returned
           by the statement is also consumed implicitly when
           :meth:`.ValuesBase.return_defaults` is used.  By contrast,
           :meth:`.UpdateBase.returning` leaves the RETURNING result-set
           intact with a collection of any number of rows.

        2. It is compatible with the existing logic to fetch auto-generated
           primary key values, also known as "implicit returning".  Backends
           that support RETURNING will automatically make use of RETURNING in
           order to fetch the value of newly generated primary keys; while the
           :meth:`.UpdateBase.returning` method circumvents this behavior,
           :meth:`.ValuesBase.return_defaults` leaves it intact.

        3. It can be called against any backend.  Backends that don't support
           RETURNING will skip the usage of the feature, rather than raising
           an exception.  The return value of
           :attr:`_engine.ResultProxy.returned_defaults` will be ``None``

        :meth:`.ValuesBase.return_defaults` is used by the ORM to provide
        an efficient implementation for the ``eager_defaults`` feature of
        :func:`.mapper`.

        :param cols: optional list of column key names or
         :class:`_schema.Column`
         objects.  If omitted, all column expressions evaluated on the server
         are added to the returning list.

        .. versionadded:: 0.9.0

        .. seealso::

            :meth:`.UpdateBase.returning`

            :attr:`_engine.ResultProxy.returned_defaults`

        z1RETURNING is already configured on this statementTN)rErr6rDrGs  r!�return_defaultszValuesBase.return_defaults�s;��J�?�	��)�C���
�!%������r#)rRrSrTrUrVr5r`r2rf�_post_values_clauserdrrbrprr#r!r]r]�s�������%�%�#�N�!&��!�� %��
�F���+�+�+��y/�y/��[�y/�v�H-�H-��[�H-�H-�H-r#r]c�V�eZdZdZdZdZ						d
d�Zd�Zedd���Z	e
fd	�ZdS)�Insertz�Represent an INSERT construct.

    The :class:`_expression.Insert` object is created using the
    :func:`_expression.insert()` function.

    .. seealso::

        :ref:`coretutorial_insert_expressions`

    �insertTNFc���t�||||��||_dx|_|_d|_||_||_|�|��||_	dS)a�Construct an :class:`_expression.Insert` object.

        Similar functionality is available via the
        :meth:`_expression.TableClause.insert` method on
        :class:`_schema.Table`.

        :param table: :class:`_expression.TableClause`
         which is the subject of the
         insert.

        :param values: collection of values to be inserted; see
         :meth:`_expression.Insert.values`
         for a description of allowed formats here.
         Can be omitted entirely; a :class:`_expression.Insert` construct
         will also dynamically render the VALUES clause at execution time
         based on the parameters passed to :meth:`_engine.Connection.execute`.

        :param inline: if True, no attempt will be made to retrieve the
         SQL-generated default values to be provided within the statement;
         in particular,
         this allows SQL expressions to be rendered 'inline' within the
         statement without the need to pre-execute them beforehand; for
         backends that support "returning", this turns off the "implicit
         returning" feature for the statement.

        If both `values` and compile-time bind parameters are present, the
        compile-time bind parameters override the information specified
        within `values` on a per-key basis.

        The keys within `values` can be either
        :class:`~sqlalchemy.schema.Column` objects or their string
        identifiers. Each key may reference one of:

        * a literal data value (i.e. string, number, etc.);
        * a Column object;
        * a SELECT statement.

        If a ``SELECT`` statement is specified which references this
        ``INSERT`` statement's table, the statement will be correlated
        against the ``INSERT`` statement.

        .. seealso::

            :ref:`coretutorial_insert_expressions` - SQL Expression Tutorial

            :ref:`inserts_and_updates` - SQL Expression Tutorial

        NF)
r]rdr?rf�select_names�#include_insert_from_select_defaults�inlinerE�_validate_dialect_kwargsrD)	r+r)rbrxr@rcrIrp�
dialect_kws	         r!rdzInsert.__init__sm��v	���D�%���:�:�:���
�*.�.���d�'�38��0����#����%�%�j�1�1�1� /����r#c�$�|j�|jfSdS�Nr)rf�r+rms  r!�get_childrenzInsert.get_childrenDs���;�"��K�>�!��2r#c���|jrtjd���|�d�|D����\|_|_||_d|_||_t|��|_	dS)a	Return a new :class:`_expression.Insert` construct which represents
        an ``INSERT...FROM SELECT`` statement.

        e.g.::

            sel = select([table1.c.a, table1.c.b]).where(table1.c.c > 5)
            ins = table2.insert().from_select(['a', 'b'], sel)

        :param names: a sequence of string column names or
         :class:`_schema.Column`
         objects representing the target columns.
        :param select: a :func:`_expression.select` construct,
         :class:`_expression.FromClause`
         or other construct which resolves into a
         :class:`_expression.FromClause`,
         such as an ORM :class:`_query.Query` object, etc.  The order of
         columns returned from this FROM clause should correspond to the
         order of columns sent as the ``names`` parameter;  while this
         is not checked before passing along to the database, the database
         would normally raise an exception if these column lists don't
         correspond.
        :param include_defaults: if True, non-server default values and
         SQL expressions as specified on :class:`_schema.Column` objects
         (as documented in :ref:`metadata_defaults_toplevel`) not
         otherwise specified in the list of names will be rendered
         into the INSERT and SELECT statements, so that these values are also
         included in the data to be inserted.

         .. note:: A Python-side default that uses a Python callable function
            will only be invoked **once** for the whole statement, and **not
            per row**.

         .. versionadded:: 1.0.0 - :meth:`_expression.Insert.from_select`
            now renders
            Python-side and SQL expression column defaults into the
            SELECT statement for columns otherwise not included in the
            list of column names.

        .. versionchanged:: 1.0.0 an INSERT that uses FROM SELECT
           implies that the :paramref:`_expression.insert.inline`
           flag is set to
           True, indicating that the statement will not attempt to fetch
           the "last inserted primary key" or other defaults.  The statement
           deals with an arbitrary number of rows, so the
           :attr:`_engine.ResultProxy.inserted_primary_key`
           accessor does not apply.

        z0This construct already inserts value expressionsc�F�i|]}t|��t����Sr)r	r
)r�ns  r!�
<dictcomp>z&Insert.from_select.<locals>.<dictcomp>�s&��6�6�6�1�^�A�
�
����6�6�6r#TN)
r7rr6r8r`rvrxrwrrf)r+�namesrf�include_defaultss    r!�from_selectzInsert.from_selectJs���d�?�	��)�B���
�7;�6M�6M�6�6��6�6�6�7
�7
�3����3�"������3C��0�*�6�2�2����r#c��|j���|_|j�t|j��|_dSdSr)r7rjrfr�r+�cloner<s   r!�_copy_internalszInsert._copy_internals�s<���/�.�.�0�0����;�"� ���-�-�D�K�K�K�#�"r#)NFNNNF)T)rRrSrTrUrVr5rdr~rr�rr�rr#r!rsrs�s�������	�	��N�!%��
��
����B0�B0�B0�B0�H����=3�=3�=3��[�=3�~%+�.�.�.�.�.�.r#rsc�j�eZdZdZdZ								d
d�Zd�Zefd�Ze	d���Z
ed	���ZdS)�Updatez�Represent an Update construct.

    The :class:`_expression.Update`
    object is created using the :func:`update()`
    function.

    rkNFc
���|	|_t�||||��||_||_|�t|��|_nd|_||_|�|
��||_	dS)a;Construct an :class:`_expression.Update` object.

        E.g.::

            from sqlalchemy import update

            stmt = update(users).where(users.c.id==5).\
                    values(name='user #5')

        Similar functionality is available via the
        :meth:`_expression.TableClause.update` method on
        :class:`_schema.Table`::

            stmt = users.update().\
                        where(users.c.id==5).\
                        values(name='user #5')

        :param table: A :class:`_schema.Table`
         object representing the database
         table to be updated.

        :param whereclause: Optional SQL expression describing the ``WHERE``
         condition of the ``UPDATE`` statement; is equivalent to using the
         more modern :meth:`~Update.where()` method to specify the ``WHERE``
         clause.

        :param values:
          Optional dictionary which specifies the ``SET`` conditions of the
          ``UPDATE``.  If left as ``None``, the ``SET``
          conditions are determined from those parameters passed to the
          statement during the execution and/or compilation of the
          statement.   When compiled standalone without any parameters,
          the ``SET`` clause generates for all columns.

          Modern applications may prefer to use the generative
          :meth:`_expression.Update.values` method to set the values of the
          UPDATE statement.

        :param inline:
          if True, SQL defaults present on :class:`_schema.Column` objects via
          the ``default`` keyword will be compiled 'inline' into the statement
          and not pre-executed.  This means that their values will not
          be available in the dictionary returned from
          :meth:`_engine.ResultProxy.last_updated_params`.

        :param preserve_parameter_order: if True, the update statement is
          expected to receive parameters **only** via the
          :meth:`_expression.Update.values` method,
          and they must be passed as a Python
          ``list`` of 2-tuples. The rendered UPDATE statement will emit the SET
          clause for each referenced column maintaining this order.

          .. versionadded:: 1.0.10

          .. seealso::

            :ref:`updates_order_parameters` - full example of the
            :paramref:`_expression.update.preserve_parameter_order` flag

        If both ``values`` and compile-time bind parameters are present, the
        compile-time bind parameters override the information specified
        within ``values`` on a per-key basis.

        The keys within ``values`` can be either :class:`_schema.Column`
        objects or their string identifiers (specifically the "key" of the
        :class:`_schema.Column`, normally but not necessarily equivalent to
        its "name").  Normally, the
        :class:`_schema.Column` objects used here are expected to be
        part of the target :class:`_schema.Table` that is the table
        to be updated.  However when using MySQL, a multiple-table
        UPDATE statement can refer to columns from any of
        the tables referred to in the WHERE clause.

        The values referred to in ``values`` are typically:

        * a literal data value (i.e. string, number, etc.)
        * a SQL expression, such as a related :class:`_schema.Column`,
          a scalar-returning :func:`_expression.select` construct,
          etc.

        When combining :func:`_expression.select` constructs within the values
        clause of an :func:`_expression.update` construct,
        the subquery represented by the :func:`_expression.select` should be
        *correlated* to the parent table, that is, providing criterion
        which links the table inside the subquery to the outer table
        being updated::

            users.update().values(
                    name=select([addresses.c.email_address]).\
                            where(addresses.c.user_id==users.c.id).\
                            as_scalar()
                )

        .. seealso::

            :ref:`inserts_and_updates` - SQL Expression
            Language Tutorial


        N)
r2r]rdr?rEr
�_whereclauserxryrD)r+r)�whereclauserbrxr@rcrIrp�preserve_parameter_orderrzs           r!rdzUpdate.__init__�s���b*B��&����D�%���:�:�:���
�#����"� 0�� =� =�D��� $�D������%�%�j�1�1�1� /����r#c�$�|j�|jfSdSr|�r�r}s  r!r~zUpdate.get_children�����(��%�'�'��2r#c�h�||jfi|��|_|j���|_dSr)r�r7rjr�s   r!r�zUpdate._copy_internalss8��!�E�$�"3�:�:�r�:�:����/�.�.�0�0����r#c��|j�)t|jt|����|_dSt|��|_dS)a�Return a new update() construct with the given expression added to
        its WHERE clause, joined to the existing clause via AND, if any.

        Both :meth:`_dml.Update.where` and :meth:`_dml.Delete.where`
        support multiple-table forms, including database-specific
        ``UPDATE...FROM`` as well as ``DELETE..USING``.  For backends that
        don't have multiple-table support, a backend agnostic approach
        to using multiple tables is to make use of correlated subqueries.
        See the linked tutorial sections below for examples.

        .. seealso::

            :ref:`tutorial_1x_correlated_updates`

            :ref:`multi_table_updates`

            :ref:`multi_table_deletes`


        N�r�rr
�r+r�s  r!�wherezUpdate.where$�N��,��(� $��!�#3�K�#@�#@�!�!�D����!1�� =� =�D���r#c�p�g}ttj|j����}|dh}|j�`t|j��D]K}|�|j��s|�|��|�	|j���L|�
|dd���|S)Nr-r)r%�sql_util�tables_from_leftmostr)r�r�intersection�_cloned_set�appendrkri)r+�froms�
all_tables�seen�items     r!�_extra_fromszUpdate._extra_fromsAs������(�7��
�C�C�D�D�
��1�
�����(�%�d�&7�8�8�
.�
.���(�(��)9�:�:�'��L�L��&�&�&����D�,�-�-�-�-�
���Z����^�$�$�$��r#)NNFNNNFF)
rRrSrTrUrVrdr~rr�rr�r[r�rr#r!r�r��s����������N�
���
����!&�{0�{0�{0�{0�z���%+�1�1�1�1�
�>�>��[�>�8�
�
��X�
�
�
r#r�c�b�eZdZdZdZ				d	d�Zd�Zed���Ze	d���Z
efd�ZdS)
�Deletez�Represent a DELETE construct.

    The :class:`_expression.Delete`
    object is created using the :func:`delete()`
    function.

    �deleteNc���||_t|��|_||_|r|�|��|�t|��|_nd|_|�|��dS)a=Construct :class:`_expression.Delete` object.

        Similar functionality is available via the
        :meth:`_expression.TableClause.delete` method on
        :class:`_schema.Table`.

        :param table: The table to delete rows from.

        :param whereclause: Optional SQL expression describing the ``WHERE``
         condition of the ``DELETE`` statement; is equivalent to using the
         more modern :meth:`~Delete.where()` method to specify the ``WHERE``
         clause.

        .. seealso::

            :ref:`deletes` - SQL Expression Tutorial

        N)r?rr)rErar
r�ry)r+r)r�r@rIrcrzs       r!rdzDelete.__init__]sx��6��
�'��.�.��
�#����	+�� � ��*�*�*��"� 0�� =� =�D��� $�D���%�%�j�1�1�1�1�1r#c�$�|j�|jfSdSr|r�r}s  r!r~zDelete.get_children�r�r#c��|j�)t|jt|����|_dSt|��|_dS)a�Add the given WHERE clause to a newly returned delete construct.

        Both :meth:`_dml.Update.where` and :meth:`_dml.Delete.where`
        support multiple-table forms, including database-specific
        ``UPDATE...FROM`` as well as ``DELETE..USING``.  For backends that
        don't have multiple-table support, a backend agnostic approach
        to using multiple tables is to make use of correlated subqueries.
        See the linked tutorial sections below for examples.

        .. seealso::

            :ref:`tutorial_1x_correlated_updates`

            :ref:`multi_table_updates`

            :ref:`multi_table_deletes`


        Nr�r�s  r!r�zDelete.where�r�r#c���g}|jh}|j�`t|j��D]K}|�|j��s|�|��|�|j���L|Sr)r)r�rr�r�r�rk)r+r�r�r�s    r!r�zDelete._extra_froms�s{�����
�|����(�%�d�&7�8�8�
.�
.���(�(��)9�:�:�'��L�L��&�&�&����D�,�-�-�-�-��r#c�,�||jfi|��|_dSrr�r�s   r!r�zDelete._copy_internals�s%��!�E�$�"3�:�:�r�:�:����r#)NNNN)
rRrSrTrUrVrdr~rr�r[r�rr�rr#r!r�r�Rs����������N�
�
���
'2�'2�'2�'2�R����>�>��[�>�8�
�
��X�
�%+�;�;�;�;�;�;r#r�N)rU�rr��baserrrr�elementsrr	r
rrr
rOrrrrrrr]rsr�r�rr#r!�<module>r�s^����
������������������������������������$�$�$�$�$�$�&�&�&�&�&�&�������#�#�#�#�#�#�������*�*�*�*�*�*�,�,�,�,�,�,�������#�#�#�#�#�#�������������rL�rL�rL�rL�rL�
�M�;�
�M�rL�rL�rL�jY-�Y-�Y-�Y-�Y-��Y-�Y-�Y-�x^.�^.�^.�^.�^.�Z�^.�^.�^.�B~�~�~�~�~�Z�~�~�~�Bf;�f;�f;�f;�f;�Z�f;�f;�f;�f;�f;r#

Zerion Mini Shell 1.0