Files
serveur-d-authentification/venv/lib/python3.10/site-packages/sqlparse/__pycache__/sql.cpython-310.pyc

206 lines
21 KiB
Plaintext
Raw Normal View History

o
2026-09-08 11:07:02 +00:00
l<><6C>j<EFBFBD>Q<00>@s<>dZddlZddlmZddlmZmZGdd<06>d<06>ZGdd<08>d<08>Z Gd d
<EFBFBD>d
e <09>Z
Gd d <0C>d e
<EFBFBD>Z Gd d<0E>dee
<EFBFBD>Z Gdd<10>de
<EFBFBD>Z Gdd<12>de
<EFBFBD>ZGdd<14>de
<EFBFBD>ZGdd<16>de
<EFBFBD>ZGdd<18>de
<EFBFBD>ZGdd<1A>de
<EFBFBD>ZGdd<1C>de
<EFBFBD>ZGdd<1E>de
<EFBFBD>ZGdd <20>d e
<EFBFBD>ZGd!d"<22>d"e
<EFBFBD>ZGd#d$<24>d$e
<EFBFBD>ZGd%d&<26>d&e
<EFBFBD>ZGd'd(<28>d(e
<EFBFBD>ZGd)d*<2A>d*ee
<EFBFBD>ZGd+d,<2C>d,e
<EFBFBD>ZGd-d.<2E>d.e
<EFBFBD>ZGd/d0<64>d0e
<EFBFBD>ZGd1d2<64>d2e
<EFBFBD>ZdS)3zFThis module contains classes representing syntactical elements of SQL.<2E>N<><01>tokens)<02>imt<6D> remove_quotesc@<00> eZdZdZdd<03>Zdd<05>ZdS)<07>NameAliasMixinz'Implements get_real_name and get_alias.cCs$|jtjdfd<02>\}}|j|dd<04>S)<05>7Returns the real name (object name) of this identifier.<2E>.<2E><01>mT)<01> real_name)<04> token_next_by<62>T<> Punctuation<6F>_get_first_name)<03>self<6C>dot_idx<64>_<>r<00>o/home/sorel/systeme_gestion_cerfig/serveur-d-authentification/venv/lib/python3.10/site-packages/sqlparse/sql.py<70> get_real_nameszNameAliasMixin.get_real_namecCsl|jtjdfd<02>\}}|dur|j|ddd<06>S|jtjd<07>\}}t|j<06>dkr2|dur4|jdd <09>SdSdS)
<EFBFBD>2Returns the alias for this identifier or ``None``.<2E>ASr
N<>T)<01>keywords<64><01>t<><00><01>reverse)r r<00>Keywordr<00>
Whitespace<EFBFBD>lenr)r<00>kw_idx<64>kwr<00>wsrrr<00> get_aliass <08>zNameAliasMixin.get_aliasN)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr&rrrrrs rc@sfeZdZdZdZdd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Z d d<0E>Z
ddd<11>Z dd<13>Z dd<15>Z dd<17>ZdS)<1A>Tokenz<6E>Base class for all other classes in this module.
It represents a single token and has two instance attributes:
``value`` is the unchanged value of the token and ``ttype`` is
the type of the token.
)<08>value<75>ttype<70>parent<6E>
normalized<EFBFBD>
is_keyword<EFBFBD>is_group<75> is_whitespace<63>
is_newlinecCsft|<02>}||_||_d|_d|_|tjv|_|jtjv|_ |jtj
v|_ |jr.|<02> <0C>|_ dS||_ dS)NF)<0E>strr,r-r.r1rr r0r!r2<00>Newliner3<00>upperr/)rr-r,rrr<00>__init__2s zToken.__init__cC<00>|jS<00>N<>r,<00>rrrr<00>__str__=sz Token.__str__cCsF|<00><00>}|<00><01>}|<02>d<01>r|<02>d<01>rdnd}djddt|<00>it<06><00><01>S)N<>'<27>"z"<{cls} {q}{value}{q} at 0x{id:2X}><3E>idr)<07>_get_repr_name<6D>_get_repr_value<75>
startswith<EFBFBD>endswith<74>formatr?<00>locals)r<00>clsr,<00>qrrr<00>__repr__Ds<02><06>zToken.__repr__cCst|j<01><01>d<01>dS)Nr <00><><EFBFBD><EFBFBD><EFBFBD>)r4r-<00>splitr;rrrr@LszToken._get_repr_namecCs2t|<00>}t|<01>dkr|dd<02>d}t<02>dd|<01>S)N<><00>z...z\s+<2B> )r4r"<00>re<72>sub)r<00>rawrrrrAOs zToken._get_repr_valueccs <00>|VdS)zResolve subgroups.Nrr;rrr<00>flattenUs<02>
z Token.flattenFcs<>|j|u}|r |dur |St|t<02>r|f}|r8|jrtjnd<02><00>fdd<04>|D<00>}|D] }|<05>|j<07>r5dSq*dS|jrBdd<04>|D<00>}|j|vS)alChecks whether the token matches the given arguments.
*ttype* is a token type as defined in `sqlparse.tokens`. If it does
not match, ``False`` is returned.
*values* is a list of possible values for this token. For match to be
considered valid, the token value needs to be in this list. For tokens
of type ``Keyword`` the comparison is case-insensitive. For
convenience, a single value can be given passed as a string.
If *regex* is ``True``, the given values are treated as regular
expressions. Partial matches are allowed. Defaults to ``False``.
Nrc3s<00>|] }t<00>|<01><00>VqdSr9)rN<00>compile<6C><02>.0<EFBFBD>v<><01>flagrr<00> <genexpr>os<02>zToken.match.<locals>.<genexpr>TFcss<00>|]}|<01><00>VqdSr9)r6rSrrrrXws<02>)r-<00>
isinstancer4r0rN<00>
IGNORECASE<EFBFBD>searchr/)rr-<00>values<65>regex<65> type_matched<65>patternrrVr<00>matchYs

 <02>
