관리-도구
편집 파일: array.cpython-311.pyc
� �܋f . � � � d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ej fd�Z ej fd�Z G d � d ej � � Z ej dd� � � Z ej dd� � � Z ej dd� � � Z G d� dej � � ZdS )� N� )�types)�util)� expression)� operatorsc �. � |� | |� � S )z�A synonym for the :meth:`.ARRAY.Comparator.any` method. This method is legacy and is here for backwards-compatibility. .. seealso:: :func:`_expression.any_` )�any��other�arrexpr�operators �[/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/postgresql/array.py�Anyr � � � �;�;�u�h�'�'�'� c �. � |� | |� � S )z�A synonym for the :meth:`.ARRAY.Comparator.all` method. This method is legacy and is here for backwards-compatibility. .. seealso:: :func:`_expression.all_` )�allr s r �Allr r r c �6 � � e Zd ZdZd Z� fd�Zdd�Zdd�Z� xZS ) �arraya A PostgreSQL ARRAY literal. This is used to produce ARRAY literals in SQL expressions, e.g.:: from sqlalchemy.dialects.postgresql import array from sqlalchemy.dialects import postgresql from sqlalchemy import select, func stmt = select([ array([1,2]) + array([3,4,5]) ]) print(stmt.compile(dialect=postgresql.dialect())) Produces the SQL:: SELECT ARRAY[%(param_1)s, %(param_2)s] || ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]) AS anon_1 An instance of :class:`.array` will always have the datatype :class:`_types.ARRAY`. The "inner" type of the array is inferred from the values present, unless the ``type_`` keyword argument is passed:: array(['foo', 'bar'], type_=CHAR) Multidimensional arrays are produced by nesting :class:`.array` constructs. The dimensionality of the final :class:`_types.ARRAY` type is calculated by recursively adding the dimensions of the inner :class:`_types.ARRAY` type:: stmt = select([ array([ array([1, 2]), array([3, 4]), array([column('q'), column('x')]) ]) ]) print(stmt.compile(dialect=postgresql.dialect())) Produces:: SELECT ARRAY[ARRAY[%(param_1)s, %(param_2)s], ARRAY[%(param_3)s, %(param_4)s], ARRAY[q, x]] AS anon_1 .. versionadded:: 1.3.6 added support for multidimensional array literals .. seealso:: :class:`_postgresql.ARRAY` c �( �� t t | � � j |i |�� t | j t � � r=t | j j | j j �| j j dz nd�� � | _ d S t | j � � | _ d S )N� � )� dimensions)�superr �__init__� isinstance�type�ARRAY� item_typer )�self�clauses�kw� __class__s �r r zarray.__init__c s� �� �#��e�T���#�W�3��3�3�3��d�i��'�'� )��� �#��9�'�3� �9�/�!�3�3�� � � �D�I�I�I� �d�i�(�(�D�I�I�Ir FNc � � ��� |s�t j u rt j d |��� j d�� � S t �� �fd�|D � � � � S )NT)�_compared_to_operator�type_�_compared_to_type�uniquec �B �� g | ]}�� �|d ��� � ��S )T)�_assume_scalarr'