U kf@s dZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl m Z ddl m Z ddl m Z dd l mZdd l mZdd l mZdd l mZdd l mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl m!Z!ddl m"Z"ddl m#Z#ddl m$Z$ddl m%Z%dd l&m'Z'dd!l&m(Z(dd"l&m)Z)dd#l&m*Z*dd$l+m,Z,dd%l+m-Z-dd&l.m/Z/dd'l.m0Z0dd(l.m1Z1dd)l.m2Z2dd*l.m3Z3dd+l.m4Z4dd,l.m5Z5dd-l.m6Z6dd.l.m7Z7dd/l.m8Z8dd0l9m:Z:dd1l9m;Z;dd2l!mZ>dd5l?m@Z@dd6l?mAZAdd7l?mBZBdd8l?mCZCdd9l?mDZDd:d;l mEZEd:dlGmHZHd:d?lGmIZId:d@lJmKZKd:dAlJmLZLd:dBlJmMZMe jrddCl&mNZNddDl&mOZOddEl&mPZPddFl&mQZQddGl&mRZRddHl&mSZSddIl&mTZTddJl9mUZUddKl9mVZVddLlWmXZXddMlWmYZYddNlZm[Z[ddOl"m\Z\ddPl]m^Z^ddQl]m_Z_ddRl]m`Z`ddSl]maZaddTlbmcZcddUlbmdZdddVlbmeZeddWlbmfZfddXlgmhZhddYl%miZiddZl?mjZjdd[l?mkZkdd\l?mlZld:d]lmmnZnd:d^lmmoZod:d_lpmqZqd:d`lpmrZrd:dalpmsZsd:dblpmtZtd:dclpmuZud:ddlvmwZweexefZyeexezefZ{ededfdgZ|edhe didjZ}edkdfdgZ~edldmdgZedndodgZeddfdqdrdsdtdudvZeddedwdrdsdtdxdvZeddfdydrdzdtd{dvZddfdydrdzdtd|dvZdd}d~ddddZGdddeDZeFjGddde-e:e>eAeZGdddeZGddde#je#je#jeZGdddee}e=eIZGdddee}e#je}eIZeZGddde#je#je#je#je|e#je#je#je#je#je#jee|eZGdddee|ZGdddee|ZGddde#jee|ZGdddeZGddde#je#je#je#je#je#je#je#je4e3ee#je eFjdZGddde8e#jdedZeGddde8e#jeeeZeGddde8e#jeeeZeGddde#je#je#je#jeZGdddee|ZGdddee|ZGdddeeZejZejZGdddeeee dfZGdddee|ZGdddee|ZGdddee|ZGdddee|ZGdddeezZGdddee|ZGdddee ZGdddee|ZGdddee|ZGdddeeeeZGdddee|ZGddÄdee ZGddńdee ZGddDŽdeZGddɄdeee|ZGdd˄dee|ZGdd̈́deZejZejZeezefZGddτdee|ZGddфdee|ZGddӄde4ee|ZGddՄdee|ZeLdփZGdd؄de#je|ee|ZGddڄde#je#je|e#je6ee|ZGdd܄dee|ZGddބdeeZGddde3eZGddde̓ZGddde̓ZGddde̓ZGdddeGje˃ZdddddZdddddZԐdddZGdddeGjdZGddde,ZGddde҃ZGdddeكZeZGdddeكZdS(zCore SQL expression elements, including :class:`_expression.ClauseElement`, :class:`_expression.ColumnElement`, and derived classes. ) annotations)Decimal)EnumN) AbstractSet)Any)Callable)cast)Dict) FrozenSet)Generic)Iterable)Iterator)List)Mapping)Optional)overload)Sequence)Set)Tuple)Type) TYPE_CHECKING)TypeVar)Union) coercions) operators)roles) traversals)type_api)has_schema_attr)is_named_from_clause)is_quoted_name) is_tuple_type) Annotated)SupportsWrappingAnnotations)_clone)_expand_cloned) _generative)_NoArg) Executable) Generative) HasMemoized) Immutable)NO_ARG)SingletonConstant)MemoizedHasCacheKey)NO_CACHE)_document_text_coercion)ColumnOperators)HasCopyInternals)cloned_traverse)ExternallyTraversible)InternalTraversal)traverse) Visitable)exc) inspection)util)!HasMemoized_ro_memoized_attribute) TypingOnly)Literal) ParamSpec)Self) _ByArgument)_ColumnExpressionArgument)#_ColumnExpressionOrStrLabelArgument) _HasDialect) _InfoType)_PropagateAttrsType)_TypeEngineArgument)_CacheKeyTraversalType)CacheKey)Compiled) SQLCompiler)FunctionElement) OperatorType)Column)DefaultGenerator) FetchedValue) ForeignKey)_SelectIterable) FromClause)NamedFromClause) TextualSelect) TupleType) TypeEngine)_CloneCallableType)_TraverseInternalsType)anon_map) Connection)Dialect)_CoreMultiExecuteParams) CacheStats)CompiledCacheType)CoreExecuteOptionsParameter)SchemaTranslateMapType)Result_Tr)bound_T_coT)re covariant_OPT_NT_NUMERIC_NMT_NUMBERF_TypeEngineArgument[_T]boolBindParameter[_T])valuetype_literal_executereturncCsdSNrprqrrruruG/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/sql/elements.pyliteralsrxNonecCsdSrtrurvrururwrxs"Optional[_TypeEngineArgument[Any]]BindParameter[Any]cCsdSrtrurvrururwrxscCstjtj|||dS)aReturn a literal clause, bound to a bind parameter. Literal clauses are created automatically when non- :class:`_expression.ClauseElement` objects (such as strings, ints, dates, etc.) are used in a comparison operation with a :class:`_expression.ColumnElement` subclass, such as a :class:`~sqlalchemy.schema.Column` object. Use this function to force the generation of a literal clause, which will be created as a :class:`BindParameter` with a bound value. :param value: the value to be bound. Can be any Python object supported by the underlying DB-API, or is translatable via the given type argument. :param type\_: an optional :class:`~sqlalchemy.types.TypeEngine` which will provide bind-parameter translation for this literal. :param literal_execute: optional bool, when True, the SQL engine will attempt to render the bound value directly in the SQL statement at execution time rather than providing as a parameter value. .. versionadded:: 2.0 )rqrr)rexpectrZLiteralValueRolervrururwrxs str!Optional[_TypeEngineArgument[_T]]zColumnClause[_T])textrqrscCst||ddS)aProduce a :class:`.ColumnClause` object that has the :paramref:`_expression.column.is_literal` flag set to True. :func:`_expression.literal_column` is similar to :func:`_expression.column`, except that it is more often used as a "standalone" column expression that renders exactly as stated; while :func:`_expression.column` stores a string name that will be assumed to be part of a table and may be quoted as such, :func:`_expression.literal_column` can be that, or any other arbitrary column-oriented expression. :param text: the text of the expression; can be any SQL expression. Quoting rules will not be applied. To specify a column-name expression which should be subject to quoting rules, use the :func:`column` function. :param type\_: an optional :class:`~sqlalchemy.types.TypeEngine` object which will provide result-set translation and additional expression semantics for this column. If left as ``None`` the type will be :class:`.NullType`. .. seealso:: :func:`_expression.column` :func:`_expression.text` :ref:`tutorial_select_arbitrary_text` T)rq is_literal ColumnClause)rrqrururwliteral_columns#rc@sjeZdZdZdZdZdZdZe de ddd d d d d ddZ dd d dddZ ddddZ dS)CompilerElementznbase class for SQL elements that can be compiled to produce a SQL string. .. versionadded:: 2.0 ruZcompiler_elementFdefaultzsqlalchemy.engine.defaultzsqlalchemy.engine.urlNOptional[_HasDialect]Optional[Dialect]rrKbinddialectkwrscKsZ|dkrL|r|j}n8|jdkr0tjj}|}ntjj}|j|j }|j |f|S)aCompile this SQL expression. The return value is a :class:`~.Compiled` object. Calling ``str()`` or ``unicode()`` on the returned value will yield a string representation of the result. The :class:`~.Compiled` object also can return a dictionary of bind parameter names and values using the ``params`` accessor. :param bind: An :class:`.Connection` or :class:`.Engine` which can provide a :class:`.Dialect` in order to generate a :class:`.Compiled` object. If the ``bind`` and ``dialect`` parameters are both omitted, a default SQL compiler is used. :param column_keys: Used for INSERT and UPDATE statements, a list of column names which should be present in the VALUES clause of the compiled statement. If ``None``, all columns from the target table object are rendered. :param dialect: A :class:`.Dialect` instance which can generate a :class:`.Compiled` object. This argument takes precedence over the ``bind`` argument. :param compile_kwargs: optional dictionary of additional parameters that will be passed through to the compiler within all "visit" methods. This allows any custom flag to be passed through to a custom compilation construct, for example. It is also used for the case of passing the ``literal_binds`` flag through:: from sqlalchemy.sql import table, column, select t = table('t', column('x')) s = select(t).where(t.c.x == 5) print(s.compile(compile_kwargs={"literal_binds": True})) .. seealso:: :ref:`faq_sql_expression_string` Nr) rstringify_dialectr< preloadedZengine_defaultZStrCompileDialectZ engine_urlURLcreate get_dialect _compiler)selfrrrrurlrururwcompiles4   zCompilerElement.compiler]rrrscKs"trt|tst|j||f|S)zNReturn a compiler appropriate for this ClauseElement, given a Dialect.)r isinstance ClauseElementAssertionErrorZstatement_compilerrrrrururwr6szCompilerElement._compilerr}rscCs t|Srt)r}rrrururw__str__>szCompilerElement.__str__)NN) __name__ __module__ __qualname____doc__ __slots____visit_name__supports_executionrr<preload_modulerrrrurururwrs@rc @sTeZdZUdZdZer,ejddddZnej Zej dddd Z d Z d e d <d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"e#ddddZ$d Z%de d<de d<e&jrddddddddZ'ej(dddd Z)d!d"d#d$d%Z*dd"d&d'd(Z+d)d*Z,d+d,Z-e#d-d.Z.e/j0d/d0Z1d1d2Z2e#d3d4Z3d5d6Z4d7d8d9d:d;dd?Z6d@ddAdBZ7didCdd"dDdEdFZ8djdGdd"dDdHdIZ9dJdGdKd"dLdMdNZ:dddJdOdPdQZ;dkdRddSdTdUZdadbZ?dddcddZ@dedfZAdgdhZBd S)lrzSBase class for elements of a programmatically constructed SQL expression. clauserGrcCsdS)zlike annotations, however these propagate outwards liberally as SQL constructs are built, and are set up at construction time. Nrurrururw_propagate_attrsSszClauseElement._propagate_attrs Optional[str]cCsdSrtrurrururw description^szClauseElement.descriptionNzOptional[Self] _is_clone_ofTFOptional[Label[Any]]cCsdSrtrurrururw_order_by_label_elementzsz%ClauseElement._order_by_label_elementrI_cache_key_traversalColumnElement[bool]negation_clause.) omit_attrsztyping_Tuple[str, ...]rzIterable[ClauseElement])rrrscKsdSrtru)rrrrururw get_childrenszClauseElement.get_childrenList[FromClause]cCsgSrtrurrururw _from_objectsszClauseElement._from_objectsMapping[str, Any]rA)valuesrscCst||_|Srt)r<Z immutabledictr)rrrururw_set_propagate_attrss z"ClauseElement._set_propagate_attrs)rrsc s`|j|j|j}r8fdd|jD|_n |j|_|j}|dk rV|n||_|S)zCreate a shallow copy of this ClauseElement. This method may be used by a generative API. Its also used as part of the "deep" copy afforded by a traversal that combines the _copy_internals() method. csi|]\}}|kr||qSruru.0kvskiprurw sz(ClauseElement._clone..N)Z_memoized_keys __class____new____dict__copyitemsr)rrcccrurrwr%s    zClauseElement._clonecCs|S)za hook to allow the right side of a binary expression to respond to a negation of the binary expression. Used for the special case of expanding bind parameter with IN. ru)r negated_op original_oprururw_negate_in_binaryszClauseElement._negate_in_binarycCs|S)zin the context of binary expression, convert the type of this object to the one given. applies only to :class:`_expression.ColumnElement` classes. rurrqrururw_with_binary_element_typesz'ClauseElement._with_binary_element_typecCs|jS)a.return the 'constructor' for this ClauseElement. This is for the purposes for creating a new object of this type. Usually, its just the element's __class__. However, the "Annotated" version of the object overrides to return the class of its proxied element. rrrururw _constructors zClauseElement._constructorcCs*t}|}|dk r&|||j}q |S)aReturn the set consisting all cloned ancestors of this ClauseElement. Includes this ClauseElement. This accessor tends to be used for FromClause objects to identify 'equivalent' FROM clauses, regardless of transformative operations. N)r<Z column_setaddr)rsfrururw _cloned_sets  zClauseElement._cloned_setcCs|jdk r|j}q|Srt)rrrururw _de_clones zClauseElement._de_clonecCs tddS)NzFThis SQL expression has no entity namespace with which to filter from.)AttributeErrorrrururwentity_namespaceszClauseElement.entity_namespacecCs&|j}|dd|dd|S)Nr_generate_cache_key)rrpop)rdrururw __getstate__s   zClauseElement.__getstate__r\r^raz Result[Any]) connectiondistilled_paramsexecution_optionsrscCs4|jr&trt|tst||||St|dSrt)rrrr)rZ_execute_clauseelementr:ZObjectNotExecutableErrorrrrrrururw_execute_on_connectionsz$ClauseElement._execute_on_connectioncCs||||S)zan additional hook for subclasses to provide a different implementation for connection.scalar() vs. connection.execute(). .. versionadded:: 2.0 )rZscalarrrururw_execute_on_scalar s z ClauseElement._execute_on_scalarSequence[BindParameter[Any]]cCs4|}|dkr*g}t|id|ji|S|jSdS)aReturn the list of :class:`.BindParameter` objects embedded in the object. This accomplishes the same purpose as ``visitors.traverse()`` or similar would provide, however by making use of the cache key it takes advantage of memoization of the key to result in fewer net method calls, assuming the statement is also going to be executed. N bindparam)rr7append bindparams)rkeyrrururw_get_embedded_bindparamss z&ClauseElement._get_embedded_bindparamszOptional[Dict[str, Any]])_ClauseElement__optionaldictkwargsrscKs|d||S)aReturn a copy with :func:`_expression.bindparam` elements replaced. Same functionality as :meth:`_expression.ClauseElement.params`, except adds `unique=True` to affected bind parameters so that multiple statements can be used. T_replace_paramsrrrrururw unique_params/szClauseElement.unique_paramsOptional[Mapping[str, Any]]cKs|d||S)aReturn a copy with :func:`_expression.bindparam` elements replaced. Returns a copy of this ClauseElement with :func:`_expression.bindparam` elements replaced with values taken from the given dictionary:: >>> clause = column('x') + bindparam('foo') >>> print(clause.compile().params) {'foo':None} >>> print(clause.params({'foo':7}).compile().params) {'foo':7} Frrrururwparams?szClauseElement.paramsrnzDict[str, Any])unique optionaldictrrscs:|r|dddfdd }t|dddd|iS) Nr{ry)rrscs,|jkr|j|_d|_r(|dS)NF)rrprequired_convert_to_unique)rrrrurwvisit_bindparam]s   z6ClauseElement._replace_params..visit_bindparamT) maintain_keydetect_subquery_colsr)updater4)rrrrrrurrwrTs zClauseElement._replace_paramsotherrrscKstj||f|S)aCompare this :class:`_expression.ClauseElement` to the given :class:`_expression.ClauseElement`. Subclasses should override the default behavior, which is a straight identity comparison. \**kw are arguments consumed by subclass ``compare()`` methods and may be used to modify the criteria for comparison (see :class:`_expression.ColumnElement`). )rcomparerrrrururwrjs zClauseElement.compareOptional[OperatorType]againstrscCs|S)aApply a 'grouping' to this :class:`_expression.ClauseElement`. This method is overridden by subclasses to return a "grouping" construct, i.e. parenthesis. In particular it's used by "binary" expressions to provide a grouping around themselves when placed into a larger expression, as well as by :func:`_expression.select` constructs when placed into the FROM clause of another :func:`_expression.select`. (Note that subqueries should be normally created using the :meth:`_expression.Select.alias` method, as many platforms require nested SELECT statements to be named). As expressions are composed together, the application of :meth:`self_group` is automatic - end-user code should never need to use this method directly. Note that SQLAlchemy's clause constructs take operator precedence into account - so parenthesis might not be needed, for example, in an expression like ``x OR (y AND z)`` - AND takes precedence over OR. The base :meth:`self_group` method of :class:`_expression.ClauseElement` just returns self. rurrrururw self_groupxszClauseElement.self_groupcCs|S)zVReturn this :class:`_expression.ClauseElement` without any groupings. rurrururw_ungroupszClauseElement._ungroup)for_executemanyschema_translate_mapr]zOptional[CompiledCacheType]z List[str]z Optional[SchemaTranslateMapType]zJtyping_Tuple[Compiled, Optional[Sequence[BindParameter[Any]]], CacheStats])rcompiled_cache column_keysrrrrsc Ks|dk r|jr|}nd}|dk rtr4|dk s4t|\}} ||t|t||f} || } | dkr|j} |j|f||||d|} | || <q|j } nDd} |j|f||||d|} |js|j } n|dkr|j } n|j } | | | fS)N) cache_keyrrr) Z_supports_statement_cacherrrtuplerngetZ CACHE_MISSrZ CACHE_HITZNO_DIALECT_SUPPORTZCACHING_DISABLEDZ NO_CACHE_KEY) rrrrrrrZelem_cache_keyrZextracted_paramsrZ compiled_sqlZ cache_hitrururw_compile_w_cachesZ     zClauseElement._compile_w_cachecCst|dr|jS|SdS)Nr)hasattrr_negaterrururw __invert__s zClauseElement.__invert__cCs*|jtjd}t|tstt|tjdS)Nroperatorrrinvr ColumnElementrUnaryExpressionrgroupedrururwrszClauseElement._negatecCs tddS)N+Boolean value of this clause is not defined) TypeErrorrrururw__bool__szClauseElement.__bool__cCs6|j}|dkrt|Sd|j|jjt||fSdS)Nz<%s.%s at 0x%x; %s>)robject__repr__rrrid)rfriendlyrururwrs zClauseElement.__repr__)N)N)N)Crrrrrrr<memoized_propertyr EMPTY_DICTro_memoized_propertyrr__annotations__Zis_clause_elementZ is_selectableZis_dml_is_column_element_is_keyed_column_elementZ _is_tableZ!_gen_static_annotations_cache_key _is_textualZ_is_from_clauseZ_is_returns_rows_is_text_clauseZ_is_from_containerZ_is_select_containerZ_is_select_baseZ_is_select_statement_is_bind_parameter_is_clause_listZ_is_lambda_elementZ_is_singleton_constant _is_immutable_is_starpropertyrrtypingrro_non_memoized_propertyrrr%rrrr+memoized_attributerrrrrrrrrrrrrrrrrrrurururwrBs          Brc@s>eZdZdZejr:ddddddZdd d ddd d d ZdS)DQLDMLClauseElementz|represents a :class:`.ClauseElement` that compiles to a DQL or DML expression, not DDL. .. versionadded:: 2.0 r]rrLrcKsdS)zRReturn a compiler appropriate for this ClauseElement, given a Dialect.NrurrururwrszDQLDMLClauseElement._compilerNrrrcKsdSrtru)rrrrrururwr szDQLDMLClauseElement.compile)NN)rrrrr%rrrrurururwr(s r(c@seZdZdZdZejZdZdS)CompilerColumnElementzdA compiler-only column element used for ad-hoc string compilations. .. versionadded:: 2.0 ruFN) rrrrrr<rr_is_collection_aggregaterurururwr)sr)c @seZdZdZejrejddddZddddd d d Z ddddd d d Z e ddddddddddddZ e ddddddddddZ ddddddddddZ ddddd d!d"d#Z dd$d%d&d'Zdd$d%d(d)Zd*dd+d,Zdd-d%d.d/Zdd-d%d0d1Zddd2d3Zdd-d%d4d5Zdd-d%d6d7Zdd-d%d8d9Zdd-d%d:d;Zdd-d%dd?Zd@ddAdBZdd-d%dCdDZdddEdFdGZe dHddIdJdKdLZe ddd%dMdLZddd%dNdLZe dHddIdJdOdPZe ddd%dQdPZddd%dRdPZe dSddTdJdUdVZe ddd%dWdVZddd%dXdVZdddYdZd[d\d]Z dddYdZd[d^d_Z!dd`d%dadbZ"dd`d%dcddZ#dd`d%dedfZ$d@ddgdhZ%dd`d%didjZ&dd`d%dkdlZ'dmdZd%dndoZ(dmdZd%dpdqZ)dmdZd%drdsZ*dddYdZd[dtduZ+dddYdZd[dvdwZ,dddYdZd[dxdyZ-dddYdZd[dzd{Z.ddZd%d|d}Z/ddZd%d~dZ0ddZd%ddZ1dddYdd-dddZ2dddYdd-dddZ3dddYdd-dddZ4dddYdd-dddZ5ddd-dddZ6ddd-dddZ7ddd-dddZ8dddYd-dddZ9ddddYdTdddZ:d@dddZ;d@dddZd@dddZ?d@dddZ@dddddZAdddddZdddZBdd@dddZCddddZDddddZEe ddddJddZFe dSddTdJddZFe ddd%ddZFddd%ddZFe ddddJddZGe dSddTdJddZGddd%ddZGe ddddJddZHe ddd%ddZHddd%ddZHe ddddJddńZIe ddd%ddńZIddd%ddńZIe ddddJddɄZJe ddd%ddɄZJddd%ddɄZJe ddddJdd̈́ZKe ddd%dd̈́ZKddd%dd̈́ZKe ddddJddфZLe ddd%ddфZLddd%ddфZLe ddddJddՄZMe ddd%ddՄZMddd%ddՄZMe dHdddJddڄZNe ddddJddڄZNe ddd%ddڄZNddd%ddڄZNe ddddJddZOe ddd%ddZOddd%ddZOe ddddJddZPe ddd%ddZPddd%ddZPe ddddJddZQe ddd%ddZQddd%ddZQdS)SQLCoreOperationsrurGrcCsdSrtrurrururwr/sz"SQLCoreOperations._propagate_attrsrNrColumnElement[Any]oprrrscOsdSrtrurr.rrrururwoperate2szSQLCoreOperations.operatecKsdSrtrur/rururwreverse_operate6sz!SQLCoreOperations.reverse_operate.N) python_implr}intrn_TypeEngineArgument[_OPT]zOptional[Callable[..., Any]]z'Callable[[Any], BinaryExpression[_OPT]])opstring precedence is_comparison return_typer2rscCsdSrtrurr5r6r7r8r2rururwr.:s zSQLCoreOperations.oprzz&Callable[[Any], BinaryExpression[Any]]cCsdSrtrur9rururwr.EsrFcCsdSrtrur9rururwr.Osz'Callable[[Any], BinaryExpression[bool]])r5r6r2rscCsdSrtru)rr5r6r2rururwbool_opXszSQLCoreOperations.bool_opBooleanClauseListrrscCsdSrtrurrrururw__and___zSQLCoreOperations.__and__cCsdSrtrur=rururw__or__ar?zSQLCoreOperations.__or__zColumnElement[_T_co]cCsdSrtrurrururwrcr?zSQLCoreOperations.__invert__rcCsdSrtrur=rururw__lt__er?zSQLCoreOperations.__lt__cCsdSrtrur=rururw__le__gr?zSQLCoreOperations.__le__cCsdSrtrurrururw__hash__mr?zSQLCoreOperations.__hash__cCsdSrtrur=rururw__eq__oszSQLCoreOperations.__eq__cCsdSrtrur=rururw__ne__rszSQLCoreOperations.__ne__cCsdSrtrur=rururwis_distinct_fromur?z"SQLCoreOperations.is_distinct_fromcCsdSrtrur=rururwis_not_distinct_fromwr?z&SQLCoreOperations.is_not_distinct_fromcCsdSrtrur=rururw__gt__yr?zSQLCoreOperations.__gt__cCsdSrtrur=rururw__ge__{r?zSQLCoreOperations.__ge__zUnaryExpression[_T_co]cCsdSrtrurrururw__neg__}r?zSQLCoreOperations.__neg__cCsdSrtrur=rururw __contains__r?zSQLCoreOperations.__contains__)indexrscCsdSrtru)rrLrururw __getitem__r?zSQLCoreOperations.__getitem__z _SQO[int]zColumnElement[int])rrrscCsdSrtrur=rururw __lshift__szSQLCoreOperations.__lshift__cCsdSrtrur=rururwrNscCsdSrtrur=rururwrNr?cCsdSrtrur=rururw __rshift__szSQLCoreOperations.__rshift__cCsdSrtrur=rururwrOscCsdSrtrur=rururwrOr?z _SQO[str]zColumnElement[str]cCsdSrtrur=rururwconcatszSQLCoreOperations.concatcCsdSrtrur=rururwrPscCsdSrtrur=rururwrPr?rzBinaryExpression[bool])rescaperscCsdSrtrurrrQrururwlikeszSQLCoreOperations.likecCsdSrtrurRrururwilikeszSQLCoreOperations.ilikezBinaryExpression[Any]cCsdSrtrur=rururw bitwise_xorr?zSQLCoreOperations.bitwise_xorcCsdSrtrur=rururw bitwise_orr?zSQLCoreOperations.bitwise_orcCsdSrtrur=rururw bitwise_andr?zSQLCoreOperations.bitwise_andcCsdSrtrurrururw bitwise_notr?zSQLCoreOperations.bitwise_notcCsdSrtrur=rururwbitwise_lshiftr?z SQLCoreOperations.bitwise_lshiftcCsdSrtrur=rururwbitwise_rshiftr?z SQLCoreOperations.bitwise_rshiftz=Union[Iterable[Any], BindParameter[Any], roles.InElementRole]cCsdSrtrur=rururwin_szSQLCoreOperations.in_cCsdSrtrur=rururwnot_inszSQLCoreOperations.not_incCsdSrtrur=rururwnotin_szSQLCoreOperations.notin_cCsdSrtrurRrururwnot_likeszSQLCoreOperations.not_likecCsdSrtrurRrururwnotlikeszSQLCoreOperations.notlikecCsdSrtrurRrururw not_ilikeszSQLCoreOperations.not_ilikecCsdSrtrurRrururwnotilikeszSQLCoreOperations.notilikecCsdSrtrur=rururwis_r?zSQLCoreOperations.is_cCsdSrtrur=rururwis_notr?zSQLCoreOperations.is_notcCsdSrtrur=rururwisnotr?zSQLCoreOperations.isnot)rrQ autoescaperscCsdSrtrurrrQrerururw startswithszSQLCoreOperations.startswithcCsdSrtrurfrururw istartswithszSQLCoreOperations.istartswithcCsdSrtrurfrururwendswithszSQLCoreOperations.endswithcCsdSrtrurfrururw iendswithszSQLCoreOperations.iendswithrcKsdSrtrurrururwcontainsr?zSQLCoreOperations.containscKsdSrtrurrururw icontainsr?zSQLCoreOperations.icontains)rrrscKsdSrtru)rrrrururwmatchr?zSQLCoreOperations.match)patternflagsrscCsdSrtru)rrnrorururw regexp_matchszSQLCoreOperations.regexp_match)rn replacementrorscCsdSrtru)rrnrqrorururwregexp_replacesz SQLCoreOperations.regexp_replacecCsdSrtrurrururwdescr?zSQLCoreOperations.desccCsdSrtrurrururwascr?zSQLCoreOperations.asccCsdSrtrurrururw nulls_firstr?zSQLCoreOperations.nulls_firstcCsdSrtrurrururw nullsfirst r?zSQLCoreOperations.nullsfirstcCsdSrtrurrururw nulls_last r?zSQLCoreOperations.nulls_lastcCsdSrtrurrururw nullslastr?zSQLCoreOperations.nullslastCollationClause) collationrscCsdSrtrurrzrururwcollater?zSQLCoreOperations.collate)cleftcright symmetricrscCsdSrtru)rr}r~rrururwbetweenszSQLCoreOperations.betweenz _SQO[_T_co]rrscCsdSrtrurrururwdistinctr?zSQLCoreOperations.distinctzCollectionAggregate[Any]cCsdSrtrurrururwany_r?zSQLCoreOperations.any_cCsdSrtrurrururwall_r?zSQLCoreOperations.all_z _SQO[_NMT]zColumnElement[_NMT]cCsdSrtrur=rururw__add__!szSQLCoreOperations.__add__cCsdSrtrur=rururwr'scCsdSrtrur=rururwr-scCsdSrtrur=rururwr0r?cCsdSrtrur=rururw__radd__2szSQLCoreOperations.__radd__cCsdSrtrur=rururwr5scCsdSrtrur=rururwr8r?cCsdSrtrur=rururw__sub__:szSQLCoreOperations.__sub__cCsdSrtrur=rururwr@scCsdSrtrur=rururwrCr?cCsdSrtrur=rururw__rsub__EszSQLCoreOperations.__rsub__cCsdSrtrur=rururwrKscCsdSrtrur=rururwrNr?cCsdSrtrur=rururw__mul__PszSQLCoreOperations.__mul__cCsdSrtrur=rururwrVscCsdSrtrur=rururwrYr?cCsdSrtrur=rururw__rmul__[szSQLCoreOperations.__rmul__cCsdSrtrur=rururwrascCsdSrtrur=rururwrdr?cCsdSrtrur=rururw__mod__fszSQLCoreOperations.__mod__cCsdSrtrur=rururwriscCsdSrtrur=rururwrlr?cCsdSrtrur=rururw__rmod__nszSQLCoreOperations.__rmod__cCsdSrtrur=rururwrqscCsdSrtrur=rururwrtr?zColumnElement[_NUMERIC]cCsdSrtrur=rururw __truediv__vszSQLCoreOperations.__truediv__z _SQO[_NT]zColumnElement[_NT]cCsdSrtrur=rururwr{scCsdSrtrur=rururwr~scCsdSrtrur=rururwrr?cCsdSrtrur=rururw __rtruediv__szSQLCoreOperations.__rtruediv__cCsdSrtrur=rururwrscCsdSrtrur=rururwrr?cCsdSrtrur=rururw __floordiv__szSQLCoreOperations.__floordiv__cCsdSrtrur=rururwrscCsdSrtrur=rururwrr?cCsdSrtrur=rururw __rfloordiv__szSQLCoreOperations.__rfloordiv__cCsdSrtrur=rururwrscCsdSrtrur=rururwrr?)..)....)rFNN)rN)N)N)N)N)N)N)NF)NF)NF)NF)N)N)F)Rrrrrr%rr<non_memoized_propertyrr0r1rr.r:r>r@rrArBrCrDrErFrGrHrIrJrKrMrNrOrPrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrgrhrirjrkrlrmrprrrsrtrurvrwrxr|rrrrrrrrrrrrrrrrrurururwr+'s^      r+c@seZdZdZdZdS)SQLColumnExpressionaA type that may be used to indicate any SQL column element or object that acts in place of one. :class:`.SQLColumnExpression` is a base of :class:`.ColumnElement`, as well as within the bases of ORM elements such as :class:`.InstrumentedAttribute`, and may be used in :pep:`484` typing to indicate arguments or return values that should behave as column expressions. .. versionadded:: 2.0.0b4 ruNrrrrrrurururwrsrc @seZdZUdZdZdZded<ded<dZdZded <dZ dZ e Z d ed <e jd d ddZe jdd ddZdZded<ejdd ddZedd ddZedd ddZedd ddZdZdZdZdZded<edd d!d"d#d$Zedd%d&d"d'd$Zdd%d&d"d(d$Zed)d)d*d+d,Z ed!d!d*d-d,Z d&d d.d,Z d/ed0<e!sxe jd/d d1d2Z"ejd3d d4d5Z#d6d7Z$d8d9d:d;d<Z%d=d9d9d&d>d?d@Z&d=d9d9d&d>dAdBZ'dd=d9dCddDdEdFdGZ(ed&d dHdIZ)edJd dKdLZ*e jdMd dNdOZ+e jdMd dPdQZ,e jdMd dRdSZ-d d dTdUZ.d&ddVdWdXZ/d&ddYdZd[Z0ejdd d\d]Z1ejdd d^d_Z2ddddd`daddddbd9dcdddedfZ3dgdhdidjdkZ4ddldmdndoZ5dddpdqdrdsdtZ6e jd8d dudvZ7e jdqd dwdxZ8ee 9dydzd8d d{d|Z:ee 9dyd}d8d d~dZ;dd8dddZddqdddZ?dS)r aRepresent a column-oriented SQL expression suitable for usage in the "columns" clause, WHERE clause etc. of a statement. While the most familiar kind of :class:`_expression.ColumnElement` is the :class:`_schema.Column` object, :class:`_expression.ColumnElement` serves as the basis for any unit that may be present in a SQL expression, including the expressions themselves, SQL functions, bound parameters, literal expressions, keywords such as ``NULL``, etc. :class:`_expression.ColumnElement` is the ultimate base class for all such elements. A wide variety of SQLAlchemy Core functions work at the SQL expression level, and are intended to accept instances of :class:`_expression.ColumnElement` as arguments. These functions will typically document that they accept a "SQL expression" as an argument. What this means in terms of SQLAlchemy usually refers to an input which is either already in the form of a :class:`_expression.ColumnElement` object, or a value which can be **coerced** into one. The coercion rules followed by most, but not all, SQLAlchemy Core functions with regards to SQL expressions are as follows: * a literal Python value, such as a string, integer or floating point value, boolean, datetime, ``Decimal`` object, or virtually any other Python object, will be coerced into a "literal bound value". This generally means that a :func:`.bindparam` will be produced featuring the given value embedded into the construct; the resulting :class:`.BindParameter` object is an instance of :class:`_expression.ColumnElement`. The Python value will ultimately be sent to the DBAPI at execution time as a parameterized argument to the ``execute()`` or ``executemany()`` methods, after SQLAlchemy type-specific converters (e.g. those provided by any associated :class:`.TypeEngine` objects) are applied to the value. * any special object value, typically ORM-level constructs, which feature an accessor called ``__clause_element__()``. The Core expression system looks for this method when an object of otherwise unknown type is passed to a function that is looking to coerce the argument into a :class:`_expression.ColumnElement` and sometimes a :class:`_expression.SelectBase` expression. It is used within the ORM to convert from ORM-specific objects like mapped classes and mapped attributes into Core expression objects. * The Python ``None`` value is typically interpreted as ``NULL``, which in SQLAlchemy Core produces an instance of :func:`.null`. A :class:`_expression.ColumnElement` provides the ability to generate new :class:`_expression.ColumnElement` objects using Python expressions. This means that Python operators such as ``==``, ``!=`` and ``<`` are overloaded to mimic SQL operations, and allow the instantiation of further :class:`_expression.ColumnElement` instances which are composed from other, more fundamental :class:`_expression.ColumnElement` objects. For example, two :class:`.ColumnClause` objects can be added together with the addition operator ``+`` to produce a :class:`.BinaryExpression`. Both :class:`.ColumnClause` and :class:`.BinaryExpression` are subclasses of :class:`_expression.ColumnElement`: .. sourcecode:: pycon+sql >>> from sqlalchemy.sql import column >>> column('a') + column('b') >>> print(column('a') + column('b')) {printsql}a + b .. seealso:: :class:`_schema.Column` :func:`_expression.column` Zcolumn_elementFrn primary_keyOptional[ColumnElement[_T]]rT_insert_sentinelzAbstractSet[ForeignKey] foreign_keysList[ColumnElement[Any]]rcCsgSrtrurrururw_proxies!szColumnElement._proxiesrcCsdS)a}The named label that can be used to target this column in a result set in a "table qualified" context. This label is almost always the label used when rendering AS