� g\�g�.���dZddlmZddlmZddlmZddlZddlZddlm Z ddlm Z ddlm Z ddlm Z dd lm Z dd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZesesddlmZnddl mZerddl!m"Z"ddl!m#Z#ddl!m$Z$ede ���Z%edee d f���Z&Gd!�d"eee e e&��Z'eZ(e'Z)Gd#�d$e��Z*Gd%�d&e*ej+d'ej,e ��Z-Gd(�d)e*ej.d'e f��Z/Gd*�d+eejd'e f��Z0dS),z.Define row constructs including :class:`.Row`.�)� annotations)�ABCN)�Any)�Callable)�Dict)�Generic)�Iterator)�List)�Mapping)�NoReturn)�Optional)�overload)�Sequence)�Tuple)� TYPE_CHECKING)�TypeVar)�Union�)�util)� deprecated)�HAS_CYEXTENSION�)�BaseRow)�_KeyType)�_ProcessorsType)� RMKeyView�_T)�bound�_TP.c��eZdZdZdZd6d �Zd7d �Zd8d �Zed d��d8d���Z e d8d���Z e ed d��d8d�����Z e d9d���Z d:d�Zesd;d�Zed��Zed��Zd<d�Zd=d"�ZejZered>d$���Zed?d'���Zd@d)�ZdAd*�ZdAd+�ZdAd,�ZdAd-�ZdAd.�ZdAd/�ZdBd0�Ze dCd2���Z dDd4�Z!d5S)E�RowaRepresent a single result row. The :class:`.Row` object represents a row of a database result. It is typically associated in the 1.x series of SQLAlchemy with the :class:`_engine.CursorResult` object, however is also used by the ORM for tuple-like results as of SQLAlchemy 1.4. The :class:`.Row` object seeks to act as much like a Python named tuple as possible. For mapping (i.e. dictionary) behavior on a row, such as testing for containment of keys, refer to the :attr:`.Row._mapping` attribute. .. seealso:: :ref:`tutorial_selecting_data` - includes examples of selecting rows from SELECT statements. .. versionchanged:: 1.4 Renamed ``RowProxy`` to :class:`.Row`. :class:`.Row` is no longer a "proxy" object in that it contains the final form of data within it, and now acts mostly like a named tuple. Mapping-like functionality is moved to the :attr:`.Row._mapping` attribute. See :ref:`change_4710_core` for background on this change. ��name�str�valuer�returnr c� �td���)Nzcan't set attribute��AttributeError)�selfr#r%s �e/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sqlalchemy/engine/row.py� __setattr__zRow.__setattr__Ps���2�3�3�3�c� �td���)Nzcan't delete attributer()r*r#s r+� __delattr__zRow.__delattr__Ss���5�6�6�6r-rc��|S)a5Return a 'tuple' form of this :class:`.Row`. At runtime, this method returns "self"; the :class:`.Row` object is already a named tuple. However, at the typing level, if this :class:`.Row` is typed, the "tuple" return type will be a :pep:`484` ``Tuple`` datatype that contains typing information about individual elements, supporting typed unpacking and attribute access. .. versionadded:: 2.0.19 - The :meth:`.Row._tuple` method supersedes the previous :meth:`.Row.tuple` method, which is now underscored to avoid name conflicts with column names in the same way as other named-tuple methods on :class:`.Row`. .. seealso:: :attr:`.Row._t` - shorthand attribute notation :meth:`.Result.tuples` r"�r*s r+�_tuplez Row._tupleVs ��,� r-z2.0.19z�The :meth:`.Row.tuple` method is deprecated in favor of :meth:`.Row._tuple`; all :class:`.Row` methods and library-level attributes are intended to be underscored to avoid name conflicts. Please use :meth:`Row._tuple`.c�*�|���S)zUReturn a 'tuple' form of this :class:`.Row`. .. versionadded:: 2.0 )r2r1s r+�tuplez Row.tuplens���{�{�}�}�r-c��|S)awA synonym for :meth:`.Row._tuple`. .. versionadded:: 2.0.19 - The :attr:`.Row._t` attribute supersedes the previous :attr:`.Row.t` attribute, which is now underscored to avoid name conflicts with column names in the same way as other named-tuple methods on :class:`.Row`. .. seealso:: :attr:`.Result.t` r"r1s r+�_tzRow._t}s ��� r-z�The :attr:`.Row.t` attribute is deprecated in favor of :attr:`.Row._t`; all :class:`.Row` methods and library-level attributes are intended to be underscored to avoid name conflicts. Please use :attr:`Row._t`.c��|jS)zKA synonym for :meth:`.Row._tuple`. .. versionadded:: 2.0 )r6r1s r+�tzRow.t�s ���w�r-� RowMappingc�D�t|jd|j|j��S)a]Return a :class:`.RowMapping` for this :class:`.Row`. This object provides a consistent Python mapping (i.e. dictionary) interface for the data contained within the row. The :class:`.Row` by itself behaves like a named tuple. .. seealso:: :attr:`.Row._fields` .. versionadded:: 1.4 N)r9�_parent� _key_to_index�_datar1s r+�_mappingz Row._mapping�s���$�,��d�.@�$�*�M�M�Mr-� processor�Optional[_ProcessorsType]�Row[Any]c�D�t|j||j|j��S�N)r!r;r<r=)r*r?s r+�_filter_on_valueszRow._filter_on_values�s���4�<��D�,>�� �K�K�Kr-c�.��td�fd� ��}|S)z3Handle ambiguous names such as "count" and "index" r*r!r&rc�v����j����r�����Sd��fd� }|S)N�argr�kwr&c�L��ttj����g|�Ri|��SrC)�getattr�collections_abcr)rGrHr#r*s ��r+�methz4Row._special_name_accessor.<locals>.go.<locals>.meth�sA���F�w��'?��F�F� � �#&� � � �*,� � �r-)rGrrHrr&r)r;�_has_key� __getattr__)r*rLr#s` �r+�goz&Row._special_name_accessor.<locals>.go�sZ�����<�(�(��.�.�  ��+�+�D�1�1�1��������  �Kr-)r*r!r&r)�property)r#rOs` r+�_special_name_accessorzRow._special_name_accessor�s4���� � � � � ��X� ��Ir-�count�index�key�boolc��||jvSrC)r=�r*rTs r+� __contains__zRow.__contains__�s���d�j� � r-�other�op�Callable[[Any, Any], bool]c���t|t��r0||���|�����n||���|��SrC)� isinstancer!�_to_tuple_instance)r*rYrZs r+�_opzRow._op�s_���%��%�%� 6�B�B�t�&�&�(�(�%�*B�*B�*D�*D� E� E� E���D�+�+�-�-�u�5�5� r-�intc��dSrCr"�r*rSs r+� __getitem__zRow.__getitem__�s��25�#r-�slice� Sequence[Any]c��dSrCr"rbs r+rczRow.__getitem__�s��>A�cr-�Union[int, slice]c��dSrCr"rbs r+rczRow.__getitem__�����r-c�B�|�|tj��SrC)r_�operator�lt�r*rYs r+�__lt__z Row.__lt__�����x�x��x�{�+�+�+r-c�B�|�|tj��SrC)r_rk�lerms r+�__le__z Row.__le__�ror-c�B�|�|tj��SrC)r_rk�germs r+�__ge__z Row.__ge__�ror-c�B�|�|tj��SrC)r_rk�gtrms r+�__gt__z Row.__gt__�ror-c�B�|�|tj��SrC)r_rk�eqrms r+�__eq__z Row.__eq__�ror-c�B�|�|tj��SrC)r_rk�nerms r+�__ne__z Row.__ne__�ror-c�D�ttj|����SrC)�repr�sql_util� _repr_rowr1s r+�__repr__z Row.__repr__�s���H�&�t�,�,�-�-�-r-�Tuple[str, ...]c�H�td�|jjD����S)a�Return a tuple of string keys as represented by this :class:`.Row`. The keys can represent the labels of the columns returned by a core statement or the names of the orm classes returned by an orm execution. This attribute is analogous to the Python named tuple ``._fields`` attribute. .. versionadded:: 1.4 .. seealso:: :attr:`.Row._mapping` c��g|]}|�|��SrCr"��.0�ks r+� <listcomp>zRow._fields.<locals>.<listcomp>s��D�D�D�A�a�m�a�m�m�mr-)r4r;�keysr1s r+�_fieldsz Row._fields�s&��&�D�D���!2�D�D�D�E�E�Er-�Dict[str, Any]c�*�t|j��S)amReturn a new dict which maps field names to their corresponding values. This method is analogous to the Python named tuple ``._asdict()`` method, and works by applying the ``dict()`` constructor to the :attr:`.Row._mapping` attribute. .. versionadded:: 1.4 .. seealso:: :attr:`.Row._mapping` )�dictr>r1s r+�_asdictz Row._asdict s���D�M�"�"�"r-N)r#r$r%rr&r )r#r$r&r )r&r)r&r9)r?r@r&rA)r#r$r&r)rTrr&rU)rYrrZr[r&rU)rSr`r&r)rSrdr&re)rSrgr&r�rYrr&rU�r&r$)r&r�)r&r�)"�__name__� __module__� __qualname__�__doc__� __slots__r,r/r2rr4rPr6r8r>rDrrQrRrSrXr_r�__hash__rrcrnrrrurxr{r~r�r�r�r"r-r+r!r!2s���������6�I�4�4�4�4�7�7�7�7�����0�Z�� C���������� � � ��X� ���Z�� ?���������X���N�N�N��X�N� L�L�L�L� �0� � � � �$'�&�w�/�/��&�&�w�/�/��!�!�!�!� � � � ���H��D� �5�5�5� ��5� �A�A�A� ��A�C�C�C�C�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�.�.�.�.��F�F�F��X�F�(#�#�#�#�#�#r-r!c�`�eZdZUdZded<ded<dd�Zdd �Zdd �Zdd�Zdd�Z dd�Z dd�Z dS)� ROMappingViewr"re�_items�Mapping['_KeyType', Any]r>�mapping�itemsc�"�||_||_dSrC)r>r�)r*r�r�s r+�__init__zROMappingView.__init__%s�� �� ��� � � r-r&r`c�*�t|j��SrC)�lenr�r1s r+�__len__zROMappingView.__len__+s���4�;���r-r$c�,�d�|��S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr1s r+r�zROMappingView.__repr__.s��7�>�>�t�D�D�Dr-� Iterator[Any]c�*�t|j��SrC)�iterr�r1s r+�__iter__zROMappingView.__iter__1s���D�K� � � r-�itemrrUc��||jvSrC�r�)r*r�s r+rXzROMappingView.__contains__4s���t�{�"�"r-rYc�B�t|��t|��kSrC��listrms r+r{zROMappingView.__eq__7����E�{�{�d�4�j�j�(�(r-c�B�t|��t|��kSrCr�rms r+r~zROMappingView.__ne__:r�r-N)r�r�r�re�r&r`r�)r&r�)r�rr&rUr�) r�r�r�r��__annotations__r�r�r�r�rXr{r~r"r-r+r�r�s���������I�����&�&�&�&�����  � � � �E�E�E�E�!�!�!�!�#�#�#�#�)�)�)�)�)�)�)�)�)�)r-r�c��eZdZdZdS)�ROMappingKeysValuesViewr�N�r�r�r�r�r"r-r+r�r�>s�������I�I�Ir-r�rc��eZdZdZdS)�ROMappingItemsViewr�Nr�r"r-r+r�r�Ds�������I�I�Ir-r�c�r�eZdZdZdZerdd�ZnejZdd �Z dd �Z dd �Z dd�Z dd�Z d d�Zd!d�Zd"d�ZdS)#r9a�A ``Mapping`` that maps column names and objects to :class:`.Row` values. The :class:`.RowMapping` is available from a :class:`.Row` via the :attr:`.Row._mapping` attribute, as well as from the iterable interface provided by the :class:`.MappingResult` object returned by the :meth:`_engine.Result.mappings` method. :class:`.RowMapping` supplies Python mapping (i.e. dictionary) access to the contents of the row. This includes support for testing of containment of specific keys (string column names or objects), as well as iteration of keys, values, and items:: for row in result: if "a" in row._mapping: print("Column 'a': %s" % row._mapping["a"]) print("Column b: %s" % row._mapping[table.c.b]) .. versionadded:: 1.4 The :class:`.RowMapping` object replaces the mapping-like access previously provided by a database result row, which now seeks to behave mostly like a named tuple. r"rTrr&rc��dSrCr"rWs r+rczRowMapping.__getitem__frir-� List[Any]c�*�t|j��SrC)r�r=r1s r+� _values_implzRowMapping._values_implks���D�J���r-� Iterator[str]c�.�d�|jjD��S)Nc3�K�|]}|�|V�� dSrCr"r�s r+� <genexpr>z&RowMapping.__iter__.<locals>.<genexpr>os"����>�>�a�� �� � � � �>�>r-�r;r�r1s r+r�zRowMapping.__iter__ns��>�>�4�<�,�>�>�>�>r-r`c�*�t|j��SrC)r�r=r1s r+r�zRowMapping.__len__qs���4�:���r-�objectrUc�6�|j�|��SrC)r;rMrWs r+rXzRowMapping.__contains__ts���|�$�$�S�)�)�)r-r$c�:�tt|����SrC)r�r�r1s r+r�zRowMapping.__repr__ws���D��J�J���r-r�c�`��t��fd�����D����S)zeReturn a view of key/value tuples for the elements in the underlying :class:`.Row`. c�$��g|] }|�|f�� Sr"r")r�rTr*s �r+r�z$RowMapping.items.<locals>.<listcomp>�s"���;�;�;��C��c��#�;�;�;r-)r�r�r1s`r+r�zRowMapping.itemszs9��� "� �;�;�;�;�t�y�y�{�{�;�;�;� � � r-rc��|jjS)znReturn a view of 'keys' for string column names represented by the underlying :class:`.Row`. r�r1s r+r�zRowMapping.keys�s�� �|� � r-r�c�F�t||�����S)zeReturn a view of values for the values represented in the underlying :class:`.Row`. )r�r�r1s r+�valueszRowMapping.values�s �� '�t�T�->�->�-@�-@�A�A�Ar-N)rTrr&r)r&r�)r&r�r�)rTr�r&rUr�)r&r�)r&r)r&r�)r�r�r�r�r�rrcr�_get_by_key_impl_mappingr�r�r�rXr�r�r�r�r"r-r+r9r9Hs���������2�I��7�8�8�8�8�8��6� � � � � �?�?�?�?�����*�*�*�*� � � � � � � � �!�!�!�!�B�B�B�B�B�Br-r9)1r�� __future__r�abcr�collections.abcrKrk�typingrrrrr r r r r rrrrrr�sqlrr�r� util._has_cyr�_py_rowr�"sqlalchemy.cyextension.resultproxy�resultrrrrrr!� BaseRowProxy�RowProxyr��KeysView� ValuesViewr�� ItemsViewr�r9r"r-r+�<module>r�s��5�4�"�"�"�"�"�"�������)�)�)�)�)�)����� � � � ������������������������������������������������������������������������� � � � � � �������������"�"�"�"�"�"�������*�*�*�*�*�*��F��F�+�+�+�+�+�+�+�E�E�E�E�E�E��"� � � � � � �'�'�'�'�'�'�!�!�!�!�!�!� �W�T������ �g�e�5��c��?�+�+�+��f#�f#�f#�f#�f#�'�8�C�=�'�#�,�f#�f#�f#�R� � ��)�)�)�)�)�C�)�)�)�>������6�?�:�.��0A�#�0F���� �������(8��S��(I����HB�HB�HB�HB�HB��&�.��S��9�HB�HB�HB�HB�HBr-
Memory