Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/dialects/postgresql/__pycache__/array.cpython-39.pyc
Ðазад
a _�h . � @ s� d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ejfdd�Z ejfd d �Z G dd� dej�Zej d dd�Zej ddd�Zej ddd�ZG dd� dej�ZdS )� N� )�types)�util)� expression)� operatorsc C s |� | |�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��otherZarrexpr�operator� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/sqlalchemy/dialects/postgresql/array.py�Any s r c C s |� | |�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 r r r �All s r c s8 e Zd ZdZd Z� fdd�Zd dd�Zddd �Z� ZS )�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 s^ t t| �j|i |�� t| jt�rNt| jj| jjd urB| jjd ndd�| _nt| j�| _d S )N� � )� dimensions)�superr �__init__� isinstance�type�ARRAY� item_typer )�selfZclauses�kw�� __class__r r r c s �� zarray.__init__FNc sD |s� t ju r&tjd |� ��jdd�S t� ��fdd�|D ��S d S )NT)Z_compared_to_operator�type_Z_compared_to_type�uniquec s g | ]}�j � |d �d��qS )T)�_assume_scalarr )�_bind_param)�.0�o�r r r r r � <listcomp>| s ��z%array._bind_param.<locals>.<listcomp>)r �getitemr Z BindParameterr r )r r �objr r r r$ r r! o s � ��zarray._bind_paramc C s&