z Token.matchcCs&|j}|rt||<01>r dS|j}|sdS)z<>Returns ``True`` if this token is within *group_cls*.
Use this method for example to check if an identifier is within
a function: ``t.within(sql.Function)``.
TF)r.rY)r<00> group_clsr.rrr<00>within{s
<04>z Token.withincCs
|j|kS)z<Returns ``True`` if this token is a direct child of *other*.<2E>r.)r<00>otherrrr<00> is_child_of<6F><00>
zToken.is_child_ofcCs$|j}|r||kr dS|j}|sdS)z7Returns ``True`` if *other* is in this tokens ancestry.TFrc)rrdr.rrr<00> has_ancestor<6F>s<04>zToken.has_ancestorN<72>F)r'r(r)r*<00> __slots__r7r<rHr@rArQr`rbrergrrrrr+'s 
" r+cseZdZdZdZd?<3F>fdd<05> Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z d@dd<11>Z
dd<13>Z dd<15>Z dd<17>Z edd<19><00>ZdAdd<1C>ZdBdd<1F>ZdCd!d"<22>Zd#d$<24>Zd%d&<26>ZdBd'd(<28>ZdDd)d*<2A>ZdEd+d,<2C>Z  dBd-d.<2E>Zd/d0<64>ZdFd1d2<64>Zd3d4<64>Zd5d6<64>Zd7d8<64>Zd9d:<3A>Zd;d<<3C>Z  dGd=d><3E>Z <20>Z!S)H<> TokenListzwA group of tokens.
It has an additional instance attribute ``tokens`` which holds a
list of child-tokens.
rNcs:|pg<00>_<00>fdd<02><08>jD<00>t<01><00>dt<03><00><01>d<03>_dS)Ncsg|]}t|d<00><00><03>qSrc)<01>setattr<74>rT<00>tokenr;rr<00>
<listcomp><3E><00>z&TokenList.__init__.<locals>.<listcomp>T)r<00>superr7r4r1)rr<00><01> __class__r;rr7<00>s

