Ë
    r™ãj�,  ã                  óÒ  — d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ dd	l	m
Z
 dd
l	mZ ddl	mZ ddl	mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddlm"Z" ddlm#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) dd l*m+Z+ d!Z,d,d#„Z- G d$„ d"e«      Z G d%„ d&ee «      Z. G d'„ d(e.«      Z/ G d)„ d*e.«      Z0y+)-é    )Úannotations)ÚAny)ÚDict)ÚList)ÚOptional)ÚSequence)ÚUnioné   )Ú_OnConflictIndexElementsT)Ú_OnConflictIndexWhereT)Ú_OnConflictSetT)Ú_OnConflictWhereTé   )Úexc)Úutil)Ú	coercions)Úroles)Úschema)Ú_DMLTableArgument)ÚColumnCollection)ÚReadOnlyColumnCollection)ÚSyntaxExtension)Ú_DMLColumnElement©ÚInsert)ÚClauseElement)ÚColumnElement)ÚKeyedColumnElement)Ú
TextClause)Úalias)ÚNULLTYPE)ÚInternalTraversal)ÚSelf)r   Úinsertr   c                ó   — t        | «      S )aW  Construct a sqlite-specific variant :class:`_sqlite.Insert`
    construct.

    .. container:: inherited_member

        The :func:`sqlalchemy.dialects.sqlite.insert` function creates
        a :class:`sqlalchemy.dialects.sqlite.Insert`.  This class is based
        on the dialect-agnostic :class:`_sql.Insert` construct which may
        be constructed using the :func:`_sql.insert` function in
        SQLAlchemy Core.

    The :class:`_sqlite.Insert` construct includes additional methods
    :meth:`_sqlite.Insert.on_conflict_do_update`,
    :meth:`_sqlite.Insert.on_conflict_do_nothing`.

    r   )Útables    úi/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/dml.pyr$   r$   +   s   € ô" �%‹=Ðó    c                  ó~   — e Zd ZdZdZdZej                  	 	 dd„«       Z	 	 	 	 d		 	 	 	 	 	 	 	 	 d
d„Z		 	 d	 	 	 	 	 dd„Z
y)r   a?  SQLite-specific implementation of INSERT.

    Adds methods for SQLite-specific syntaxes such as ON CONFLICT.

    The :class:`_sqlite.Insert` object is created using the
    :func:`sqlalchemy.dialects.sqlite.insert` function.

    .. versionadded:: 1.4

    .. seealso::

        :ref:`sqlite_on_conflict_insert`

    ÚsqliteTc                óD   — t        | j                  d¬«      j                  S )aÚ  Provide the ``excluded`` namespace for an ON CONFLICT statement

        SQLite's ON CONFLICT clause allows reference to the row that would
        be inserted, known as ``excluded``.  This attribute provides
        all columns in this row to be referenceable.

        .. tip::  The :attr:`_sqlite.Insert.excluded` attribute is an instance
            of :class:`_expression.ColumnCollection`, which provides an
            interface the same as that of the :attr:`_schema.Table.c`
            collection described at :ref:`metadata_tables_and_columns`.
            With this collection, ordinary names are accessible like attributes
            (e.g. ``stmt.excluded.some_column``), but special names and
            dictionary method names should be accessed using indexed access,
            such as ``stmt.excluded["column name"]`` or
            ``stmt.excluded["values"]``.  See the docstring for
            :class:`_expression.ColumnCollection` for further examples.

        Úexcluded)Úname)r    r&   Úcolumns)Úselfs    r'   r,   zInsert.excludedR   s   € ô, �T—Z‘Z jÔ1×9Ñ9Ð9r(   Nc                ó<   — | j                  t        ||||«      «      S )af  
        Specifies a DO UPDATE SET action for ON CONFLICT clause.

        This method may be invoked more than once against the same
        :class:`_sqlite.Insert` construct, where each ``ON CONFLICT`` clause
        renders in the order in which it was established.

        .. versionadded:: 2.1  Multiple ``ON CONFLICT`` clauses may be
           established on a single :class:`_sqlite.Insert` construct.

        .. seealso::

            :ref:`sqlite_on_conflict_multiple`

        :param index_elements:
         A sequence consisting of string column names, :class:`_schema.Column`
         objects, or other column expression objects that will be used
         to infer a target index or unique constraint.

        :param index_where:
         Additional WHERE criterion that can be used to infer a
         conditional target index.

        :param set\_:
         A dictionary or other mapping object
         where the keys are either names of columns in the target table,
         or :class:`_schema.Column` objects or other ORM-mapped columns
         matching that of the target table, and expressions or literals
         as values, specifying the ``SET`` actions to take.

         .. versionadded:: 1.4 The
            :paramref:`_sqlite.Insert.on_conflict_do_update.set_`
            parameter supports :class:`_schema.Column` objects from the target
            :class:`_schema.Table` as keys.

         .. warning:: This dictionary does **not** take into account
            Python-specified default UPDATE values or generation functions,
            e.g. those specified using :paramref:`_schema.Column.onupdate`.
            These values will not be exercised for an ON CONFLICT style of
            UPDATE, unless they are manually specified in the
            :paramref:`.Insert.on_conflict_do_update.set_` dictionary.

        :param where:
         Optional argument. An expression object representing a ``WHERE``
         clause that restricts the rows affected by ``DO UPDATE SET``. Rows not
         meeting the ``WHERE`` condition will not be updated (effectively a
         ``DO NOTHING`` for those rows).

        )ÚextÚOnConflictDoUpdate)r/   Úindex_elementsÚindex_whereÚset_Úwheres        r'   Úon_conflict_do_updatezInsert.on_conflict_do_updatej   s$   € ðr �x‰xÜ˜~¨{¸DÀ%ÓHó
