PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
 ec @s'dZddlZddlZddlmZddlmZddlmZddlmZddlm Z dd lm Z dd lm Z dd l m Z dd l mZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"dd lm#Z#dd!l$m%Z%dd"l$m&Z&dd#l$m'Z'dd$l$m(Z(dd%l$m)Z)dd&l$m*Z*dd'l$m+Z+dd(l$m,Z,dd)l$m-Z-dd*l$m.Z.dd+l$m/Z/dd,l$m0Z0dd-l m1Z1d.d/lm2Z2d.d0lm3Z3d.d1l4m5Z5d2e'fd3YZ6e3j7d4d5d6Z8d7ej9e)fd8YZ:d9e:fd:YZ;d;e<fd<YZ=d=e<fd>YZ>d?e<fd@YZ?dAej@e;fdBYZAe3jBdCdDZCe3jBdEdFZDe3jBdGdHZEeEZFdIejGeAfdJYZHdKe<fdLYZIdMeIeAfdNYZJdOejGeJfdPYZKdQeKfdRYZLdSeJfdTYZMdUeJfdVYZNdWejGejOee=e>eJfdXYZPdYejQfdZYZRd[eJfd\YZSd]e,eAfd^YZTd_ejGe!eAfd`YZUdae)fdbYZVdceeAfddYZWdeejXejYejZej[eReee;fdfYZ\dge,e\fdhYZ]die<fdjYZ^dke^e\fdlYZ_ej`dmdndoefdpYZadqee_fdrYZbdse<fdtYZcej`dmdudve3jdefdwYZedxe<fdyYZfdze jge jhe jifd{YZjd|e=e>e?eecefe_fd}YZkd~ej[ee-fdYZlde0fdYZmde\fdYZnenZode fdYZpdS(stThe :class:`_expression.FromClause` class of SQL expression elements, representing SQL tables and derived rowsets. iN(t attrgetteri(t coercions(t operators(troles(t traversals(ttype_api(tvisitors(t Annotated(tSupportsCloneAnnotations(t_clone(t_cloned_difference(t_cloned_intersection(t_entity_namespace_key(t_expand_cloned(t _from_objects(t _generative(t_select_iterables(tCacheableOptions(tColumnCollection(t ColumnSet(t CompileState(tDedupeColumnCollection(t Executable(t Generative(tHasCompileState(t HasMemoized(t Immutable(tprefix_anon_map(t_document_text_coercion(t_anonymous_label(tand_(t BindParameter(tBooleanClauseList(t ClauseElement(t ClauseList(t ColumnClause(tGroupedElement(tGrouping(tliteral_column(tTableValuedColumn(tUnaryExpression(tInternalTraversali(texc(tutil(tinspectt_OffsetLimitParamcBseZeZedZRS(cCs|jS(N(teffective_value(tself((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_limit_offset_valueCs(t__name__t __module__tTruet inherit_cachetpropertyR0(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR-@ss1.4szThe standalone :func:`.subquery` function is deprecated and will be removed in a future release. Use select().subquery().cOstj||j|S(sReturn an :class:`.Subquery` object derived from a :class:`_expression.Select`. :param alias: the alias name for the subquery :param \*args, \**kwargs: all other arguments are passed through to the :func:`_expression.select` function. (tSelecttcreate_legacy_selecttsubquery(taliastargstkwargs((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR8Hst ReturnsRowscBsSeZdZeZeZeZeZe dZ e dZ e dZ RS(sThe base-most class for Core constructs that have some concept of columns that can represent rows. While the SELECT statement and TABLE are the primary things we think of in this category, DML like INSERT, UPDATE and DELETE can also specify RETURNING which means they can be used in CTEs and other forms, and PostgreSQL has functions that return rows also. .. versionadded:: 1.4 cCs|S(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt selectablenscCs tdS(sEA sequence of column expression objects that represents the "selected" columns of this :class:`_expression.ReturnsRows`. This is typically equivalent to .exported_columns except it is delivered in the form of a straight sequence and not keyed :class:`_expression.ColumnCollection`. N(tNotImplementedError(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_all_selected_columnsrs cCs tdS(sA :class:`_expression.ColumnCollection` that represents the "exported" columns of this :class:`_expression.ReturnsRows`. The "exported" columns represent the collection of :class:`_expression.ColumnElement` expressions that are rendered by this SQL construct. There are primary varieties which are the "FROM clause columns" of a FROM clause, such as a table, join, or subquery, the "SELECTed columns", which are the columns in the "columns clause" of a SELECT statement, and the RETURNING columns in a DML statement.. .. versionadded:: 1.4 .. seealso:: :attr:`_expression.FromClause.exported_columns` :attr:`_expression.SelectBase.exported_columns` N(R>(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytexported_columns~s( R1R2t__doc__R3t_is_returns_rowstFalset_is_from_clauset_is_select_statementt _is_lateralR5R=R?R@(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR<Zs  t SelectablecBsheZdZdZeZdZd dZe j ddde j ddZ e d ZRS( s!Mark a class as being selectable.R=cCs tdS(N(R>(R/tcolumn((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_refresh_for_new_columnscCstj||S(sZReturn a LATERAL alias of this :class:`_expression.Selectable`. The return value is the :class:`_expression.Lateral` construct also provided by the top-level :func:`_expression.lateral` function. .. versionadded:: 1.1 .. seealso:: :ref:`tutorial_lateral_correlation` - overview of usage. (tLateralt _construct(R/tname((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytlaterals s1.4tmessagesThe :meth:`.Selectable.replace_selectable` method is deprecated, and will be removed in a future release. Similar functionality is available via the sqlalchemy.sql.visitors module.ssqlalchemy.sql.utilcCstjjj|j|S(sReplace all occurrences of :class:`_expression.FromClause` 'old' with the given :class:`_expression.Alias` object, returning a copy of this :class:`_expression.FromClause`. (R+t preloadedtsql_utilt ClauseAdapterttraverse(R/toldR9((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytreplace_selectables cCs|jj||S(sGiven a :class:`_expression.ColumnElement`, return the exported :class:`_expression.ColumnElement` object from the :attr:`_expression.Selectable.exported_columns` collection of this :class:`_expression.Selectable` which corresponds to that original :class:`_expression.ColumnElement` via a common ancestor column. :param column: the target :class:`_expression.ColumnElement` to be matched. :param require_embedded: only return corresponding columns for the given :class:`_expression.ColumnElement`, if the given :class:`_expression.ColumnElement` is actually present within a sub-element of this :class:`_expression.Selectable`. Normally the column will match if it merely shares a common ancestor with one of the exported columns of this :class:`_expression.Selectable`. .. seealso:: :attr:`_expression.Selectable.exported_columns` - the :class:`_expression.ColumnCollection` that is used for the operation. :meth:`_expression.ColumnCollection.corresponding_column` - implementation method. (R@tcorresponding_column(R/RHtrequire_embedded((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRUs! N(R1R2RAt__visit_name__R3t is_selectableRItNoneRMR+t deprecatedtpreload_moduleRTRCRU(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRGs   t HasPrefixescBsMeZdZdejfgZeeddddZddZ RS(t _prefixestexprs+:meth:`_expression.HasPrefixes.prefix_with`s*:paramref:`.HasPrefixes.prefix_with.*expr`cOsK|jdd}|r7tjddj|n|j||dS(sAdd one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative. This is used to support backend-specific prefix keywords such as those provided by MySQL. E.g.:: stmt = table.insert().prefix_with("LOW_PRIORITY", dialect="mysql") # MySQL 5.7 optimizer hints stmt = select(table).prefix_with( "/*+ BKA(t1) */", dialect="mysql") Multiple prefixes can be specified by multiple calls to :meth:`_expression.HasPrefixes.prefix_with`. :param \*expr: textual or :class:`_expression.ClauseElement` construct which will be rendered following the INSERT, UPDATE, or DELETE keyword. :param \**kw: A single keyword 'dialect' is accepted. This is an optional string dialect name which will limit rendering of this prefix to only that dialect. tdialectsUnsupported argument(s): %st,N(tpopRYR*t ArgumentErrortjoint_setup_prefixes(R/R^tkwR_((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt prefix_withs !cCsB|jtg|D]!}tjtj||f^q|_dS(N(R]ttupleRtexpectRtStatementOptionRole(R/tprefixesR_tp((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRds (N( R1R2R]R)tdp_prefix_sequencet _has_prefixes_traverse_internalsRRRfRYRd(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR\s$t HasSuffixescBsMeZdZdejfgZeeddddZddZ RS(t _suffixesR^s+:meth:`_expression.HasSuffixes.suffix_with`s*:paramref:`.HasSuffixes.suffix_with.*expr`cOsK|jdd}|r7tjddj|n|j||dS(sAdd one or more expressions following the statement as a whole. This is used to support backend-specific suffix keywords on certain constructs. E.g.:: stmt = select(col1, col2).cte().suffix_with( "cycle empno set y_cycle to 1 default 0", dialect="oracle") Multiple suffixes can be specified by multiple calls to :meth:`_expression.HasSuffixes.suffix_with`. :param \*expr: textual or :class:`_expression.ClauseElement` construct which will be rendered following the target clause. :param \**kw: A single keyword 'dialect' is accepted. This is an optional string dialect name which will limit rendering of this suffix to only that dialect. R_sUnsupported argument(s): %sR`N(RaRYR*RbRct_setup_suffixes(R/R^ReR_((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt suffix_with&s cCsB|jtg|D]!}tjtj||f^q|_dS(N(RoRgRRhRRi(R/tsuffixesR_Rk((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRpIs (N( R1R2RoR)Rlt _has_suffixes_traverse_internalsRRRqRYRp(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRnstHasHintscBsVeZejZdZdejfdejfgZ ddZ e ddZ RS(t_statement_hintst_hintst*cCs|jd||S(sAdd a statement hint to this :class:`_expression.Select` or other selectable object. This method is similar to :meth:`_expression.Select.with_hint` except that it does not require an individual table, and instead applies to the statement as a whole. Hints here are specific to the backend database and may include directives such as isolation levels, file directives, fetch directives, etc. .. versionadded:: 1.0.0 .. seealso:: :meth:`_expression.Select.with_hint` :meth:`_expression.Select.prefix_with` - generic SELECT prefixing which also can suit some database-specific HINT syntaxes such as MySQL optimizer hints N(t with_hintRY(R/ttextt dialect_name((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytwith_statement_hint[scCs\|dkr'|j||ff7_n1|jji|tjtj||f6|_dS(sAdd an indexing or other executional context hint for the given selectable to this :class:`_expression.Select` or other selectable object. The text of the hint is rendered in the appropriate location for the database backend in use, relative to the given :class:`_schema.Table` or :class:`_expression.Alias` passed as the ``selectable`` argument. The dialect implementation typically uses Python string substitution syntax with the token ``%(name)s`` to render the name of the table or alias. E.g. when using Oracle, the following:: select(mytable).\ with_hint(mytable, "index(%(name)s ix_mytable)") Would render SQL as:: select /*+ index(mytable ix_mytable) */ ... from mytable The ``dialect_name`` option will limit the rendering of a particular hint to a particular backend. Such as, to add hints for both Oracle and Sybase simultaneously:: select(mytable).\ with_hint(mytable, "index(%(name)s ix_mytable)", 'oracle').\ with_hint(mytable, "WITH INDEX ix_mytable", 'sybase') .. seealso:: :meth:`_expression.Select.with_statement_hint` N(RYRuRvtunionRRhRtFromClauseRole(R/R=RyRz((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRxus $  (( R1R2R+t immutabledictRvRuR)tdp_statement_hint_listtdp_table_hint_listt_has_hints_traverse_internalsR{RRx(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRtRs   t FromClausecBseZdZdZeZgZd Ze Z e Z eZ eZ ejdd!dd"d dZd eedZd ed Zd ed Zejd d Zd d d ZdZdZedZdZedZejdZedZejdZ ejdZ!dZ"ee#dddZ$ee#dZ%dZ&edZ'dZ(dZ)d edZ*RS(#sERepresent an element that can be used within the ``FROM`` clause of a ``SELECT`` statement. The most common forms of :class:`_expression.FromClause` are the :class:`_schema.Table` and the :func:`_expression.select` constructs. Key features common to all :class:`_expression.FromClause` objects include: * a :attr:`.c` collection, which provides per-name access to a collection of :class:`_expression.ColumnElement` objects. * a :attr:`.primary_key` attribute, which is a collection of all those :class:`_expression.ColumnElement` objects that indicate the ``primary_key`` flag. * Methods to generate various derivations of a "from" clause, including :meth:`_expression.FromClause.alias`, :meth:`_expression.FromClause.join`, :meth:`_expression.FromClause.select`. t fromclauset whereclauses2.0sThe :paramref:`_sql.FromClause.select().whereclause` parameter is deprecated and will be removed in version 2.0. Please make use of the :meth:`.Select.where` method to add WHERE criteria to the SELECT statement.R;sThe :meth:`_sql.FromClause.select` method will no longer accept keyword arguments in version 2.0. Please use generative methods from the :class:`_sql.Select` construct in order to apply additional modifications.cKs/|dk r||d>> from sqlalchemy import select, column, func, table >>> a = table("a", column("id"), column("x"), column("y")) >>> stmt = select(func.row_to_json(a.table_valued())) >>> print(stmt) SELECT row_to_json(a) AS row_to_json_1 FROM a .. versionadded:: 1.4.0b2 .. seealso:: :ref:`tutorial_functions` - in the :ref:`unified_tutorial` (R'Rt TABLEVALUE(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt table_valuedjscCstj||||S(svReturn a TABLESAMPLE alias of this :class:`_expression.FromClause`. The return value is the :class:`_expression.TableSample` construct also provided by the top-level :func:`_expression.tablesample` function. .. versionadded:: 1.1 .. seealso:: :func:`_expression.tablesample` - usage guidelines and parameters (t TableSampleRK(R/tsamplingRLtseed((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt tablesamplescCs ||jkS(sReturn ``True`` if this :class:`_expression.FromClause` is 'derived' from the given ``FromClause``. An example would be an Alias of a Table is derived from that Table. (t _cloned_set(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytis_derived_froms cCs|jj|jS(sReturn ``True`` if this :class:`_expression.FromClause` and the other represent the same lexical identity. This tests if either one is a copy of the other, or if they are the same via annotation identity. (Rt intersection(R/tother((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_is_lexical_equivalentscCst|d|jjdS(s|A brief description of this :class:`_expression.FromClause`. Used primarily for error message formatting. RLs object(tgetattrt __class__R1(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt descriptionscs'jjfd|jDdS(Nc3s|]}|jVqdS(N(t _make_proxy(t.0tcol(R(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s(t_columnst_populate_separate_keystc(R/R((RsL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt#_generate_fromclause_column_proxiess cCs|jS(sA :class:`_expression.ColumnCollection` that represents the "exported" columns of this :class:`_expression.Selectable`. The "exported" columns for a :class:`_expression.FromClause` object are synonymous with the :attr:`_expression.FromClause.columns` collection. .. versionadded:: 1.4 .. seealso:: :attr:`_expression.Selectable.exported_columns` :attr:`_expression.SelectBase.exported_columns` (tcolumns(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR@scCs3d|jkr&|j|jn|jjS(sA named-based collection of :class:`_expression.ColumnElement` objects maintained by this :class:`_expression.FromClause`. The :attr:`.columns`, or :attr:`.c` collection, is the gateway to the construction of SQL expressions using table-bound or other selectable-bound columns:: select(mytable).where(mytable.c.somecolumn == 5) :return: a :class:`.ColumnCollection` object. R(t__dict__t_init_collectionst_populate_column_collectionRt as_immutable(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs  cCs|jS(sReturn a namespace used for name-based access in SQL expressions. This is the namespace that is used to resolve "filter_by()" type expressions, such as:: stmt.filter_by(address='some address') It defaults to the ``.c`` collection, however internally it can be overridden using the "entity_namespace" annotation to deliver alternative results. (R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytentity_namespacescCs|j|j|jS(spReturn the iterable collection of :class:`_schema.Column` objects which comprise the primary key of this :class:`_selectable.FromClause`. For a :class:`_schema.Table` object, this collection is represented by the :class:`_schema.PrimaryKeyConstraint` which itself is an iterable collection of :class:`_schema.Column` objects. (RRt primary_key(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs  cCs|j|j|jS(sVReturn the collection of :class:`_schema.ForeignKey` marker objects which this FromClause references. Each :class:`_schema.ForeignKey` is a member of a :class:`_schema.Table`-wide :class:`_schema.ForeignKeyConstraint`. .. seealso:: :attr:`_schema.Table.foreign_key_constraints` (RRt foreign_keys(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs  cCs4x-ddddgD]}|jj|dqWdS(sReset the attributes linked to the ``FromClause.c`` attribute. This collection is separate from all the other memoized things as it has shown to be sensitive to being cleared out in situations where enclosing code, typically in a replacement traversal scenario, has already established strong relationships with the exported columns. The collection is cleared for the case where a table is having a column added to it as well as within a Join during copy internals. RRRRN(RRaRY(R/tkey((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_reset_column_collectionsRtdocs< A named-based collection of :class:`_expression.ColumnElement` objects maintained by this :class:`_expression.FromClause`. The :attr:`_sql.FromClause.c` attribute is an alias for the :attr:`_sql.FromClause.columns` attribute. :return: a :class:`.ColumnCollection` cCsgd|jkstd|jks*td|jks?tt|_t|_t|_dS(NRRR(RtAssertionErrorRRRRtsetR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR4s   cCs d|jkS(NR(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_cols_populated=scCsdS(sCalled on subclasses to establish the .c collection. Each implementation has a different way of establishing this collection. N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRAtcCs|jdS(sNGiven a column added to the .c collection of an underlying selectable, produce the local version of that column, assuming this selectable ultimately should proxy this column. this is used to "ping" a derived selectable to add a new column to its .c. collection when a Column has been added to one of the Table objects it ultimately derives from. If the given selectable hasn't populated its .c. collection yet, it should at least pass on the message to the contained selectables, but it will return None. This method is currently used by Declarative to allow Table columns to be added to a partially constructed inheritance mapping that may have already produced joins. The method isn't public right now, as the full span of implications and/or caveats aren't yet clear. It's also possible that this functionality could be invoked by default via an event, which would require that selectables maintain a weak referencing collection of all derivations. N(R(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRIIscCs|jd|S(NRL(R9(R/RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_anonymous_fromclausedsN(s2.0sThe :paramref:`_sql.FromClause.select().whereclause` parameter is deprecated and will be removed in version 2.0. Please make use of the :meth:`.Select.where` method to add WHERE criteria to the SELECT statement.(s2.0sThe :meth:`_sql.FromClause.select` method will no longer accept keyword arguments in version 2.0. Please use generative methods from the :class:`_sql.Select` construct in order to apply additional modifications.(+R1R2RARWRCtnamed_with_columnt _hide_fromsRYtschemaR3RXRDt_is_joint_use_schema_mapR+tdeprecated_paramsRRcRR9R[RRRRR5RRR@tmemoized_propertyRRRRRRRt_select_iterableRRRRIR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRsN  ..       tLABEL_STYLE_NONEsvLabel style indicating no automatic labeling should be applied to the columns clause of a SELECT statement. Below, the columns named ``columna`` are both rendered as is, meaning that the name ``columna`` can only refer to the first occurrence of this name within a result set, as well as if the statement were used as a subquery:: >>> from sqlalchemy import table, column, select, true, LABEL_STYLE_NONE >>> table1 = table("table1", column("columna"), column("columnb")) >>> table2 = table("table2", column("columna"), column("columnc")) >>> print(select(table1, table2).join(table2, true()).set_label_style(LABEL_STYLE_NONE)) SELECT table1.columna, table1.columnb, table2.columna, table2.columnc FROM table1 JOIN table2 ON true Used with the :meth:`_sql.Select.set_label_style` method. .. versionadded:: 1.4 tLABEL_STYLE_TABLENAME_PLUS_COLsMLabel style indicating all columns should be labeled as ``_`` when generating the columns clause of a SELECT statement, to disambiguate same-named columns referenced from different tables, aliases, or subqueries. Below, all column names are given a label so that the two same-named columns ``columna`` are disambiguated as ``table1_columna`` and ``table2_columna``:: >>> from sqlalchemy import table, column, select, true, LABEL_STYLE_TABLENAME_PLUS_COL >>> table1 = table("table1", column("columna"), column("columnb")) >>> table2 = table("table2", column("columna"), column("columnc")) >>> print(select(table1, table2).join(table2, true()).set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL)) SELECT table1.columna AS table1_columna, table1.columnb AS table1_columnb, table2.columna AS table2_columna, table2.columnc AS table2_columnc FROM table1 JOIN table2 ON true Used with the :meth:`_sql.GenerativeSelect.set_label_style` method. Equivalent to the legacy method ``Select.apply_labels()``; :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL` is SQLAlchemy's legacy auto-labeling style. :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY` provides a less intrusive approach to disambiguation of same-named column expressions. .. versionadded:: 1.4 tLABEL_STYLE_DISAMBIGUATE_ONLYsLabel style indicating that columns with a name that conflicts with an existing name should be labeled with a semi-anonymizing label when generating the columns clause of a SELECT statement. Below, most column names are left unaffected, except for the second occurrence of the name ``columna``, which is labeled using the label ``columna_1`` to disambiguate it from that of ``tablea.columna``:: >>> from sqlalchemy import table, column, select, true, LABEL_STYLE_DISAMBIGUATE_ONLY >>> table1 = table("table1", column("columna"), column("columnb")) >>> table2 = table("table2", column("columna"), column("columnc")) >>> print(select(table1, table2).join(table2, true()).set_label_style(LABEL_STYLE_DISAMBIGUATE_ONLY)) SELECT table1.columna, table1.columnb, table2.columna AS columna_1, table2.columnc FROM table1 JOIN table2 ON true Used with the :meth:`_sql.GenerativeSelect.set_label_style` method, :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY` is the default labeling style for all SELECT statements outside of :term:`1.x style` ORM queries. .. versionadded:: 1.4 RcBseZdZdZdejfdejfdejfdejfdejfgZeZ d'e e dZ e d'e dZe d'e e d Zed Zd Zd'd Zejd dZedZdZdZe d'd'dZe d'dZe ejd dZe dZejdd(dd)d'dZ eej!dddde d Z"ejd d'e d!Z#ej!d"dd#d'e d$Z$ed%Z%ed&Z&RS(*sRepresent a ``JOIN`` construct between two :class:`_expression.FromClause` elements. The public constructor function for :class:`_expression.Join` is the module-level :func:`_expression.join()` function, as well as the :meth:`_expression.FromClause.join` method of any :class:`_expression.FromClause` (e.g. such as :class:`_schema.Table`). .. seealso:: :func:`_expression.join` :meth:`_expression.FromClause.join` RctleftRRRRcCstjtj|dt|_tjtj|dtj|_|dkrl|j |j|j|_ n'tjtj |jdt j |_ ||_||_dS(sConstruct a new :class:`_expression.Join`. The usual entrypoint here is the :func:`_expression.join` function or the :meth:`_expression.FromClause.join` method of any :class:`_expression.FromClause` object. t deannotatetagainstN(RRhRR}R3Rt self_groupRRYt_match_primariesRt OnClauseRoleRt_asboolRR(R/RRRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt__init__s  cCs||||dtd|S(sReturn an ``OUTER JOIN`` clause element. The returned object is an instance of :class:`_expression.Join`. Similar functionality is also available via the :meth:`_expression.FromClause.outerjoin` method on any :class:`_expression.FromClause`. :param left: The left side of the join. :param right: The right side of the join. :param 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 :meth:`_expression.FromClause.join` or :meth:`_expression.FromClause.outerjoin` methods on the resulting :class:`_expression.Join` object. RR(R3(tclsRRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_outerjoinscCs||||||S(s6Produce a :class:`_expression.Join` object, given two :class:`_expression.FromClause` expressions. E.g.:: j = join(user_table, address_table, user_table.c.id == address_table.c.user_id) stmt = select(user_table).select_from(j) would emit SQL along the lines of:: SELECT user.id, user.name FROM user JOIN address ON user.id = address.user_id Similar functionality is available given any :class:`_expression.FromClause` object (e.g. such as a :class:`_schema.Table`) using the :meth:`_expression.FromClause.join` method. :param left: The left side of the join. :param right: the right side of the join; this is any :class:`_expression.FromClause` object such as a :class:`_schema.Table` object, and may also be a selectable-compatible object such as an ORM-mapped class. :param onclause: a SQL expression representing the ON clause of the join. If left at ``None``, :meth:`_expression.FromClause.join` will attempt to join the two tables based on a foreign key relationship. :param isouter: if True, render a LEFT OUTER JOIN, instead of JOIN. :param full: if True, render a FULL OUTER JOIN, instead of JOIN. .. versionadded:: 1.1 .. seealso:: :meth:`_expression.FromClause.join` - method form, based on a given left side. :class:`_expression.Join` - the type of object produced. ((RRRRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _create_joins4cCs2d|jjt|j|jjt|jfS(Ns Join object on %s(%d) and %s(%d)(RRtidR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRMs    cCs:t|t|kp9|jj|p9|jj|S(N(thashRRR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRVscCs t|S(N(t FromGrouping(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR_sssqlalchemy.sql.utilcCstjj}g|jjD] }|^qg|jjD] }|^q5}|jj|jd|D|j |j j d|D|j j tjg|D]}|j ^qdS(Ncss|]}|jr|VqdS(N(R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys kscss|]}|j|fVqdS(N(t _tq_key_label(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys os(R+RORPRRRRtextendtreduce_columnsRRRRtupdatet itertoolstchain(R/tsqlutilRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRbs     c sttjt|jt|j}fd|Dfd}|ds cs<t|tr8|jkr8|jj|}|SdS(N(t isinstanceR#ttableRU(tobjRetnewelem(t new_froms(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytreplacesRR( RRRRRRtsuperRt_copy_internalst_reset_memoizations(R/RRet all_the_fromsR((RReRsL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRus  cCs:tt|j||jj||jj|dS(N(RRRIRR(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRIscCs7t|tr|j}nd}|j||d|S(Nta_subset(RRRRYt_join_condition(R/RRt left_right((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs c Cs|j||||}t|dkrC|j||||nt|dkrt|trmd}nd}tjd|j|j|fngt|j dD]\}}||k^q} t| dkr| dSt | SdS(s=Create a join condition between two tables or selectables. e.g.:: join_condition(tablea, tableb) would produce an expression along the lines of:: tablea.c.id==tableb.c.tablea_id The join is determined based on the foreign key relationships between the two selectables. If there are multiple ways to join, or no way to join, an error is raised. :param a_subset: An optional expression that is a sub-component of ``a``. An attempt will be made to join to just this sub-component first before looking at the full ``a`` construct, and if found will be successful even if there are other ways to join to ``a``. This allows the "right side" of a join to be passed thereby providing a "natural join". iisI Perhaps you meant to convert the right side to a subquery using alias()?RsACan't find any foreign key relationships between '%s' and '%s'.%sN( t_joincond_scan_left_righttlent_joincond_trim_constraintsRRR*tNoForeignKeysErrorRtlisttvaluesR( RtatbRtconsider_as_foreign_keyst constraintsthinttxtytcrit((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs  5c CsOt|tr|j}nd}|jd|d|d|d|}t|S(NRRRR(RRRRYRtbool(RRRRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _can_joins   c Cs%tjj}tjtj|}tjtj|}tjt }x||fD]}|dkrjqRnxt |j ddD]}|dk r|j |krqny|j|} WnGtjk r} d|j|D} | j| krqqnX| dk r||jj| |j fqqW||k rxt |j ddD]}|dk r|j |krq\ny|j|} WnGtjk r} d|j|D} | j| kr\qq\nX| dk r\||jj| |j fq\q\Wn|rRPqRqRW|S(NRcSs |jjS(N(tparentt_creation_order(tfk((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytRcSsh|]}|jqS((RL(Rtt((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s cSs |jjS(N(RR(R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR RcSsh|]}|jqS((RL(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s (R+RORPRRhRR}t collectionst defaultdictRRYtsortedRRt get_referentR*tNoReferenceErrort find_tablest table_namet constrainttappend( RRRRRRPRRRRtnrtet table_names((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRsN    $   'cCs|rOxFt|D]5}td|jDt|kr||=qqWnt|dkrtd|jD}t|dkrt|d}i|||6}qnt|dkrtjd|j|jfndS(Ncss|]}|jVqdS(N(R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys ,sicss|]}t|VqdS(N(Rg(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys 4sisCan't determine join between '%s' and '%s'; tables have more than one foreign key constraint relationship between them. Please specify the 'onclause' of this join explicitly.(RRtelementsRRR*tAmbiguousForeignKeysErrorR(RRRRRtconsttdedupeR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR#s Rs2.0sThe :paramref:`_sql.Join.select().whereclause` parameter is deprecated and will be removed in version 2.0. Please make use of the :meth:`.Select.where` method to add WHERE criteria to the SELECT statement.R;sThe :meth:`_sql.Join.select` method will no longer accept keyword arguments in version 2.0. Please use generative methods from the :class:`_sql.Select` construct in order to apply additional modifications.cKsG|j|jg}|dk r+||d_`` scheme:: j.c.table_a_id j.c.table_b_a_id :meth:`_expression.Join.alias` also features an alternate option for aliasing joins which produces no enclosing SELECT and does not normally apply labels to the column names. The ``flat=True`` option will call :meth:`_expression.FromClause.alias` against the left and right sides individually. Using this option, no new ``SELECT`` is produced; we instead, from a construct as below:: j = table_a.join(table_b, table_a.c.id == table_b.c.a_id) j = j.alias(flat=True) we get a result like this:: table_a AS table_a_1 JOIN table_b AS table_b_1 ON table_a_1.id = table_b_1.a_id The ``flat=True`` argument is also propagated to the contained selectables, so that a composite join such as:: j = table_a.join( table_b.join(table_c, table_b.c.id == table_c.c.b_id), table_b.c.a_id == table_a.c.id ).alias(flat=True) Will produce an expression like:: table_a AS table_a_1 JOIN ( table_b AS table_b_1 JOIN table_c AS table_c_1 ON table_b_1.id = table_c_1.b_id ) ON table_a_1.id = table_b_1.a_id The standalone :func:`_expression.alias` function as well as the base :meth:`_expression.FromClause.alias` method also support the ``flat=True`` argument as a no-op, so that the argument can be passed to the ``alias()`` method of any selectable. :param name: name given to the alias. :param flat: if True, produce an alias of the left and right sides of this :class:`_expression.Join` and return the join of those two selectables. This produces join expression that does not include an enclosing SELECT. .. seealso:: :ref:`core_tutorial_aliases` :func:`_expression.alias` RRL(R(R/RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9sfcCs2tjg|jD]}t|j|j^qS(N(RRRRRR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCs|g|jj|jjS(N(RRR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR sN(s2.0sThe :paramref:`_sql.Join.select().whereclause` parameter is deprecated and will be removed in version 2.0. Please make use of the :meth:`.Select.where` method to add WHERE criteria to the SELECT statement.(s2.0sThe :meth:`_sql.Join.select` method will no longer accept keyword arguments in version 2.0. Please use generative methods from the :class:`_sql.Select` construct in order to apply additional modifications.('R1R2RARWR)tdp_clauseelementt dp_booleant_traverse_internalsR3RRYRCRt classmethodRRR5RRRR+R[RR RRIRRRRRRRt deprecated_20R RR9RR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs\    4  !  59  ctNoInitcBseZdZRS(cOs;td|jj|jjj|jjjfdS(NsThe %s class is not intended to be constructed directly. Please use the %s() standalone function or the %s() method available from appropriate selectable objects.(R>RR1tlower(R/targRe((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs  (R1R2R(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRstAliasedReturnsRowscBseZdZeZeZeZdej fdej fgZ e dZ e ddZddZdZedZedZd Zd Zed Zed Zed ZRS(sLBase class of aliases against tables, subqueries, and other selectables.telementRLcOs#|j|}|j|||S(N(t__new__t_init(RRReR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRK5scCs tdS(s6Base factory method. Subclasses need to provide this.N(R>(Rt returnsrowsRL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_factory;scCstjtj|d||_||_||_|dkrt|tr|j rt |dd}t|t rd}qnt j t ||pd}n||_dS(Ntapply_propagate_attrsRLtanon(RRhRtReturnsRowsRoleRt _orig_nameRYRRRRRtsafe_constructRRL(R/R=RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR@s     !cCs*tt|j||jj|dS(N(RRRIR(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRIQscCsB|j}t|tr!d}ntjr.|S|jddSdS(Ntanon_1tasciitbackslashreplace(RLRRR+tpy3ktencode(R/RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRUs    cCs|jS(s9Legacy for dialects that are referring to Alias.original.(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytoriginal`scCs#||jkrtS|jj|S(N(RR3RR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRescCs|jj|dS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRjscKsE|j}tt|jd||||jk rA|jndS(NR(RRRRR(R/RRetexisting_element((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRms cCs|gS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRyscCs |jjS(N(RR (R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR }sN(R1R2RAR3t_is_from_containerRRCt_supports_derived_columnsR)Rt dp_anon_nameRRRKRYRRRIR5RR)RRR RRR (((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR's$       RcBs/eZdZdZeZededZ RS(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 :func:`_expression.alias` module level function as well as the :meth:`_expression.FromClause.alias` method available on all :class:`_expression.FromClause` subclasses. .. seealso:: :meth:`_expression.FromClause.alias` R9cCs+tjtj|dtjd|d|S(sReturn an :class:`_expression.Alias` object. An :class:`_expression.Alias` represents any :class:`_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 :meth:`_expression.FromClause.alias` method available on all :class:`_expression.FromClause` subclasses. In terms of a SELECT object as generated from the :func:`_expression.select` function, the :meth:`_expression.SelectBase.alias` method returns an :class:`_expression.Alias` or similar object which represents a named, parenthesized subquery. When an :class:`_expression.Alias` is created from a :class:`_schema.Table` object, this has the effect of the table being rendered as ``tablename AS aliasname`` in a SELECT statement. For :func:`_expression.select` objects, the effect is that of creating a named subquery, i.e. ``(select ...) AS aliasname``. The ``name`` parameter is optional, and provides the name to use in the rendered SQL. If blank, an "anonymous" name will be deterministically generated at compile time. Deterministic means the name is guaranteed to be unique against other constructs used in the same statement, and will also be the same name for each successive compilation of the same statement object. :param selectable: any :class:`_expression.FromClause` subclass, such as a table, select statement, etc. :param name: string name to be assigned as the alias. If ``None``, a name will be deterministically generated at compile time. :param flat: Will be passed through to if the given selectable is an instance of :class:`_expression.Join` - see :meth:`_expression.Join.alias` for details. t allow_selectRLR(RRhRR}R3R9(RR=RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs/N( R1R2RARWR3R4RRYRCR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs tTableValuedAliascBseZdZdZeZeZeZeZ de j fde j fde j fde jfde jfgZd d edZejdZd d Zd d Zd ed ZRS( sAn alias against a "table valued" SQL function. This construct provides for a SQL function that returns columns to be used in the FROM clause of a SELECT statement. The object is generated using the :meth:`_functions.FunctionElement.table_valued` method, e.g.:: >>> from sqlalchemy import select, func >>> fn = func.json_array_elements_text('["one", "two", "three"]').table_valued("value") >>> print(select(fn.c.value)) SELECT anon_1.value FROM json_array_elements_text(:json_array_elements_text_1) AS anon_1 .. versionadded:: 1.4.0b2 .. seealso:: :ref:`tutorial_functions_table_valued` - in the :ref:`unified_tutorial` ttable_valued_aliasRRLt_tableval_typet_render_derivedt_render_derived_w_typescCsGtt|j|d|||_|dkr:tjn||_dS(NRL(RR/Rtjoins_implicitlyRYRRR1(R/R=RLttable_value_typeR4((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs cCst||jS(sReturn a column expression representing this :class:`_sql.TableValuedAlias`. This accessor is used to implement the :meth:`_functions.FunctionElement.column_valued` method. See that method for further details. E.g.:: >>> print(select(func.some_func().table_valued("value").column)) SELECT anon_1 FROM some_func() AS anon_1 .. seealso:: :meth:`_functions.FunctionElement.column_valued` (R'R1(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRHscCsLtj|d|d|jd|j}|jrHt|_|j|_n|S(sReturn a new alias of this :class:`_sql.TableValuedAlias`. This creates a distinct FROM object that will be distinguished from the original one when used in a SQL statement. RLR5R4(R/RKR1R4R2R3R3(R/RLttva((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9s    cCs|jd|}t|_|S(sReturn a new :class:`_sql.TableValuedAlias` with the lateral flag set, so that it renders as LATERAL. .. seealso:: :func:`_expression.lateral` RL(R9R3RF(R/RLR6((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRM,s  cCs@tj|jd|d|jd|j}t|_||_|S(sfApply "render derived" to this :class:`_sql.TableValuedAlias`. This has the effect of the individual column names listed out after the alias name in the "AS" sequence, e.g.:: >>> print( ... select( ... func.unnest(array(["one", "two", "three"])). table_valued("x", with_ordinality="o").render_derived() ... ) ... ) SELECT anon_1.x, anon_1.o FROM unnest(ARRAY[%(param_1)s, %(param_2)s, %(param_3)s]) WITH ORDINALITY AS anon_1(x, o) The ``with_types`` keyword will render column types inline within the alias expression (this syntax currently applies to the PostgreSQL database):: >>> print( ... select( ... func.json_to_recordset( ... '[{"a":1,"b":"foo"},{"a":"2","c":"bar"}]' ... ) ... .table_valued(column("a", Integer), column("b", String)) ... .render_derived(with_types=True) ... ) ... ) SELECT anon_1.a, anon_1.b FROM json_to_recordset(:json_to_recordset_1) AS anon_1(a INTEGER, b VARCHAR) :param name: optional string name that will be applied to the alias generated. If left as None, a unique anonymizing name will be used. :param with_types: if True, the derived columns will include the datatype specification with each column. This is a special syntax currently known to be required by PostgreSQL for some SQL functions. RLR5R4(R/RKRR1R4R3R2R3(R/RLt with_typest new_alias((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytrender_derived9s0     N(R1R2RARWR3R,RCR2R3R4R)RR-tdp_typeRRRYRRtmemoized_attributeRHR9RMR9(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR/s$       RJcBs2eZdZdZeZeZeddZ RS(sRepresent a LATERAL subquery. This object is constructed from the :func:`_expression.lateral` module level function as well as the :meth:`_expression.FromClause.lateral` method available on all :class:`_expression.FromClause` subclasses. While LATERAL is part of the SQL standard, currently only more recent PostgreSQL versions provide support for this keyword. .. versionadded:: 1.1 .. seealso:: :ref:`tutorial_lateral_correlation` - overview of usage. RMcCs%tjtj|dtjd|S(sReturn a :class:`_expression.Lateral` object. :class:`_expression.Lateral` is an :class:`_expression.Alias` subclass that represents a subquery with the LATERAL keyword applied to it. The special behavior of a LATERAL subquery is that it appears in the FROM clause of an enclosing SELECT, but may correlate to other FROM clauses of that SELECT. It is a special case of subquery only supported by a small number of backends, currently more recent PostgreSQL versions. .. versionadded:: 1.1 .. seealso:: :ref:`tutorial_lateral_correlation` - overview of usage. texplicit_subqueryRL(RRhRR}R3RM(RR=RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRsN( R1R2RARWR3RFR4RRYR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRJts RcBsueZdZdZejdejfdejfgZedddZ e j ddddZ dZRS( sdRepresent a TABLESAMPLE clause. This object is constructed from the :func:`_expression.tablesample` module level function as well as the :meth:`_expression.FromClause.tablesample` method available on all :class:`_expression.FromClause` subclasses. .. versionadded:: 1.1 .. seealso:: :func:`_expression.tablesample` RRRcCs(tjtj|j|d|d|S(sReturn a :class:`_expression.TableSample` object. :class:`_expression.TableSample` is an :class:`_expression.Alias` subclass that represents a table with the TABLESAMPLE clause applied to it. :func:`_expression.tablesample` is also available from the :class:`_expression.FromClause` class via the :meth:`_expression.FromClause.tablesample` method. The TABLESAMPLE clause allows selecting a randomly selected approximate percentage of rows from a table. It supports multiple sampling methods, most commonly BERNOULLI and SYSTEM. e.g.:: from sqlalchemy import func selectable = people.tablesample( func.bernoulli(1), name='alias', seed=func.random()) stmt = select(selectable.c.people_id) Assuming ``people`` with a column ``people_id``, the above statement would render as:: SELECT alias.people_id FROM people AS alias TABLESAMPLE bernoulli(:bernoulli_1) REPEATABLE (random()) .. versionadded:: 1.1 :param sampling: a ``float`` percentage between 0 and 100 or :class:`_functions.Function`. :param name: optional alias name :param seed: any real-valued SQL expression. When specified, the REPEATABLE sub-clause is also rendered. RLR(RRhRR}R(RR=RRLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs,ssqlalchemy.sql.functionscCsetjj}t||js3|jj|}n||_||_t t |j |d|dS(NRL( R+ROt sql_functionsRtFunctiontfunctsystemRRRRR(R/R=RRLRt functions((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs    cCs|jS(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _get_methodsN(R1R2RARWRRR)RRRYRR+R[RRB(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs /  tCTEcBseZdZdZejdejfdejfdejfdejfge j e j Ze d edZd eed d d d dZdZd ed Zd Zd Zd ZRS(sURepresent a Common Table Expression. The :class:`_expression.CTE` object is obtained using the :meth:`_sql.SelectBase.cte` method from any SELECT statement. A less often available syntax also allows use of the :meth:`_sql.HasCTE.cte` method present on :term:`DML` constructs such as :class:`_sql.Insert`, :class:`_sql.Update` and :class:`_sql.Delete`. See the :meth:`_sql.HasCTE.cte` method for usage details on CTEs. .. seealso:: :ref:`tutorial_subqueries_ctes` - in the 2.0 tutorial :meth:`_sql.HasCTE.cte` - examples of calling styles tctet _cte_aliast _restatest recursivetnestingcCs%tjtj|jd|d|S(sReturn a new :class:`_expression.CTE`, or Common Table Expression instance. Please see :meth:`_expression.HasCTE.cte` for detail on CTE usage. RLRG(RRhRt HasCTERoleRD(RR=RLRG((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR$sc Csh||_||_||_||_|r6||_n|rH||_ntt|j|d|dS(NRL( RGRHRERFR]RoRRCR( R/R=RLRGRHRERFR]Ro((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR0s      cCs6|jdk r"|jj|n|jj|dS(N(RERYRR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRFscCs@tj|jd|d|jd|jd|d|jd|jS(s2Return an :class:`_expression.Alias` of this :class:`_expression.CTE`. This method is a CTE-specific specialization of the :meth:`_expression.FromClause.alias` method. .. seealso:: :ref:`tutorial_using_aliases` :func:`_expression.alias` RLRGRHRER]Ro(RCRKRRGRHR]Ro(R/RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9Ls    cGsLtj|jj|d|jd|jd|jd|d|jd|jS(sReturn a new :class:`_expression.CTE` with a SQL ``UNION`` of the original CTE against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. .. seealso:: :meth:`_sql.HasCTE.cte` - examples of calling styles RLRGRHRFR]Ro( RCRKRR|RLRGRHR]Ro(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR|ds    cGsLtj|jj|d|jd|jd|jd|d|jd|jS(sReturn a new :class:`_expression.CTE` with a SQL ``UNION ALL`` of the original CTE against the given selectables provided as positional arguments. :param \*other: one or more elements with which to create a UNION. .. versionchanged:: 1.4.28 multiple elements are now accepted. .. seealso:: :meth:`_sql.HasCTE.cte` - examples of calling styles RLRGRHRFR]Ro( RCRKRt union_allRLRGRHR]Ro(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRJ}s    cCs|jdk r|jS|S(s A recursive CTE is updated to attach the recursive part. Updated CTEs should still refer to the original CTE. This function returns this reference identifier. N(RFRY(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_get_reference_ctesN(R1R2RARWRRR)RRR\RmRnRsRRYRCRRRR9R|RJRK(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRCs" K   tHasCTEcBsGeZdZdejfgZdZedZde e dZ RS(sTMixin that declares a class to include CTE support. .. versionadded:: 1.1 t_independent_ctescCs+tjtj|}|j|f7_dS(sdAdd a :class:`_sql.CTE` to this statement object that will be independently rendered even if not referenced in the statement otherwise. This feature is useful for the use case of embedding a DML statement such as an INSERT or UPDATE as a CTE inline with a primary statement that may draw from its results indirectly; while PostgreSQL is known to support this usage, it may not be supported by other backends. E.g.:: from sqlalchemy import table, column, select t = table('t', column('c1'), column('c2')) ins = t.insert().values({"c1": "x", "c2": "y"}).cte() stmt = select(t).add_cte(ins) Would render:: WITH anon_1 AS (INSERT INTO t (c1, c2) VALUES (:param_1, :param_2)) SELECT t.c1, t.c2 FROM t Above, the "anon_1" CTE is not referred towards in the SELECT statement, however still accomplishes the task of running an INSERT statement. Similarly in a DML-related context, using the PostgreSQL :class:`_postgresql.Insert` construct to generate an "upsert":: from sqlalchemy import table, column from sqlalchemy.dialects.postgresql import insert t = table("t", column("c1"), column("c2")) delete_statement_cte = ( t.delete().where(t.c.c1 < 1).cte("deletions") ) insert_stmt = insert(t).values({"c1": 1, "c2": 2}) update_statement = insert_stmt.on_conflict_do_update( index_elements=[t.c.c1], set_={ "c1": insert_stmt.excluded.c1, "c2": insert_stmt.excluded.c2, }, ).add_cte(delete_statement_cte) print(update_statement) The above statement renders as:: WITH deletions AS (DELETE FROM t WHERE t.c1 < %(c1_1)s) INSERT INTO t (c1, c2) VALUES (%(c1)s, %(c2)s) ON CONFLICT (c1) DO UPDATE SET c1 = excluded.c1, c2 = excluded.c2 .. versionadded:: 1.4.21 N(RRhRt IsCTERoleRM(R/RD((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytadd_ctes@cCstj|d|d|d|S(sK"Return a new :class:`_expression.CTE`, or Common Table Expression instance. Common table expressions are a SQL standard whereby SELECT statements can draw upon secondary statements specified along with the primary statement, using a clause called "WITH". Special semantics regarding UNION can also be employed to allow "recursive" queries, where a SELECT statement can draw upon the set of rows that have previously been selected. CTEs can also be applied to DML constructs UPDATE, INSERT and DELETE on some databases, both as a source of CTE rows when combined with RETURNING, as well as a consumer of CTE rows. .. versionchanged:: 1.1 Added support for UPDATE/INSERT/DELETE as CTE, CTEs added to UPDATE/INSERT/DELETE. SQLAlchemy detects :class:`_expression.CTE` objects, which are treated similarly to :class:`_expression.Alias` objects, as special elements to be delivered to the FROM clause of the statement as well as to a WITH clause at the top of the statement. For special prefixes such as PostgreSQL "MATERIALIZED" and "NOT MATERIALIZED", the :meth:`_expression.CTE.prefix_with` method may be used to establish these. .. versionchanged:: 1.3.13 Added support for prefixes. In particular - MATERIALIZED and NOT MATERIALIZED. :param name: name given to the common table expression. Like :meth:`_expression.FromClause.alias`, the name can be left as ``None`` in which case an anonymous symbol will be used at query compile time. :param recursive: if ``True``, will render ``WITH RECURSIVE``. A recursive common table expression is intended to be used in conjunction with UNION ALL in order to derive rows from those already selected. :param nesting: if ``True``, will render the CTE locally to the actual statement. .. versionadded:: 1.4.24 The following examples include two from PostgreSQL's documentation at https://www.postgresql.org/docs/current/static/queries-with.html, as well as additional examples. Example 1, non recursive:: from sqlalchemy import (Table, Column, String, Integer, MetaData, select, func) metadata = MetaData() orders = Table('orders', metadata, Column('region', String), Column('amount', Integer), Column('product', String), Column('quantity', Integer) ) regional_sales = select( orders.c.region, func.sum(orders.c.amount).label('total_sales') ).group_by(orders.c.region).cte("regional_sales") top_regions = select(regional_sales.c.region).\ where( regional_sales.c.total_sales > select( func.sum(regional_sales.c.total_sales) / 10 ) ).cte("top_regions") statement = select( orders.c.region, orders.c.product, func.sum(orders.c.quantity).label("product_units"), func.sum(orders.c.amount).label("product_sales") ).where(orders.c.region.in_( select(top_regions.c.region) )).group_by(orders.c.region, orders.c.product) result = conn.execute(statement).fetchall() Example 2, WITH RECURSIVE:: from sqlalchemy import (Table, Column, String, Integer, MetaData, select, func) metadata = MetaData() parts = Table('parts', metadata, Column('part', String), Column('sub_part', String), Column('quantity', Integer), ) included_parts = select(\ parts.c.sub_part, parts.c.part, parts.c.quantity\ ).\ where(parts.c.part=='our part').\ cte(recursive=True) incl_alias = included_parts.alias() parts_alias = parts.alias() included_parts = included_parts.union_all( select( parts_alias.c.sub_part, parts_alias.c.part, parts_alias.c.quantity ).\ where(parts_alias.c.part==incl_alias.c.sub_part) ) statement = select( included_parts.c.sub_part, func.sum(included_parts.c.quantity). label('total_quantity') ).\ group_by(included_parts.c.sub_part) result = conn.execute(statement).fetchall() Example 3, an upsert using UPDATE and INSERT with CTEs:: from datetime import date from sqlalchemy import (MetaData, Table, Column, Integer, Date, select, literal, and_, exists) metadata = MetaData() visitors = Table('visitors', metadata, Column('product_id', Integer, primary_key=True), Column('date', Date, primary_key=True), Column('count', Integer), ) # add 5 visitors for the product_id == 1 product_id = 1 day = date.today() count = 5 update_cte = ( visitors.update() .where(and_(visitors.c.product_id == product_id, visitors.c.date == day)) .values(count=visitors.c.count + count) .returning(literal(1)) .cte('update_cte') ) upsert = visitors.insert().from_select( [visitors.c.product_id, visitors.c.date, visitors.c.count], select(literal(product_id), literal(day), literal(count)) .where(~exists(update_cte.select())) ) connection.execute(upsert) Example 4, Nesting CTE (SQLAlchemy 1.4.24 and above):: value_a = select( literal("root").label("n") ).cte("value_a") # A nested CTE with the same name as the root one value_a_nested = select( literal("nesting").label("n") ).cte("value_a", nesting=True) # Nesting CTEs takes ascendency locally # over the CTEs at a higher level value_b = select(value_a_nested.c.n).cte("value_b") value_ab = select(value_a.c.n.label("a"), value_b.c.n.label("b")) The above query will render the second CTE nested inside the first, shown with inline parameters below as:: WITH value_a AS (SELECT 'root' AS n), value_b AS (WITH value_a AS (SELECT 'nesting' AS n) SELECT value_a.n AS n FROM value_a) SELECT value_a.n AS a, value_b.n AS b FROM value_a, value_b Example 5, Non-Linear CTE (SQLAlchemy 1.4.28 and above):: edge = Table( "edge", metadata, Column("id", Integer, primary_key=True), Column("left", Integer), Column("right", Integer), ) root_node = select(literal(1).label("node")).cte( "nodes", recursive=True ) left_edge = select(edge.c.left).join( root_node, edge.c.right == root_node.c.node ) right_edge = select(edge.c.right).join( root_node, edge.c.left == root_node.c.node ) subgraph_cte = root_node.union(left_edge, right_edge) subgraph = select(subgraph_cte) The above query will render 2 UNIONs inside the recursive CTE:: WITH RECURSIVE nodes(node) AS ( SELECT 1 AS node UNION SELECT edge."left" AS "left" FROM edge JOIN nodes ON edge."right" = nodes.node UNION SELECT edge."right" AS "right" FROM edge JOIN nodes ON edge."left" = nodes.node ) SELECT nodes.node FROM nodes .. seealso:: :meth:`_orm.Query.cte` - ORM version of :meth:`_expression.HasCTE.cte`. RLRGRH(RCRK(R/RLRGRH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRDs(N( R1R2RAR)tdp_clauseelement_listt_has_ctes_traverse_internalsRMRRORYRCRD(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRLs CtSubquerycBsVeZdZdZeZeZeddZ e j dddZ dZ RS(sRepresent a subquery of a SELECT. A :class:`.Subquery` is created by invoking the :meth:`_expression.SelectBase.subquery` method, or for convenience the :meth:`_expression.SelectBase.alias` method, on any :class:`_expression.SelectBase` subclass which includes :class:`_expression.Select`, :class:`_expression.CompoundSelect`, and :class:`_expression.TextualSelect`. As rendered in a FROM clause, it represents the body of the SELECT statement inside of parenthesis, followed by the usual "AS " that defines all "alias" objects. The :class:`.Subquery` object is very similar to the :class:`_expression.Alias` object and can be used in an equivalent way. The difference between :class:`_expression.Alias` and :class:`.Subquery` is that :class:`_expression.Alias` always contains a :class:`_expression.FromClause` object whereas :class:`.Subquery` always contains a :class:`_expression.SelectBase` object. .. versionadded:: 1.4 The :class:`.Subquery` class was added which now serves the purpose of providing an aliased version of a SELECT statement. R8cCstjtj|jd|S(s#Return a :class:`.Subquery` object.RL(RRhRtSelectStatementRoleR8(RR=RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR ss1.4sxThe :meth:`.Subquery.as_scalar` method, which was previously ``Alias.as_scalar()`` prior to version 1.4, is deprecated and will be removed in a future release; Please use the :meth:`_expression.Select.scalar_subquery` method of the :func:`_expression.select` construct before constructing a subquery object, or with the ORM use the :meth:`_query.Query.scalar_subquery` method.cCs|jjtjS(N(RR Rtscalar_subquery(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt as_scalar s cCs/tjdd|jj||||dtS(NsExecuting a subquery object is deprecated and will raise ObjectNotExecutableError in an upcoming release. Please execute the underlying select() statement directly.s1.4t_force(R+twarn_deprecatedRt_execute_on_connectionR3(R/t connectiont multiparamstparamstexecution_options((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRX s  N(R1R2RARWR3t _is_subqueryR4RRYRR+RZRURX(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRR s RcBseZdZdejfgZdZdZedZ edZ edZ dZ dZ d Zed Zed Zd Zd ZRS(s%Represent a grouping of a FROM clauseRcCstjtj||_dS(N(RRhRR}R(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR0 scCsdS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR3 scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR6 scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR: scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR> scCs|jj|S(N(RR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRB scKst|jj|S(N(RRR9(R/Re((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9E scKst|jj|S(N(RRR(R/Re((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRH scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRK scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRO scCsi|jd6S(NR(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt __getstate__S scCs|d|_dS(NR(R(R/tstate((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt __setstate__V s(R1R2RAR)RRRRR5RRRRR9RRRR^R`(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR+ s      t TableClausecBseZdZdZdejfdejfdejfgZeZ e Z dZ dZdZdZdZejd Zd Zejd de d Zejd dde d Zejd ddZedZRS(s-Represents a minimal "table" construct. This is a lightweight table object that has only a name, a collection of columns, which are typically produced by the :func:`_expression.column` function, and a schema:: from sqlalchemy import table, column user = table("user", column("id"), column("name"), column("description"), ) The :class:`_expression.TableClause` construct serves as the base for the more commonly used :class:`_schema.Table` object, providing the usual set of :class:`_expression.FromClause` services including the ``.c.`` collection and statement generation methods. It does **not** provide all the additional schema-level services of :class:`_schema.Table`, including constraints, references to other tables, or support for :class:`_schema.MetaData`-level services. It's useful on its own as an ad-hoc construct used to generate quick SQL statements when a more fully fledged :class:`_schema.Table` is not on hand. RRRLRcOstt|j||_t|_t|_t|_ x|D]}|j |qGW|j dd}|dk r||_ n|j dk rd|j |jf|_n |j|_|rtjdt|ndS(sProduce a new :class:`_expression.TableClause`. The object returned is an instance of :class:`_expression.TableClause`, which represents the "syntactical" portion of the schema-level :class:`_schema.Table` object. It may be used to construct lightweight table constructs. .. versionchanged:: 1.0.0 :func:`_expression.table` can now be imported from the plain ``sqlalchemy`` namespace like any other SQL element. :param name: Name of the table. :param columns: A collection of :func:`_expression.column` constructs. :param schema: The schema name for this table. .. versionadded:: 1.3.18 :func:`_expression.table` can now accept a ``schema`` argument. Rs%s.%ssUnsupported argument(s): %sN(RRaRRLRRRRRRt append_columnRaRYRtfullnameR*RbR(R/RLRReRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s        cCs,|jdk r!|jd|jS|jSdS(Nt.(RRYRL(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt__str__ scCsdS(N((R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRI scCsdS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs'tjr|jS|jjddSdS(NR%R&(R+R'RLR((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s cKs]|j}|dk r@||k r@tjd|j|fn|jj|||_dS(Ns1column object '%s' already assigned to table '%s'(RRYR*RbRRtadd(R/RRetexisting((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRb s ssqlalchemy.sql.dmlcKs"tjjj|d|d||S(sGenerate an :func:`_expression.insert` construct against this :class:`_expression.TableClause`. E.g.:: table.insert().values(name='foo') See :func:`_expression.insert` for argument and usage information. Rtinline(R+ROtsql_dmltInsert(R/RRhR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytinsert s c Ks(tjjj|d|d|d||S(sGenerate an :func:`_expression.update` construct against this :class:`_expression.TableClause`. E.g.:: table.update().where(table.c.id==7).values(name='foo') See :func:`_expression.update` for argument and usage information. RRRh(R+RORitUpdate(R/RRRhR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s cKstjjj|||S(sGenerate a :func:`_expression.delete` construct against this :class:`_expression.TableClause`. E.g.:: table.delete().where(table.c.id==7) See :func:`_expression.delete` for argument and usage information. (R+RORitDelete(R/RR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytdelete s cCs|gS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR sN(R1R2RARWR)t)dp_fromclause_canonical_column_collectiont dp_stringRR3RRCtimplicit_returningRYt_autoincrement_columnRReRIRR+RRRbR[RkRRnR5R(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRaZ s,   *       t ForUpdateArgcBseZdejfdejfdejfdejfgZedZdZdZ dZ e e d e e dZ RS( toftnowaittreadt skip_lockedcCsJt|tr|S|dtfkr)dS|tkr<tSt|SdS(N(RRsRYRCR3(Rtwith_for_update((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_from_argument s cCsgt|tof|j|jkof|j|jkof|j|jkof|j|jkof|j|jkS(N(RRsRuRvRwt key_shareRt(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt__eq__ s cCs|j| S(N(R{(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt__ne__) scCs t|S(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt__hash__, scCst||_||_||_||_|dk rggtj|D]}tjt j |^q@|_ n d|_ dS(sZRepresents arguments specified to :meth:`_expression.Select.for_update`. N( RuRvRwRzRYR+tto_listRRhRtColumnsClauseRoleRt(R/RuRvRtRwRztelem((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR/ s     4N(R1R2R)RPRRRRyR{R|R}RCRYR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs s     tValuescBseZdZeZdZd Zdejfdej fdej fdej fgZ dZ edZedZedd Zed Zd Zed ZRS(sRepresent a ``VALUES`` construct that can be used as a FROM element in a statement. The :class:`_expression.Values` object is created from the :func:`_expression.values` function. .. versionadded:: 1.4 Rt _column_argst_dataRLt literal_bindscOs\tt|j||_|jdd|_|jdt|_|jdk |_ dS(sConstruct a :class:`_expression.Values` construct. The column expressions and the actual data for :class:`_expression.Values` are given in two separate steps. The constructor receives the column expressions typically as :func:`_expression.column` constructs, and the data is then passed via the :meth:`_expression.Values.data` method as a list, which can be called multiple times to add more data, e.g.:: from sqlalchemy import column from sqlalchemy import values value_expr = values( column('id', Integer), column('name', String), name="my_values" ).data( [(1, 'name1'), (2, 'name2'), (3, 'name3')] ) :param \*columns: column expressions, typically composed using :func:`_expression.column` objects. :param name: the name for this VALUES construct. If omitted, the VALUES construct will be unnamed in a SQL expression. Different backends may have different requirements here. :param literal_binds: Defaults to False. Whether or not to render the data values inline in the SQL output, rather than using bound parameters. RLRN( RRRRRaRYRLRCRR(R/RRe((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR` s $ cCsg|jD]}|j^q S(N(Rttype(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _column_types scKs||_|jdk |_dS(sYReturn a new :class:`_expression.Values` construct that is a copy of this one with the given name. This method is a VALUES-specific specialization of the :meth:`_expression.FromClause.alias` method. .. seealso:: :ref:`tutorial_using_aliases` :func:`_expression.alias` N(RLRYR(R/RLRe((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9 s cCs%t|_|dk r!||_ndS(sReturn a new :class:`_expression.Values` with the lateral flag set, so that it renders as LATERAL. .. seealso:: :func:`_expression.lateral` N(R3RFRYRL(R/RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRM s  cCs|j|f7_dS(srReturn a new :class:`_expression.Values` construct, adding the given data to the data list. E.g.:: my_values = my_values.data([(1, 'value 1'), (2, 'value2')]) :param values: a sequence (i.e. list) of tuples that map to the column expressions given in the :class:`_expression.Values` constructor. N(R(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytdata scCs1x*|jD]}|jj|||_q WdS(N(RRRfR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|gS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s(N(R1R2RAR3RRWRR)RPtdp_dml_multi_valuesRpRRRR5RRR9RYRMRRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRI s      * t SelectBasecBs+eZdZeZeZdZdZedZ edZ edZ ee j dddZed Ze j dd d Zejd Ze j dd dZdZdZdZddZedZddZdZdedZRS(sBase class for SELECT statements. This includes :class:`_expression.Select`, :class:`_expression.CompoundSelect` and :class:`_expression.TextualSelect`. cCs tdS(N(R>(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jdS(N(R(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRI scCs tdS(s$A :class:`_expression.ColumnCollection` representing the columns that this SELECT statement or similar construct returns in its result set. This collection differs from the :attr:`_expression.FromClause.columns` collection of a :class:`_expression.FromClause` in that the columns within this collection cannot be directly nested inside another SELECT statement; a subquery must be applied first which provides for the necessary parenthesization required by SQL. .. note:: The :attr:`_sql.SelectBase.selected_columns` collection does not include expressions established in the columns clause using the :func:`_sql.text` construct; these are silently omitted from the collection. To use plain textual column expressions inside of a :class:`_sql.Select` construct, use the :func:`_sql.literal_column` construct. .. seealso:: :attr:`_sql.Select.selected_columns` .. versionadded:: 1.4 N(R>(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytselected_columns scCs tdS(s A sequence of expressions that correspond to what is rendered in the columns clause, including :class:`_sql.TextClause` constructs. .. versionadded:: 1.4.12 .. seealso:: :attr:`_sql.SelectBase.exported_columns` N(R>(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR? s cCs|jS(sfA :class:`_expression.ColumnCollection` that represents the "exported" columns of this :class:`_expression.Selectable`, not including :class:`_sql.TextClause` constructs. The "exported" columns for a :class:`_expression.SelectBase` object are synonymous with the :attr:`_expression.SelectBase.selected_columns` collection. .. versionadded:: 1.4 .. seealso:: :attr:`_expression.Select.exported_columns` :attr:`_expression.Selectable.exported_columns` :attr:`_expression.FromClause.exported_columns` (R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR@ ss1.4sThe :attr:`_expression.SelectBase.c` and :attr:`_expression.SelectBase.columns` attributes are deprecated and will be removed in a future release; these attributes implicitly create a subquery that should be explicit. Please call :meth:`_expression.SelectBase.subquery` first in order to create a subquery, which then contains this attribute. To access the columns that this SELECT object SELECTs from, use the :attr:`_expression.SelectBase.selected_columns` attribute.cCs |jjS(N(t_implicit_subqueryR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR/ scCs|jS(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR@ ss The :meth:`_expression.SelectBase.select` method is deprecated and will be removed in a future release; this method implicitly creates a subquery that should be explicit. Please call :meth:`_expression.SelectBase.subquery` first in order to create a subquery, which then can be selected.cOs|jj||S(N(RR(R/RRe((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRD s cCs |jS(N(R8(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRP ssThe :meth:`_expression.SelectBase.as_scalar` method is deprecated and will be removed in a future release. Please refer to :meth:`_expression.SelectBase.scalar_subquery`.cCs |jS(N(RT(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRUT scCs t|S(saReturn an :class:`_sql.Exists` representation of this selectable, which can be used as a column expression. The returned object is an instance of :class:`_sql.Exists`. .. seealso:: :func:`_sql.exists` :ref:`tutorial_exists` - in the :term:`2.0 style` tutorial. .. versionadded:: 1.4 (tExists(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytexists^ scCs+|jtk r!|jt}nt|S(sXReturn a 'scalar' representation of this selectable, which can be used as a column expression. The returned object is an instance of :class:`_sql.ScalarSelect`. Typically, a select statement which has only one column in its columns clause is eligible to be used as a scalar expression. The scalar subquery can then be used in the WHERE clause or columns clause of an enclosing SELECT. Note that the scalar subquery differentiates from the FROM-level subquery that can be produced using the :meth:`_expression.SelectBase.subquery` method. .. versionchanged: 1.4 - the ``.as_scalar()`` method was renamed to :meth:`_expression.SelectBase.scalar_subquery`. .. seealso:: :ref:`tutorial_scalar_subquery` - in the 2.0 tutorial (t _label_styleRR t ScalarSelect(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRTo scCs|jj|S(sReturn a 'scalar' representation of this selectable, embedded as a subquery with a label. .. seealso:: :meth:`_expression.SelectBase.as_scalar`. (RTtlabel(R/RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s cCstj||S(sZReturn a LATERAL alias of this :class:`_expression.Selectable`. The return value is the :class:`_expression.Lateral` construct also provided by the top-level :func:`_expression.lateral` function. .. versionadded:: 1.1 .. seealso:: :ref:`tutorial_lateral_correlation` - overview of usage. (RJR(R/RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRM s cCs|gS(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCstj|j|S(sReturn a subquery of this :class:`_expression.SelectBase`. A subquery is from a SQL perspective a parenthesized, named construct that can be placed in the FROM clause of another SELECT statement. Given a SELECT statement such as:: stmt = select(table.c.id, table.c.name) The above statement might look like:: SELECT table.id, table.name FROM table The subquery form by itself renders the same way, however when embedded into the FROM clause of another SELECT statement, it becomes a named sub-element:: subq = stmt.subquery() new_stmt = select(subq) The above renders as:: SELECT anon_1.id, anon_1.name FROM (SELECT table.id, table.name FROM table) AS anon_1 Historically, :meth:`_expression.SelectBase.subquery` is equivalent to calling the :meth:`_expression.FromClause.alias` method on a FROM object; however, as a :class:`_expression.SelectBase` object is not directly FROM object, the :meth:`_expression.SelectBase.subquery` method provides clearer semantics. .. versionadded:: 1.4 (RRRKt_ensure_disambiguated_names(R/RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR8 s(cCs tdS(stEnsure that the names generated by this selectbase will be disambiguated in some way, if possible. N(R>(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jd|S(s.Return a named subquery against this :class:`_expression.SelectBase`. For a :class:`_expression.SelectBase` (as opposed to a :class:`_expression.FromClause`), this returns a :class:`.Subquery` object which behaves mostly the same as the :class:`_expression.Alias` object that is used with a :class:`_expression.FromClause`. .. versionchanged:: 1.4 The :meth:`_expression.SelectBase.alias` method is now a synonym for the :meth:`_expression.SelectBase.subquery` method. RL(R8(R/RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR9 sN(R1R2RAR3REt is_selectRRIR5RR?R@R+RZRRRRR;RRURRTRRYRMRR8RRCR9(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s8       * tSelectStatementGroupingcBseZdZdZdejfgZeZdZ dZ dZ dZ e dZe dZdd Zd Zd Zd Ze d Ze dZe dZRS(sRepresent a grouping of a :class:`_expression.SelectBase`. This differs from :class:`.Subquery` in that we are still an "inner" SELECT statement, this is strictly for grouping inside of compound selects. tselect_statement_groupingRcCstjtj||_dS(N(RRhRRSR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs0|jj}||jk r(t|S|SdS(N(RRR(R/t new_element((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s cCs|jS(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytget_label_style scCst|jj|S(N(RRR (R/t label_style((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR  scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jS(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytselect_statement scCs|S(N((R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jj|S(N(Rt_generate_columns_plus_names(R/tanon_for_dupe_key((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jj|dS(N(RR(R/R8((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|jj|S(N(Rt_generate_proxy_for_new_column(R/RHR8((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs |jjS(N(RR?(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR?" scCs |jjS(s:A :class:`_expression.ColumnCollection` representing the columns that the embedded SELECT statement returns in its result set, not including :class:`_sql.TextClause` constructs. .. versionadded:: 1.4 .. seealso:: :attr:`_sql.Select.selected_columns` (RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR& scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR6 sN(R1R2RARWR)RRR3t_is_select_containerRRRR R5RRRYRRRRR?RR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s"        tDeprecatedSelectBaseGenerationscBsDeZdZejdddZejdddZRS(sA collection of methods available on :class:`_sql.Select` and :class:`_sql.CompoundSelect`, these are all **deprecated** methods as they modify the object in-place. s1.4sThe :meth:`_expression.GenerativeSelect.append_order_by` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.GenerativeSelect.order_by`.cGs|jj||dS(sAppend the given ORDER BY criterion applied to this selectable. The criterion will be appended to any pre-existing ORDER BY criterion. This is an **in-place** mutation method; the :meth:`_expression.GenerativeSelect.order_by` method is preferred, as it provides standard :term:`method chaining`. .. seealso:: :meth:`_expression.GenerativeSelect.order_by` N(torder_bytnon_generative(R/tclauses((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytappend_order_byB ssThe :meth:`_expression.GenerativeSelect.append_group_by` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.GenerativeSelect.group_by`.cGs|jj||dS(s\Append the given GROUP BY criterion applied to this selectable. The criterion will be appended to any pre-existing GROUP BY criterion. This is an **in-place** mutation method; the :meth:`_expression.GenerativeSelect.group_by` method is preferred, as it provides standard :term:`method chaining`. N(tgroup_byR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytappend_group_byZ s(R1R2RAR+RZRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR; stGenerativeSelectc BseZdZdZdZdZdZdZdZ dZ e j dde eddddddZeeedeedZdZdZe jdd d d Zed Zed ZdddZdZedZdZedZedZedZeeedZ edZ!ee j"ddZ#edZ$edZ%RS(s&Base class for SELECT statements where additional elements can be added. This serves as the base for :class:`_expression.Select` and :class:`_expression.CompoundSelect` where elements such as ORDER BY, GROUP BY can be added and column rendering can be controlled. Compare to :class:`_expression.TextualSelect`, which, while it subclasses :class:`_expression.SelectBase` and is also a SELECT construct, represents a fixed textual string which cannot be altered at this level, only wrapped as a subquery. R s2.0s^The :paramref:`_sql.select.bind` argument is deprecated and will be removed in SQLAlchemy 2.0.cCs|r.tjr%tjdddnt}n||_|dk rY|jj||n|dk r{|jj||n|dk r|j j|tj |n|dk r|j j|tj |n||_ dS(NsThe use_labels=True keyword argument to GenerativeSelect is deprecated and will be removed in version 2.0. Please use select.set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL) if you need to replicate this legacy behavior.t stackleveli( R+tSQLALCHEMY_WARN_20twarn_deprecated_20RRRYtlimitRtoffsetRR~Rt_bind(R/Rt use_labelsRRRRR ((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s         c Cs.td|d|d|d|d||_dS(sSpecify a ``FOR UPDATE`` clause for this :class:`_expression.GenerativeSelect`. E.g.:: stmt = select(table).with_for_update(nowait=True) On a database like PostgreSQL or Oracle, the above would render a statement like:: SELECT table.a, table.b FROM table FOR UPDATE NOWAIT on other backends, the ``nowait`` option is ignored and instead would produce:: SELECT table.a, table.b FROM table FOR UPDATE When called with no arguments, the statement will render with the suffix ``FOR UPDATE``. Additional arguments can then be provided which allow for common database-specific variants. :param nowait: boolean; will render ``FOR UPDATE NOWAIT`` on Oracle and PostgreSQL dialects. :param read: boolean; will render ``LOCK IN SHARE MODE`` on MySQL, ``FOR SHARE`` on PostgreSQL. On PostgreSQL, when combined with ``nowait``, will render ``FOR SHARE NOWAIT``. :param of: SQL expression or list of SQL expression elements (typically :class:`_schema.Column` objects or a compatible expression) which will render into a ``FOR UPDATE OF`` clause; supported by PostgreSQL and Oracle. May render as a table or as a column depending on backend. :param skip_locked: boolean, will render ``FOR UPDATE SKIP LOCKED`` on Oracle and PostgreSQL dialects or ``FOR SHARE SKIP LOCKED`` if ``read=True`` is also specified. :param key_share: boolean, will render ``FOR NO KEY UPDATE``, or if combined with ``read=True`` will render ``FOR KEY SHARE``, on the PostgreSQL dialect. RuRvRtRwRzN(Rst_for_update_arg(R/RuRvRtRwRz((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRx s 6cCs|jS(sS Retrieve the current label style. .. versionadded:: 1.4 (R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs+|j|k r'|j}||_n|S(s8Return a new selectable with the specified label style. There are three "label styles" available, :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY`, :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL`, and :data:`_sql.LABEL_STYLE_NONE`. The default style is :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL`. In modern SQLAlchemy, there is not generally a need to change the labeling style, as per-expression labels are more effectively used by making use of the :meth:`_sql.ColumnElement.label` method. In past versions, :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL` was used to disambiguate same-named columns from different tables, aliases, or subqueries; the newer :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY` now applies labels only to names that conflict with an existing name so that the impact of this labeling is minimal. The rationale for disambiguation is mostly so that all column expressions are available from a given :attr:`_sql.FromClause.c` collection when a subquery is created. .. versionadded:: 1.4 - the :meth:`_sql.GenerativeSelect.set_label_style` method replaces the previous combination of ``.apply_labels()``, ``.with_labels()`` and ``use_labels=True`` methods and/or parameters. .. seealso:: :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY` :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL` :data:`_sql.LABEL_STYLE_NONE` :data:`_sql.LABEL_STYLE_DEFAULT` (Rt _generate(R/tstyle((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR  s&  s*:meth:`_sql.GenerativeSelect.apply_labels`R s<Use set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL) instead.cCs |jtS(N(R R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt apply_labels%scCstjtj|jS(s9ClauseList access to group_by_clauses for legacy dialects(R"t_construct_rawRtcomma_opt_group_by_clauses(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_group_by_clause-scCstjtj|jS(s9ClauseList access to order_by_clauses for legacy dialects(R"RRRt_order_by_clauses(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_order_by_clause4scCstjtj|d|d|S(sConvert the given value to an "offset or limit" clause. This handles incoming integers and converts to an expression; if an expression is already given, it is passed through. RLttype_(RRhRtLimitOffsetRole(R/RRLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_offset_or_limit_clause;scCsd|dkrdSy |j}Wn3tk rR}tjtjd|d|nXtj|SdS(sConvert the "offset or limit" clause of a select construct to an integer. This is only possible if the value is stored as a simple bound parameter. Otherwise, a compilation error is raised. s@This SELECT structure does not use a simple integer value for %streplace_contextN(RYR0tAttributeErrorR+traise_R*t CompileErrortasint(R/tclausetattrnametvalueterr((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_offset_or_limit_clause_asintFs    cCs|j|jdS(sGet an integer value for the limit. This should only be used by code that cannot support a limit as a BindParameter or other custom clause as it will throw an exception if the limit isn't currently set to an integer. R(Rt _limit_clause(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_limit]scCs t|tS(skTrue if the clause is a simple integer, False if it is not present or is a SQL expression. (RR-(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_simple_int_clausegscCs|j|jdS(sGet an integer value for the offset. This should only be used by code that cannot support an offset as a BindParameter or other custom clause as it will throw an exception if the offset isn't currently set to an integer. R(Rt_offset_clause(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_offsetmscCs+|jdk p*|jdk p*|jdk S(N(RRYRt _fetch_clause(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_has_row_limiting_clauseyscCs&d|_|_|j||_dS(sfReturn a new selectable with the given LIMIT criterion applied. This is a numerical value which usually renders as a ``LIMIT`` expression in the resulting select. Backends that don't support ``LIMIT`` will attempt to provide similar functionality. .. note:: The :meth:`_sql.GenerativeSelect.limit` method will replace any clause applied with :meth:`_sql.GenerativeSelect.fetch`. .. versionchanged:: 1.0.0 - :meth:`_expression.Select.limit` can now accept arbitrary SQL expressions as well as integer values. :param limit: an integer LIMIT parameter, or a SQL expression that provides an integer result. Pass ``None`` to reset it. .. seealso:: :meth:`_sql.GenerativeSelect.fetch` :meth:`_sql.GenerativeSelect.offset` N(RYRt_fetch_clause_optionsRR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCsUd|_|dkr(d|_|_n)|j||_i|d6|d6|_dS(sReturn a new selectable with the given FETCH FIRST criterion applied. This is a numeric value which usually renders as ``FETCH {FIRST | NEXT} [ count ] {ROW | ROWS} {ONLY | WITH TIES}`` expression in the resulting select. This functionality is is currently implemented for Oracle, PostgreSQL, MSSQL. Use :meth:`_sql.GenerativeSelect.offset` to specify the offset. .. note:: The :meth:`_sql.GenerativeSelect.fetch` method will replace any clause applied with :meth:`_sql.GenerativeSelect.limit`. .. versionadded:: 1.4 :param count: an integer COUNT parameter, or a SQL expression that provides an integer result. When ``percent=True`` this will represent the percentage of rows to return, not the absolute value. Pass ``None`` to reset it. :param with_ties: When ``True``, the WITH TIES option is used to return any additional rows that tie for the last place in the result set according to the ``ORDER BY`` clause. The ``ORDER BY`` may be mandatory in this case. Defaults to ``False`` :param percent: When ``True``, ``count`` represents the percentage of the total number of selected rows to return. Defaults to ``False`` .. seealso:: :meth:`_sql.GenerativeSelect.limit` :meth:`_sql.GenerativeSelect.offset` t with_tiestpercentN(RYRRRR(R/tcountRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytfetchs(  cCs|j||_dS(sReturn a new selectable with the given OFFSET criterion applied. This is a numeric value which usually renders as an ``OFFSET`` expression in the resulting select. Backends that don't support ``OFFSET`` will attempt to provide similar functionality. .. versionchanged:: 1.0.0 - :meth:`_expression.Select.offset` can now accept arbitrary SQL expressions as well as integer values. :param offset: an integer OFFSET parameter, or a SQL expression that provides an integer result. Pass ``None`` to reset it. .. seealso:: :meth:`_sql.GenerativeSelect.limit` :meth:`_sql.GenerativeSelect.fetch` N(RR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRsssqlalchemy.sql.utilcCsJtjj}d|_|_|j|j|j||\|_|_dS(sApply LIMIT / OFFSET to this statement based on a slice. The start and stop indices behave like the argument to Python's built-in :func:`range` function. This method provides an alternative to using ``LIMIT``/``OFFSET`` to get a slice of the query. For example, :: stmt = select(User).order_by(User).id.slice(1, 3) renders as .. sourcecode:: sql SELECT users.id AS users_id, users.name AS users_name FROM users ORDER BY users.id LIMIT ? OFFSET ? (2, 1) .. note:: The :meth:`_sql.GenerativeSelect.slice` method will replace any clause applied with :meth:`_sql.GenerativeSelect.fetch`. .. versionadded:: 1.4 Added the :meth:`_sql.GenerativeSelect.slice` method generalized from the ORM. .. seealso:: :meth:`_sql.GenerativeSelect.limit` :meth:`_sql.GenerativeSelect.offset` :meth:`_sql.GenerativeSelect.fetch` N( R+RORPRYRRt _make_sliceRR(R/tstarttstopRP((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytslices) cGsQt|dkr.|ddkr.d|_n|jtd|D7_dS(sReturn a new selectable with the given list of ORDER BY criteria applied. e.g.:: stmt = select(table).order_by(table.c.id, table.c.name) Calling this method multiple times is equivalent to calling it once with all the clauses concatenated. All existing ORDER BY criteria may be cancelled by passing ``None`` by itself. New ORDER BY criteria may then be added by invoking :meth:`_orm.Query.order_by` again, e.g.:: # will erase all ORDER BY and ORDER BY new_col alone stmt = stmt.order_by(None).order_by(new_col) :param \*clauses: a series of :class:`_expression.ColumnElement` constructs which will be used to generate an ORDER BY clause. .. seealso:: :ref:`tutorial_order_by` - in the :ref:`unified_tutorial` :ref:`tutorial_order_by_label` - in the :ref:`unified_tutorial` iicss$|]}tjtj|VqdS(N(RRhRt OrderByRole(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys ?sN((RRYRRg(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs "  cGsQt|dkr.|ddkr.d|_n|jtd|D7_dS(s~Return a new selectable with the given list of GROUP BY criterion applied. All existing GROUP BY settings can be suppressed by passing ``None``. e.g.:: stmt = select(table.c.name, func.max(table.c.stat)).\ group_by(table.c.name) :param \*clauses: a series of :class:`_expression.ColumnElement` constructs which will be used to generate an GROUP BY clause. .. seealso:: :ref:`tutorial_group_by_w_aggregates` - in the :ref:`unified_tutorial` :ref:`tutorial_order_by_label` - in the :ref:`unified_tutorial` iicss$|]}tjtj|VqdS(N(RRhRt GroupByRole(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys `sN((RRYRRg(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRCs "  ((N(s2.0s^The :paramref:`_sql.select.bind` argument is deprecated and will be removed in SQLAlchemy 2.0.(&R1R2RARRRYRRRRRR+RtLABEL_STYLE_DEFAULTRCRRRxRR RRR5RRRRRRRRRRRR[RRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRp sZ 7 +    1.%tdefaulttcompound_selecttCompoundSelectStatecBseZejdZRS(cCs>|jj}t|_td|jD}|||fS(Ncss|]}|j|fVqdS(N(R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys ls(t statementR8RCRtdictR(R/thacky_subquerytd((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_label_resolve_dictgs (R1R2R+RR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRestCompoundSelectc BseZdZdZdejfdejfdejfdejfdejfdejfdejfd ejfd ejfg e j Z e j d Ze j d Ze j d Ze j dZe j dZe j dZeZdZedZedZedZedZedZedZdZd'dZ dZ!dZ"dZ#dZ$dZ%e&dZ'e&d Z(e&e j)d!d"d#d$e*d%Z+e+j,d&Z+RS((sXForms the basis of ``UNION``, ``UNION ALL``, and other SELECT-based set operations. .. seealso:: :func:`_expression.union` :func:`_expression.union_all` :func:`_expression.intersect` :func:`_expression.intersect_all` :func:`_expression.except` :func:`_expression.except_all` RtselectsRRRRRRRtkeywordtUNIONs UNION ALLtEXCEPTs EXCEPT ALLt INTERSECTs INTERSECT ALLcOs|jdt|_||_g|D]'}tjtj|jd|^q%|_ |rzt j rzt j dddnt j||dS(NR RsSet functions such as union(), union_all(), extract(), etc. in SQLAlchemy 2.0 will accept a series of SELECT statements only. Please use generative methods such as order_by() for additional modifications to this CompoundSelect.Ri(RaRCt_auto_correlateRRRhRtCompoundElementRoleRRR+RRRR(R/RRR;ts((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs 4 cOsttj||S(sReturn a ``UNION`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. A similar :func:`union()` method is available on all :class:`_expression.FromClause` subclasses. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (RR(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _create_unionscOsttj||S(sReturn a ``UNION ALL`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. A similar :func:`union_all()` method is available on all :class:`_expression.FromClause` subclasses. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (Rt UNION_ALL(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_union_allscOsttj||S(s]Return an ``EXCEPT`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (RR(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_exceptscOsttj||S(saReturn an ``EXCEPT ALL`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (Rt EXCEPT_ALL(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_except_allscOsttj||S(s`Return an ``INTERSECT`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (RR(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_intersectscOsttj||S(sdReturn an ``INTERSECT ALL`` of multiple selectables. The returned object is an instance of :class:`_expression.CompoundSelect`. :param \*selects: a list of :class:`_expression.Select` instances. :param \**kwargs: available keyword arguments are the same as those of :func:`select`. (Rt INTERSECT_ALL(RRR;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_intersect_all scCs|jdjS(Ni(Rt _scalar_type(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCs t|S(N(R(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR!scCs+x$|jD]}|j|r tSq WtS(N(RRR3RC(R/RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR$scCsO|j|k rK|j}|jdj|}|g|jd|_n|S(Nii(RRRt_set_label_style(R/Rtselect_0((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR*s  cCsP|jdj}||jdk rL|j}|g|jd|_n|S(Nii(RRR(R/t new_select((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR2s  cCs|jd}|jtk r1|j|j}n|j|x~t|jjtg|jD]}|j^qZD]H\}}gt |D]&\}}|j i|dd6^q|_ qsWdS(Niitweight( RRRR RtzipRt _all_columnsRt enumeratet _annotatet_proxies(R/R8RRtsubq_colt select_colstiR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR:s   2cCs;tt|j|x|jD]}|j|q WdS(N(RRRIR(R/RHR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRIZscCs|jdjS(Ni(RR?(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR?_scCs|jdjS(s\A :class:`_expression.ColumnCollection` representing the columns that this SELECT statement or similar construct returns in its result set, not including :class:`_sql.TextClause` constructs. For a :class:`_expression.CompoundSelect`, the :attr:`_expression.CompoundSelect.selected_columns` attribute returns the selected columns of the first SELECT statement contained within the series of statements within the set operation. .. seealso:: :attr:`_sql.Select.selected_columns` .. versionadded:: 1.4 i(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRcss:attr:`.Executable.bind`R s5Bound metadata is being removed as of SQLAlchemy 2.0.R cCs?|jr|jSx(|jD]}|j}|r|SqWdSdS(sReturns the :class:`_engine.Engine` or :class:`_engine.Connection` to which this :class:`.Executable` is bound, or None if none found. N(RRR RY(R/Rte((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR ys  cCs ||_dS(N(R(R/R ((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR sN(-R1R2RARWR)RPRt dp_plain_dictRpRt%_clone_annotations_traverse_internalsRR+tsymbolRRRRRRR3R+RRRRRRRRRRYRRRRRRIR5R?RRRCR tsetter(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRpsR                tDeprecatedSelectGenerationscBseZdZejdddZejdddZejdddZejddd Zejdd d Z ejdd d Z RS(sA collection of methods available on :class:`_sql.Select`, these are all **deprecated** methods as they modify the :class:`_sql.Select` object in -place. s1.4sThe :meth:`_expression.Select.append_correlation` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.correlate`.cCs|jj||dS(sAppend the given correlation expression to this select() construct. This is an **in-place** mutation method; the :meth:`_expression.Select.correlate` method is preferred, as it provides standard :term:`method chaining`. N(R R(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytappend_correlationssThe :meth:`_expression.Select.append_column` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.add_columns`.cCs|jj||dS(soAppend the given column expression to the columns clause of this select() construct. E.g.:: my_select.append_column(some_table.c.new_column) This is an **in-place** mutation method; the :meth:`_expression.Select.add_columns` method is preferred, as it provides standard :term:`method chaining`. N(t add_columnsR(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRbssThe :meth:`_expression.Select.append_prefix` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.prefix_with`.cCs|jj||dS(sAppend the given columns clause prefix expression to this select() construct. This is an **in-place** mutation method; the :meth:`_expression.Select.prefix_with` method is preferred, as it provides standard :term:`method chaining`. N(RfR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt append_prefixssThe :meth:`_expression.Select.append_whereclause` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.where`.cCs|jj||dS(s\Append the given expression to this select() construct's WHERE criterion. The expression will be joined to existing WHERE criterion via AND. This is an **in-place** mutation method; the :meth:`_expression.Select.where` method is preferred, as it provides standard :term:`method chaining`. N(twhereR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytappend_whereclausessThe :meth:`_expression.Select.append_having` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.having`.cCs|jj||dS(s_Append the given expression to this select() construct's HAVING criterion. The expression will be joined to existing HAVING criterion via AND. This is an **in-place** mutation method; the :meth:`_expression.Select.having` method is preferred, as it provides standard :term:`method chaining`. N(thavingR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt append_havingssThe :meth:`_expression.Select.append_from` method is deprecated and will be removed in a future release. Use the generative method :meth:`_expression.Select.select_from`.cCs|jj||dS(s2Append the given :class:`_expression.FromClause` expression to this select() construct's FROM clause. This is an **in-place** mutation method; the :meth:`_expression.Select.select_from` method is preferred, as it provides standard :term:`method chaining`. N(RR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt append_froms( R1R2RAR+RZRRbRRR R (((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs&Rt SelectStatecBseZdZdefdYZdZedZedZed Z ed Z ed Z d Z edd ZdddZdZedZedZdZejddZejddZRS(t from_clausestfromstcolumns_plus_namesRtdefault_select_compile_optionscBseZgZRS((R1R2t_cache_key_traversal(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscKs||_|j|_x'|jD]}|j|j|jqW|jra|j|j|jn|j||_|jt |_ dS(N( Rt _from_objR t_memoized_select_entitiest _setup_joinst _raw_columnst _get_fromsR RR3R(R/RtcompilerRetmemoized_entities((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs   cCstddS(NsLThe default SELECT construct without plugins does not implement this method.(R>(R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_plugin_not_implemented.scCsGg|jtD]3\}}}}}i|d6|jd6|d6^qS(NRLRR^(RRCR(RRt_RLR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytget_column_descriptions5scCs|jdS(N(R(RRtfrom_statement((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRBscCs&|jtjjd|jDS(Ncss|]}|jVqdS(N(R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys Js(t_normalize_fromsRRt from_iterableR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytget_columns_clause_fromsFs csI|tk|tk ttdfd}|S(Ncs|jr dSs5|j}|dkr1d}n|SrD|jn|j}|dkrd}|kr||j|Sj||Sn9|krr|jS|jSj||SdS(Nt _no_label(t_is_text_clauseRYt _proxy_keyRt _anon_labelRft_anon_tq_key_labelt_anon_key_label(Rtcol_nameRL(Rtnamestpattable_qualified(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytgoWs&          (RRRRRY(RRR)((RR&R'R(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_column_naming_conventionNs     cCso|jtjtjjg|jD]}|j^qtjjg|jD]}|j^qG|jd|S(Ntcheck_statement(RRRRRRt_where_criteriaR (R/RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRws   cCst}g}xj|D]b}|jrF|j|krFtjdn|j|js|j||j|jqqW|rtt j j g|D]}t |j ^q}|rg|D]}||kr|^q}qn|S(s0given an iterable of things to select FROM, reduce them to what would actually render in the FROM clause of a SELECT. This does the job of checking for JOINs, tables, etc. that are in fact overlapping due to cloning, adaption, present in overlapping joins, etc. s-select() construct refers to itself as a FROM(RR]RR*tInvalidRequestErrorRRRRRRRR R(Rtiterable_of_fromsR+tseenR titemRttoremove((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs     (+cCs@|j}|jjrj|jj}|rjg|D]0}|tt||pId|kr.|^q.}qjn|jjdk rg|D]6}|tt||pd|jjkr|^q}n|jjr<|r<t|dkr<g|D]!}|t||kr|^q}t|s<t j d|jq<n|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 '%r' returned no FROM clauses due to auto-correlation; specify correlate() to control correlation manually.(N(( R Rt _correlateR t_correlate_exceptRYR RRR*R-(R/texplicit_correlate_fromstimplicit_correlate_fromsR t to_correlateR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_get_display_fromss>     !   cCstd|jjD}tdt|jD}|j}x*|jD]\}}|j||qTW|||fS(Ncss0|]&}|jr|jp!|j|fVqdS(N(t_allow_label_resolvet _tq_labelR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys scss'|]}|jr|j|fVqdS(N(R8R(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s(RRR?RR tcopytitemst setdefault(R/t with_colst only_fromst only_colsRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt"_memoized_attr__label_resolve_dicts cCs |jr|jddSdSdS(Nii(RRY(Rtstmt((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytdetermine_last_joined_entitys cCs gt|jD] }|^qS(N(RR(RRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytall_selected_columns sc Csx|D]\}}}}|d}|d}|dkrZ|j||||\}} n|j|} | dk r|j| } |j| t| ||d|d|f|j| d|_q|jt|||d|d|f|_qWdS(NRRi(RYt"_join_determine_implicit_left_sidet_join_place_explicit_left_sideR R( R/R:t raw_columnsRRRtflagsRRtreplace_from_obj_indext left_clause((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs      Assqlalchemy.sql.utilcCsvtjj}d}|j}|rb|j|||}t|dkr)|d}||}q)ni} |j} xktj tj j g|D]} | j ^qtj j g| j D]} | j ^qD]} d| |       & cCsd}tjj}t|jj}|rE|j|j|}ng}t |dkrot j dn|r|d}n|S(NisrCan't identify which entity in which to assign the left side of this join. Please use a more specific ON clause.i( RYR+RORPRRt_iterate_from_elementst#find_left_clause_that_matches_givenR RR*R-(R/RRHRPR RL((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRE~s   (R R RRN(R1R2t __slots__RRRRRRRRR*RRYRR7R@RBRCRR+R[RDRE(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s*  ) $C  )Ft_SelectFromElementscBseZdZRS(ccst}xI|jD]>}x5|jD]*}||kr;q#n|j||Vq#WqWxI|jD]>}x5|jD]*}||krqon|j||VqoWq_Wx5|jD]*}||krqn|j||VqWdS(N(RRRRfR,R(R/R/Rtfr((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRPs$         (R1R2RP(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRSst_MemoizedSelectEntitiescBseeZdZdejfdejfdejfdejfgZej Z dZ e dZ RS(tmemoized_select_entitiesRRt_legacy_setup_joinst _with_optionscKsM|jj|j}d|jjD|_|jjd||_|S(NcSsi|]\}}||qS(((Rtktv((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s t _is_clone_of(RRRR;tgetR[(R/ReR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs|js|js|jrt}|j|_|j|_|j|_|j|_|j|f7_d|_|_|_|_ndS(N((RRWRXRURR(Rt select_stmtR/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_generate_for_statements        (R1R2RWR)RPtdp_setup_join_tupletdp_executable_optionsRR+t EMPTY_DICTt _annotationsR RR^(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRUs     R6cBseZdZdZfZfZfZeZfZ fZ e Z fZ fZfZeZejZdejfdejfdejfdejfdejfdejfdejfd ejfd ejfd ejfd ejfd ejfdejfdejfdejfdejfdejfdejfdejfgeje j!e"j#e$j%e&j'e(j)Z*e*dej+fgZ,e-dZ.e-e/j0dde e e ee ee e dZ1e-dZ2e2Z3e-dZ4e-dZ5dZ6dZ7dZ8d Z9d!Z:e;d"Z<d#Z=e>e eed$Z?e ed%Z@e>e eed&ZAe ed'ZBd(ZCe;e/j0d)d*d+ZDe;d,ZEe;d-ZFd.ZGeHd/ZId0ZJe>d1ZKd2ZLe/j0d3d4d5ZMe/jNd6ed7ZOe>d8ZPe;d9ZQeQZRe>d:ZSe>d;ZTe>d<ZUe>d=ZVe>d>ZWe>d?ZXeYjZd@Z[eYjZdAZ\dBZ]e dCZ^dDZ_dEZ`e dFZadGZbdHZcdIZddJZedKZfdLZge;e/jhdMdNdOdPedQZieijjdRZiRS(SsRepresents a ``SELECT`` statement. The :class:`_sql.Select` object is normally constructed using the :func:`_sql.select` function. See that function for details. .. seealso:: :func:`_sql.select` :ref:`tutorial_selecting_data` - in the 2.0 tutorial RRRRR,t_having_criteriaRRRRWR2R3RRRRRt _distinctt _distinct_onRt_compile_optionscOs0|s |rtj|||Stj|SdS(N(R6R7t_create_select(RttargettentitiesRRe((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR.s s2.0sThe legacy calling style of :func:`_sql.select` is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at :func:`_sql.select`.c Ks|j|} || _|tk rb|tkrC| jj| qb| jj| tj|n|dk r| j j| tj|nyt |} Wn5t k r} tj t jdddd| nX| rg|D]!} tjtj| d| ^q| _n g| _|dk r:| jj| |n|dk r\| jj| |n|rr| j|n|r| j|ntj| | | S(sConstruct a new :class:`_expression.Select` using the 1.x style API. This method is called implicitly when the :func:`_expression.select` construct is used and the first argument is a Python list or other plain sequence object, which is taken to refer to the columns collection. .. versionchanged:: 1.4 Added the :meth:`.Select.create_legacy_select` constructor which documents the calling style in use when the :func:`.select` construct is invoked using 1.x-style arguments. Similar functionality is also available via the :meth:`_expression.FromClause.select` method on any :class:`_expression.FromClause`. All arguments which accept :class:`_expression.ClauseElement` arguments also accept string arguments, which will be converted as appropriate into either :func:`_expression.text()` or :func:`_expression.literal_column()` constructs. .. seealso:: :ref:`tutorial_selecting_data` - in the :ref:`unified_tutorial` :param columns: A list of :class:`_expression.ColumnElement` or :class:`_expression.FromClause` objects which will form the columns clause of the resulting statement. For those objects that are instances of :class:`_expression.FromClause` (typically :class:`_schema.Table` or :class:`_expression.Alias` objects), the :attr:`_expression.FromClause.c` collection is extracted to form a collection of :class:`_expression.ColumnElement` objects. This parameter will also accept :class:`_expression.TextClause` constructs as given, as well as ORM-mapped classes. .. note:: The :paramref:`_expression.select.columns` parameter is not available in the method form of :func:`_expression.select`, e.g. :meth:`_expression.FromClause.select`. .. seealso:: :meth:`_expression.Select.column` :meth:`_expression.Select.with_only_columns` :param whereclause: A :class:`_expression.ClauseElement` expression which will be used to form the ``WHERE`` clause. It is typically preferable to add WHERE criterion to an existing :class:`_expression.Select` using method chaining with :meth:`_expression.Select.where`. .. seealso:: :meth:`_expression.Select.where` :param from_obj: A list of :class:`_expression.ClauseElement` objects which will be added to the ``FROM`` clause of the resulting statement. This is equivalent to calling :meth:`_expression.Select.select_from` using method chaining on an existing :class:`_expression.Select` object. .. seealso:: :meth:`_expression.Select.select_from` - full description of explicit FROM clause specification. :param bind=None: an :class:`_engine.Engine` or :class:`_engine.Connection` instance to which the resulting :class:`_expression.Select` object will be bound. The :class:`_expression.Select` object will otherwise automatically bind to whatever :class:`~.base.Connectable` instances can be located within its contained :class:`_expression.ClauseElement` members. :param correlate=True: indicates that this :class:`_expression.Select` object should have its contained :class:`_expression.FromClause` elements "correlated" to an enclosing :class:`_expression.Select` object. It is typically preferable to specify correlations on an existing :class:`_expression.Select` construct using :meth:`_expression.Select.correlate`. .. seealso:: :meth:`_expression.Select.correlate` - full description of correlation. :param distinct=False: when ``True``, applies a ``DISTINCT`` qualifier to the columns clause of the resulting statement. The boolean argument may also be a column expression or list of column expressions - this is a special calling form which is understood by the PostgreSQL dialect to render the ``DISTINCT ON ()`` syntax. ``distinct`` is also available on an existing :class:`_expression.Select` object via the :meth:`_expression.Select.distinct` method. .. seealso:: :meth:`_expression.Select.distinct` :param group_by: a list of :class:`_expression.ClauseElement` objects which will comprise the ``GROUP BY`` clause of the resulting select. This parameter is typically specified more naturally using the :meth:`_expression.Select.group_by` method on an existing :class:`_expression.Select`. .. seealso:: :meth:`_expression.Select.group_by` :param having: a :class:`_expression.ClauseElement` that will comprise the ``HAVING`` clause of the resulting select when ``GROUP BY`` is used. This parameter is typically specified more naturally using the :meth:`_expression.Select.having` method on an existing :class:`_expression.Select`. .. seealso:: :meth:`_expression.Select.having` :param limit=None: a numerical value which usually renders as a ``LIMIT`` expression in the resulting select. Backends that don't support ``LIMIT`` will attempt to provide similar functionality. This parameter is typically specified more naturally using the :meth:`_expression.Select.limit` method on an existing :class:`_expression.Select`. .. seealso:: :meth:`_expression.Select.limit` :param offset=None: a numeric value which usually renders as an ``OFFSET`` expression in the resulting select. Backends that don't support ``OFFSET`` will attempt to provide similar functionality. This parameter is typically specified more naturally using the :meth:`_expression.Select.offset` method on an existing :class:`_expression.Select`. .. seealso:: :meth:`_expression.Select.offset` :param order_by: a scalar or list of :class:`_expression.ClauseElement` objects which will comprise the ``ORDER BY`` clause of the resulting select. This parameter is typically specified more naturally using the :meth:`_expression.Select.order_by` method on an existing :class:`_expression.Select`. .. seealso:: :meth:`_expression.Select.order_by` :param 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 a :class:`_expression.Subquery` created against this :class:`_expression.Select` object, as well as the :attr:`_expression.Select.selected_columns` collection of the :class:`_expression.Select` itself, will use these names for targeting column members. This parameter can also be specified on an existing :class:`_expression.Select` object using the :meth:`_expression.Select.set_label_style` method. .. seealso:: :meth:`_expression.Select.set_label_style` sselect() construct created in legacy mode, i.e. with keyword arguments, must provide the columns argument as a Python list or other iterable.tcodetc9aetfrom_RN(RRRCR3tdistinctRR+R~RYRRt TypeErrorRR*RbRRhRRRRRRdRpRR(RRRtfrom_objRmRR RjRrR;R/t cols_presentRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR75s<      1   cGsQ|j|}g|D]!}tjtj|d|^q|_tj||S(sConstruct a new :class:`_expression.Select` using the 2. x style API. .. versionadded:: 1.4 - The :func:`_sql.select` function now accepts column arguments positionally. The top-level :func:`_sql.select` function will automatically use the 1.x or 2.x style API based on the incoming arguments; using :func:`_future.select` from the ``sqlalchemy.future`` module will enforce that only the 2.x style constructor is used. Similar functionality is also available via the :meth:`_expression.FromClause.select` method on any :class:`_expression.FromClause`. .. seealso:: :ref:`coretutorial_selecting` - Core Tutorial description of :func:`_expression.select`. :param \*entities: Entities to SELECT from. For Core usage, this is typically a series of :class:`_expression.ColumnElement` and / or :class:`_expression.FromClause` objects which will form the columns clause of the resulting statement. For those objects that are instances of :class:`_expression.FromClause` (typically :class:`_schema.Table` or :class:`_expression.Alias` objects), the :attr:`_expression.FromClause.c` collection is extracted to form a collection of :class:`_expression.ColumnElement` objects. This parameter will also accept :class:`_expression.TextClause` constructs as given, as well as ORM-mapped classes. R(RRRhRRRRR(RRiR/tent((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_future_selectFs '. cKs#tjt}|jj||S(sCreate a :class:`.Select` using raw ``__new__`` with no coercions. Used internally to build up :class:`.Select` constructs with pre-established state. (R6RRR(RReRA((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_create_raw_select{s cOs|rzt|dtst|ddrzt|dtjtf rzt|ddtdkrzt|dd s|r|j ||S|j |SdS(sCreate a :class:`.Select` using either the 1.x or 2.0 constructor style. For the legacy calling style, see :meth:`.Select.create_legacy_select`. If the first argument passed is a Python sequence or if keyword arguments are present, this style is used. .. versionadded:: 2.0 - the :func:`_future.select` construct is the same construct as the one returned by :func:`_expression.select`, except that the function only accepts the "columns clause" entities up front; the rest of the state of the SELECT should be built up using generative methods. Similar functionality is also available via the :meth:`_expression.FromClause.select` method on any :class:`_expression.FromClause`. .. seealso:: :ref:`coretutorial_selecting` - Core Tutorial description of :func:`_expression.select`. :param \*entities: Entities to SELECT from. For Core usage, this is typically a series of :class:`_expression.ColumnElement` and / or :class:`_expression.FromClause` objects which will form the columns clause of the resulting statement. For those objects that are instances of :class:`_expression.FromClause` (typically :class:`_schema.Table` or :class:`_expression.Alias` objects), the :attr:`_expression.FromClause.c` collection is extracted to form a collection of :class:`_expression.ColumnElement` objects. This parameter will also accept :class:`_expression.TextClause` constructs as given, as well as ORM-mapped classes. it__iter__traiseerrt__clause_element__N( RRthasattrR+t string_typesR!R,RCRYR7Rr(RR:Re((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_creates)cCs tdS(N(R>(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCs'|jd}t|j}|djS(Ni(RRRR(R/Rtcols((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs cGs |j|S(s6A synonym for the :meth:`_future.Select.where` method.(R(R/tcriteria((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytfilterscCsY|jr:tj|j}||}|dk r:|Sn|jrN|jdS|jdS(Ni(RR tget_plugin_classRBRYRR(R/tmetht_last_joined_entity((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt_filter_by_zeros      cKsM|j}g|jD]!\}}t|||k^q}|j|S(sWapply the given filtering criterion as a WHERE clause to this select. (RR;R R|(R/R;t from_entityRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt filter_bys 1cCstj|j}||S(s5Return a :term:`plugin-enabled` 'column descriptions' structure referring to the columns which are SELECTed by this statement. This attribute is generally useful when using the ORM, as an extended structure which includes information about mapped entities is returned. The section :ref:`queryguide_inspection` contains more background. For a Core-only statement, the structure returned by this accessor is derived from the same objects that are returned by the :attr:`.Select.selected_columns` accessor, formatted as a list of dictionaries which contain the keys ``name``, ``type`` and ``expr``, which indicate the column expressions to be selected:: >>> stmt = select(user_table) >>> stmt.column_descriptions [ { 'name': 'id', 'type': Integer(), 'expr': Column('id', Integer(), ...)}, { 'name': 'name', 'type': String(length=30), 'expr': Column('name', String(length=30), ...)} ] .. versionchanged:: 1.4.33 The :attr:`.Select.column_descriptions` attribute returns a structure for a Core-only set of entities, not just ORM-only entities. .. seealso:: :attr:`.UpdateBase.entity_description` - entity information for an :func:`.insert`, :func:`.update`, or :func:`.delete` :ref:`queryguide_inspection` - ORM background (R R}R(R/R~((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytcolumn_descriptionss)cCstj|j}|||S(sApply the columns which this :class:`.Select` would select onto another statement. This operation is :term:`plugin-specific` and will raise a not supported exception if this :class:`_sql.Select` does not select from plugin-enabled entities. The statement is typically either a :func:`_expression.text` or :func:`_expression.select` construct, and should return the set of columns appropriate to the entities represented by this :class:`.Select`. .. seealso:: :ref:`orm_queryguide_selecting_text` - usage examples in the ORM Querying Guide (R R}R(R/RR~((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCsotjtj|d|}|dk r?tjtj|}n|j||di|d6|d6ff7_dS(sh Create a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. E.g.:: stmt = select(user_table).join(address_table, user_table.c.id == address_table.c.user_id) The above statement generates SQL similar to:: SELECT user.id, user.name FROM user JOIN address ON user.id = address.user_id .. versionchanged:: 1.4 :meth:`_expression.Select.join` now creates a :class:`_sql.Join` object between a :class:`_sql.FromClause` source that is within the FROM clause of the existing SELECT, and a given target :class:`_sql.FromClause`, and then adds this :class:`_sql.Join` to the FROM clause of the newly generated SELECT statement. This is completely reworked from the behavior in 1.3, which would instead create a subquery of the entire :class:`_expression.Select` and then join that subquery to the target. This is a **backwards incompatible change** as the previous behavior was mostly useless, producing an unnamed subquery rejected by most databases in any case. The new behavior is modeled after that of the very successful :meth:`_orm.Query.join` method in the ORM, in order to support the functionality of :class:`_orm.Query` being available by using a :class:`_sql.Select` object with an :class:`_orm.Session`. See the notes for this change at :ref:`change_select_join`. :param target: target table to join towards :param onclause: ON clause of the join. If omitted, an ON clause is generated automatically based on the :class:`_schema.ForeignKey` linkages between the two tables, if one can be unambiguously determined, otherwise an error is raised. :param isouter: if True, generate LEFT OUTER join. Same as :meth:`_expression.Select.outerjoin`. :param full: if True, generate FULL OUTER join. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join_from` :meth:`_expression.Select.outerjoin` RRRN(RRhRtJoinTargetRoleRYRR(R/RhRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRc-s ; c Cs"|j||d|dtd|S(sCreate a SQL LEFT OUTER JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. Usage is the same as that of :meth:`_selectable.Select.join_from`. RRR(t join_fromR3(R/RlRhRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytouterjoin_fromqscCstjtj|d|}tjtj|d|}|dk rZtjtj|}n|j|||i|d6|d6ff7_dS(sCreate a SQL JOIN against this :class:`_expression.Select` object's criterion and apply generatively, returning the newly resulting :class:`_expression.Select`. E.g.:: stmt = select(user_table, address_table).join_from( user_table, address_table, user_table.c.id == address_table.c.user_id ) The above statement generates SQL similar to:: SELECT user.id, user.name, address.id, address.email, address.user_id FROM user JOIN address ON user.id = address.user_id .. versionadded:: 1.4 :param from\_: the left side of the join, will be rendered in the FROM clause and is roughly equivalent to using the :meth:`.Select.select_from` method. :param target: target table to join towards :param onclause: ON clause of the join. :param isouter: if True, generate LEFT OUTER join. Same as :meth:`_expression.Select.outerjoin`. :param full: if True, generate FULL OUTER join. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join` RRRN(RRhRR}RRYRR(R/RlRhRRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR}s1 cCs|j|d|dtd|S(sCreate a left outer join. Parameters are the same as that of :meth:`_expression.Select.join`. .. versionchanged:: 1.4 :meth:`_expression.Select.outerjoin` now creates a :class:`_sql.Join` object between a :class:`_sql.FromClause` source that is within the FROM clause of the existing SELECT, and a given target :class:`_sql.FromClause`, and then adds this :class:`_sql.Join` to the FROM clause of the newly generated SELECT statement. This is completely reworked from the behavior in 1.3, which would instead create a subquery of the entire :class:`_expression.Select` and then join that subquery to the target. This is a **backwards incompatible change** as the previous behavior was mostly useless, producing an unnamed subquery rejected by most databases in any case. The new behavior is modeled after that of the very successful :meth:`_orm.Query.join` method in the ORM, in order to support the functionality of :class:`_orm.Query` being available by using a :class:`_sql.Select` object with an :class:`_orm.Session`. See the notes for this change at :ref:`change_select_join`. .. seealso:: :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` :meth:`_expression.Select.join` RRR(RcR3(R/RhRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs#cCs|j|djS(sGCompute the final displayed list of :class:`_expression.FromClause` elements. This method will run through the full computation required to determine what FROM elements will be displayed in the resulting SELECT statement, including shadowing individual tables with JOIN objects, as well as full computation for ORM use cases including eager loading clauses. For ORM use, this accessor returns the **post compilation** list of FROM objects; this collection will include elements such as eagerly loaded tables and joins. The objects will **not** be ORM enabled and not work as a replacement for the :meth:`_sql.Select.select_froms` collection; additionally, the method is not well performing for an ORM enabled statement as it will incur the full ORM construction process. To retrieve the FROM list that's implied by the "columns" collection passed to the :class:`_sql.Select` originally, use the :attr:`_sql.Select.columns_clause_froms` accessor. To select from an alternative set of columns while maintaining the FROM list, use the :meth:`_sql.Select.with_only_columns` method and pass the :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter. .. versionadded:: 1.4.23 - the :meth:`_sql.Select.get_final_froms` method replaces the previous :attr:`_sql.Select.froms` accessor, which is deprecated. .. seealso:: :attr:`_sql.Select.columns_clause_froms` N(t_compile_state_factoryRYR7(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytget_final_fromss%s1.4.23sqThe :attr:`_expression.Select.froms` attribute is moved to the :meth:`_expression.Select.get_final_froms` method.cCs |jS(sYReturn the displayed list of :class:`_expression.FromClause` elements. (R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s cCstj|j|S(sReturn the set of :class:`_expression.FromClause` objects implied by the columns clause of this SELECT statement. .. versionadded:: 1.4.23 .. seealso:: :attr:`_sql.Select.froms` - "final" FROM list taking the full statement into account :meth:`_sql.Select.with_only_columns` - makes use of this collection to set up a new FROM list (R R}R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytcolumns_clause_fromsscCs t|jS(s0An iterator of all :class:`_expression.ColumnElement` expressions which would be rendered into the columns clause of the resulting SELECT statement. This method is legacy as of 1.4 and is superseded by the :attr:`_expression.Select.exported_columns` collection. (titerR?(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt inner_columns*s cCsA||jkrtSx'|jD]}|j|r tSq WtS(N(RR3RPRRC(R/RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR7s c sttjt|jt|jtg|jD]}|d^q.}fd|Dg|jD]}|^qp}tdjDj |j |}t |t ||_fd}|dWs css$|]}t|tr|VqdS(N(RR(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys \scs<t|tr8|jkr8|jj|}|SdS(N(RR#RRU(RReR(R(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyResRRt omit_attrsR(R(RRRRRR,RRRt differenceRgRR6RR( R/RReRRRtexisting_from_objt add_fromsR((RReRsL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR@s   , %   cKs4tjtt|jddddg|jS(NRRR2R3(RRRR6t get_childrenRP(R/R;((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRvscGsF|j|jg|D]!}tjtj|d|^q|_dS(sReturn a new :func:`_expression.select` construct with the given column expressions added to its columns clause. E.g.:: my_select = my_select.add_columns(table.c.new_column) See the documentation for :meth:`_expression.Select.with_only_columns` for guidelines on adding /replacing the columns of a :class:`_expression.Select` object. RN(RRRRhRR(R/RRH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR~s cCs>gtj|D]!}tjtj|d|^q|_dS(NR(R+R~RRhRRR(R/RiRq((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt _set_entitiesss1.4sThe :meth:`_expression.Select.column` method is deprecated and will be removed in a future release. Please use :meth:`_expression.Select.add_columns`cCs |j|S(sReturn a new :func:`_expression.select` construct with the given column expression added to its columns clause. E.g.:: my_select = my_select.column(table.c.new_column) See the documentation for :meth:`_expression.Select.with_only_columns` for guidelines on adding /replacing the columns of a :class:`_expression.Select` object. (R(R/RH((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRHsssqlalchemy.sql.utilcCs2|jtjjj|jd||j|jS(s"Return a new :func:`_expression.select` construct with redundantly named, equivalently-valued columns removed from the columns clause. "Redundant" here means two columns where one refers to the other either based on foreign key, or via a simple equality comparison in the WHERE clause of the statement. The primary purpose of this method is to automatically construct a select statement with all uniquely-named columns, without the need to use table-qualified labels as :meth:`_expression.Select.set_label_style` does. When columns are omitted based on foreign key, the referred-to column is the one that's kept. When columns are omitted based on WHERE equivalence, the first column in the columns clause is the one that's kept. :param only_synonyms: when True, limit the removal of columns to those which have the same name as the equivalent. Otherwise, all columns that are equivalent to another are removed. t only_synonyms(twith_only_columnsR+RORPRR?R,R(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs   cOs|j|jdt}|rAtddj|fn|r`|jj||jntj |gt j dd|D]}t j t j|^q|_dS(sReturn a new :func:`_expression.select` construct with its columns clause replaced with the given columns. By default, this method is exactly equivalent to as if the original :func:`_expression.select` had been called with the given columns clause. E.g. a statement:: s = select(table1.c.a, table1.c.b) s = s.with_only_columns(table1.c.b) should be exactly equivalent to:: s = select(table1.c.b) In this mode of operation, :meth:`_sql.Select.with_only_columns` will also dynamically alter the FROM clause of the statement if it is not explicitly stated. To maintain the existing set of FROMs including those implied by the current columns clause, add the :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter:: s = select(table1.c.a, table2.c.b) s = s.with_only_columns(table1.c.a, maintain_column_froms=True) The above parameter performs a transfer of the effective FROMs in the columns collection to the :meth:`_sql.Select.select_from` method, as though the following were invoked:: s = select(table1.c.a, table2.c.b) s = s.select_from(table1, table2).with_only_columns(table1.c.a) The :paramref:`_sql.Select.with_only_columns.maintain_column_froms` parameter makes use of the :attr:`_sql.Select.columns_clause_froms` collection and performs an operation equivalent to the following:: s = select(table1.c.a, table2.c.b) s = s.select_from(*s.columns_clause_froms).with_only_columns(table1.c.a) :param \*columns: column expressions to be used. .. versionchanged:: 1.4 the :meth:`_sql.Select.with_only_columns` method accepts the list of column expressions positionally; passing the expressions as a list is deprecated. :param maintain_column_froms: boolean parameter that will ensure the FROM list implied from the current columns clause will be transferred to the :meth:`_sql.Select.select_from` method first. .. versionadded:: 1.4.23 tmaintain_column_fromssunknown parameters: %ss, RsSelect.with_only_columnsN(t_assert_no_memoizationsRaRCRnRcRRRRUR^Rt!_expression_collection_was_a_listRhRRR(R/RReRR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs:  cCstj|jS(s Return the completed WHERE clause for this :class:`_expression.Select` statement. This assembles the current collection of WHERE criteria into a single :class:`_expression.BooleanClauseList` construct. .. versionadded:: 1.4 (R t_construct_for_whereclauseR,(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR!s cGsTt|jtstx5|D]-}tjtj|}|j|f7_qWdS(sReturn a new :func:`_expression.select` construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any. N(RR,RgRRRhRtWhereHavingRole(R/Rt criteriontwhere_criteria((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR4s cCs%|jtjtj|f7_dS(sReturn a new :func:`_expression.select` construct with the given expression added to its HAVING clause, joined to the existing clause via AND, if any. N(RcRRhRR(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRBscGs?|r2t|_|jtd|D|_n t|_dS(sReturn a new :func:`_expression.select` construct which will apply DISTINCT to its columns clause. :param \*expr: optional column expressions. When present, the PostgreSQL dialect will render a ``DISTINCT ON (>)`` construct. .. deprecated:: 1.4 Using \*expr in other dialects is deprecated and will raise :class:`_exc.CompileError` in a future version. css$|]}tjtj|VqdS(N(RRhRtByOfRole(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys ]sN(R3RdReRg(R/R^((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRmMs   cs)jtfd|D7_dS(sReturn a new :func:`_expression.select` construct with the given FROM expression(s) merged into its list of FROM objects. E.g.:: table1 = table('t1', column('a')) table2 = table('t2', column('b')) s = select(table1.c.a).\ select_from( table1.join(table2, table1.c.a==table2.c.b) ) The "from" list is a unique set on the identity of each element, so adding an already present :class:`_schema.Table` or other selectable will have no effect. Passing a :class:`_expression.Join` that refers to an already present :class:`_schema.Table` or other selectable will have the effect of concealing the presence of that selectable as an individual element in the rendered FROM list, instead rendering it into a JOIN clause. While the typical purpose of :meth:`_expression.Select.select_from` is to replace the default, derived FROM clause with a join, it can also be called with individual table elements, multiple times if desired, in the case that the FROM clause cannot be fully derived from the columns clause:: select(func.count('*')).select_from(table1) c3s*|] }tjtj|dVqdS(RN(RRhRR}(RR(R/(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys sN(RRg(R/R ((R/sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRbs$  cGsUt|_|r1|ddthkr1d|_n |jtd|D|_dS(sXReturn a new :class:`_expression.Select` which will correlate the given FROM clauses to that of an enclosing :class:`_expression.Select`. Calling this method turns off the :class:`_expression.Select` object's default behavior of "auto-correlation". Normally, FROM elements which appear in a :class:`_expression.Select` that encloses this one via its :term:`WHERE clause`, ORDER BY, HAVING or :term:`columns clause` will be omitted from this :class:`_expression.Select` object's :term:`FROM clause`. Setting an explicit correlation collection using the :meth:`_expression.Select.correlate` method provides a fixed list of FROM objects that can potentially take place in this process. When :meth:`_expression.Select.correlate` is used to apply specific FROM clauses for correlation, the FROM elements become candidates for correlation regardless of how deeply nested this :class:`_expression.Select` object is, relative to an enclosing :class:`_expression.Select` which refers to the same FROM object. This is in contrast to the behavior of "auto-correlation" which only correlates to an immediate enclosing :class:`_expression.Select`. Multi-level correlation ensures that the link between enclosed and enclosing :class:`_expression.Select` is always via at least one WHERE/ORDER BY/HAVING/columns clause in order for correlation to take place. If ``None`` is passed, the :class:`_expression.Select` object will correlate none of its FROM entries, and all will render unconditionally in the local FROM clause. :param \*fromclauses: a list of one or more :class:`_expression.FromClause` constructs, or other compatible constructs (i.e. ORM-mapped classes) to become part of the correlate collection. .. seealso:: :meth:`_expression.Select.correlate_except` :ref:`tutorial_scalar_subquery` icss$|]}tjtj|VqdS(N(RRhRR}(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys sN((RCRRYR2Rg(R/t fromclauses((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR s 5   cGs[t|_|r1|ddthkr1d|_n&|jp=dtd|D|_dS(sReturn a new :class:`_expression.Select` which will omit the given FROM clauses from the auto-correlation process. Calling :meth:`_expression.Select.correlate_except` turns off the :class:`_expression.Select` object's default behavior of "auto-correlation" for the given FROM elements. An element specified here will unconditionally appear in the FROM list, while all other FROM elements remain subject to normal auto-correlation behaviors. If ``None`` is passed, the :class:`_expression.Select` object will correlate all of its FROM entries. :param \*fromclauses: a list of one or more :class:`_expression.FromClause` constructs, or other compatible constructs (i.e. ORM-mapped classes) to become part of the correlate-exception collection. .. seealso:: :meth:`_expression.Select.correlate` :ref:`tutorial_scalar_subquery` icss$|]}tjtj|VqdS(N(RRhRR}(RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys sN(((RCRRYR3Rg(R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pytcorrelate_excepts   cCsMtj|j}tg|jD]!}|js|||f^qjS(s-A :class:`_expression.ColumnCollection` representing the columns that this SELECT statement or similar construct returns in its result set, not including :class:`_sql.TextClause` constructs. This collection differs from the :attr:`_expression.FromClause.columns` collection of a :class:`_expression.FromClause` in that the columns within this collection cannot be directly nested inside another SELECT statement; a subquery must be applied first which provides for the necessary parenthesization required by SQL. For a :func:`_expression.select` construct, the collection here is exactly what would be rendered inside the "SELECT" statement, and the :class:`_expression.ColumnElement` objects are directly present as they were given, e.g.:: col1 = column('q', Integer) col2 = column('p', Integer) stmt = select(col1, col2) Above, ``stmt.selected_columns`` would be a collection that contains the ``col1`` and ``col2`` objects directly. For a statement that is against a :class:`_schema.Table` or other :class:`_expression.FromClause`, the collection will use the :class:`_expression.ColumnElement` objects that are in the :attr:`_expression.FromClause.c` collection of the from element. .. note:: The :attr:`_sql.Select.selected_columns` collection does not include expressions established in the columns clause using the :func:`_sql.text` construct; these are silently omitted from the collection. To use plain textual column expressions inside of a :class:`_sql.Select` construct, use the :func:`_sql.literal_column` construct. .. versionadded:: 1.4 (R R*RRR?R R(R/tconvR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs / cCs"tj|j}t||S(N(R R}RCR(R/R~((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR?)scCs%|jtkr!|jt}n|S(N(RRR R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR.scCs|dkr|j}ntj|j}i}g}|j}|jtk}|jtk}d} x|D]} t} | j sd} } }n|rd} } | j p| j }n|r| j } } }n| j } }d} | dkr| j }|dkry| j |k} | || j s(RRR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCs|jS(N(R(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR?scCs|S(N((R/R((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscCs|S(N((R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scCs |jjS(N(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR scOs|jj|||_dS(N(Rt bindparams(R/tbindstbind_as_values((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRscs'jjfd|jDdS(Nc3s|]}|jVqdS(N(R(RR(R(sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pys s(RRR(R/R((RsL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs cCs|jdjS(Ni(RR(R/((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs(R1R2RARWRRR)RRPRRRR3t _is_textualtis_textRRCRRR;RR5R?RRRRRRR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyRs$      tAnnotatedFromClausecBseZdZRS(cCs|jtj|||dS(N(RRR(R/RR((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR"s(R1R2R(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyR!s(qRARRRRRRRRRRRt annotationRRtbaseR R R R R RRRRRRRRRRRRRRRRRRRR R!R"R#R$R%R&R'R(R)R*R+t inspectionR,R-RZR8R!R<RGtobjectR\RnRttAnonymizedFromClauseRoleRRRRRRt DMLTableRoleRRRRR/RJRRNRCRIRLRRRRaRsRRSt DMLSelectRoleRt InElementRoleRRRRt plugin_forRRRt MemoizedSlotsR RSt HasCacheKeytHasCopyInternalst TraversibleRUR6RRRt TextAsFromR(((sL/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/selectable.pyt s  ?N83T    P[J3UDI/=M5 #")ng