OwlCyberSecurity - MANAGER
Edit File: _elements_constructors.cpython-312.pyc
� _��g�� � � � d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d lm Z d d lmZ d dlmZ d dlm Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm!Z! d dlm"Z" d d lm#Z# d d!lm$Z$ d d"lm%Z% d d lm Z d d#lm&Z& d d$lm'Z' d d%lm(Z( d d&l)m*Z* d'd(l+m,Z, ej r0d d)l-m.Z. d d*l-m/Z/ d d+l-m0Z0 d d,l-m1Z1 d d-l-m2Z2 d d.lm3Z3 d d/l4m5Z5 d d0l6m7Z7 ed1� Z8dZd2�Z9 d[d3�Z:esd4� Z:dZd5�Z; d\d6�Z< d]d7�Z= d^ d_d9�Z> d` dad:�Z?edbd;�� Z@edcd<�� Z@dcd=�Z@ej� dd8ej� ddd8d8d8f ddd>�ZBddd?� ded@�ZC dfdA�ZD dgdB�ZE dh didD�ZF d\dE�ZGdjdF�ZHdjdG�ZIdkdH�ZJdldI�ZK dmdJ�ZL d` dndK�ZMdodL�ZNdpdM�ZOdpdN�ZP dqdO�ZQesdP� ZQ dr dsdQ�ZR edCdRdS� dtdT�� ZSdudU�ZTddV� dvdW�ZU dwdX�ZV dxdY�ZWy)y� )�annotationsN)�Any)�Callable)�Mapping)�Optional)�overload)�Sequence��Tuple)� TYPE_CHECKING)�TypeVar)�Union� )� coercions)�roles)�_NoArg)�_document_text_coercion�� BindParameter)�BooleanClauseList��Case��Cast)�CollationClause)�CollectionAggregate��ColumnClause)� ColumnElement��Extract)�False_��FunctionFilter��Label)�Null��Over�� TextClause)�True_��TryCast�� TypeCoerce)�UnaryExpression��WithinGroup)�FunctionElement� )�Literal)�_ByArgument)�_ColumnExpressionArgument)�"_ColumnExpressionOrLiteralArgument)�#_ColumnExpressionOrStrLabelArgument)�_TypeEngineArgument)�BinaryExpression)� FromClause)� TypeEngine�_Tc �, � t j | � S )ak Produce an ALL expression. For dialects such as that of PostgreSQL, this operator applies to usage of the :class:`_types.ARRAY` datatype, for that of MySQL, it may apply to a subquery. e.g.:: # renders on PostgreSQL: # '5 = ALL (somearray)' expr = 5 == all_(mytable.c.somearray) # renders on MySQL: # '5 = ALL (SELECT value FROM table)' expr = 5 == all_(select(table.c.value)) Comparison to NULL may work using ``None``:: None == all_(mytable.c.somearray) The any_() / all_() operators also feature a special "operand flipping" behavior such that if any_() / all_() are used on the left side of a comparison using a standalone operator such as ``==``, ``!=``, etc. (not including operator methods such as :meth:`_sql.ColumnOperators.is_`) the rendered expression is flipped:: # would render '5 = ALL (column)` all_(mytable.c.column) == 5 Or with ``None``, which note will not perform the usual step of rendering "IS" as is normally the case for NULL:: # would render 'NULL = ALL(somearray)' all_(mytable.c.somearray) == None .. versionchanged:: 1.4.26 repaired the use of any_() / all_() comparing to NULL on the right side to be flipped to the left. The column-level :meth:`_sql.ColumnElement.all_` method (not to be confused with :class:`_types.ARRAY` level :meth:`_types.ARRAY.Comparator.all`) is shorthand for ``all_(col)``:: 5 == mytable.c.somearray.all_() .. seealso:: :meth:`_sql.ColumnOperators.all_` :func:`_expression.any_` )r �_create_all��exprs �V/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/sql/_elements_constructors.py�all_rE ? � � �f �*�*�4�0�0� c � � y)aF Produce a conjunction of expressions joined by ``AND``. E.g.:: from sqlalchemy import and_ stmt = select(users_table).where( and_(users_table.c.name == "wendy", users_table.c.enrolled == True) ) The :func:`.and_` conjunction is also available using the Python ``&`` operator (though note that compound expressions need to be parenthesized in order to function with Python operator precedence behavior):: stmt = select(users_table).where( (users_table.c.name == "wendy") & (users_table.c.enrolled == True) ) The :func:`.and_` operation is also implicit in some cases; the :meth:`_expression.Select.where` method for example can be invoked multiple times against a statement, which will have the effect of each clause being combined using :func:`.and_`:: stmt = ( select(users_table) .where(users_table.c.name == "wendy") .where(users_table.c.enrolled == True) ) The :func:`.and_` construct must be given at least one positional argument in order to be valid; a :func:`.and_` construct with no arguments is ambiguous. To produce an "empty" or dynamically generated :func:`.and_` expression, from a given list of expressions, a "default" element of :func:`_sql.true` (or just ``True``) should be specified:: from sqlalchemy import true criteria = and_(true(), *expressions) The above expression will compile to SQL as the expression ``true`` or ``1 = 1``, depending on backend, if no other expressions are present. If expressions are present, then the :func:`_sql.true` value is ignored as it does not affect the outcome of an AND expression that has other elements. .. deprecated:: 1.4 The :func:`.and_` element now requires that at least one argument is passed; creating the :func:`.and_` construct with no arguments is deprecated, and will emit a deprecation warning while continuing to produce a blank SQL string. .. seealso:: :func:`.or_` N� ��initial_clause�clausess rD �and_rM u s � �| rG c �&