ð 	
r(   c                ó8   — | j                  t        ||«      «      S )aÔ  
        Specifies a DO NOTHING action for ON CONFLICT clause.

        This method may be invoked more than once against the same
        :class:`_sqlite.Insert` construct, and may be combined with
        :meth:`_sqlite.Insert.on_conflict_do_update`, where each
        ``ON CONFLICT`` clause renders in the order in which it was
        established.  As SQLite allows only the last ``ON CONFLICT`` clause
        of a statement to omit its conflict target, a call that omits
        :paramref:`_sqlite.Insert.on_conflict_do_nothing.index_elements`
        must be the last clause established, else
        :class:`.InvalidRequestError` is raised.

        .. versionadded:: 2.1  Multiple ``ON CONFLICT`` clauses may be
           established on a single :class:`_sqlite.Insert` construct.

        .. seealso::

            :ref:`sqlite_on_conflict_multiple`

        :param index_elements:
         A sequence consisting of string column names, :class:`_schema.Column`
         objects, or other column expression objects that will be used
         to infer a target index or unique constraint.

        :param index_where:
         Additional WHERE criterion that can be used to infer a
         conditional target index.

        )r1   ÚOnConflictDoNothing)r/   r3   r4   s      r'   Úon_conflict_do_nothingzInsert.on_conflict_do_nothing§   s   € ðH �x‰xÔ+¨N¸KÓHÓIÐIr(   )Úreturnz6ReadOnlyColumnCollection[str, KeyedColumnElement[Any]]©NNNN)
r3   r   r4   r   r5   r   r6   r   r;   r#   ©NN)r3   r   r4   r   r;   r#   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústringify_dialectÚinherit_cacher   Úmemoized_propertyr,   r7   r:   © r(   r'   r   r   ?   s¥   „ ñð !ÐØ€Mà	×Ñð:à	?ò:ó ð:ð2 59Ø.2Ø $Ø#'ð;
à1ð;
ð ,ð;
ð ð	;
ð
 !ð;
ð 
ó;
ð~ 59Ø.2ð$Jà1ð$Jð ,ð$Jð 
ô	$Jr(   c                  óŠ   — e Zd ZU dZded<   ded<   dej                  fdej                  fgZ	 	 d
	 	 	 dd„Z		 	 	 	 dd„Z
dd	„Zy)ÚOnConflictClauser*   z.Optional[List[Union[str, schema.Column[Any]]]]Úinferred_target_elementsz/Optional[Union[ColumnElement[Any], TextClause]]Úinferred_target_whereclauseNc                ó  — |�k|D �cg c]&  }t        j                  t        j                  |«      ‘Œ( c}| _        |�*t        j                  t        j
                  |«      | _        y d | _        y d x| _        | _        y c c}w )N)r   Úexpectr   ÚDDLConstraintColumnRolerH   ÚWhereHavingRolerI   )r/   r3   r4   Úcolumns       r'   Ú__init__zOnConflictClause.__init__Û   s�   € ð
 Ð%ð -ö-àô × Ñ ¤×!>Ñ!>ÀÕGò-ˆDÔ)ð Ð*ô	 × Ñ Ü×)Ñ)Øóð Õ,ð ð Õ,ð ðˆDÔ)ØÕ0ùò-s   ‡+A=c                ó~   — |r6|d   }t        |t        «      r!|j                  €t        j                  d«      ‚g |¢| ‘S )Néÿÿÿÿz˜This Insert construct already has an ON CONFLICT clause that omits a conflict target; such a clause must be the last ON CONFLICT clause in the statement)Ú
