m %Gc^@sdZdklZlZlZlZlZdklZdk Z dk Z dk Z dk Z e i dddddd d d gZeid d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhg]Zeie ie ie idiZeie idjZdkeifdlYZdmeifdnYZdoeifdpYZdqefdrYZdsefdtYZdueifdvYZdwe fdxYZ!dS(yskdefines ANSI SQL operations. Contains default implementations for the abstract objects in the sql module.(sschemassqlsenginesutilssql_util(sdefaultNt CURRENT_TIMEtCURRENT_TIMESTAMPt CURRENT_DATEt LOCALTIMEtLOCALTIMESTAMPt CURRENT_USERt SESSION_USERtUSERtalltanalysetanalyzetandtanytarraytastasct asymmetrict authorizationtbetweentbinarytbothtcasetcasttchecktcollatetcolumnt constrainttcreatetcrosst current_datet current_rolet current_timetcurrent_timestampt current_usertdefaultt deferrabletdesctdistincttdotelsetendtexcepttfalsetfortforeigntfreezetfromtfulltgranttgroupthavingtiliketint initiallytinnert intersecttintotistisnulltjointleadingtlefttliketlimitt localtimetlocaltimestamptnaturaltnewtnottnotnulltnulltofftoffsettoldtontonlytortordertoutertoverlapstplacingtprimaryt referencestrighttselectt session_usertsimilartsomet symmetricttabletthenttottrailingttruetuniontuniquetusertusingtverbosetwhentwheres_$t$t ANSIDialectcBsJtZedZdZdZdZdZdZdZ RS(NcKs2tt|i||i|_||_dS(N(tsuperRftselft__init__tkwargstpreparertidentifier_preparertcache_identifiers(RhRmRj((t6/home/holguin2/public_html/spyce/sqlalchemy/ansisql.pyRi scCs ghfS(N((Rh((Rntcreate_connect_args%scCsdS(N(tNone(Rh((Rntdbapi(scOs t||S(N(tANSISchemaGeneratortargstparams(RhRsRt((Rntschemagenerator+scOs t||S(N(tANSISchemaDropperRsRt(RhRsRt((Rnt schemadropper.scKst||||S(N(t ANSICompilerRht statementt parametersRj(RhRyRzRj((Rntcompiler1scCs t|S(sreturn an IdenfifierPreparer. This object is used to format table and column names including proper quoting and case conventions.N(tANSIIdentifierPreparerRh(Rh((RnRk4s( t__name__t __module__tTrueRiRoRqRuRwR{Rk(((RnRfs      RxcBstZdZedZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,d*Z-RS(+sbdefault implementation of Compiled, which compiles ClauseElements into ANSI-compliant SQL strings.cKstii|||||h|_h|_ h|_ h|_ g|_ h|_ t|_t|_d|_|i|_|i|_g|_|i|_dS(sconstructs a new ANSICompiler object. dialect - Dialect to be used statement - ClauseElement to be compiled parameters - optional dictionary indicating a set of bind parameters specified with this Compiled object. These parameters are the "default" key/value pairs when the Compiled is executed, and also may affect the actual compilation, as in the case of an INSERT where the actual columns inserted will correspond to the keys present in the parameters.s:%sN(tsqltCompiledRiRhtdialectRyRzRjtbindstfromstwhereststringst select_stackttypemaptFalsetisinserttisupdatet bindtemplatet paramstylet positionalt positiontupRlRk(RhRRyRzRj((RnRi<s             csjd}|idjo0ti|d|i|i|i|i]sitqmarkt?tformats%stnumericicsdcd7n|i|i<}|o|d|7}n||i>|7}||i?|7}t@|d tAod |d |iB|q>Wt_i|}d}dii|idtig}|D]|iidq~ddd tig}|D]||d q0~dd}|i|R;R3((RhR3RRnt visit_inserts"  B  c sghdtifdY}|}xg|iiD]Ytti o@i djpi i iddjoi|q>q>Wt_i|}d}dii|idtig}|D]1|diid|dfq~d }|io|d i|i7}n|i|t update_stmtRYRR R@RhRzRpRRRARRRBRCR;RkRRR;RRRRRR( RhRGRCRRERR>R;RR3((RhR3RRnt visit_updates"  B  l c Cs|idjoT|idjoDg}|iiD](}||ti |i d|i fq1~Sn|idjo h}n|ii }|idj o4x1|ii D]\} }|i| |qWnx*|i D]\} }|i| |qWh}xo|i D]a\} } t| tio| ||  D       "cCsRd|ii|i}|io|d|i|i7}n||i|