WOc:@sdZddkZddkZddklZddklZlZddkl Z ddk l Z l Z ddkl ZddkZeeef\aZaeeef\aaadd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9g2Zd:Zd;Zed<Zeed=Zeegd>Zd?Zeed@ZeeedAZedBZ dCZ!dDZ"dEZ#dFZ$dGZ%eedHZ&dIZ'dJZ(dKZ)dLZ*dMZ+dNZ,dOZ-dPZ.dQZ/dRZ0edSZ1edTZ2dUZ3edVZ4edWZ5dXZ6eeeedYZ7edZZ8ed[Z9d\Z:d]e;fd^YZ<e<Z=e<d_eZ>d`e?fdaYZ@dbZAdcZBddZCdeZDdfZEdgZFdhZGdiZHdjZIdkZJdlZKdmZLeednZMdoZNedpZOdqZPd e fdrYZQdse;fdtYZRdue;fdvYZSdweSfdxYZTdyeTfdzYZUd eQeUfd{YZVd eiWfd|YZXd}eiYfd~YZZdeQfdYZ[de[fdYZ\deVfdYZ]deQfdYZ^deQfdYZ_deVfdYZ`deQfdYZadeaeVfdYZbdeVfdYZcdeVe\fdYZddeVfdYZedeVfdYZfdeVfdYZgdeVfdYZhdegfdYZide\fdYZjde\fdYZkdeVfdYZlde\fdYZmdeVfdYZndeReVfdYZodeRe\fdYZpeiqdZrde;fdYZsdelfdYZtd ese\fdYZudese\fdYZvdeQfdYZwdewfdYZxdexfdYZydexfdYZzd ewfdYZ{deQfdYZ|de|fdYZ}de|fdYZ~de|fdYZdS(sDefines the base components of SQL expression trees. All components are derived from a common base class :class:`~sqlalchemy.sql.expression.ClauseElement`. Common behaviors are organized based on class hierarchies, in some cases via mixins. All object construction from this package occurs via functions which in some cases will construct composite ``ClauseElement`` structures together, and in other cases simply return a single ``ClauseElement`` constructed directly. The function interface affords a more "DSL-ish" feel to constructing SQL expressions and also allows future class reorganizations. Even though classes are not constructed directly from the outside, most classes which have additional public methods are considered to be public (i.e. have no leading underscore). Other classes which are "semi-public" are marked with a single leading underscore; these classes usually have few or no public methods and are less guaranteed to stay the same in future releases. iN(t attrgetter(tutiltexc(t operators(t Visitabletcloned_traverse(ttypestAliast ClauseElementtColumnCollectiont ColumnElementtCompoundSelecttDeletet FromClausetInserttJointSelectt Selectablet TableClausetUpdatetaliastand_tasctbetweent bindparamtcasetcasttcolumntdeletetdesctdistincttexcept_t except_alltexiststextracttfunctmodifiertcollatetinsertt intersectt intersect_alltjointlabeltliteraltliteral_columntnot_tnulltor_toutparamt outerjointselecttsubqueryttablettexttuniont union_alltupdatecCst|dtiS(siReturn a descending ``ORDER BY`` clause element. e.g.:: order_by = [desc(table1.mycol)] R$(t_UnaryExpressionRtdesc_op(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR7scCst|dtiS(shReturn an ascending ``ORDER BY`` clause element. e.g.:: order_by = [asc(table1.mycol)] R$(R9Rtasc_op(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRAscCst|||dtS(svReturn an ``OUTER JOIN`` clause element. The returned object is an instance of :class:`~sqlalchemy.sql.expression.Join`. Similar functionality is also available via the ``outerjoin()`` method on any :class:`~sqlalchemy.sql.expression.FromClause`. left The left side of the join. right The right side of the join. onclause Optional criterion for the ``ON`` clause, is derived from foreign key relationships established between left and right otherwise. To chain joins together, use the ``join()`` or ``outerjoin()`` methods on the resulting ``Join`` object. tisouter(RtTrue(tlefttrighttonclause((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR1KscCst||||S(sReturn a ``JOIN`` clause element (regular inner join). The returned object is an instance of :class:`~sqlalchemy.sql.expression.Join`. Similar functionality is also available via the ``join()`` method on any :class:`~sqlalchemy.sql.expression.FromClause`. left The left side of the join. right The right side of the join. onclause Optional criterion for the ``ON`` clause, is derived from foreign key relationships established between left and right otherwise. To chain joins together, use the ``join()`` or ``outerjoin()`` methods on the resulting ``Join`` object. (R(R>R?R@R<((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR)dscKsed|jotidn|idt}t|d|d||}|o |iS|SdS(sSReturns a ``SELECT`` clause element. Similar functionality is also available via the ``select()`` method on any :class:`~sqlalchemy.sql.expression.FromClause`. The returned object is an instance of :class:`~sqlalchemy.sql.expression.Select`. All arguments which accept ``ClauseElement`` arguments also accept string arguments, which will be converted as appropriate into either ``text()`` or ``literal_column()`` constructs. columns A list of ``ClauseElement`` objects, typically ``ColumnElement`` objects or subclasses, which will form the columns clause of the resulting statement. For all members which are instances of ``Selectable``, the individual ``ColumnElement`` members of the ``Selectable`` will be added individually to the columns clause. For example, specifying a ``Table`` instance will result in all the contained ``Column`` objects within to be added to the columns clause. This argument is not present on the form of ``select()`` available on ``Table``. whereclause A ``ClauseElement`` expression which will be used to form the ``WHERE`` clause. from_obj A list of ``ClauseElement`` objects which will be added to the ``FROM`` clause of the resulting statement. Note that "from" objects are automatically located within the columns and whereclause ClauseElements. Use this parameter to explicitly specify "from" objects which are not automatically locatable. This could include ``Table`` objects that aren't otherwise present, or ``Join`` objects whose presence will supercede that of the ``Table`` objects already located in the other clauses. \**kwargs Additional parameters include: autocommit indicates this SELECT statement modifies the database, and should be subject to autocommit behavior if no transaction has been started. prefixes a list of strings or ``ClauseElement`` objects to include directly after the SELECT keyword in the generated statement, for dialect-specific query features. distinct=False when ``True``, applies a ``DISTINCT`` qualifier to the columns clause of the resulting statement. use_labels=False when ``True``, the statement will be generated using labels for each column in the columns clause, which qualify each column with its parent table's (or aliases) name so that name conflicts between columns in different tables don't occur. The format of the label is _. The "c" collection of the resulting ``Select`` object will use these names as well for targeting column members. for_update=False when ``True``, applies ``FOR UPDATE`` to the end of the resulting statement. Certain database dialects also support alternate values for this parameter, for example mysql supports "read" which translates to ``LOCK IN SHARE MODE``, and oracle supports "nowait" which translates to ``FOR UPDATE NOWAIT``. correlate=True indicates that this ``Select`` object should have its contained ``FromClause`` elements "correlated" to an enclosing ``Select`` object. This means that any ``ClauseElement`` instance within the "froms" collection of this ``Select`` which is also present in the "froms" collection of an enclosing select will not be rendered in the ``FROM`` clause of this select statement. group_by a list of ``ClauseElement`` objects which will comprise the ``GROUP BY`` clause of the resulting select. having a ``ClauseElement`` that will comprise the ``HAVING`` clause of the resulting select when ``GROUP BY`` is used. order_by a scalar or list of ``ClauseElement`` objects which will comprise the ``ORDER BY`` clause of the resulting select. limit=None a numerical value which usually compiles to a ``LIMIT`` expression in the resulting select. Databases that don't support ``LIMIT`` will attempt to provide similar functionality. offset=None a numeric value which usually compiles to an ``OFFSET`` expression in the resulting select. Databases that don't support ``OFFSET`` will attempt to provide similar functionality. bind=None an ``Engine`` or ``Connection`` instance to which the resulting ``Select ` object will be bound. The ``Select`` object will otherwise automatically bind to whatever ``Connectable`` instances can be located within its contained ``ClauseElement`` members. scalar=False deprecated. Use select(...).as_scalar() to create a "scalar column" proxy for an existing Select object. tscalars1scalar option is deprecated; see docs for detailst whereclausetfrom_objN(Rtwarn_deprecatedtpoptFalseRt as_scalar(tcolumnsRBRCtkwargsRAts((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR2}sv  cOst||i|S(sReturn an :class:`~sqlalchemy.sql.expression.Alias` object derived from a :class:`~sqlalchemy.sql.expression.Select`. name alias name \*args, \**kwargs all other arguments are delivered to the :func:`~sqlalchemy.sql.expression.select` function. (RR(RtargsRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR3s cKst||d||S(smReturn an :class:`~sqlalchemy.sql.expression.Insert` clause element. Similar functionality is available via the ``insert()`` method on :class:`~sqlalchemy.schema.Table`. :param table: The table to be inserted into. :param values: A dictionary which specifies the column specifications of the ``INSERT``, and is optional. If left as None, the column specifications are determined from the bind parameters used during the compile phase of the ``INSERT`` statement. If the bind parameters also are None during the compile phase, then the column specifications will be generated from the full list of table columns. Note that the :meth:`~Insert.values()` generative method may also be used for this. :param prefixes: A list of modifier keywords to be inserted between INSERT and INTO. Alternatively, the :meth:`~Insert.prefix_with` generative method may be used. :param inline: if True, SQL defaults will be compiled 'inline' into the statement and not pre-executed. If both `values` and compile-time bind parameters are present, the compile-time bind parameters override the information specified within `values` on a per-key basis. The keys within `values` can be either ``Column`` objects or their string identifiers. Each key may reference one of: * a literal data value (i.e. string, number, etc.); * a Column object; * a SELECT statement. If a ``SELECT`` statement is specified which references this ``INSERT`` statement's table, the statement will be correlated against the ``INSERT`` statement. tinline(R(R4tvaluesRLRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR& s(c Kst|d|d|d||S(sReturn an :class:`~sqlalchemy.sql.expression.Update` clause element. Similar functionality is available via the ``update()`` method on :class:`~sqlalchemy.schema.Table`. :param table: The table to be updated. :param whereclause: A ``ClauseElement`` describing the ``WHERE`` condition of the ``UPDATE`` statement. Note that the :meth:`~Update.where()` generative method may also be used for this. :param values: A dictionary which specifies the ``SET`` conditions of the ``UPDATE``, and is optional. If left as None, the ``SET`` conditions are determined from the bind parameters used during the compile phase of the ``UPDATE`` statement. If the bind parameters also are None during the compile phase, then the ``SET`` conditions will be generated from the full list of table columns. Note that the :meth:`~Update.values()` generative method may also be used for this. :param inline: if True, SQL defaults will be compiled 'inline' into the statement and not pre-executed. If both `values` and compile-time bind parameters are present, the compile-time bind parameters override the information specified within `values` on a per-key basis. The keys within `values` can be either ``Column`` objects or their string identifiers. Each key may reference one of: * a literal data value (i.e. string, number, etc.); * a Column object; * a SELECT statement. If a ``SELECT`` statement is specified which references this ``UPDATE`` statement's table, the statement will be correlated against the ``UPDATE`` statement. RBRMRL(R(R4RBRMRLRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR84s*cKst|||S(sReturn a :class:`~sqlalchemy.sql.expression.Delete` clause element. Similar functionality is available via the ``delete()`` method on :class:`~sqlalchemy.schema.Table`. :param table: The table to be updated. :param whereclause: A :class:`ClauseElement` describing the ``WHERE`` condition of the ``UPDATE`` statement. Note that the :meth:`~Delete.where()` generative method may be used instead. (R (R4RBRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR`s cGs/t|djo |dStdti|S(sJoin a list of clauses together using the ``AND`` operator. The ``&`` operator is also overloaded on all :class:`~sqlalchemy.sql.expression._CompareMixin` subclasses to produce the same result. iitoperator(tlentBooleanClauseListRR(tclauses((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRos cGs/t|djo |dStdti|S(sJoin a list of clauses together using the ``OR`` operator. The ``|`` operator is also overloaded on all :class:`~sqlalchemy.sql.expression._CompareMixin` subclasses to produce the same result. iiRN(RORPRR/(RQ((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR/{s cCstit|S(sReturn a negation of the given clause, i.e. ``NOT(clause)``. The ``~`` operator is also overloaded on all :class:`~sqlalchemy.sql.expression._CompareMixin` subclasses to produce the same result. (Rtinvt_literal_as_binds(tclause((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR-scCst|dtiS(sReturn a ``DISTINCT`` clause.RN(R9Rt distinct_op(texpr((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsc CsUt|}t|tt|d|it|d|idtidttiS(sReturn a ``BETWEEN`` predicate clause. Equivalent of SQL ``clausetest BETWEEN clauseleft AND clauseright``. The ``between()`` method on all :class:`~sqlalchemy.sql.expression._CompareMixin` subclasses provides similar functionality. ttype_RNtgroup(RSt_BinaryExpressiont ClauseListttypeRRRFt between_op(tctesttclefttcright((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  cCst|d|d|S(sProduce a ``CASE`` statement. whens A sequence of pairs, or alternatively a dict, to be translated into "WHEN / THEN" clauses. value Optional for simple case statements, produces a column expression as in "CASE WHEN ..." else\_ Optional as well, for case defaults produces the "ELSE" portion of the "CASE" statement. The expressions used for THEN and ELSE, when specified as strings, will be interpreted as bound values. To specify textual SQL expressions for these, use the text() construct. The expressions used for the WHEN criterion may only be literal strings when "value" is present, i.e. CASE table.somecol WHEN "x" THEN "y". Otherwise, literal strings are not accepted in this position, and either the text() or literal() constructs must be used to interpret raw string values. Usage examples:: case([(orderline.c.qty > 100, item.c.specialprice), (orderline.c.qty > 10, item.c.bulkprice) ], else_=item.c.regularprice) case(value=emp.c.type, whens={ 'engineer': emp.c.salary * 1.1, 'manager': emp.c.salary * 3, }) tvaluetelse_(t_Case(twhensR`Ra((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs(cKst|||S(sReturn a ``CAST`` function. Equivalent of SQL ``CAST(clause AS totype)``. Use with a :class:`~sqlalchemy.types.TypeEngine` subclass, i.e:: cast(table.c.unit_price * table.c.qty, Numeric(10,4)) or:: cast(table.c.timestamp, DATE) (t_Cast(RTttotypeRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs t||S(s/Return the clause ``extract(field FROM expr)``.(t_Extract(tfieldRV((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR"scCs.t|}t|t|tid|iS(s3Return the clause ``expression COLLATE collation``.RW(RSRYt_literal_as_textRR%R[(t expressiont collationRV((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR%s   cOs t||S(sReturn an ``EXISTS`` clause as applied to a :class:`~sqlalchemy.sql.expression.Select` object. Calling styles are of the following forms:: # use on an existing select() s = select([table.c.col1]).where(table.c.col2==5) s = exists(s) # construct a select() at once exists(['*'], **select_arguments).where(criterion) # columns argument is optional, generates "EXISTS (SELECT *)" # by default. exists().where(table.c.col2==5) (t_Exists(RKRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR!scOstd||S(sReturn a ``UNION`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. A similar ``union()`` method is available on all :class:`~sqlalchemy.sql.expression.FromClause` subclasses. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. tUNION(t_compound_select(tselectsRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR6scOstd||S(sReturn a ``UNION ALL`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. A similar ``union_all()`` method is available on all :class:`~sqlalchemy.sql.expression.FromClause` subclasses. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. s UNION ALL(Rm(RnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR7scOstd||S(sbReturn an ``EXCEPT`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. tEXCEPT(Rm(RnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR)s cOstd||S(sfReturn an ``EXCEPT ALL`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. s EXCEPT ALL(Rm(RnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR 8s cOstd||S(seReturn an ``INTERSECT`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. t INTERSECT(Rm(RnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR'Gs cOstd||S(siReturn an ``INTERSECT ALL`` of multiple selectables. The returned object is an instance of :class:`~sqlalchemy.sql.expression.CompoundSelect`. \*selects a list of :class:`~sqlalchemy.sql.expression.Select` instances. \**kwargs available keyword arguments are the same as those of :func:`~sqlalchemy.sql.expression.select`. s INTERSECT ALL(Rm(RnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR(Vs cCst|d|S(srReturn an :class:`~sqlalchemy.sql.expression.Alias` object. An ``Alias`` represents any :class:`~sqlalchemy.sql.expression.FromClause` with an alternate name assigned within SQL, typically using the ``AS`` clause when generated, e.g. ``SELECT * FROM table AS aliasname``. Similar functionality is available via the ``alias()`` method available on all ``FromClause`` subclasses. selectable any ``FromClause`` subclass, such as a table, select statement, etc.. alias string name to be assigned as the alias. If ``None``, a random name will be generated. R(R(t selectableR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRescCstd|d|dtS(sReturn a literal clause, bound to a bind parameter. Literal clauses are created automatically when non- ``ClauseElement`` objects (such as strings, ints, dates, etc.) are used in a comparison operation with a :class:`~sqlalchemy.sql.expression._CompareMixin` subclass, such as a ``Column`` object. Use this function to force the generation of a literal clause, which will be created as a :class:`~sqlalchemy.sql.expression._BindParamClause` with a bound value. 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. type\_ an optional :class:`~sqlalchemy.types.TypeEngine` which will provide bind-parameter translation for this literal. RWtuniqueN(t_BindParamClausetNoneR=(R`RW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR+{scCs t||S(sReturn a :class:`~sqlalchemy.sql.expression._Label` object for the given :class:`~sqlalchemy.sql.expression.ColumnElement`. A label changes the name of an element in the columns clause of a ``SELECT`` statement, typically via the ``AS`` SQL keyword. This functionality is more conveniently available via the ``label()`` method on ``ColumnElement``. name label name obj a ``ColumnElement``. (t_Label(tnametobj((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR*scCst|d|S(sReturn a textual column clause, as would be in the columns clause of a ``SELECT`` statement. The object returned is an instance of :class:`~sqlalchemy.sql.expression.ColumnClause`, which represents the "syntactical" portion of the schema-level :class:`~sqlalchemy.schema.Column` object. text the name of the column. Quoting rules will be applied to the clause like any other column name. For textual column constructs that are not to be quoted, use the :func:`~sqlalchemy.sql.expression.literal_column` function. type\_ an optional :class:`~sqlalchemy.types.TypeEngine` object which will provide result-set translation for this column. RW(t ColumnClause(R5RW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCst|d|dtS(sReturn a textual column expression, as would be in the columns clause of a ``SELECT`` statement. The object returned supports further expressions in the same way as any other column object, including comparison, math and string operations. The type\_ parameter is important to determine proper expression behavior (such as, '+' means string concatenation or numerical addition based on the type). 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:`~sqlalchemy.sql.expression.column` function. 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 NullType. RWt is_literal(RxR=(R5RW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR,scGs t||S(sReturn a :class:`~sqlalchemy.sql.expression.TableClause` object. This is a primitive version of the :class:`~sqlalchemy.schema.Table` object, which is a subclass of this object. (R(RvRH((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR4sc CsYt|to&t|i|d|id|d|St||d|d|d|SdS(s2Create a bind parameter clause with the given key. value a default value for this bind parameter. a bindparam with a value is called a ``value-based bindparam``. type\_ a sqlalchemy.types.TypeEngine object indicating the type of this bind param, will invoke type-specific bind parameter processing shortname deprecated. unique if True, bind params sharing the same name will have their underlying ``key`` modified to a uniquely generated name. mostly useful with value-based bind params. RWRrt shortnameN(t isinstanceRxRsRvR[(tkeyR`RzRWRr((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs&c Cst|dd|dtdtS(ssCreate an 'OUT' parameter for usage in functions (stored procedures), for databases which support them. The ``outparam`` can be used like a regular function parameter. The "output" value will be available from the :class:`~sqlalchemy.engine.ResultProxy` object via its ``out_parameters`` attribute, which returns a dictionary containing the values. RWRrt isoutparamN(RsRtRFR=(R|RW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR0s cOst|d|||S(sCreate literal text to be inserted into a query. When constructing a query from a ``select()``, ``update()``, ``insert()`` or ``delete()``, using plain strings for argument values will usually result in text objects being created automatically. Use this function when creating textual clauses outside of other ``ClauseElement`` objects, or optionally wherever plain text is to be used. text the text of the SQL statement to be created. use ``:`` to specify bind parameters; they will be compiled to their engine-specific format. bind an optional connection or engine to be used for this text query. autocommit=True indicates this SELECT statement modifies the database, and should be subject to autocommit behavior if no transaction has been started. bindparams a list of ``bindparam()`` instances which can be used to define the types and/or initial values for the bind parameters within the textual statement; the keynames of the bindparams must match those within the text of the statement. The types will be used for pre-processing on bind values. typemap a dictionary mapping the names of columns represented in the ``SELECT`` clause of the textual statement to type objects, which will be used to perform post-processing on columns within the result set (for textual statements that produce result sets). tbind(t _TextClause(R5R~RKRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR5s&cCstS(sNReturn a :class:`_Null` object, which compiles to ``NULL`` in a sql statement.(t_Null(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR.%st_FunctionGeneratorcBs)eZdZdZdZdZRS(s:Generate :class:`Function` objects based on getattr calls.cKsg|_||_dS(N(t_FunctionGenerator__namestopts(tselfR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__init__-s cCs|ido5y|i|SWqftj ot|qfXn"|ido|dd!}nt|i}t|i|g|_|S(Nt__t_ii( t startswitht__dict__tKeyErrortAttributeErrortendswithRRtlistR(RRvtf((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __getattr__1scOs|ii}|i|t|idjo_tdjoddklantt|idi d}|dj o|||Snt |idd|idd!||S(Nii(t functionst packagenamesi( RtcopyR8RORRRttsqlalchemy.sqltgetattrtlowertFunction(RtcRItoR#((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__call__?s   (t__name__t __module__t__doc__RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR*s  RXt_generated_labelcBseZdZRS(s@A unicode subclass used to identify dynamically generated names.(RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRSscCs)t|to|S|iddSdS(Nt%s%%(R{Rtreplace(tx((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_escape_for_generatedVscCs |iS(N(t_clone(telement((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR\scCs+tig}|D]}||iq~S(sRexpand the given set of ClauseElements to be the set of all 'cloned' predecessors.(t itertoolstchaint _cloned_set(telementst_[1]R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_expand_cloned_scs;tt|it|tfd|DS(sreturn the intersection of sets a and b, counting any overlap between 'cloned' predecessors. The returned set is in terms of the enties present within 'a'. c3s0x)|]"}i|io |VqqWdS(N(t intersectionR(t.0telem(t all_overlap(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys ls (tsetRR(tatb((Rs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_cloned_intersectionds!cOst|||S(N(R (tkeywordRnRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRmnscCst|t ot|d S(Nt__clause_element__(R{Rthasattr(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _is_literalqscGs+tig}|D]}||iq~S(N(RRt _from_objects(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRtscCs&t|dp|idS|SdS(NRv(RR*Rt(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_labeledwscCs<t|to|St|do|i}n|iS(NR(R{t basestringRRR|(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_column_as_key}s cCsDt|do |iSt|tptt|S|SdS(NR(RRR{RRtunicode(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRhs  cCs#t|do |iS|SdS(NR(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_clause_element_as_exprs cCsDt|do |iSt|tptt|S|SdS(NR(RRR{RR,tstr(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_literal_as_columns  cCset|do |iSt|tp2|djotSt||d|dtSn|SdS(NRRWRr(RRR{RRtR.RsR=(RRvRW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRSs  cCsJt|do |iSt|tptid|n|SdS(NRsAmbiguous literal: %r. Use the 'text()' function to indicate a SQL expression literal, or 'literal()' to indicate a bound value.(RRR{RRt ArgumentError(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _no_literalss   cCsO|i|d|}|p/tid|t|dd|ifn|S(Ntrequire_embeddedsbGiven column '%s', attached to table '%s', failed to locate a corresponding column from table '%s'R4(tcorresponding_columnRtInvalidRequestErrorRRtt description(t fromclauseRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_corresponding_column_or_errors  &cCs t|tS(s4True if ``col`` is an instance of ``ColumnElement``.(R{R (tcol((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt is_columnscBseZdZdZhZeZgZdZe i dZ dZ dZ dZdZdZd Zd Zed Zd Zdd ZedZdZdZddddedZdZdZdZdZdZ dZ!RS(sIBase class for elements of a programmatically constructed SQL expression.RTcCsG|ii|i}|ii|_|iidd||_|S(sCreate 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. RN(t __class__t__new__RRRERtt _is_clone_of(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  cCsJti}|}x1|dj o#|i|t|dd}qW|S(s Return the set consisting all cloned anscestors of this ClauseElement. Includes this ClauseElement. This accessor tends to be used for FromClause objects to identify 'equivalent' FROM clauses, regardless of transformative operations. RN(Rt column_setRttaddR(RRJR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs   cCs#|ii}|idd|S(NR(RRRERt(Rtd((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __getstate__scCs.tdjoddklant||S(sJreturn a copy of this ClauseElement with the given annotations dictionary.i(t AnnotatedN(RRttsqlalchemy.sql.util(RRM((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _annotates cCs |iS(sIreturn a copy of this ClauseElement with an empty annotations dictionary.(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _deannotatescOs|it||S(sReturn a copy with ``bindparam()`` elments replaced. Same functionality as ``params()``, except adds `unique=True` to affected bind parameters so that multiple statements can be used. (t_paramsR=(Rt optionaldictRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt unique_paramsscOs|it||S(sReturn a copy with ``bindparam()`` elments replaced. Returns a copy of this ClauseElement with ``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} (RRF(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytparamss cswt|djoi|dn't|djotidnfd}t|hh|d6S(Niis9params() takes zero or one positional dictionary argumentcs=|ijo|i|_no|indS(N(R|R`t_convert_to_unique(R~(RrRI(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytvisit_bindparamsR(ROR8RRR(RRrRRIR((RIRrs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs cCs ||jS(sCompare this ClauseElement to the given ClauseElement. Subclasses should override the default behavior, which is a straight identity comparison. ((Rtother((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytcompare scCsdS(sReassign internal elements to be clones of themselves. Called during a copy-and-traverse operation on newly shallow-copied elements to create a deep copy. N((Rtclone((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_copy_internals)scKsgS(sReturn immediate child elements of this ``ClauseElement``. This is used for visit traversal. \**kwargs may contain flags that change the collection that is returned, for example to return a subset of items in order to cut down on larger traversals, or to return child items from a different context (such as schema-level collections instead of clause-level). ((RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt get_children2s cCs|S(N((Rtagainst((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt self_group@scCsy|idj o|iSWntj onXxGt|D]5}||joq?n|i}|dj o|Sq?WdSdS(s]Returns the Engine or Connection to which this ClauseElement is bound, or None if none found.N(t_bindRtRRR~(RRtengine((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR~Cs      cOs^|i}|djo5t|d|ii}d|}ti|n|i|||S(s+Compile and execute this ``ClauseElement``.RsThis %s is not bound and does not support direct execution. Supply this statement to a Connection or Engine for execution. Or, assign a bind to the statement or the Metadata of its underlying tables to enable implicit execution via this method.N(R~RtRRRRtUnboundExecutionErrort_execute_clauseelement(Rt multiparamsRteR*tmsg((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytexecuteUs  cOs|i||iS(sYCompile and execute this ``ClauseElement``, returning the result's scalar representation.(RRA(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRAcscCs|djo|dj o"|i||d|d|}q|dj o|i|d|d|}q|idj o"|ii|d|d|}qtdjoddklant}|i||d|d|}n|i|S(sNCompile this SQL expression. The return value is a :class:`~sqlalchemy.engine.Compiled` object. Calling `str()` or `unicode()` on the returned value will yield a string representation of the result. The :class:`~sqlalchemy.engine.Compiled` object also can return a dictionary of bind parameter names and values using the `params` accessor. :param bind: An ``Engine`` or ``Connection`` from which a ``Compiled`` will be acquired. This argument takes precedence over this ``ClauseElement``'s bound engine, if any. :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 compiler: A ``Compiled`` instance which will be used to compile this expression. This argument takes precedence over the `bind` and `dialect` arguments as well as this ``ClauseElement``'s bound engine, if any. :param dialect: A ``Dialect`` instance frmo which a ``Compiled`` will be acquired. This argument takes precedence over the `bind` argument as well as this ``ClauseElement``'s bound engine, if any. :param inline: Used for INSERT statements, for a dialect which does not support inline retrieval of newly generated primary key columns, will force the expression used to create the new primary key value to be rendered inline within the INSERT statement's VALUES clause. This typically refers to Sequence execution but may also refer to any server-side default generation function associated with a primary key `Column`. t column_keysRLi(tDefaultDialectN(Rttstatement_compilerR~Rtsqlalchemy.engine.defaulttcompile(RR~RtcompilertdialectRL((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRhs(  " "  " cCst|iiddS(Ntasciitbackslashreplace(RRtencode(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__str__scCs t||S(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__and__scCs t||S(N(R/(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__or__scCs |iS(N(t_negate(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __invert__scCsDt|do|iSt|idtidtiddSdS(Ntnegation_clauseRRNtnegate(RRR9RRRRRt(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCsTt|dd}|djoti|Sd|i|iit||fSdS(NRs<%s.%s at 0x%x; %s>(RRttobjectt__repr__RRRtid(Rtfriendly((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  N("RRRt__visit_name__t _annotationsRFtsupports_executionRRRtmemoized_propertyRRRRRRRRRRRtRtpropertyR~RRARRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs6         8     t _ImmutablecBseZdZdZRS(s@mark a ClauseElement as 'immutable' when expressions are cloned.cCs|S(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs(RRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRst OperatorscBs>eZdZdZdZdZdZdZRS(cCs|iti|S(N(toperateRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|iti|S(N(RRR/(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|itiS(N(RRRR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscsfd}|S(Ncsiti|S(N(RRtop(R(Rtopstring(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs((RRR((RRs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscOstt|dS(N(tNotImplementedErrorR(RRRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscKstt|dS(N(RR(RRRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytreverse_operates(RRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs      tColumnOperatorscBs(eZdZdZdZdZeiZdZ dZ dZ dZ dZ ddZdd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#RS(s'Defines comparison and math operations.cCs|iti|S(N(RRtlt(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__lt__scCs|iti|S(N(RRtle(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__le__scCs|iti|S(N(RRteq(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__eq__scCs|iti|S(N(RRtne(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__ne__scCs|iti|S(N(RRtgt(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__gt__scCs|iti|S(N(RRtge(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__ge__scCs|iti|S(N(RRt concat_op(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytconcatscCs|iti|d|S(Ntescape(RRtlike_op(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytlikescCs|iti|d|S(NR(RRtilike_op(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytilikescCs|iti|S(N(RRtin_op(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytin_scKs|iti||S(N(RRt startswith_op(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscKs|iti||S(N(RRt endswith_op(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscKs|iti||S(N(RRt contains_op(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytcontainsscKs|iti||S(N(RRtmatch_op(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytmatchscCs|itiS(N(RRR:(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|itiS(N(RRR;(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs|iti|S(N(RRR%(RRj((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR%scCs|iti|S(N(RRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__radd__scCs|iti|S(N(RRtsub(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__rsub__scCs|iti|S(N(RRtmul(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__rmul__scCs|iti|S(N(RRtdiv(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__rdiv__scCs|iti||S(N(RRR\(RR^R_((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|itiS(N(RRRU(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs|iti|S(N(RRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__add__#scCs|iti|S(N(RRR&(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__sub__&scCs|iti|S(N(RRR((RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__mul__)scCs|iti|S(N(RRR*(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__div__,scCs|iti|S(N(RRtmod(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__mod__/scCs|iti|S(N(RRttruediv(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __truediv__2sN($RRRRtt timetupleR R Rt__hash__RRRRRRRRRRR"R$RRR%R%R'R)R+RRR,R-R.R/R1R3(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s@                             t _CompareMixincBseZdZdedZedZhefei6efei 6efei 6efei 6efei 6efei 6eeifei6eeifei6eeifei6eeifei6eeifei6eeifei6eeifei6eeifei6ZdZdZdZdZddZddZdd Zd Zd Z d Z!d Z"dZ#dZ$dZ%dZ&dZ'dZ(dZ)RS(sGDefines comparison and math operations for ``ClauseElement`` instances.c Ks|djpt|tos|tijo t|ttidtiS|ti jo t|ttidtiSt i dn|i |}|o&t|||dt id|d|St|||dt id|d|SdS(NRs-Only '='/'!=' operators can be used with NULLRWt modifiers(RtR{RRRRYR.tis_tisnotRRRt_check_literaltsqltypestBoolean(RRRwRtreverseRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __compare8s  &cCsh|i|}|i|}|o t|||i|d|St|||i|d|SdS(NRW(R:t _compare_typeRYtadapt_operator(RRRwR=RW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __operateHs  cOs/ti|}|d|||d|d|S(Nii(R6R(RRRRIR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRes c Ks1ti|}|d|||dt|d|S(NiR=i(R6RR=(RRRRIR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRis cCs|ititi|S(N(t_in_implRRtnotin_op(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRmscCs8t|}t|to|i||d|St|to|i||id|St|to|i||d|Sg}xb|D]Z}t|p+t|tpt i d|qn|i |}|i |qWt |djo ||jS|i|t|id|d|S(NRsQin() function accepts either a list of non-selectable values, or a selectable: %riR(RR{t _ScalarSelectt_CompareMixin__comparet_SelectBaseMixinRGRRR6RRt _bind_paramtappendRORZR(RRt negate_optseq_or_selectableRKR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRBps&   cCs:|ititddtii|i|d|S(s&Produce the clause ``LIKE '%'``s'%'RWR(RERRR,R;tStringR%R:(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs'cCs5|ititddti|i|d|S(s&Produce the clause ``LIKE '%'``s'%'RWR(RERRR,R;RKR:(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs"cCsH|ititddti|i|tddtid|S(s'Produce the clause ``LIKE '%%'``s'%'RWR(RERRR,R;RKR:(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR"s cCs|iti|i|S(sProduce a MATCH clause, i.e. ``MATCH ''`` The allowed contents of ``other`` are database backend specific. (RERR#R:(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR$scCst|||iS(sProduce a column label, i.e. `` AS ``. if 'name' is None, an anonymous label name will be generated. (RuR[(RRv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR*scCs t|S(s1Produce a DESC clause, i.e. `` DESC``(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs t|S(s/Produce a ASC clause, i.e. `` ASC``(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCst|dtiS(s9Produce a DISTINCT clause, i.e. ``DISTINCT ``RN(R9RRU(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsc Cs=t|t|i||i|dtidttiS(sHProduce a BETWEEN clause, i.e. `` BETWEEN AND ``RNRX(RYRZR:RRRFR\(RR^R_((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  cCs t||S(s<Produce a COLLATE clause, i.e. `` COLLATE utf8_bin``(R%(RRj((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR%scsfdS(sEproduce a generic operator function. e.g.:: somecolumn.op("*")(5) produces:: somecolumn * 5 operator a string which will be output as the infix operator between this ``ClauseElement`` and the expression passed to the generated function. csi|S((t_CompareMixin__operate(R(RNR(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyts((RRN((RNRs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCstd|d|idtS(NRWRr(RsRtR[R=(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRGscCst|to't|itio|i|_|St|do |iSt|tp|i|St|t t fo |i S|SdS(NR( R{RsR[R;tNullTypeRRRRGRFRRG(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR:s&   cCs|iS(sAllow subclasses to override the type used in constructing ``_BinaryExpression`` objects. Default return value is the type of the given object. (R[(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR?sN(*RRRRtRFRERLRRR(R&R*R0R2RR RR RRt notlike_opRt notilike_opRRRRRBRRR"R$R*RRRRR%RRGR:R?(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR65sH                    cBseZdZdZeZgZdZdZ e dZ e i dZe i dZdZddZe i dZRS( sWRepresent an element that is usable within the "column clause" portion of a ``SELECT`` statement. This includes columns associated with tables, aliases, and subqueries, expressions, function calls, SQL keywords such as ``NULL``, literals, etc. ``ColumnElement`` is the ultimate base class for all such elements. ``ColumnElement`` supports the ability to be a *proxy* element, which indicates that the ``ColumnElement`` may be associated with a ``Selectable`` which was derived from another ``Selectable``. An example of a "derived" ``Selectable`` is an ``Alias`` of a ``Table``. A ``ColumnElement``, by subclassing the ``_CompareMixin`` mixin class, provides the ability to generate new ``ClauseElement`` objects using Python expressions. See the ``_CompareMixin`` docstring for more details. RcCs|fS(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_select_iterable"scCstid|iDS(Ncss-x&|]}t|dp |VqqWdS(tproxiesN(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys (s (RRt proxy_set(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt base_columns&scCsNti|g}t|do(x%|iD]}|i|iq,Wn|S(NRR(RRRRRR8RS(RRJR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRS+s  cCst|ii|iS(s[Return True if the given ``ColumnElement`` has a common ancestor to this ``ColumnElement``.(tboolRSR(Rt othercolumn((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytshares_lineage3scCsy|o%t||dt|dd}n1t|}t|i|dt|dd}|g|_||i|<|S(sCreate a new ``ColumnElement`` representing this ``ColumnElement`` as it appears in the select list of a descending selectable. RWR[N(RxRRtRt anon_labelRRRH(RRqRvtco((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _make_proxy8s% $  cCs&tdt|t|ddfS(sprovides a constant 'anonymous label' for this ColumnElement. This is a label() expression which will be named at compile time. The same label() is returned each time anon_label is called so that expressions can reference anon_label multiple times, producing the same label name at compile time. the compiler uses this function automatically at compile time for expressions that are known to be 'unnamed' like binary expressions and function calls. s %%(%d %s)sRvtanon(RRR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRXIsN(RRRRRFt primary_keyt foreign_keysRttquotet_labelRRQRRRTRSRWRZRX(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s  cBsneZdZdZdZdZdZdZdZdZ d Z dZ d Z d ZRS( sAn ordered dictionary that stores a list of ColumnElement instances. Overrides the ``__eq__()`` method to produce SQL clauses between sets of correlated columns. cGs?tt|ig}|D]}||i|q~dS(N(tsuperR RR(RtcolsRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRbscCs+tg}|D]}|t|q~S(N(treprR(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRfscCsr|i|joE|i|ijo2||i}|i|ijo||i=qUntii||i|dS(sadd the given column to this collection, removing unaliased versions of this column as well as existing columns with the same key. e.g.:: t = Table('sometable', metadata, Column('col1', Integer)) t.columns.replace(Column('col1', Integer, key='columnone')) will remove the original 'col1' from the collection, and add the new column under the name 'columnname'. Used by schema.Column to override columns during table reflection. N(RvR|RtOrderedPropertiest __setitem__(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRis # cCs|||i}x5|D]-}|i|o|i||jqqWq Wt|S(N(RWRHR(RRtlRtlocal((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs6t|tptidntii||S(Ns'__contains__ requires a string argument(R{RRRRRct __contains__(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRlscCs|ti|jS(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytcontains_columnsN(RRRRRRRRdRgRiRtR5RRlRm(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR Ys       t ColumnSetcBs5eZdZdZdZdZdZRS(cCs ||jS(N((RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRmscCs"x|D]}|i|qWdS(N(R(RRaR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRiscCst|t|S(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR,scCsYg}xF|D]>}x5|D]-}|i|o|i||jqqWq Wt|S(N(RWRHR(RRRjRRk((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCsttd|DS(Ncssx|] }|VqWdS(N((RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys s (thashttuple(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR5s(RRRmRiR,RR5(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRns     cBseZdZdZRS(s mark a class as being selectableRq(RRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscBsbeZdZdZeZgZdZdZ ddZ ddZ dedZ ddZ ddZdZdZd Zed Zed Zd Zeid ZeidZeidZeeddeiZeeddeiZeeddeiZeeddeiZZ dZ!dZ"RS(s[Represent an element that can be used within the ``FROM`` clause of a ``SELECT`` statement.RcKsb|iot|id}nt|id}tti|idg|d|g|S(s<return a SELECT COUNT generated against this ``FromClause``.it tbl_row_countRC(R\RRHR2R#tcountR*(RRBRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRrs cKst|g||S(s'return a SELECT of this ``FromClause``.(R2(RRBR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR2scCst||||S(sDreturn a join of this ``FromClause`` against another ``FromClause``.(R(RR?R@R<((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR)scCst|||tS(sKreturn an outer join of this ``FromClause`` against another ``FromClause``.(RR=(RR?R@((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR1scCs t||S(sreturn an alias of this ``FromClause``. For table objects, this has the effect of the table being rendered as ``tablename AS aliasname`` in a SELECT statement. For select objects, the effect is that of creating a named subquery, i.e. ``(select ...) AS aliasname``. The ``alias()`` method is the general way to create a "subquery" out of an existing SELECT. The ``name`` parameter is optional, and if left blank an "anonymous" name will be generated at compile time, guaranteed to be unique against other anonymous constructs used in the same statement. (R(RRv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs ||ijS(sReturn True if this FromClause is 'derived' from the given FromClause. An example would be an Alias of a Table is derived from that Table. (R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytis_derived_fromscCs4tdjoddklant|i|S(spreplace all occurences of FromClause 'old' with the given Alias object, returning a copy of this ``FromClause``.i(t ClauseAdapterN(RtRtRttraverse(RtoldR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytreplace_selectables cCsm|i|dt}|djoG||jo:x7||D]'}|i|dt}|o|Sq:Wn|S(sReturn corresponding_column for the given column, or if None search for a match in the given dictionary. RN(RR=Rt(RRt equivalentsRtequivtnc((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytcorrespond_on_equivalents s  c Cs|ii|o|Sd\}}|i}|i}xi|D]a}|ii|}|oB| p|ii|o'|djo||}}qt|t|jo||}}q||jotit i g} |iD]0} | i |o| | i i ddqq~ } tit i g} |iD]0} | i |o| | i i ddq<q<~ } | | jo||}}qqq=q=W|S(sGiven a ``ColumnElement``, return the exported ``ColumnElement`` object from this ``Selectable`` which corresponds to that original ``Column`` via a common anscestor column. :param column: the target ``ColumnElement`` to be matched :param require_embedded: only return corresponding columns for the given ``ColumnElement``, if the given ``ColumnElement`` is actually present within a sub-element of this ``FromClause``. Normally the column will match if it merely shares a common anscestor with one of the exported columns of this ``FromClause``. tweightiN(NN(RRmRtRSRt issupersetRORtreduceRNRRWRtget(RRRRR't target_setRaRtiRtsct col_distancet_[2]t c_distance((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs,      J J cCst|d|iidS(sga brief description of this FromClause. Used primarily for error message formatting. Rvs object(RRR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyROscCs(x!dD]}|ii|dqWdS(s8delete memoized collections when a FromClause is cloned.t_columnst_primary_key_foreign_keystlocate_all_fromsN(s_columnsRslocate_all_froms(RRERt(Rtattr((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_reset_exportedXscCs|i|iS(sEReturn the collection of Column objects contained by this FromClause.(t_export_columnsR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR^s cCs|i|iS(sZReturn the collection of Column objects which comprise the primary key of this FromClause.(Rt _primary_key(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRes cCs|i|iS(sMReturn the collection of ForeignKey objects which this FromClause references.(Rt _foreign_keys(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRls RtdocRRRHcCs2t|_t|_t|_|idS(sInitialize column collections.N(R RRnRRRt_populate_column_collection(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRzs   cCsdS(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsN(#RRRRRFtnamed_with_columnt _hide_fromsRtR^tschemaRrR2R)R1RRsRwR{RRRRRRRRRRRHR\R]RRQRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s4      5  RscBsneZdZdZd Zd eed dZdZdZ dZ dZ dZ dZ d ZRS( sZRepresent a bind parameter. Public constructor is the ``bindparam()`` function. RcCs|o*tdt||pdf|_n!|ptdt||_|pd|_||_||_||_||_|djo(t i i t |t i |_ n*t|t o||_ n ||_ dS(sConstruct a _BindParamClause. key the key for this bind param. Will be used in the generated SQL statement for dialects that use named parameters. This value may be modified when part of a compilation operation, if other ``_BindParamClause`` objects exist with the same key, or if its length is too long and truncation is required. value Initial value for this bind param. This value may be overridden by the dictionary of parameters sent to statement compilation/execution. shortname deprecated. type\_ A ``TypeEngine`` object that will be used to pre-process the value corresponding to this ``_BindParamClause`` at execution time. unique if True, the key name of this BindParamClause will be modified if another ``_BindParamClause`` of the same name already has been located within the containing ``ClauseElement``. isoutparam if True, the parameter should be treated like a stored procedure "OUT" parameter. s %%(%d %s)stparams %%(%d param)sN(RRR|t _orig_keyRrR`R}RzRtR;ttype_mapRR[RNR{(RR|R`RWRrR}Rz((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs#*      (cCsJti|}|io-tdt||ipdf|_n|S(Ns %%(%d %s)sR(RRRrRRRR|(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs -cCsD|ip6t|_tdt||ipdf|_ndS(Ns %%(%d %s)sR(RrR=RRRR|(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  cCs|ii|i|S(N(R[t dialect_impltbind_processor(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs)t|itip|iS|iSdS(N(R{R[R;RN(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR?scCs9t|to)|ii|iijo|i|ijS(sCompare this ``_BindParamClause`` to the given clause. Since ``compare()`` is meant to compare statement syntax, this method returns True if the two ``_BindParamClauses`` have just the same type. (R{RsR[RR`(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCsC|ii}|i}ti|o |}n||d<|S(s4execute a deferred value for serialization purposes.R`(RRR`Rtcallable(RRtv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs    cCs,dt|it|it|ifS(Ns"_BindParamClause(%s, %s, type_=%s)(RbR|R`R[(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsN(RRRRRtR^RFRRRRR?RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRss4     t _TypeClausecBseZdZdZdZRS(sTHandle a type keyword in a SQL statement. Used by the ``Case`` statement. t typeclausecCs ||_dS(N(R[(RR[((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs(RRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsRcBseZdZdZeideiZeZ e dZ gZ dd d d edZe dZedZdZRS( s`Represent a literal SQL text fragment. Public constructor is the ``text()`` function. t textclauses(?Wnfd}ii ||_ |dj o%x"|D]}|i|i )s (tdictRRM(RR((Rs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR(scKs |iiS(N(RRM(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR,sN(RRRRtreRtUNICODERR=RRRQRRtRFRR[RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs RcBseZdZdZdZRS(shRepresent the NULL keyword in a SQL statement. Public constructor is the ``null()`` function. R.cCsti|_dS(N(R;tNULLTYPER[(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR9s(RRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR0sRZcBseZdZdZdZdZdZedZdZ e dZ dZ ed Z d d Zd ZRS( szDescribe a list of clauses, separated by an operator. By default, is comma-separated, such as a column listing. t clauselistcOs|idti|_|idt|_|idt|_|ioNg}|D]3}|dj o |t|i d|iqWqW~|_ n<g}|D]$}|dj o|t|qq~|_ dS(NRNRXtgroup_contentsR( RERtcomma_opRNR=RXRRtRhRRQ(RRQRIRRTR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyREs GcCs t|iS(N(RhRQ(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__iter__RscCs t|iS(N(RORQ(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__len__UscCs t|S(N(Rh(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRQXscCsM|io)|iit|id|in|iit|dS(NR(RRQRHRhRRN(RRT((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRH\s )cCs1g}|iD]}|||q~|_dS(N(RQ(RRRRT((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRfscKs|iS(N(RQ(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRiscCs4ttig}|iD]}||iq~S(N(RRRRQR(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRlscCsC|io1|i|j o!ti|i|o t|S|SdS(N(RXRNRt is_precedentt _Grouping(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRps0 cCst|t o+t|idjo|idi|St|toyt|it|ijoZx[tdt|iD])}|i|i|i|ptSqW|i|ijSntSdS(szCompare this ``ClauseList`` to the given ``ClauseList``, including a comparison of all the clause items. iiN(R{RZRORQRtrangeRFRN(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRvs'/ N(RRRRRRRRRQRHRRRRRtRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRZ=s     RPcBs&eZdZdZedZRS(RcOs>tt|i||ti|idti|_dS(NRW(R`RPRR;RRR<R[(RRQRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|fS(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRQs(RRRRRRQ(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRPs RbcBsAeZdZdddZedZdZedZ RS(Rc CsByti|}Wntj onX|oCg}|D]+\}}|t|it|fq;~}n@g}|D]+\}}|t|it|fq~~}|ot|ddi} nd} |djo d|_ nt||_ | |_||_ |dj ot||_ n d|_ dS(Ni( Rtdictlike_iteritemst TypeErrorRSRRRR[RtR`RcRa( RRcR`RaRRtrtwhenlistRRW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs$C?     cCs|io||i|_ng}|iD]%\}}|||||fq.~|_|io||i|_ndS(N(R`RcRa(RRRRty((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  ? cksT|io |iVnx!|iD]\}}|V|Vq W|io |iVndS(N(R`RcRa(RRIRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs     cCs7ttig}|iD]}||iq~S(N(RRRRR(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsN( RRRRtRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRbs   RcBseZdZdZdZedZedZei dZ edZ dZ e dZd Zd Zd Zd Zd ZRS(sDescribe a SQL function.tfunctioncOs|iddpg|_||_|idd|_g}|D]}|t||iqE~}tdtidt |i |_ t i |idd|_dS(NRR~RNRRW(RRtRRvRRSRZRRR=Rt clause_exprR;RR[(RRvRQRIRRRK((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs  -$cCs|iS(N(Rv(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR|scCs|gS(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRHscCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRQscCs |iiS(N(RQR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscKs |ifS(N(R(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs0||i|_|iti|ddS(NRQ(RRRtreset_memoized(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs cCst|i|d|idtS(NRWRr(RsRvR[R=(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRGscCs t|gS(N(R2(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR2scCst|giiS(N(R2RRA(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRAscCst|giS(N(R2R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs|iS(N(R[(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR?s(RRRRRRR|RHRRRQRRRRRGR2RARR?(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs       RdcBs;eZdZdZedZdZedZRS(RcKs:ti||_t|d|_t|i|_dS(N(R;RR[RSRtRTRR(RRTReRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs(||i|_||i|_dS(N(RTR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKs|i|ifS(N(RTR(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RTR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s( RRRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRds    RfcBs;eZdZdZedZdZedZRS(R"cKs.ti|_||_t|d|_dS(N(R;tIntegerR[RgRSRtRV(RRgRVRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cCs(||i|_||i|_dS(N(RgRV(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKs|i|ifS(N(RgRV(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RVR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s( RRRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRf s    R9cBsbeZdZdddddZedZedZdZ dZ dZ dZ RS( tunarycCsY||_||_t|id|ip|i|_ti||_||_dS(NR( RNR$RhRRR;RR[R(RRRNR$RWR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR( s   (cCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR0 scCs||i|_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR4 scKs |ifS(N(R(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR7 scCsIt|to9|i|ijo&|i|ijo|ii|iS(sFCompare this ``_UnaryExpression`` against the given ``ClauseElement``.(R{R9RNR$RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR: sc CsY|idj o2t|id|id|id|id|iStt|iSdS(NRNRR$RW( RRtR9RRNR$R[R`R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRD s     cCs3|io!ti|i|o t|S|SdS(N(RNRRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRO s  N( RRRRtRRRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR9$ s   RYcBsheZdZdZd d d dZedZedZ dZ dZ d dZ dZ RS( s:Represent an expression that is ``LEFT RIGHT``.tbinarycCst|id||_t|id||_||_ti||_||_|djo h|_ n ||_ dS(NR( RhRR>R?RNR;RR[RRtR7(RR>R?RNRWRR7((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR[ s    cCs|ii|iiS(N(R>RR?(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRf scCs(||i|_||i|_dS(N(R>R?(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRj scKs|i|ifS(N(R>R?(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRn scCst|to{|i|ijoh|ii|io|ii|ip<ti|io)|ii|io|ii|iS(sKCompare this ``_BinaryExpression`` against the given ``_BinaryExpression``.(R{RYRNR>RR?Rtis_commutative(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRq scCs9|i|j o!ti|i|o t|S|SdS(N(RNRRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s& c Cs\|idj o5t|i|i|id|id|id|iStt|i SdS(NRRWR7( RRtRYR>R?RNR[R7R`R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s    N(RRRRRtRRRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRYV s     RkcBsGeZeiZgZdZddZdZdZ dZ RS(cOs|o"t|dto|d}n9|ptdgf}nt||ii}ti||dti dt i dS(Nit*RNRW( R{RFR,R2RGRR9RRR!R;R<(RRKRIRJ((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cKst|g||S(N(R2(RRBR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR2 scCs+|i}|ii|i|_|S(N(RRt correlateR(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cCs+|i}|ii|i|_|S(sQreturn a new exists() construct with the given expression set as its FROM clause.(RRt select_fromR(RRTR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cCs+|i}|ii|i|_|S(sreturn a new exists() construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any.(RRtwhereR(RRTR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s N( RRR9RRRRtR2RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRk s    cBseZdZdZdedZedZdZ ddZ dZ e dZ dZd Zded Zed Zdd Zed ZedZRS(srepresent a ``JOIN`` construct between two ``FromClause`` elements. The public constructor function for ``Join`` is the module-level ``join()`` function, as well as the ``join()`` method available off all ``FromClause`` subclasses. R)cCsot||_t|i|_|djo|i|i|i|_n ||_||_d|_dS(N( RhR>RR?Rtt_match_primariesR@R<t_Join__folded_equivalents(RR>R?R@R<((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s   cCs2d|iit|i|iit|ifS(Ns Join object on %s(%d) and %s(%d)(R>RRR?(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s    cCs0||jp#|ii|p|ii|S(N(R>RsR?(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs scCs t|S(N(t _FromGrouping(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR sc Csg}|iiD] }||q~g}|iiD] }||q5~}tpddklan|iitid|D|i |i i d|D|i i t ig}|D]}||iq~dS(Ni(Rcss'x |]}|io |VqqWdS(N(R\(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys s css"x|]}|i|fVqWdS(N(R_(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys s (R>RHR?tsql_utilRRRRitreduce_columnsR@RR8RRRR](RRRRRHt_[3]R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR sLcCsM|i||i|_||i|_||i|_d|_dS(N(RR>R?R@RtR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s  cKs|i|i|ifS(N(R>R?R@(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs+tpddklanti||S(Ni(R(RRRtjoin_condition(Rtprimaryt secondary((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKs`|o.tpddklanti|}n|i|ig}t||d|g|S(sCreate a :class:`Select` from this :class:`Join`. :param whereclause: the WHERE criterion that will be sent to the :func:`select()` function :param fold_equivalents: based on the join criterion of this :class:`Join`, do not include repeat column names in the column list of the resulting select, for columns that are calculated to be "equivalent" based on the join criterion of this :class:`Join`. This will recursively apply to any joins directly nested by this one as well. This flag is specific to a particular use case by the ORM and will be deprecated in 0.6. :param \**kwargs: all other kwargs are sent to the underlying :func:`select()` function. i(RRC(RRRtfolded_equivalentsR>R?R2(RRBtfold_equivalentsRItcollist((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR2 s cCs|iip |iiS(N(R>R~R?(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR~ scCs|idtdti|S(sCreate a ``Select`` out of this ``Join`` clause and return an ``Alias`` of it. The ``Select`` is not correlating. t use_labelsR(R2R=RFR(RRv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs:tig}|iD]}|t|i|iq~S(N(RRRRR>R?(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR# scCs%|g|ii|ii|iiS(N(R@RR>R?(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR' sN(RRRRRtRFRRRRsRRRRRRR2R~RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s       cBseZdZdZeZd dZedZ dZ dZ dZ e dZeedZed Zed ZRS( sRepresents an table or selectable alias (AS). Represents an alias, as typically applied to any table or sub-select within a SQL statement using the ``AS`` keyword (or without the keyword on certain databases such as Oracle). This object is constructed from the ``alias()`` module level function as well as the ``alias()`` method available on all ``FromClause`` subclasses. RcCs|}xt|to |i}q W||_|i|_|io|i|_n||_|djoM|iiot|idd}nt dt ||pdf}n||_ dS(NRvs %%(%d %s)sR[( R{RRtoriginalRRRtRRRRRv(RRqRtbaseselectable((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR> s      'cCs|iiddS(NRR(RvR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRM scCs>y|iiSWn&tj otd|inXdS(Ns)Element %s does not support 'as_scalar()'(RRGR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRGQ scCs%||ijotS|ii|S(N(RR=RRs(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsW scCs(x!|iiD]}|i|q WdS(N(RRHRZ(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR\ s cCsS|it|i|_|i}xt|to |i}q(W||_dS(N(RRRR{RRqR(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR` s  cks;|ox|iD] }|VqWn|o |iVndS(N(RR(Rtcolumn_collectionstaliased_selectablesRIR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRh s   cCs|gS(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRo scCs |iiS(N(RR~(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR~s sN(RRRRR=RRtRRRRGRsRRRRRR~(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR. s      RcBszeZdZdZdZedZedZedZ dZ edZ dZ d Z d ZRS( s/Represent a grouping within a column expressiontgroupingcCs"||_t|dd|_dS(NR[(RRRtR[(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR| s cCs |iiS(N(RR|(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR| scCst|iddp|iS(NR_(RRRtRX(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR_ scCs||i|_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKs |ifS(N(R(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCst|i|S(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCsh|id6|id6S(NRR[(RR[(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs|d|_|d|_dS(NRR[(RR[(Rtstate((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt __setstate__ s (RRRRRRR|R_RRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRw s     RcBszeZdZdZdZedZedZdZe dZ edZ dZ d Z d ZRS( s%Represent a grouping of a FROM clauseRcCs ||_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RRH(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRH scCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKs |ifS(N(R(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs||i|_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCst|i|S(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCsh|id6S(NR(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs|d|_dS(NR(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s(RRRRRRRHRRRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s     RucBseZdZdZddZeidZeidZ dZ e dZ e dZ e dZ e d Ze d Zd Zed Zed ZddZRS(s4Represents a column label (AS). Represent a label, as typically applied to any column-level element using the ``AS`` sql keyword. This object is constructed from the ``label()`` module level function as well as the ``label()`` method available on all ``ColumnElement`` subclasses. R*cCsxt|to |i}qW|p&tdt|t|ddf|_|_|_||_ ||_ |i |_ dS(Ns %%(%d %s)sRvR[( R{RuRRRRRvR|R_t_elementt_typeR^(RRvRRW((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s@  cCs&ti|ipt|iddS(NR[(R;RRRRRt(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR[ scCs|iidtiS(NR(RRRtas_(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scs%t|fd}t|S(Ncs |iS(N(R(R(R(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s(RR(RvR((Rs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _proxy_attr s RRRTRSR\R]cKs |ifS(N(R(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs||i|_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iiS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCsgt|ittfo|ii|d|i}nt|iid|}|ii||S(NRvRq( R{RRR RZRvRRRRH(RRqRvR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRZ s N(RRRRRtRRRR[RRRRRTRSR\R]RRRRRRZ(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRu s          RxcBseZdZdZd d edZeidZ eidZ dZ e dZ dZd edZd ZRS( sXRepresents a generic column expression from any textual string. This includes columns associated with tables, aliases and select statements, but also any arbitrary text. May or may not be bound to an underlying ``Selectable``. ``ColumnClause`` is usually created publically via the ``column()`` function or the ``literal_column()`` function. text the text of the element. selectable parent selectable. type ``TypeEngine`` object which can associate this ``ColumnClause`` with a type. is_literal if True, the ``ColumnClause`` is assumed to be an exact expression that will be delivered to the output with no quoting rules applied regardless of case sensitive settings. the ``literal_column()`` function is usually used to create such a ``ColumnClause``. RcCs8||_|_||_ti||_||_dS(N(R|RvR4R;RR[Ry(RR5RqRWRy((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cCs|iiddS(NRR(RvR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs |iodS|io|iiot|iddo5|iidt|iidt|i}n$t|iidt|i}||iijoO|}d}x6||iijo"|dt |}|d7}qW|}nt |S|iSdS(NRRi( RyRtR4RRRRRvRRR(RR*R_tcounter((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR_! s$ !  cCs,|djo|Stt|i|SdS(N(RtR`RxR*(RRv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR*< s cCs|io |igSgSdS(N(R4(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRB s  cCst|i|d|idtS(NRWRr(RsRvR[R=(RRw((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRGI scCs||io|djp ||ij}t|p|id|d|id|}|g|_|o||i|ieZgZdZedZeZdZdZRS(cCsR||_t|i}t|djotidn|di|_dS(Nis^Scalar select can only be created from a Select object that has exactly one column expression.i(RRRRORRR[(RRRa((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR' s  cCstiddS(NscScalar Select expression has no columns; use this object directly within a column-level expression.(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRH/ scKs|S(N((RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR5 scCst|idi||S(Ni(Rt inner_columnsRZ(RRqRv((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRZ8 s( RRRRRRHRRRZ(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRD$ s   cBsteZdZdZdZd dZdZdZe dZ e dZ dZ d Zee eZ RS( sSForms the basis of ``UNION``, ``UNION ALL``, and other SELECT-based set operations.tcompound_selectcOs|idt|_||_g|_d}xt|D]\}}t|}|pt|i }nWt|i |jo@t i ddt|idi |dt|i fn|o|ii |i |q:|ii |q:Wti||dS(NRs}All selectables passed to CompoundSelect must have identical numbers of columns; select #%d has %d columns, select #%d has %dii(RERFt_should_correlateRRnRtt enumerateRRORRRRHRRFR(RRRnRItnumcolstnRJ((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR@ s"    7cCs t|S(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR\ scCs-x&|iD]}|i|otSq WtS(N(RnRsR=RF(RRRJ((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs_ s   c Csxtg}|iD]}||iq~D]{}|di|d|io|dipd}g}t|D]'\}}||ih|dd6qv~|_ q.WdS(NiRviR|( tzipRnRRZRR_RtRRRR(RRRJRatproxyRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRe s.1c Cs|ig}|iD]}|||q~|_t|do |`nxGdD]?}t||dj o#t|||t||qXqXWdS(Nt_col_mapRR(s_order_by_clauses_group_by_clause(RRnRRRRttsetattr(RRRRJR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRn s - cKs8|ot|ipg|i|igt|iS(N(RRRRRn(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRw scCsC|io|iSx*|iD]}|i}|o|SqWdSdS(N(RRnR~Rt(RRJR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR~{ s    cCs ||_dS(N(R(RR~((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt _set_bind sN(RRRRRRtRRsRRRR=RR~RR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR ; s     cBseZdZdZd$d$ed$ed$dZd$dZe dZ e dZ e i dZe dZdZed Zed Zed Zed Zed ZedZedZedZedZedZdZdZdZdZ dZ!dZ"dZ#dZ$d$dZ%dZ&dZ'dZ(dZ)d Z*d!Z+d"Z,d#Z-e e,e-Z,RS(%sRepresents a ``SELECT`` statement. Select statements support appendable clauses, as well as the ability to execute themselves and return a result set. R2c Ks||_||_t|_ti|_|og} g} |D]} | t| qF~ D]3} | t| t o| i dt i p| q`~ |_ |iit|i n g|_ |o,t||_|iit|in d|_|o'|iidti|Dn|ot||_n d|_|o.g} |D]} | t| qd~ |_n g|_ti||dS(sXConstruct a Select object. The public constructor for Select is the :func:`~sqlalchemy.sql.expression.select` function; see that function for argument descriptions. Additional generative and mutator methods are available on the :class:`~sqlalchemy.sql.expression._SelectBaseMixin` superclass. Rcss3x,|]%}t|o t|p|VqWdS(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys s N(Rt _distinctRt _correlateRt OrderedSett_fromsRR{RDRRRt _raw_columnsR8RRht _whereclauseRtRt_havingt _prefixesRFR(RRHRBRCRthavingRtprefixesRIRRRRtp((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s0   d    . cCs|i}tig}|D]}||iq~}|o|i|}nt|djp |io~|io|it||i}n|ioG|o@|it||}t|pt i d|qqn|S(sReturn the full list of 'from' clauses to be displayed. Takes into account a set of existing froms which may be rendered in the FROM clause of enclosing selects; this Select may want to leave those absent if it is automatically correlating. isSelect statement '%s' returned no FROM clauses due to auto-correlation; specify correlate() to control correlation manually.( RRRRt differenceRORRRRR(Rtexisting_fromstfromsRRttoremove((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt_get_display_froms s -  cCs |iS(s1Return the displayed list of FromClause elements.(R (R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR  scCstiddS(NsvSelect objects don't have a type. Call as_scalar() on this Select object to return a 'scalar' version of this Select.(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR[ scCs|iitt|iS(sreturn a Set of all FromClause elements referenced by this Select. This set is a superset of that returned by the ``froms`` property, which is specifically for those FromClause elements that would actually be rendered. (RR6RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs.tig}|iD]}||iq~S(san iterator of all ColumnElement expressions which would be rendered into the columns clause of the resulting SELECT statement. (RRRRQ(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCsE||ijotSx)|iD]}|i|otSq"WtS(N(RR=RRsRF(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs s  c s|itfd|ii|iDtfd|iD|_tfd|iD|_g}|iD]}||q~|_xGdD]?}t||dj o#t ||t||qqWdS( Nc3s%x|]}||fVqWdS(N((RR(R(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys s c3sx|]}|VqWdS(N((RR(t from_cloned(s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys  s c3sx|]}|VqWdS(N((RR(R (s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pys  s RRRR(s _whereclauses_havings_order_by_clauses_group_by_clause( RRRR6RRRRRtR(RRRRR((R Rs=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s ""-cKsw|ot|ipg|it|ig}|i|i|i|ifD]}|dj o ||qQqQ~S(s=return child elements as per the ClauseElement specification.N( RRHRRRRRRRt(RRRIRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s.cCsgt|}t|to|idti}n|i|g|_|iit ||_dS(s]return a new select() construct with the given column expression added to its columns clause.RN( RR{RDRRRRRR6R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s  cCsog}g}|D]}|t|q~D]3}|t|to|idtip|q,~|_dS(sXreturn a new select() construct with its columns clause replaced with the given columns.RN(RR{RDRRRR(RRHRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytwith_only_columns) scCs|i|dS(sreturn a new select() construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any.N(tappend_whereclause(RRB((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR3 scCs|i|dS(sreturn a new select() construct with the given expression added to its HAVING clause, joined to the existing clause via AND, if any.N(t append_having(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR: scCs t|_dS(sPreturn a new select() construct which will apply DISTINCT to its columns clause.N(R=R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRA scCs#t|}|i|g|_dS(sreturn a new select() construct which will apply the given expression to the start of its columns clause, not using any commas.N(RhR(RRT((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt prefix_withG s cCs(t|}|ii|g|_dS(skreturn a new select() construct with the given FROM expression applied to its list of FROM objects.N(RhRR6(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRO s cGs?t|_|djot|_n|ii||_dS(sireturn a new select() construct which will correlate the given FROM clauses to that of an enclosing select(), if a match is found. By "match", the given fromclause must be present in this select's list of FROM objects and also present in an enclosing select's list of FROM objects. Calling this method turns off the select's default behavior of "auto-correlation". Normally, select() auto-correlates all of its FROM clauses to those of an embedded select when compiled. If the fromclause is None, correlation is disabled for the returned select(). N(N(RFRRtRRR6(Rt fromclauses((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRW s  cCs%t|_|ii|g|_dS(sCappend the given correlation expression to this select() construct.N(RFRRR6(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pytappend_correlationl s cCsqt|}t|to|idti}n|i|g|_|iit ||_|i dS(sTappend the given column expression to the columns clause of this select() construct.RN( RR{RDRRRRRR6RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRr s  cCs(t|}|ii|g|_dS(sMappend the given columns clause prefix expression to this select() construct.N(RhRR6(RRT((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt append_prefix~ s cCs]t|}|iit||_|idj ot|i||_n ||_dS(sappend the given expression to this select() construct's WHERE criterion. The expression will be joined to existing WHERE criterion via AND. N(RhRR6RRRtR(RRB((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s  cCsB|idj ot|it||_nt||_dS(sappend the given expression to this select() construct's HAVING criterion. The expression will be joined to existing HAVING criterion via AND. N(RRtRRh(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs9t|ot|}n|ii|g|_dS(sZappend the given FromClause expression to this select() construct's FROM clause. N(RRRR6(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt append_from s ccsaxZ|iD]O}t|tox6|iD] }|Vq*Wq t|to |Vq q q WdS(N(RR{RRHR (RRRY((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyt__exportable_columns s    cCsBx;|iD]-}|i|d|io |ipdq WdS(NRv(t_Select__exportable_columnsRZRR_Rt(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s cCst|to|St|S(sreturn a 'grouping' construct as per the ClauseElement specification. This produces an element that can be embedded in an expression. Note that this method is called automatically as needed when constructing expressions. (R{R R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKst|||S(sKreturn a SQL UNION of this select() construct against the given selectable.(R6(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR6 scKst|||S(sOreturn a SQL UNION ALL of this select() construct against the given selectable.(R7(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR7 scKst|||S(sLreturn a SQL EXCEPT of this select() construct against the given selectable.(R(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKst|||S(sPreturn a SQL EXCEPT ALL of this select() construct against the given selectable.(R (RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scKst|||S(sOreturn a SQL INTERSECT of this select() construct against the given selectable.(R'(RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR' scKst|||S(sSreturn a SQL INTERSECT ALL of this select() construct against the given selectable.(R((RRRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR( scCs|io|iS|ip6x^|iD]$}|i}|o||_|Sq&Wn,t|idi}|o||_|SdS(Ni(RRRR~RRt(RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR~ s       cCs ||_dS(N(R(RR~((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR sN(.RRRRRtRFR=RR RR R[Rtmemoized_instancemethodRRRsRRRRRR RRRRRRRRRRRRRRRR6R7RR R'R(R~R(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR sJ3                 t _UpdateBasecBs\eZdZdZeZeZdZdZdZ dZ dZ e e e Z RS(sDForm the base for ``INSERT``, ``UPDATE``, and ``DELETE`` statements.t update_basecCs+|ii|i}|ii|_|S(N(RRRR(RRJ((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR scCs]t|ttfo?h}x1t|iiD]\}}||||i arguments \*args A single dictionary can be sent as the first positional argument. This allows non-string based keys, such as Column objects, to be used. iN(RRtRR8R(RRKRIR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRMs (RRRRRRM(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs cBsMeZdZdZdedddZdZedZ e dZ RS(soRepresent an INSERT construct. The ``Insert`` object is created using the :func:`insert()` function. R&c Ksyti|||||_d|_||_|o.g}|D]}|t|q@~|_n g|_||_dS(N( RRRRtR2RLRhRRI( RR4RMRLR~RRIRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR<s   . cKs#|idj o |ifSdSdS(N((R2Rt(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRGs cCs|ii|_dS(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRMscCs#t|}|i|g|_dS(sAdd a word or expression between INSERT and INTO. Generative. If multiple prefixes are supplied, they will be separated with spaces. N(RhR(RRT((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRQs N( RRRRRtRFRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR4s   cBsJeZdZdZdeddZdZedZ e dZ RS(soRepresent an Update construct. The ``Update`` object is created using the :func:`update()` function. R8cKsUti|||||_|ot||_n d|_||_||_dS(N(RRRRhRRtRLRI(RR4RBRMRLR~RI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRds   cKs#|idj o |ifSdSdS(N((RRt(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRns cCs(||i|_|ii|_dS(N(RRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRtscCsB|idj ot|it||_nt||_dS(sreturn a new update() construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any.N(RRtRRh(RRB((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRysN( RRRRRtRFRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR\s   cBsDeZdZdZddZdZedZe dZ RS(snRepresent a DELETE construct. The ``Delete`` object is created using the :func:`delete()` function. RcKsB||_||_|ot||_n d|_||_dS(N(RR4RhRRtRI(RR4RBR~RI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs    cKs#|idj o |ifSdSdS(N((RRt(RRI((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRs cCsB|idj ot|it||_nt||_dS(s@Add the given WHERE clause to a newly returned delete construct.N(RRtRRh(RRB((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRscCs||i|_dS(N(R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsN( RRRRRtRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s   t_IdentifiedClausecBs)eZdZeZeZdZdZ RS(t identifiedcCs ||_dS(N(tident(RR"((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyRsN( RRRR=RRFRRtR^R(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR s tSavepointClausecBseZdZRS(t savepoint(RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR#stRollbackToSavepointClausecBseZdZRS(trollback_to_savepoint(RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR%stReleaseSavepointClausecBseZdZRS(trelease_savepoint(RRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyR's(RRRRNRt sqlalchemyRRRRtsqlalchemy.sql.visitorsRRRR;RtRRRRRtRt__all__RRR1RFR)R2R3R&R8RRR/R-RRRRR"R%R!R6R7RR R'R(RR+R*RR,R4RR0R5R.RRR#R$RRRRRRRmRRRRRhRRRSRRRRRRR R6R RcR tordered_column_setRnRR RsRRRRZRPRbRRdRfR9RYRkRRRRRuRxRt decoratorRRFRDR RRRRRR R R#R%R'(((s=/usr/lib/python2.6/site-packages/sqlalchemy/sql/expression.pyts   *,   *                ( #              _RVi 5 I 352@%sI%"<_AMk!!((&