1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
U
¸ý°d’Cã?@s\UdZddlmZddlZddlmZddlmZddlmZddlmZddlmZdd    lm    Z    dd
lm
Z
dd lm Z d d l m Z d dl mZd dl mZd dl mZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZd dlmZddl mZdd l m Z ej!d!ed"Z"ej#r˜d d#lm$Z$d d$lm%Z%d d%lm&Z&dd&e'dƒe(fd&dd'œd(d)d*d+d,d-d,d.d*d/d0œ
d1d2„Z)dnd(d3d*d,d4d*d(d5œd6d7„Z*d&dd8œd(d)d9d,d:d*d;d5œd<d=„Z+d(d)d*d*d(d>œd?d@„Z,d(d)dAd*d(dBœdCdD„Z-d(d)dEd)d*d(dFœdGdH„Z.d(d)d*d*d(d>œdIdJ„Z/d(d)d*d*dKdLœdMdN„Z0d(d)d*d(dOœdPdQ„Z1d(d)d*d(dOœdRdS„Z2d(d)d*d(dOœdTdU„Z3d(d)d*d*d(d>œdVdW„Z4d(d)d*d(dOœdXdY„Z5d(d)d*d*d*d(dZœd[d\„Z6d]d)d^d*d]d_œd`da„Z7d]d)d*dbd*d(dcœddde„Z8d(d)d*d*dbd*d(dfœdgdh„Z9e,e j:fe,e j:fe1e j:fe+e j:fe+e j:fe+e j:fe+e j:fe+e j:fe+e j:fe+e j:fe+e j:fe3e j:fe+e j:fe+e j:fe+e j:fe+e j:fe*e j:fe+e j:fe+e j:fe+e j:fe-e  ;diej<i¡fe-e  ;diej=i¡fe)e  ;djej>i¡fe)e  ;djej?i¡fe)e  ;djej@i¡fe)e  ;djejAi¡fe)e  ;djejBi¡fe)e  ;djejCi¡fe)e  ;djejDi¡fe)e  ;djejEi¡fe)e  ;djejFi¡fe)e  ;djejGi¡fe)e  ;djejHi¡fe)e  ;djejIi¡fe)e  ;djejJi¡fe)e  ;djejKi¡fe)e  ;djejLi¡fe)e  ;djejMi¡fe)e  ;djejNi¡fe)e  ;djejOi¡fe-e  ;diejPi¡fe-e  ;diejQi¡fe-e  ;diejRi¡fe-e  ;diejSi¡fe.e  ;djejTi¡fe.e  ;djejUi¡fe)e  ;djejVi¡fe)e  ;djejWi¡fe7e j:fe4e j:fe4e j:fe5e j:fe6e j:fe6e j:fe2e j:fe/e j:fe0e j:fe0e j:fe0e j:fe8e j:fe8e j:fe9e j:fdkœ>ZXdleYdm<dS)oz5Default implementation of SQL comparison operations.
é)Ú annotationsN)ÚAny)ÚCallable)ÚDict)ÚNoReturn)ÚOptional)ÚTuple)ÚType)ÚUnioné)Ú    coercions)Ú    operators)Úroles)Útype_api)Úand_)ÚBinaryExpression)Ú ClauseElement)ÚCollationClause)ÚCollectionAggregate)ÚExpressionClauseList)ÚFalse_)ÚNull)ÚOperatorExpression)Úor_)ÚTrue_)ÚUnaryExpression)Ú OperatorTypeé)Úexc)ÚutilÚ_T)Úbound)Ú ColumnElement)Ú    custom_op)Ú
TypeEngineF)Ú    negate_opÚreverseÚ_python_is_typesÚ _any_all_exprÚ result_typezColumnElement[Any]rrzOptional[OperatorType]ÚboolzTuple[Type[Any], ...]zOptional[TypeEngine[bool]]zOperatorExpression[bool])
ÚexprÚopÚobjr%r&r'r(r)ÚkwargsÚreturnc    Ksj|dkrtj}t||tttfƒr |tjtjfkrdt|t    ttfƒrdt
j |t   tj|¡||||dS|tjtjfkr”t
j |t   tj|¡||||dS|r®t j tj|||d}np|tjtjfkràt
j |t   tj|¡tjtj|dS|tjtjfkrt
j |t   tj|¡tjtj|dSt d¡‚nt j tj|||d}|rPt
j ||||||dSt
j ||||||dSdS)N)Útype_ÚnegateÚ    modifiers)ÚelementÚoperatorr+)r1r0z~Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False)rÚ BOOLEANTYPEÚ
isinstancerrrr ÚeqÚner*rÚ_construct_for_opr ÚexpectrZ ConstExprRoleÚis_distinct_fromÚis_not_distinct_fromÚis_Úis_notrÚ ArgumentErrorÚBinaryElementRole)    r+r,r-r%r&r'r(r)r.©rAúXd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/sql/default_comparator.pyÚ_boolean_compare3s˜ ÿ úþ úÿ û ûÿÿú    úrCzcustom_op[Any]zOptional[TypeEngine[Any]])r+r,r-r&r)Úkwr/cKs<|dkr"|jr|j}n |jr"tj}t|||f||dœ|—ŽS)N©r&r))Ú return_typeZ is_comparisonrr5Ú_binary_operate)r+r,r-r&r)rDrArArBÚ_custom_op_operate’sÿÿÿrHrEzroles.BinaryElementRole[Any]zOptional[TypeEngine[_T]]zOperatorExpression[_T]c    Ks^tjtj|||d}|r$||}}n
||}}|dkrJ|j ||j¡\}}tj|||||dS)N©r+r4)r0r2)r r:rr@Z
comparatorZ_adapt_expressionrr9)    r+r,r-r&r)rDZ coerced_objÚleftÚrightrArArBrG¥s*
ÿ 
ÿÿrG)r+r,ÚotherrDr/cKs2|tjkrt||ƒS|tjkr(t||ƒStƒ‚dS©N)r rrÚNotImplementedError©r+r,rLrDrArArBÚ_conjunction_operateÂs
 
 
 
 
rPz2Callable[[ColumnElement[Any]], ColumnElement[Any]])r+r,ÚfnrDr/cKs||ƒSrMrA)r+r,rQrDrArArBÚ_scalarÍsrRr)r+r,Úseq_or_selectabler%rDr/cKsDtjtj|||d}d|jkr,|jd\}}t|||fd|i|—ŽS)NrIZin_opsr%)r r:rZ InElementRoleZ _annotationsrC)r+r,rSr%rDrArArBÚ_in_implÖs"ÿ
ÿÿÿrTcKsdt|jtjƒs,t|jtjƒrPt|jjtjƒrPtjtj    |||d}t
|||f|ŽSt |||f|ŽdS)NrI) r6ÚtyperZ    INDEXABLEZ TypeDecoratorZ impl_instancer r:rr@rGÚ_unsupported_implrOrArArBÚ _getitem_implès ÿ þýÿrWr)r+r,ÚargrDr/cOstd|jƒ‚dS)Nz1Operator '%s' is not supported on this expression)rNÚ__name__)r+r,rXrDrArArBrVøsÿrV)r+r,rDr/cKst|dƒr|jS| ¡SdS)z%See :meth:`.ColumnOperators.__inv__`.Únegation_clauseN)ÚhasattrrZZ_negate©r+r,rDrArArBÚ    _inv_impls
r]cKst|tj|jdS)z%See :meth:`.ColumnOperators.__neg__`.©r4r0)rr ÚnegrUr\rArArBÚ    _neg_impl sr`cKst|tj|jdS)z)See :meth:`.ColumnOperators.bitwise_not`.r^)rr Úbitwise_not_oprUr\rArArBÚ_bitwise_not_impls
ÿrbc    KsBt|tjtjtj||tjdftj|tjkr2tj    ntjdœ|—ŽS)z#See :meth:`.ColumnOperators.match`.rI)r)r%)
rCr Úmatch_opr r:rr@rZ    MATCHTYPEÚ not_match_oprOrArArBÚ _match_impls"üý    ÿô órecKst|tj|jdS)z&See :meth:`.ColumnOperators.distinct`.r^)rr Ú distinct_oprUr\rArArBÚ_distinct_impl4s
ÿrg)r+r,ÚcleftÚcrightrDr/c Ks\t|tjtjtjtjt    j
||tjdtjt    j
||tjddd||tj krPtj ntj |dS)z%See :meth:`.ColumnOperators.between`.rIF)Úgroup)r1r2) rrZ_construct_for_listr rrZNULLTYPEr r:rr@Ú
between_opÚnot_between_op)r+r,rhrirDrArArBÚ _between_impl=s2üüñÿérmzColumnElement[str]Ústr)r+r,Ú    collationrDr/cKs t ||¡SrM)rZ_create_collation_expression)r+r,rorDrArArBÚ _collate_impl`srpz Optional[str])r+r,ÚpatternÚflagsrDr/cKsP|dk    r tjtj||tjd}nd}t|||f||tjkr@tjntjdœ|—ŽS)NrI)rrr%)    r r:rr@r Úregexp_replace_oprCÚregexp_match_opÚnot_regexp_match_op)r+r,rqrrrDÚ
flags_exprrArArBÚ_regexp_match_implfs(üýÿùørw)r+r,rqÚ replacementrrrDr/cKsTtjtj||tjd}|dk    r6tjtj||tjd}nd}t|||f||dœ|—ŽS)NrI)rxrr)r r:rr@r rsrG)r+r,rqrxrrrDrvrArArBÚ_regexp_replace_impl‚s0üüÿÿÿryrQr%)>rrÚinvÚaddÚmulÚsubÚdivÚmodZbitwise_xor_opZ bitwise_or_opZbitwise_and_opraZbitwise_lshift_opZbitwise_rshift_opÚtruedivÚfloordivr#Zjson_path_getitem_opZjson_getitem_opZ    concat_opZany_opZall_opÚltÚler8ÚgtÚger7r;r<Úlike_opÚilike_opÚ not_like_opÚ not_ilike_opZ contains_opZ icontains_opZ startswith_opZistartswith_opZ endswith_opZ iendswith_opZdesc_opZasc_opZnulls_first_opZ nulls_last_opÚin_opÚ    not_in_opr=r>Zcollatercrdrfrkrlr_ÚgetitemÚlshiftÚrshiftÚcontainsrtrursz„Dict[str, Tuple[Callable[..., ColumnElement[Any]], util.immutabledict[str, Union[OperatorType, Callable[..., ColumnElement[Any]]]]]]Úoperator_lookup)FN)ZÚ__doc__Ú
__future__rÚtypingrrrrrrr    r
Úr r rrÚelementsrrrrrrrrrrrrrrrÚTypeVarr Ú TYPE_CHECKINGr"r#r$rUr*rCrHrGrPrRrTrWrVr]r`rbrergrmrprwryÚ
EMPTY_DICTZ immutabledictZ _create_anyZ _create_allr…r„r7rƒr‚r8r<r;rˆr‰r†r‡Znot_contains_opZnot_icontains_opZnot_startswith_opZnot_istartswith_opZnot_endswith_opZnot_iendswith_opZ _create_descZ _create_ascZ_create_nulls_firstZ_create_nulls_lastr‹rŠr=r>rÚ__annotations__rArArArBÚ<module>sP                               
÷$cûú      
    #'þþþþþþþþþþþþþþþþþþþþþþ€ø