zTokenList.__init__cCsd<01>dd<03>|<00><01>D<00><01>S)N<>css<00>|]}|jVqdSr9r:rlrrrrX<00>s<02>z$TokenList.__str__.<locals>.<genexpr>)<02>joinrQr;rrrr<<00>szTokenList.__str__cCs
t|j<01>Sr9)<02>iterrr;rrr<00>__iter__<5F><00>
zTokenList.__iter__cCs
|j|Sr9r)r<00>itemrrr<00> __getitem__<5F>rwzTokenList.__getitem__cCs
t|<00>jSr9)<02>typer'r;rrrr@<00>rwzTokenList._get_repr_namerrsc Cs<>t|j<01>}t|j<01>D]Y\}}|<07><03>}|<07><04>} ||dk}
|
r dnd} | <09>d<04>r.| <09>d<04>r.dnd} t|<04>| <0B>|<06>d|<08>d| <0C>| <09>| <0C><00> |d<07>|jrc|dusQ||krc|
rUd nd
} |<07> ||d||| <00>q
dS) zPretty-print the object tree.rz`- z|- r=r>rM)<01>fileNz z| )
r"r<00> enumerater@rArBrC<00>printr1<00> _pprint_tree)r<00> max_depth<74>depth<74>f<>_pre<72> token_count<6E>idxrmrFr,<00>last<73>prerG<00>
parent_prerrrr~<00>s
  , <02><04>zTokenList._pprint_treecCsDd}|<00><00>D]}|t|j<02>}||kr|kr|S|}qdS)z-Returns the token that is on position offset.rN)rQr"r,)r<00>offsetr<74>rm<00>endrrr<00>get_token_at_offset<65>s <02><04>zTokenList.get_token_at_offsetccs.<00>|jD]}|jr|<01><02>EdHq|VqdS)znGenerator yielding ungrouped tokens.
This method is recursively called for all child tokens.
N)rr1rQ<00>rrmrrrrQ<00>s <02>
<04>zTokenList.flattenccs<00>|jD]}|jr |VqdSr9)rr1r<>rrr<00> get_sublists<74>s <02>
<02><04>zTokenList.get_sublistscCr8r9rr;rrr<00>_groupable_tokens<6E>szTokenList._groupable_tokensFc Cs<>|durdSt|ttf<02>s|f}|r!|dusJ<00>t|ddd<03>}n|dur*t|j<05>}t||<03>}|D]}|j|}|D]}||<07>rH||fSq:q1dS)znext token that match functionsNrrI<00>NN)rY<00>list<73>tuple<6C>ranger"r) r<00>funcs<63>startr<74>r<00>indexesr<73>rm<00>funcrrr<00>_token_matching<6E>s$ 


<02><02>zTokenList._token_matchingTcs<00><00>fdd<02>}|<00>|<03>dS)z<>Returns the first child token.
If *skip_ws* is ``True`` (the default), whitespace
tokens are ignored.
if *skip_cm* is ``True`` (default: ``False``), comments are
ignored too.
c<00> <00>r|jp<0E>ot|tjtd<01> S<00>N)r<00>i<>r2rr<00>Comment<6E><01>tk<74><02>skip_cm<63>skip_wsrr<00>matcher<00>
<04>z&TokenList.token_first.<locals>.matcherr<00>r<>)rr<>r<>r<>rr<>r<00> token_first<73>s
zTokenList.token_firstrIcs"|d7}|<00><00><00><01>fdd<03>||<05>S)Nrcst|<00><00><01><02>Sr9)rr<><00>r<>r rrr<00><lambda>
sz)TokenList.token_next_by.<locals>.<lambda>r<>)rr<>r rr<>r<>rr<>rr szTokenList.token_next_bycCs2t|ttf<02>s
|fn|}dd<02>|D<00>}|<00>||<02>S)Ncsg|]<08><00>fdd<01><08>qS)cs
<00>|<00> Sr9rr<><00>r<>rrr<>s
z9TokenList.token_not_matching.<locals>.<listcomp>.<lambda>r)rTrr<>rrnroz0TokenList.token_not_matching.<locals>.<listcomp>)rYr<>r<>r<><00>rr<>r<>rrr<00>token_not_matching s zTokenList.token_not_matchingcCs|<00>||<02>dS)Nrr<>r<>rrr<00>token_matchingszTokenList.token_matchingcCs|j|||dd<02>S)z<>Returns the previous token relative to *idx*.
If *skip_ws* is ``True`` (the default) whitespace tokens are ignored.
If *skip_cm* is ``True`` comments are ignored.
``None`` is returned if there's no previous token.
T)<01>_reverse)<01>
token_next)rr<>r<>r<>rrr<00>
token_prevszTokenList.token_prevcs2|durdS|d7}<01><00>fdd<05>}|j|||d<06>S)z<>Returns the next token relative to *idx*.
If *skip_ws* is ``True`` (the default) whitespace tokens are ignored.
If *skip_cm* is ``True`` comments are ignored.
``None`` is returned if there's no next token.
Nr<4E>rcr<>r<>r<>r<>r<>rrr<>)r<>z%TokenList.token_next.<locals>.matcherrr<>)rr<>r<>r<>r<>r<>rr<>rr<>s
zTokenList.token_nextcCs0t|t<01>r|n|<00>|<02>}||j|d<01><00>|<01>S)zReturn list index of token.N)rY<00>int<6E> token_indexr<00>index)rrmr<>rrrr<>.szTokenList.token_indexc Cs<>|}|j|}||}|r1t||<01>r1|j|d|<07>}|} | j<00>|<08>|j|d|<07>=t|<02>| _n|j||<07>}||<08>} | g|j||<07><|| _|D]}
| |
_qI| S)z+Replace tokens by an instance of *grp_cls*.r)rrY<00>extendr4r,r.) r<00>grp_clsr<73>r<><00> include_endr<64><00> start_idx<64>end_idx<64> subtokens<6E>grprmrrr<00> group_tokens3s 
  zTokenList.group_tokenscCs,t|t<01>s
|<00>|<01>}||_|j<04>||<02>dS)zInserts *token* before *where*.N)rYr<>r<>r.r<00>insert)r<00>wherermrrr<00> insert_beforeQs

zTokenList.insert_beforecCsVt|t<01>s
|<00>|<01>}|j||d<01>\}}||_|dur"|j<05>|<02>dS|j<05>||<02>dS)zInserts *token* after *where*.<2E>r<>N)rYr<>r<>r<>r.r<00>appendr<64>)rr<>rmr<><00>nidx<64>next_rrr<00> insert_afterXs

zTokenList.insert_aftercCs |<00><00>duS)z(Returns ``True`` if an alias is present.N)r&r;rrr<00> has_aliascs zTokenList.has_aliascC<00>dS)rNrr;rrrr&g<00>zTokenList.get_aliascCs|<00><00>p|<00><01>S)aReturns the name of this identifier.
This is either it's alias or it's real name. The returned valued can
be considered as the name under which the object corresponding to
this identifier is known within the current statement.
)r&rr;rrr<00>get_namekszTokenList.get_namecCr<>)rNrr;rrrrtr<>zTokenList.get_real_namecCs:|jtjdfd<02>\}}|<00>|<01>\}}|durt|j<05>SdS)ztReturn name of the parent object if any.
A parent object is identified by the first occurring dot.
r r
N)r rrr<>rr,)rrr<00>prev_rrr<00>get_parent_namexszTokenList.get_parent_namecCs<>|r |j|d<01>n|j}|rt|<05>n|}tjtjtjjg}|r%|<06>tj<08>|D]#}|j |vr5t
|j <0B>St |t tf<02>rJ|rD|<07><0F>S|<07><10>Sq'dS)z/Returns the name of the first token with a nameN)r<00>reversedr<00>Name<6D>Wildcard<72>String<6E>Symbolr<6C>r r-rr,rY<00>
Identifier<EFBFBD>Functionrr<>)rr<>rrr r<00>typesrmrrrr<00>s 
<02><04>zTokenList._get_first_namer9)NrNrs)rNF)TF)NNNrIN)TFF)r)T)NFFF)"r'r(r)r*rir7r<rvryr@r~r<>rQr<><00>propertyr<79>r<>r<>r r<>r<>r<>r<>r<>r<>r<>r<>r<>r&r<>rr<>r<00> __classcell__rrrqrrj<00>sF
  






<EFBFBD>
   <12>rjc@<00>eZdZdZdd<03>ZdS)<05> StatementzRepresents a SQL statement.cCs<>|jdd<02>}|dur dS|jtjjtjjfvr|jS|jtjjkrU|<00>|<01>}|durU|j |dd<05>\}}t
|t t f<02>rQ|j |dd<05>\}}|durQ|jtjjkrQ|jS|dus*dS)aMReturns the type of a statement.
The returned value is a string holding an upper-cased reprint of
the first DML or DDL keyword. If the first token in this group
isn't a DML or DDL keyword "UNKNOWN" is returned.
Whitespaces and comments at the beginning of the statement
are ignored.
T)r<>N<>UNKNOWNr<4E>) r<>r-rr <00>DML<4D>DDLr/<00>CTEr<45>r<>rYr<><00>IdentifierList)rrm<00>tidxrrr<00>get_type<70>s

<08>
zStatement.get_typeN)r'r(r)r*r<>rrrrr<><00><00> r<>c@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) r<>zNRepresents an identifier.
Identifiers may have aliases or typecasts.
cCs|jtjd<01>\}}|duS)z7Return ``True`` if this identifier contains a wildcard.rN)r rr<>)rrrmrrr<00> is_wildcard<72>szIdentifier.is_wildcardcCs6|jtjdfd<02>\}}|j|dd<04>\}}|r|jSdS)z<Returns the typecast or ``None`` of this object as a string.z::r
Fr<46>N)r rrr<>r,)r<00>midx<64>markerr<72>r<>rrr<00> get_typecast<73>szIdentifier.get_typecastcCs"|jtjjd<01>\}}|r|jSdS)z5Returns the ordering or ``None`` as uppercase string.rN)r rr <00>Orderr/)rr<00>orderingrrr<00> get_ordering<6E>szIdentifier.get_orderingccs,<00>|jD]}t|t<02>r|jdd<02>VqdS)z(Returns an iterator of index token listsrrIN)rrY<00>SquareBracketsr<73>rrr<00>get_array_indices<65>s <02>

<02><04>zIdentifier.get_array_indicesN)r'r(r)r*r<>r<>r<>r<>rrrrr<><00>s  r<>c@r<>)r<>z.A list of :class:`~sqlparse.sql.Identifier`'s.ccs,<00>|jD]}|js|<01>tjd<01>s|VqdS)zkReturns the identifiers.
Whitespaces and punctuations are not included in this generator.
<20>,N)rr2r`rrr<>rrr<00>get_identifiers<72>s <02>
<02><04>zIdentifierList.get_identifiersN)r'r(r)r*r<>rrrrr<><00>r<>r<>c@s<eZdZdZejjdfejdfgZej j
dfZ ejdfZ dS)<05> TypedLiteralzEA typed literal, such as "date '2001-09-28'" or "interval '2 hours'".N<> TIMESTAMP)<06>DAY<41>HOUR<55>MINUTE<54>MONTH<54>SECOND<4E>YEAR) r'r(r)r*rr<><00>Builtinr <00>M_OPENr<4E><00>Single<6C>M_CLOSE<53>M_EXTENDrrrrr<><00>s
 r<>c@<00>0eZdZdZejdfZejdfZedd<05><00>Z dS)<07> ParenthesiszTokens between parenthesis.<2E>(<28>)cC<00>|jdd<02>S<00>NrrIrr;rrrr<><00><00>zParenthesis._groupable_tokensN<73>