isinstancerG   rH   r   ÚInvalidRequestError)r/   ÚexistingÚlasts      r'   Ú_append_to_existingz$OnConflictClause._append_to_existingò   sR   € ñ Ø˜B‘<ˆDä˜4Ô!1Ô2Ø×1Ñ1Ð9ä×-Ñ-ðKóð ð
 !�Ð ˜4Ð Ð r(   c                ó<   — |j                  | j                  d«       y )NÚpost_values)Úapply_syntax_extension_pointrV   )r/   Úinsert_stmts     r'   Úapply_to_insertz OnConflictClause.apply_to_insert  s   € Ø×0Ñ0Ø×$Ñ$ mõ	
r(   r=   )r3   r   r4   r   )rT   úSequence[ClauseElement]r;   r\   )rZ   ÚStandardInsertr;   ÚNone)r>   r?   r@   rB   Ú__annotations__r"   Údp_multi_listÚdp_clauseelementÚ_traverse_internalsrO   rV   r[   rE   r(   r'   rG   rG   Î   sy   … Ø ÐàLÓLð"ó ð
 
$Ð%6×%DÑ%DÐEØ	&Ð(9×(JÑ(JÐKðÐð 59Ø.2ðà1ðð ,óð.!Ø/ð!à	 ó!ô 
r(   rG   c                  ó   — e Zd ZdZdZy)r9   r:   TN)r>   r?   r@   Ú__visit_name__rC   rE   r(   r'   r9   r9     s   „ Ø-€Nà�Mr(   r9   c                  ó¤   ‡ — e Zd ZU dZded<   ded<   ej                  dej                  fdej                  fgz   Z	 	 	 	 d	 	 	 	 	 	 	 dˆ fd„Z
ˆ xZS )	r2   r7   z+Dict[_DMLColumnElement, ColumnElement[Any]]Úupdate_values_to_setzOptional[ColumnElement[Any]]Úupdate_whereclausec                ó
  •— t         ‰| �  ||¬«       t        |t        «      r|s2t	        d«      ‚t        |t
        «      rt        |«      }nt	        d«      ‚|j                  «       D ��ci c]S  \  }}t        j                  t        j                  |«      t        j                  t        j                  |t        d¬«      “ŒU c}}| _        |�*t        j                  t        j                  |«      | _        y d | _        y c c}}w )N)r3   r4   z*set parameter dictionary must not be emptyzqset parameter must be a non-empty dictionary or a ColumnCollection such as the `.c.` collection of a Table objectT)Útype_Úis_crud)ÚsuperrO   rR   ÚdictÚ
ValueErrorr   Úitemsr   rK   r   ÚDMLColumnRoleÚExpressionElementRoler!   rf   rM   rg   )r/   r3   r4   r5   r6   ÚkÚvÚ	__class__s          €r'   rO   zOnConflictDoUpdate.__init__  sõ   ø€ ô 	‰ÑØ)Ø#ð 	ô 	
ô
 �dœDÔ!ÙÜ Ð!MÓNÐNÜ˜Ô.Ô/Ü˜“:‰Däð$óð ð Ÿ
™
›÷	%
ñ ��1ô ×ÑœU×0Ñ0°!Ó4´i×6FÑ6FÜ×+Ñ+¨Q´hÈô7ñ ó%
ˆÔ!ð Ð ô ×ÑœU×2Ñ2°EÓ:ð 	Õð ð 	Õùó%
s   Á*AC?r<   )r3   r   r4   r   r5   r   r6   r   )r>   r?   r@   rd   r_   rG   rb   r"   Údp_dml_valuesra   rO   Ú__classcell__)rs   s   @r'   r2   r2     s‡   ø… Ø,€NàEÓEØ4Ó4à*×>Ñ>Ø	Ð!2×!@Ñ!@ÐAØ	Ð0×AÑAÐBðBñ Ðð 59Ø.2Ø $Ø#'ð!
à1ð!
ð ,ð!
ð ð	!
ð
 !÷!
ñ !
r(   r2   N)r&   r   r;   r   )1Ú
__future__r   Útypingr   r   r   r   r   r	   Ú_typingr   r   r   r   Ú r   r   Úsqlr   r   r   Úsql._typingr   Úsql.baser   r   r   Úsql.dmlr   r   r]   Úsql.elementsr   r   r   r   Úsql.expressionr    Úsql.sqltypesr!   Úsql.visitorsr"   Úutil.typingr#   Ú__all__r$   rG   r9   r2   rE   r(   r'   ú<module>r„      s¥   ðõ #å Ý Ý Ý Ý Ý å /Ý ,Ý %Ý 'Ý Ý Ý Ý Ý Ý ,Ý (Ý 0Ý 'Ý (Ý /Ý )Ý )Ý .Ý &Ý #Ý $Ý -Ý à
€óô(LJˆ^ô LJô^7
�¨ô 7
ôtÐ*ô ô,
Ð)õ ,
r(   