r'r(r)r*rrr<>r<>r<>r<>rrrrr<><00><00> 

r<>c@r<>)r<>zTokens between square brackets<74>[<5B>]cCr<>r<>rr;rrrr<><00>r<>z SquareBrackets._groupable_tokensNr<4E>rrrrr<><00>r<>r<>c@<00>eZdZdZdS)<03>
Assignmentz An assignment like 'var := val;'N<>r'r(r)r*rrrrr<><00>r<>c@<00>$eZdZdZejdfZejdfZdS)<05>Ifz7An 'if' clause with possible 'else if' or 'else' parts.<2E>IFzEND IFN<46>r'r(r)r*rr r<>r<>rrrrr<00>
rc@r)<05>Forz A 'FOR' loop.)<02>FOR<4F>FOREACHzEND LOOPNrrrrrr rrc@s(eZdZdZedd<03><00>Zedd<05><00>ZdS)<07>
Comparisonz/A comparison used for example in WHERE clauses.cC<00>
|jdS<00>Nrrr;rrr<00>leftrfzComparison.leftcCr )NrIrr;rrr<00>rightrfzComparison.rightN)r'r(r)r*r<>r rrrrrr
s 
r
c@r<>)r<>z
A comment.cCs|jo |jdjtjjkSr )rr-rr<><00> Multiliner;rrr<00> is_multiline!szComment.is_multilineN)r'r(r)r*rrrrrr<>r<>r<>c@r)<05>WherezA WHERE clause.<2E>WHERE)
<EFBFBD>ORDER BYzGROUP BY<42>LIMIT<49>UNIONz UNION ALL<4C>EXCEPT<50> INTERSECT<43>HAVING<4E> RETURNING<4E>INTONrrrrrr%rrc@seZdZdZejdfZdS)<04>OverzAn OVER clause.<2E>OVERN)r'r(r)r*rr r<>rrrrr-src@r)<05>HavingzA HAVING clause.r)rrNrrrrrr2rrc@s.eZdZdZejdfZejdfZddd<06>ZdS) <09>CasezAA CASE statement with one or more WHEN and possibly an ELSE part.<2E>CASE<53>ENDFcCs<>d}d}g}|}|jD]n}|<06>tjd<03>rq |r|jtjvrq |<06>tjd<04>r/|<04>ggf<02>|}n$|<06>tjd<05>r9|}n|<06>tjd<06>rJ|<04>dgf<02>|}n |<06>tjd<08>rSd}|r^|s^|<04>ggf<02>||krl|d d
<00>|<06>q ||kry|d d<00>|<06>q |S) zeReturns a list of 2-tuples (condition, value).
If an ELSE exists condition is None.
rrr<00>WHEN<45>THEN<45>ELSENr rIr)rr`rr r-r!r<>)rr<><00> CONDITION<4F>VALUE<55>ret<65>modermrrr<00> get_cases=s6
<02>zCase.get_casesNrh) r'r(r)r*rr r<>r<>r(rrrrr8s


rc@r)r<>zA function or procedure call.cCsZ|jtd<01>d}g}|jD]}t|t<04>r|<03><05>St|ttt ft
j d<03>r*|<02> |<03>q |S)zReturn a list of parameters.<2E>r<>r)r<>r) r r<>rrYr<>r<>rr<>r<>r<>r<00>Literalr<6C>)r<00> parenthesis<69>resultrmrrr<00>get_parametersps

  <06>
<02>zFunction.get_parameterscCs"|jtd<01>}|s
dS|djdS)zReturn the window if it exists.r)NrrI)r rr)r<00> over_clauserrr<00>
get_window|s zFunction.get_windowN)r'r(r)r*r-r/rrrrr<>ms r<>c@r)<05>BeginzA BEGIN/END block.<2E>BEGINr Nrrrrrr0<00>rr0c@r<>)<03> OperationzGrouping of operationsNrrrrrr2<00>rr2c@r<>)<03>ValueszGrouping of valuesNrrrrrr3<00>rr3c@r<>)<03>CommandzGrouping of CLI commands.Nrrrrrr4<00>rr4)r*rN<00>sqlparserr<00>sqlparse.utilsrrrr+rjr<>r<>r<>r<>r<>r<>r<>rrr
r<>rrrrr<>r0r2r3r4rrrr<00><module>s8 o~( 

 5