Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 0f12b69182fe3d3174a2e2454ef87704 > files > 467

python-sqlalchemy-0.6.8-1.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        
        <title>
                SQL Statements and Expressions
             &mdash; SQLAlchemy 0.6.8 Documentation</title>
        
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
          URL_ROOT:    '../',
          VERSION:     '0.6.8',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>
        <script type="text/javascript" src="../_static/jquery.js"></script>
        <script type="text/javascript" src="../_static/underscore.js"></script>
        <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/init.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
        <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="SQLAlchemy 0.6.8 Documentation" href="../index.html" />
        <link rel="up" title="SQLAlchemy Core" href="index.html" />
        <link rel="next" title="Engine Configuration" href="engines.html" />
        <link rel="prev" title="SQL Expression Language Tutorial" href="tutorial.html" />

    </head>
    <body>
        



<h1>SQLAlchemy 0.6.8 Documentation</h1>

<div id="search">
Search:
<form class="search" action="../search.html" method="get">
  <input type="text" name="q" size="18" /> <input type="submit" value="Search" />
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
</div>

<div class="versionheader">
    Version: <span class="versionnum">0.6.8</span> Last Updated: 06/05/2011 13:10:26
</div>
<div class="clearboth"></div>

<div id="topnav">
    <div id="pagecontrol">
        <ul>
            <li>Prev:
            <a href="tutorial.html" title="previous chapter">SQL Expression Language Tutorial</a>
            </li>
            <li>Next:
            <a href="engines.html" title="next chapter">Engine Configuration</a>
            </li>

        <li>
            <a href="../contents.html">Table of Contents</a> |
            <a href="../genindex.html">Index</a>
            | <a href="../_sources/core/expression_api.txt">view source
        </li>
        </ul>
    </div>
    <div id="navbanner">
        <a class="totoc" href="../index.html">SQLAlchemy 0.6.8 Documentation</a>
                » <a href="index.html" title="SQLAlchemy Core">SQLAlchemy Core</a>
        » 
                SQL Statements and Expressions
             

        <h2>
            
                SQL Statements and Expressions
            
        </h2>
        <ul>
<li><a class="reference internal" href="#">SQL Statements and Expressions</a><ul>
<li><a class="reference internal" href="#functions">Functions</a></li>
<li><a class="reference internal" href="#classes">Classes</a></li>
<li><a class="reference internal" href="#generic-functions">Generic Functions</a></li>
</ul>
</li>
</ul>

    </div>
    <div class="clearboth"></div>
</div>

<div class="document">
    <div class="body">
        
<div class="section" id="module-sqlalchemy.sql.expression">
<span id="sql-statements-and-expressions"></span><span id="expression-api-toplevel"></span><h1>SQL Statements and Expressions<a class="headerlink" href="#module-sqlalchemy.sql.expression" title="Permalink to this headline">¶</a></h1>
<p>This section presents the API reference for the SQL Expression Language.  For a full introduction to its usage,
see <a class="reference internal" href="tutorial.html"><em>SQL Expression Language Tutorial</em></a>.</p>
<div class="section" id="functions">
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<p>The expression package uses functions to construct SQL expressions.  The return value of each function is an object instance which is a subclass of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</p>
<dl class="function">
<dt id="sqlalchemy.sql.expression.alias">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">alias</tt><big>(</big><em>selectable</em>, <em>alias=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.alias" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> object.</p>
<p>An <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> represents any <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>
with an alternate name assigned within SQL, typically using the <tt class="docutils literal"><span class="pre">AS</span></tt>
clause when generated, e.g. <tt class="docutils literal"><span class="pre">SELECT</span> <span class="pre">*</span> <span class="pre">FROM</span> <span class="pre">table</span> <span class="pre">AS</span> <span class="pre">aliasname</span></tt>.</p>
<p>Similar functionality is available via the 
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause.alias" title="sqlalchemy.sql.expression.FromClause.alias"><tt class="xref py py-meth docutils literal"><span class="pre">alias()</span></tt></a> method
available on all <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclasses.</p>
<p>When an <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> is created from a <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> object,
this has the effect of the table being rendered
as <tt class="docutils literal"><span class="pre">tablename</span> <span class="pre">AS</span> <span class="pre">aliasname</span></tt> in a SELECT statement.</p>
<p>For <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> objects, the effect is that of creating a named
subquery, i.e. <tt class="docutils literal"><span class="pre">(select</span> <span class="pre">...)</span> <span class="pre">AS</span> <span class="pre">aliasname</span></tt>.</p>
<p>The <tt class="docutils literal"><span class="pre">alias</span></tt> parameter is optional, and provides the name
to use in the rendered SQL.  If blank, an &#8220;anonymous&#8221; 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.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>selectable</strong> &#8211; any <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclass,
such as a table, select statement, etc.</li>
<li><strong>alias</strong> &#8211; string name to be assigned as the alias.
If <tt class="xref docutils literal"><span class="pre">None</span></tt>, a name will be deterministically generated
at compile time.
<strong>Deprecated</strong> - this argument is called <tt class="docutils literal"><span class="pre">name</span></tt> in 
0.7 for consistency with the other aliasing methods.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.and_">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">and_</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.and_" title="Permalink to this definition">¶</a></dt>
<dd><p>Join a list of clauses together using the <tt class="docutils literal"><span class="pre">AND</span></tt> operator.</p>
<p>The <tt class="docutils literal"><span class="pre">&amp;</span></tt> operator is also overloaded on all
<a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a> subclasses to produce the
same result.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.asc">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">asc</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.asc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an ascending <tt class="docutils literal"><span class="pre">ORDER</span> <span class="pre">BY</span></tt> clause element.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">order_by</span> <span class="o">=</span> <span class="p">[</span><span class="n">asc</span><span class="p">(</span><span class="n">table1</span><span class="o">.</span><span class="n">mycol</span><span class="p">)]</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.between">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">between</tt><big>(</big><em>ctest</em>, <em>cleft</em>, <em>cright</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.between" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">BETWEEN</span></tt> predicate clause.</p>
<p>Equivalent of SQL <tt class="docutils literal"><span class="pre">clausetest</span> <span class="pre">BETWEEN</span> <span class="pre">clauseleft</span> <span class="pre">AND</span> <span class="pre">clauseright</span></tt>.</p>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.between" title="sqlalchemy.sql.expression.between"><tt class="xref py py-func docutils literal"><span class="pre">between()</span></tt></a> method on all
<a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a> subclasses provides
similar functionality.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.bindparam">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">bindparam</tt><big>(</big><em>key</em>, <em>value=None</em>, <em>type_=None</em>, <em>unique=False</em>, <em>required=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.bindparam" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a bind parameter clause with the given key.</p>
<dl class="docutils">
<dt>value</dt>
<dd>a default value for this bind parameter.  a bindparam with a
value is called a <tt class="docutils literal"><span class="pre">value-based</span> <span class="pre">bindparam</span></tt>.</dd>
<dt>type_</dt>
<dd>a sqlalchemy.types.TypeEngine object indicating the type of this
bind param, will invoke type-specific bind parameter processing</dd>
<dt>unique</dt>
<dd>if True, bind params sharing the same name will have their
underlying <tt class="docutils literal"><span class="pre">key</span></tt> modified to a uniquely generated name.
mostly useful with value-based bind params.</dd>
<dt>required</dt>
<dd>A value is required at execution time.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.case">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">case</tt><big>(</big><em>whens</em>, <em>value=None</em>, <em>else_=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.case" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a <tt class="docutils literal"><span class="pre">CASE</span></tt> statement.</p>
<dl class="docutils">
<dt>whens</dt>
<dd>A sequence of pairs, or alternatively a dict,
to be translated into &#8220;WHEN / THEN&#8221; clauses.</dd>
<dt>value</dt>
<dd>Optional for simple case statements, produces
a column expression as in &#8220;CASE &lt;expr&gt; WHEN ...&#8221;</dd>
<dt>else_</dt>
<dd>Optional as well, for case defaults produces
the &#8220;ELSE&#8221; portion of the &#8220;CASE&#8221; statement.</dd>
</dl>
<p>The expressions used for THEN and ELSE,
when specified as strings, will be interpreted
as bound values. To specify textual SQL expressions
for these, use the <a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a>
construct.</p>
<p>The expressions used for the WHEN criterion
may only be literal strings when &#8220;value&#8221; is
present, i.e. CASE table.somecol WHEN &#8220;x&#8221; THEN &#8220;y&#8221;.
Otherwise, literal strings are not accepted
in this position, and either the text(&lt;string&gt;)
or literal(&lt;string&gt;) constructs must be used to
interpret raw string values.</p>
<p>Usage examples:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">case</span><span class="p">([(</span><span class="n">orderline</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">qty</span> <span class="o">&gt;</span> <span class="mi">100</span><span class="p">,</span> <span class="n">item</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">specialprice</span><span class="p">),</span>
      <span class="p">(</span><span class="n">orderline</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">qty</span> <span class="o">&gt;</span> <span class="mi">10</span><span class="p">,</span> <span class="n">item</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">bulkprice</span><span class="p">)</span>
    <span class="p">],</span> <span class="n">else_</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">regularprice</span><span class="p">)</span>
<span class="n">case</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">emp</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">whens</span><span class="o">=</span><span class="p">{</span>
        <span class="s">&#39;engineer&#39;</span><span class="p">:</span> <span class="n">emp</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">salary</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">,</span>
        <span class="s">&#39;manager&#39;</span><span class="p">:</span>  <span class="n">emp</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">salary</span> <span class="o">*</span> <span class="mi">3</span><span class="p">,</span>
    <span class="p">})</span></pre></div>
</div>
<p>Using <a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a>, to allow for databases that
do not support bind parameters in the <tt class="docutils literal"><span class="pre">then</span></tt> clause.  The type
can be specified which determines the type of the <a class="reference internal" href="#sqlalchemy.sql.expression.case" title="sqlalchemy.sql.expression.case"><tt class="xref py py-func docutils literal"><span class="pre">case()</span></tt></a> construct
overall:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">case</span><span class="p">([(</span><span class="n">orderline</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">qty</span> <span class="o">&gt;</span> <span class="mi">100</span><span class="p">,</span> 
        <span class="n">literal_column</span><span class="p">(</span><span class="s">&quot;&#39;greaterthan100&#39;&quot;</span><span class="p">,</span> <span class="n">String</span><span class="p">)),</span>
      <span class="p">(</span><span class="n">orderline</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">qty</span> <span class="o">&gt;</span> <span class="mi">10</span><span class="p">,</span> <span class="n">literal_column</span><span class="p">(</span><span class="s">&quot;&#39;greaterthan10&#39;&quot;</span><span class="p">,</span>
        <span class="n">String</span><span class="p">))</span>
    <span class="p">],</span> <span class="n">else_</span><span class="o">=</span><span class="n">literal_column</span><span class="p">(</span><span class="s">&quot;&#39;lethan10&#39;&quot;</span><span class="p">,</span> <span class="n">String</span><span class="p">))</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.cast">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">cast</tt><big>(</big><em>clause</em>, <em>totype</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.cast" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">CAST</span></tt> function.</p>
<p>Equivalent of SQL <tt class="docutils literal"><span class="pre">CAST(clause</span> <span class="pre">AS</span> <span class="pre">totype)</span></tt>.</p>
<p>Use with a <a class="reference internal" href="types.html#sqlalchemy.types.TypeEngine" title="sqlalchemy.types.TypeEngine"><tt class="xref py py-class docutils literal"><span class="pre">TypeEngine</span></tt></a> subclass, i.e:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cast</span><span class="p">(</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">unit_price</span> <span class="o">*</span> <span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">qty</span><span class="p">,</span> <span class="n">Numeric</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">4</span><span class="p">))</span></pre></div>
</div>
<p>or:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cast</span><span class="p">(</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">timestamp</span><span class="p">,</span> <span class="n">DATE</span><span class="p">)</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.column">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">column</tt><big>(</big><em>text</em>, <em>type_=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.column" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a textual column clause, as would be in the columns clause of a
<tt class="docutils literal"><span class="pre">SELECT</span></tt> statement.</p>
<p>The object returned is an instance of <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a>, which
represents the &#8220;syntactical&#8221; portion of the schema-level
<a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> object.  It is often used directly
within <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> constructs or with lightweight <a class="reference internal" href="#sqlalchemy.sql.expression.table" title="sqlalchemy.sql.expression.table"><tt class="xref py py-func docutils literal"><span class="pre">table()</span></tt></a>
constructs.</p>
<p>Note that the <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> function is not part of
the <tt class="docutils literal"><span class="pre">sqlalchemy</span></tt> namespace.  It must be imported from the <tt class="docutils literal"><span class="pre">sql</span></tt> package:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">table</span><span class="p">,</span> <span class="n">column</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>text</strong> &#8211; the name of the column.  Quoting rules will be applied 
to the clause like any other column name. For textual column constructs
that are not to be quoted, use the <a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a> function.</li>
<li><strong>type_</strong> &#8211; an optional <a class="reference internal" href="types.html#sqlalchemy.types.TypeEngine" title="sqlalchemy.types.TypeEngine"><tt class="xref py py-class docutils literal"><span class="pre">TypeEngine</span></tt></a> object 
which will provide result-set translation for this column.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>See <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a> for further examples.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.collate">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">collate</tt><big>(</big><em>expression</em>, <em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.collate" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the clause <tt class="docutils literal"><span class="pre">expression</span> <span class="pre">COLLATE</span> <span class="pre">collation</span></tt>.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.delete">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">delete</tt><big>(</big><em>table</em>, <em>whereclause=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#sqlalchemy.sql.expression.Delete" title="sqlalchemy.sql.expression.Delete"><tt class="xref py py-class docutils literal"><span class="pre">Delete</span></tt></a> clause element.</p>
<p>Similar functionality is available via the <a class="reference internal" href="#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><tt class="xref py py-func docutils literal"><span class="pre">delete()</span></tt></a> method on
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>table</strong> &#8211; The table to be updated.</li>
<li><strong>whereclause</strong> &#8211; A <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> describing the <tt class="docutils literal"><span class="pre">WHERE</span></tt>
condition of the <tt class="docutils literal"><span class="pre">UPDATE</span></tt> statement. Note that the
<a class="reference internal" href="#sqlalchemy.sql.expression.Delete.where" title="sqlalchemy.sql.expression.Delete.where"><tt class="xref py py-meth docutils literal"><span class="pre">where()</span></tt></a> generative method may be used instead.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.desc">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">desc</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a descending <tt class="docutils literal"><span class="pre">ORDER</span> <span class="pre">BY</span></tt> clause element.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">order_by</span> <span class="o">=</span> <span class="p">[</span><span class="n">desc</span><span class="p">(</span><span class="n">table1</span><span class="o">.</span><span class="n">mycol</span><span class="p">)]</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.distinct">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">distinct</tt><big>(</big><em>expr</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.distinct" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">DISTINCT</span></tt> clause.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.except_">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">except_</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.except_" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">EXCEPT</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.except_all">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">except_all</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.except_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">EXCEPT</span> <span class="pre">ALL</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.exists">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">exists</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.exists" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">EXISTS</span></tt> clause as applied to a <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> object.</p>
<p>Calling styles are of the following forms:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># use on an existing select()</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">select</span><span class="p">([</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">col1</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">col2</span><span class="o">==</span><span class="mi">5</span><span class="p">)</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">exists</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>

<span class="c"># construct a select() at once</span>
<span class="n">exists</span><span class="p">([</span><span class="s">&#39;*&#39;</span><span class="p">],</span> <span class="o">**</span><span class="n">select_arguments</span><span class="p">)</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">criterion</span><span class="p">)</span>

<span class="c"># columns argument is optional, generates &quot;EXISTS (SELECT *)&quot;</span>
<span class="c"># by default.</span>
<span class="n">exists</span><span class="p">()</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">col2</span><span class="o">==</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.extract">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">extract</tt><big>(</big><em>field</em>, <em>expr</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.extract" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the clause <tt class="docutils literal"><span class="pre">extract(field</span> <span class="pre">FROM</span> <span class="pre">expr)</span></tt>.</p>
</dd></dl>

<dl class="data">
<dt id="sqlalchemy.sql.expression.func">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">func</tt><a class="headerlink" href="#sqlalchemy.sql.expression.func" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate SQL function expressions.</p>
<p><tt class="docutils literal"><span class="pre">func</span></tt> is a special object instance which generates SQL functions based on name-based attributes, e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">func</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">count(:param_1)</span></pre></div>
</div>
<p>Any name can be given to <cite>func</cite>. If the function name is unknown to
SQLAlchemy, it will be rendered exactly as is. For common SQL functions
which SQLAlchemy is aware of, the name may be interpreted as a <em>generic
function</em> which will be compiled appropriately to the target database:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">func</span><span class="o">.</span><span class="n">current_timestamp</span><span class="p">()</span>
<span class="go">CURRENT_TIMESTAMP</span></pre></div>
</div>
<p>To call functions which are present in dot-separated packages, specify them in the same manner:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">func</span><span class="o">.</span><span class="n">stats</span><span class="o">.</span><span class="n">yield_curve</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="go">stats.yield_curve(:yield_curve_1, :yield_curve_2)</span></pre></div>
</div>
<p>SQLAlchemy can be made aware of the return type of functions to enable
type-specific lexical and result-based behavior. For example, to ensure
that a string-based function returns a Unicode value and is similarly
treated as a string in expressions, specify
<a class="reference internal" href="types.html#sqlalchemy.types.Unicode" title="sqlalchemy.types.Unicode"><tt class="xref py py-class docutils literal"><span class="pre">Unicode</span></tt></a> as the type:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">func</span><span class="o">.</span><span class="n">my_string</span><span class="p">(</span><span class="s">u&#39;hi&#39;</span><span class="p">,</span> <span class="n">type_</span><span class="o">=</span><span class="n">Unicode</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39; &#39;</span> <span class="o">+</span> \
<span class="gp">... </span><span class="n">func</span><span class="o">.</span><span class="n">my_string</span><span class="p">(</span><span class="s">u&#39;there&#39;</span><span class="p">,</span> <span class="n">type_</span><span class="o">=</span><span class="n">Unicode</span><span class="p">)</span>
<span class="go">my_string(:my_string_1) || :my_string_2 || my_string(:my_string_3)</span></pre></div>
</div>
<p>Functions which are interpreted as &#8220;generic&#8221; functions know how to
calculate their return type automatically. For a listing of known generic
functions, see <a class="reference internal" href="#generic-functions"><em>Generic Functions</em></a>.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.insert">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">insert</tt><big>(</big><em>table</em>, <em>values=None</em>, <em>inline=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><tt class="xref py py-class docutils literal"><span class="pre">Insert</span></tt></a> clause element.</p>
<p>Similar functionality is available via the <a class="reference internal" href="#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><tt class="xref py py-func docutils literal"><span class="pre">insert()</span></tt></a> method on
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>table</strong> &#8211; The table to be inserted into.</li>
<li><strong>values</strong> &#8211; A dictionary which specifies the column specifications of
the <tt class="docutils literal"><span class="pre">INSERT</span></tt>, and is optional. If left as None, the column
specifications are determined from the bind parameters used during the
compile phase of the <tt class="docutils literal"><span class="pre">INSERT</span></tt> statement. If the bind parameters also
are None during the compile phase, then the column specifications will be
generated from the full list of table columns. Note that the
<a class="reference internal" href="#sqlalchemy.sql.expression.Insert.values" title="sqlalchemy.sql.expression.Insert.values"><tt class="xref py py-meth docutils literal"><span class="pre">values()</span></tt></a> generative method may also be used for this.</li>
<li><strong>prefixes</strong> &#8211; A list of modifier keywords to be inserted between INSERT
and INTO. Alternatively, the <a class="reference internal" href="#sqlalchemy.sql.expression.Insert.prefix_with" title="sqlalchemy.sql.expression.Insert.prefix_with"><tt class="xref py py-meth docutils literal"><span class="pre">prefix_with()</span></tt></a> generative
method may be used.</li>
<li><strong>inline</strong> &#8211; if True, SQL defaults will be compiled &#8216;inline&#8217; into the
statement and not pre-executed.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If both <cite>values</cite> and compile-time bind parameters are present, the
compile-time bind parameters override the information specified
within <cite>values</cite> on a per-key basis.</p>
<p>The keys within <cite>values</cite> can be either <a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a>
objects or their string identifiers. Each key may reference one of:</p>
<ul class="simple">
<li>a literal data value (i.e. string, number, etc.);</li>
<li>a Column object;</li>
<li>a SELECT statement.</li>
</ul>
<p>If a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement is specified which references this
<tt class="docutils literal"><span class="pre">INSERT</span></tt> statement&#8217;s table, the statement will be correlated
against the <tt class="docutils literal"><span class="pre">INSERT</span></tt> statement.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.intersect">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">intersect</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.intersect" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">INTERSECT</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.intersect_all">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">intersect_all</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.intersect_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">INTERSECT</span> <span class="pre">ALL</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.join">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">join</tt><big>(</big><em>left</em>, <em>right</em>, <em>onclause=None</em>, <em>isouter=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.join" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">JOIN</span></tt> clause element (regular inner join).</p>
<p>The returned object is an instance of <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>.</p>
<p>Similar functionality is also available via the <a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a> method
on any <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
<dl class="docutils">
<dt>left</dt>
<dd>The left side of the join.</dd>
<dt>right</dt>
<dd>The right side of the join.</dd>
<dt>onclause</dt>
<dd>Optional criterion for the <tt class="docutils literal"><span class="pre">ON</span></tt> clause, is derived from
foreign key relationships established between left and right
otherwise.</dd>
</dl>
<p>To chain joins together, use the <a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a> or <a class="reference internal" href="#sqlalchemy.sql.expression.outerjoin" title="sqlalchemy.sql.expression.outerjoin"><tt class="xref py py-func docutils literal"><span class="pre">outerjoin()</span></tt></a>
methods on the resulting <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> object.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.label">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">label</tt><big>(</big><em>name</em>, <em>obj</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.label" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="xref py py-class docutils literal"><span class="pre">_Label</span></tt> object for the
given <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>.</p>
<p>A label changes the name of an element in the columns clause of a
<tt class="docutils literal"><span class="pre">SELECT</span></tt> statement, typically via the <tt class="docutils literal"><span class="pre">AS</span></tt> SQL keyword.</p>
<p>This functionality is more conveniently available via the
<a class="reference internal" href="#sqlalchemy.sql.expression.label" title="sqlalchemy.sql.expression.label"><tt class="xref py py-func docutils literal"><span class="pre">label()</span></tt></a> method on <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>.</p>
<dl class="docutils">
<dt>name</dt>
<dd>label name</dd>
<dt>obj</dt>
<dd>a <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.literal">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">literal</tt><big>(</big><em>value</em>, <em>type_=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.literal" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a literal clause, bound to a bind parameter.</p>
<p>Literal clauses are created automatically when non- <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>
objects (such as strings, ints, dates, etc.) are used in a comparison
operation with a <a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a>
subclass, such as a <a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> object. Use this function to force the
generation of a literal clause, which will be created as a
<a class="reference internal" href="#sqlalchemy.sql.expression._BindParamClause" title="sqlalchemy.sql.expression._BindParamClause"><tt class="xref py py-class docutils literal"><span class="pre">_BindParamClause</span></tt></a> with a bound value.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>value</strong> &#8211; the value to be bound. Can be any Python object supported by
the underlying DB-API, or is translatable via the given type argument.</li>
<li><strong>type_</strong> &#8211; an optional <a class="reference internal" href="types.html#sqlalchemy.types.TypeEngine" title="sqlalchemy.types.TypeEngine"><tt class="xref py py-class docutils literal"><span class="pre">TypeEngine</span></tt></a> which
will provide bind-parameter translation for this literal.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.literal_column">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">literal_column</tt><big>(</big><em>text</em>, <em>type_=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.literal_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a textual column expression, as would be in the columns
clause of a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement.</p>
<p>The object returned supports further expressions in the same way as any
other column object, including comparison, math and string operations.
The type_ parameter is important to determine proper expression behavior
(such as, &#8216;+&#8217; means string concatenation or numerical addition based on
the type).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>text</strong> &#8211; the text of the expression; can be any SQL expression.  
Quoting rules will not be applied. To specify a column-name expression
which should be subject to quoting rules, use the <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a>
function.</li>
<li><strong>type_</strong> &#8211; an optional <a class="reference internal" href="types.html#sqlalchemy.types.TypeEngine" title="sqlalchemy.types.TypeEngine"><tt class="xref py py-class docutils literal"><span class="pre">TypeEngine</span></tt></a> object which will
provide result-set translation and additional expression semantics for
this column. If left as None the type will be NullType.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.not_">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">not_</tt><big>(</big><em>clause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.not_" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a negation of the given clause, i.e. <tt class="docutils literal"><span class="pre">NOT(clause)</span></tt>.</p>
<p>The <tt class="docutils literal"><span class="pre">~</span></tt> operator is also overloaded on all
<a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a> subclasses to produce the
same result.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.null">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">null</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.null" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="xref py py-class docutils literal"><span class="pre">_Null</span></tt> object, which compiles to <tt class="docutils literal"><span class="pre">NULL</span></tt> in a sql
statement.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.or_">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">or_</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.or_" title="Permalink to this definition">¶</a></dt>
<dd><p>Join a list of clauses together using the <tt class="docutils literal"><span class="pre">OR</span></tt> operator.</p>
<p>The <tt class="docutils literal"><span class="pre">|</span></tt> operator is also overloaded on all
<a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a> subclasses to produce the
same result.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.outparam">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">outparam</tt><big>(</big><em>key</em>, <em>type_=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.outparam" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an &#8216;OUT&#8217; parameter for usage in functions (stored procedures),
for databases which support them.</p>
<p>The <tt class="docutils literal"><span class="pre">outparam</span></tt> can be used like a regular function parameter.
The &#8220;output&#8221; value will be available from the
<tt class="xref py py-class docutils literal"><span class="pre">ResultProxy</span></tt> object via its <tt class="docutils literal"><span class="pre">out_parameters</span></tt>
attribute, which returns a dictionary containing the values.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.outerjoin">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">outerjoin</tt><big>(</big><em>left</em>, <em>right</em>, <em>onclause=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.outerjoin" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <tt class="docutils literal"><span class="pre">OUTER</span> <span class="pre">JOIN</span></tt> clause element.</p>
<p>The returned object is an instance of <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>.</p>
<p>Similar functionality is also available via the <a class="reference internal" href="#sqlalchemy.sql.expression.outerjoin" title="sqlalchemy.sql.expression.outerjoin"><tt class="xref py py-func docutils literal"><span class="pre">outerjoin()</span></tt></a>
method on any <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
<dl class="docutils">
<dt>left</dt>
<dd>The left side of the join.</dd>
<dt>right</dt>
<dd>The right side of the join.</dd>
<dt>onclause</dt>
<dd>Optional criterion for the <tt class="docutils literal"><span class="pre">ON</span></tt> clause, is derived from
foreign key relationships established between left and right
otherwise.</dd>
</dl>
<p>To chain joins together, use the <a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a> or <a class="reference internal" href="#sqlalchemy.sql.expression.outerjoin" title="sqlalchemy.sql.expression.outerjoin"><tt class="xref py py-func docutils literal"><span class="pre">outerjoin()</span></tt></a>
methods on the resulting <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> object.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.select">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">select</tt><big>(</big><em>columns=None</em>, <em>whereclause=None</em>, <em>from_obj=</em><span class="optional">[</span><span class="optional">]</span>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.select" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <tt class="docutils literal"><span class="pre">SELECT</span></tt> clause element.</p>
<p>Similar functionality is also available via the <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>
method on any <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
<p>The returned object is an instance of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a>.</p>
<p>All arguments which accept <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> arguments also accept
string arguments, which will be converted as appropriate into
either <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> or <a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a> constructs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>columns</strong> &#8211; <p>A list of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> objects, typically
<a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> objects or subclasses, which will form the
columns clause of the resulting statement. For all members which are
instances of <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a>, the individual <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>
members of the <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a> will be added individually to the
columns clause. For example, specifying a
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> instance will result in all the
contained <a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> objects within to be added
to the columns clause.</p>
<p>This argument is not present on the form of <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>
available on <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>.</p>
</li>
<li><strong>whereclause</strong> &#8211; A <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> expression which will be used to form the
<tt class="docutils literal"><span class="pre">WHERE</span></tt> clause.</li>
<li><strong>from_obj</strong> &#8211; A list of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> objects which will be added to the
<tt class="docutils literal"><span class="pre">FROM</span></tt> clause of the resulting statement. Note that &#8220;from&#8221; objects are
automatically located within the columns and whereclause ClauseElements.
Use this parameter to explicitly specify &#8220;from&#8221; objects which are not
automatically locatable. This could include
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> objects that aren&#8217;t otherwise present,
or <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> objects whose presence will supercede that of the
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> objects already located in the other
clauses.</li>
<li><strong>autocommit</strong> &#8211; Deprecated.  Use .execution_options(autocommit=&lt;True|False&gt;)
to set the autocommit option.</li>
<li><strong>prefixes</strong> &#8211; a list of strings or <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> objects to include
directly after the SELECT keyword in the generated statement,
for dialect-specific query features.</li>
<li><strong>distinct=False</strong> &#8211; when <tt class="xref docutils literal"><span class="pre">True</span></tt>, applies a <tt class="docutils literal"><span class="pre">DISTINCT</span></tt> qualifier to the columns
clause of the resulting statement.</li>
<li><strong>use_labels=False</strong> &#8211; when <tt class="xref docutils literal"><span class="pre">True</span></tt>, the statement will be generated using labels
for each column in the columns clause, which qualify each
column with its parent table&#8217;s (or aliases) name so that name
conflicts between columns in different tables don&#8217;t occur.
The format of the label is &lt;tablename&gt;_&lt;column&gt;.  The &#8220;c&#8221;
collection of the resulting <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> object will use these
names as well for targeting column members.</li>
<li><strong>for_update=False</strong> &#8211; when <tt class="xref docutils literal"><span class="pre">True</span></tt>, applies <tt class="docutils literal"><span class="pre">FOR</span> <span class="pre">UPDATE</span></tt> to the end of the
resulting statement.  Certain database dialects also support
alternate values for this parameter, for example mysql
supports &#8220;read&#8221; which translates to <tt class="docutils literal"><span class="pre">LOCK</span> <span class="pre">IN</span> <span class="pre">SHARE</span> <span class="pre">MODE</span></tt>,
and oracle supports &#8220;nowait&#8221; which translates to <tt class="docutils literal"><span class="pre">FOR</span> <span class="pre">UPDATE</span>
<span class="pre">NOWAIT</span></tt>.</li>
<li><strong>correlate=True</strong> &#8211; indicates that this <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> object should have its
contained <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> elements &#8220;correlated&#8221; to an enclosing
<a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> object.  This means that any <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>
instance within the &#8220;froms&#8221; collection of this <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a>
which is also present in the &#8220;froms&#8221; collection of an
enclosing select will not be rendered in the <tt class="docutils literal"><span class="pre">FROM</span></tt> clause
of this select statement.</li>
<li><strong>group_by</strong> &#8211; a list of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> objects which will comprise the
<tt class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></tt> clause of the resulting select.</li>
<li><strong>having</strong> &#8211; a <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> that will comprise the <tt class="docutils literal"><span class="pre">HAVING</span></tt> clause
of the resulting select when <tt class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></tt> is used.</li>
<li><strong>order_by</strong> &#8211; a scalar or list of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> objects which will
comprise the <tt class="docutils literal"><span class="pre">ORDER</span> <span class="pre">BY</span></tt> clause of the resulting select.</li>
<li><strong>limit=None</strong> &#8211; a numerical value which usually compiles to a <tt class="docutils literal"><span class="pre">LIMIT</span></tt>
expression in the resulting select.  Databases that don&#8217;t
support <tt class="docutils literal"><span class="pre">LIMIT</span></tt> will attempt to provide similar
functionality.</li>
<li><strong>offset=None</strong> &#8211; a numeric value which usually compiles to an <tt class="docutils literal"><span class="pre">OFFSET</span></tt>
expression in the resulting select.  Databases that don&#8217;t
support <tt class="docutils literal"><span class="pre">OFFSET</span></tt> will attempt to provide similar
functionality.</li>
<li><strong>bind=None</strong> &#8211; an <tt class="docutils literal"><span class="pre">Engine</span></tt> or <tt class="docutils literal"><span class="pre">Connection</span></tt> instance to which the
resulting <tt class="docutils literal"><span class="pre">Select</span> <span class="pre">`</span> <span class="pre">object</span> <span class="pre">will</span> <span class="pre">be</span> <span class="pre">bound.</span>&nbsp; <span class="pre">The</span> <span class="pre">``Select</span></tt>
object will otherwise automatically bind to whatever
<tt class="docutils literal"><span class="pre">Connectable</span></tt> instances can be located within its contained
<a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> members.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.subquery">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">subquery</tt><big>(</big><em>alias</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.subquery" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> object derived 
from a <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a>.</p>
<dl class="docutils">
<dt>name</dt>
<dd>alias name</dd>
</dl>
<p>*args, **kwargs</p>
<blockquote>
<div>all other arguments are delivered to the
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> function.</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.table">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">table</tt><big>(</big><em>name</em>, <em>*columns</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.table" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent a textual table clause.</p>
<p>The object returned is an instance of <a class="reference internal" href="#sqlalchemy.sql.expression.TableClause" title="sqlalchemy.sql.expression.TableClause"><tt class="xref py py-class docutils literal"><span class="pre">TableClause</span></tt></a>, which represents the
&#8220;syntactical&#8221; portion of the schema-level <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> object. 
It may be used to construct lightweight table constructs.</p>
<p>Note that the <a class="reference internal" href="#sqlalchemy.sql.expression.table" title="sqlalchemy.sql.expression.table"><tt class="xref py py-func docutils literal"><span class="pre">table()</span></tt></a> function is not part of
the <tt class="docutils literal"><span class="pre">sqlalchemy</span></tt> namespace.  It must be imported from the <tt class="docutils literal"><span class="pre">sql</span></tt> package:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">table</span><span class="p">,</span> <span class="n">column</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> &#8211; Name of the table.</li>
<li><strong>columns</strong> &#8211; A collection of <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> constructs.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>See <a class="reference internal" href="#sqlalchemy.sql.expression.TableClause" title="sqlalchemy.sql.expression.TableClause"><tt class="xref py py-class docutils literal"><span class="pre">TableClause</span></tt></a> for further examples.</p>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.text">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">text</tt><big>(</big><em>text</em>, <em>bind=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.text" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a SQL construct that is represented by a literal string.</p>
<p>E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">text</span><span class="p">(</span><span class="s">&quot;SELECT * FROM users&quot;</span><span class="p">)</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">connection</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="n">t</span><span class="p">)</span></pre></div>
</div>
<p>The advantages <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> provides over a plain string are
backend-neutral support for bind parameters, per-statement
execution options, as well as 
bind parameter and result-column typing behavior, allowing 
SQLAlchemy type constructs to play a role when executing
a statement that is specified literally.</p>
<p>Bind parameters are specified by name, using the format <tt class="docutils literal"><span class="pre">:name</span></tt>.
E.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">text</span><span class="p">(</span><span class="s">&quot;SELECT * FROM users WHERE id=:user_id&quot;</span><span class="p">)</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">connection</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">user_id</span><span class="o">=</span><span class="mi">12</span><span class="p">)</span></pre></div>
</div>
<p>To invoke SQLAlchemy typing logic for bind parameters, the 
<tt class="docutils literal"><span class="pre">bindparams</span></tt> list allows specification of <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a>
constructs which specify the type for a given name:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">text</span><span class="p">(</span><span class="s">&quot;SELECT id FROM users WHERE updated_at&gt;:updated&quot;</span><span class="p">,</span>
            <span class="n">bindparams</span><span class="o">=</span><span class="p">[</span><span class="n">bindparam</span><span class="p">(</span><span class="s">&#39;updated&#39;</span><span class="p">,</span> <span class="n">DateTime</span><span class="p">())]</span>
        <span class="p">)</span></pre></div>
</div>
<p>Typing during result row processing is also an important concern.
Result column types
are specified using the <tt class="docutils literal"><span class="pre">typemap</span></tt> dictionary, where the keys
match the names of columns.  These names are taken from what
the DBAPI returns as <tt class="docutils literal"><span class="pre">cursor.description</span></tt>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">text</span><span class="p">(</span><span class="s">&quot;SELECT id, name FROM users&quot;</span><span class="p">,</span>
        <span class="n">typemap</span><span class="o">=</span><span class="p">{</span>
            <span class="s">&#39;id&#39;</span><span class="p">:</span><span class="n">Integer</span><span class="p">,</span>
            <span class="s">&#39;name&#39;</span><span class="p">:</span><span class="n">Unicode</span>
        <span class="p">}</span>
<span class="p">)</span></pre></div>
</div>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> construct is used internally for most cases when
a literal string is specified for part of a larger query, such as
within <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt></a>,
<a class="reference internal" href="#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><tt class="xref py py-func docutils literal"><span class="pre">insert()</span></tt></a> or <a class="reference internal" href="#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><tt class="xref py py-func docutils literal"><span class="pre">delete()</span></tt></a>.   In those cases, the same
bind parameter syntax is applied:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">s</span> <span class="o">=</span> <span class="n">select</span><span class="p">([</span><span class="n">users</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">users</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">name</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="s">&quot;id=:user_id&quot;</span><span class="p">)</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">connection</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">user_id</span><span class="o">=</span><span class="mi">12</span><span class="p">)</span></pre></div>
</div>
<p>Using <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> explicitly usually implies the construction
of a full, standalone statement.   As such, SQLAlchemy refers
to it as an <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a> object, and it supports
the <a class="reference internal" href="#sqlalchemy.sql.expression.Executable.execution_options" title="sqlalchemy.sql.expression.Executable.execution_options"><tt class="xref py py-meth docutils literal"><span class="pre">Executable.execution_options()</span></tt></a> method.  For example,
a <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> construct that should be subject to &#8220;autocommit&#8221;
can be set explicitly so using the <tt class="docutils literal"><span class="pre">autocommit</span></tt> option:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">text</span><span class="p">(</span><span class="s">&quot;EXEC my_procedural_thing()&quot;</span><span class="p">)</span><span class="o">.</span>\
        <span class="n">execution_options</span><span class="p">(</span><span class="n">autocommit</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span></pre></div>
</div>
<p>Note that SQLAlchemy&#8217;s usual &#8220;autocommit&#8221; behavior applies to
<a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a> constructs - that is, statements which begin
with a phrase such as <tt class="docutils literal"><span class="pre">INSERT</span></tt>, <tt class="docutils literal"><span class="pre">UPDATE</span></tt>, <tt class="docutils literal"><span class="pre">DELETE</span></tt>, 
or a variety of other phrases specific to certain backends, will 
be eligible for autocommit if no transaction is in progress.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>text</strong> &#8211; the text of the SQL statement to be created.  use <tt class="docutils literal"><span class="pre">:&lt;param&gt;</span></tt>
to specify bind parameters; they will be compiled to their
engine-specific format.</li>
<li><strong>autocommit</strong> &#8211; Deprecated.  Use .execution_options(autocommit=&lt;True|False&gt;)
to set the autocommit option.</li>
<li><strong>bind</strong> &#8211; an optional connection or engine to be used for this text query.</li>
<li><strong>bindparams</strong> &#8211; a list of <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a> instances which can be used to define
the types and/or initial values for the bind parameters within
the textual statement; the keynames of the bindparams must match
those within the text of the statement.  The types will be used
for pre-processing on bind values.</li>
<li><strong>typemap</strong> &#8211; a dictionary mapping the names of columns represented in the
columns clause of a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement  to type objects,
which will be used to perform post-processing on columns within
the result set.   This argument applies to any expression 
that returns result sets.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.tuple_">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">tuple_</tt><big>(</big><em>*expr</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.tuple_" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a SQL tuple.</p>
<p>Main usage is to produce a composite IN construct:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">tuple_</span><span class="p">(</span><span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">col1</span><span class="p">,</span> <span class="n">table</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">col2</span><span class="p">)</span><span class="o">.</span><span class="n">in_</span><span class="p">(</span>
    <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">12</span><span class="p">),</span> <span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">19</span><span class="p">)]</span>
<span class="p">)</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.type_coerce">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">type_coerce</tt><big>(</big><em>expr</em>, <em>type_</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.type_coerce" title="Permalink to this definition">¶</a></dt>
<dd><p>Coerce the given expression into the given type, on the Python side only.</p>
<p><a class="reference internal" href="#sqlalchemy.sql.expression.type_coerce" title="sqlalchemy.sql.expression.type_coerce"><tt class="xref py py-func docutils literal"><span class="pre">type_coerce()</span></tt></a> is roughly similar to :func:.`cast`, except no
&#8220;CAST&#8221; expression is rendered - the given type is only applied towards
expression typing and against received result values.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.types</span> <span class="kn">import</span> <span class="n">TypeDecorator</span>
<span class="kn">import</span> <span class="nn">uuid</span>

<span class="k">class</span> <span class="nc">AsGuid</span><span class="p">(</span><span class="n">TypeDecorator</span><span class="p">):</span>
    <span class="n">impl</span> <span class="o">=</span> <span class="n">String</span>

    <span class="k">def</span> <span class="nf">process_bind_param</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">dialect</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">None</span>

    <span class="k">def</span> <span class="nf">process_result_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">dialect</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">uuid</span><span class="o">.</span><span class="n">UUID</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">None</span>

<span class="n">conn</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span>
    <span class="n">select</span><span class="p">([</span><span class="n">type_coerce</span><span class="p">(</span><span class="n">mytable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">ident</span><span class="p">,</span> <span class="n">AsGuid</span><span class="p">)])</span><span class="o">.</span>\
            <span class="n">where</span><span class="p">(</span>
                <span class="n">type_coerce</span><span class="p">(</span><span class="n">mytable</span><span class="o">.</span><span class="n">c</span><span class="o">.</span><span class="n">ident</span><span class="p">,</span> <span class="n">AsGuid</span><span class="p">)</span> <span class="o">==</span> 
                <span class="n">uuid</span><span class="o">.</span><span class="n">uuid3</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">NAMESPACE_URL</span><span class="p">,</span> <span class="s">&#39;bar&#39;</span><span class="p">)</span>
            <span class="p">)</span>
<span class="p">)</span></pre></div>
</div>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.union">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">union</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.union" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">UNION</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<p>A similar <a class="reference internal" href="#sqlalchemy.sql.expression.union" title="sqlalchemy.sql.expression.union"><tt class="xref py py-func docutils literal"><span class="pre">union()</span></tt></a> method is available on all
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclasses.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.union_all">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">union_all</tt><big>(</big><em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.union_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <tt class="docutils literal"><span class="pre">UNION</span> <span class="pre">ALL</span></tt> of multiple selectables.</p>
<p>The returned object is an instance of
<a class="reference internal" href="#sqlalchemy.sql.expression.CompoundSelect" title="sqlalchemy.sql.expression.CompoundSelect"><tt class="xref py py-class docutils literal"><span class="pre">CompoundSelect</span></tt></a>.</p>
<p>A similar <a class="reference internal" href="#sqlalchemy.sql.expression.union_all" title="sqlalchemy.sql.expression.union_all"><tt class="xref py py-func docutils literal"><span class="pre">union_all()</span></tt></a> method is available on all
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclasses.</p>
<dl class="docutils">
<dt>*selects</dt>
<dd>a list of <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> instances.</dd>
<dt>**kwargs</dt>
<dd>available keyword arguments are the same as those of
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="sqlalchemy.sql.expression.update">
<tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">update</tt><big>(</big><em>table</em>, <em>whereclause=None</em>, <em>values=None</em>, <em>inline=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an <a class="reference internal" href="#sqlalchemy.sql.expression.Update" title="sqlalchemy.sql.expression.Update"><tt class="xref py py-class docutils literal"><span class="pre">Update</span></tt></a> clause element.</p>
<p>Similar functionality is available via the <a class="reference internal" href="#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt></a> method on
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>table</strong> &#8211; The table to be updated.</li>
<li><strong>whereclause</strong> &#8211; A <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> describing the <tt class="docutils literal"><span class="pre">WHERE</span></tt>
condition of the <tt class="docutils literal"><span class="pre">UPDATE</span></tt> statement. Note that the
<a class="reference internal" href="#sqlalchemy.sql.expression.Update.where" title="sqlalchemy.sql.expression.Update.where"><tt class="xref py py-meth docutils literal"><span class="pre">where()</span></tt></a> generative method may also be used for this.</li>
<li><strong>values</strong> &#8211; A dictionary which specifies the <tt class="docutils literal"><span class="pre">SET</span></tt> conditions of the
<tt class="docutils literal"><span class="pre">UPDATE</span></tt>, and is optional. If left as None, the <tt class="docutils literal"><span class="pre">SET</span></tt>
conditions are determined from the bind parameters used during
the compile phase of the <tt class="docutils literal"><span class="pre">UPDATE</span></tt> statement.  If the bind
parameters also are None during the compile phase, then the
<tt class="docutils literal"><span class="pre">SET</span></tt> conditions will be generated from the full list of table
columns.  Note that the <a class="reference internal" href="#sqlalchemy.sql.expression.Update.values" title="sqlalchemy.sql.expression.Update.values"><tt class="xref py py-meth docutils literal"><span class="pre">values()</span></tt></a> generative method may
also be used for this.</li>
<li><strong>inline</strong> &#8211; if True, SQL defaults will be compiled &#8216;inline&#8217; into the statement
and not pre-executed.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If both <cite>values</cite> and compile-time bind parameters are present, the
compile-time bind parameters override the information specified
within <cite>values</cite> on a per-key basis.</p>
<p>The keys within <cite>values</cite> can be either <a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a>
objects or their
string identifiers. Each key may reference one of:</p>
<ul class="simple">
<li>a literal data value (i.e. string, number, etc.);</li>
<li>a Column object;</li>
<li>a SELECT statement.</li>
</ul>
<p>If a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement is specified which references this
<tt class="docutils literal"><span class="pre">UPDATE</span></tt> statement&#8217;s table, the statement will be correlated
against the <tt class="docutils literal"><span class="pre">UPDATE</span></tt> statement.</p>
</dd></dl>

</div>
<div class="section" id="classes">
<h2>Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="sqlalchemy.sql.expression.Alias">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Alias</tt><big>(</big><em>selectable</em>, <em>alias=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Alias" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>Represents an table or selectable alias (AS).</p>
<p>Represents an alias, as typically applied to any table or
sub-select within a SQL statement using the <tt class="docutils literal"><span class="pre">AS</span></tt> keyword (or
without the keyword on certain databases such as Oracle).</p>
<p>This object is constructed from the <a class="reference internal" href="#sqlalchemy.sql.expression.alias" title="sqlalchemy.sql.expression.alias"><tt class="xref py py-func docutils literal"><span class="pre">alias()</span></tt></a> module level
function as well as the <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause.alias" title="sqlalchemy.sql.expression.FromClause.alias"><tt class="xref py py-meth docutils literal"><span class="pre">FromClause.alias()</span></tt></a> method available on all
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclasses.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Alias.__init__">
<tt class="descname">__init__</tt><big>(</big><em>selectable</em>, <em>alias=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Alias.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression._BindParamClause">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">_BindParamClause</tt><big>(</big><em>key</em>, <em>value</em>, <em>type_=None</em>, <em>unique=False</em>, <em>isoutparam=False</em>, <em>required=False</em>, <em>_compared_to_operator=None</em>, <em>_compared_to_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._BindParamClause" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ColumnElement</span></tt></a></p>
<p>Represent a bind parameter.</p>
<p>Public constructor is the <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a> function.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression._BindParamClause.__init__">
<tt class="descname">__init__</tt><big>(</big><em>key</em>, <em>value</em>, <em>type_=None</em>, <em>unique=False</em>, <em>isoutparam=False</em>, <em>required=False</em>, <em>_compared_to_operator=None</em>, <em>_compared_to_type=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._BindParamClause.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a _BindParamClause.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>key</strong> &#8211; the key for this bind param.  Will be used in the generated
SQL statement for dialects that use named parameters.  This
value may be modified when part of a compilation operation,
if other <a class="reference internal" href="#sqlalchemy.sql.expression._BindParamClause" title="sqlalchemy.sql.expression._BindParamClause"><tt class="xref py py-class docutils literal"><span class="pre">_BindParamClause</span></tt></a> objects exist with the same
key, or if its length is too long and truncation is
required.</li>
<li><strong>value</strong> &#8211; Initial value for this bind param.  This value may be
overridden by the dictionary of parameters sent to statement
compilation/execution.</li>
<li><strong>type_</strong> &#8211; A <tt class="docutils literal"><span class="pre">TypeEngine</span></tt> object that will be used to pre-process the
value corresponding to this <a class="reference internal" href="#sqlalchemy.sql.expression._BindParamClause" title="sqlalchemy.sql.expression._BindParamClause"><tt class="xref py py-class docutils literal"><span class="pre">_BindParamClause</span></tt></a> at
execution time.</li>
<li><strong>unique</strong> &#8211; if True, the key name of this BindParamClause will be
modified if another <a class="reference internal" href="#sqlalchemy.sql.expression._BindParamClause" title="sqlalchemy.sql.expression._BindParamClause"><tt class="xref py py-class docutils literal"><span class="pre">_BindParamClause</span></tt></a> of the same name
already has been located within the containing
<a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</li>
<li><strong>required</strong> &#8211; a value is required at execution time.</li>
<li><strong>isoutparam</strong> &#8211; if True, the parameter should be treated like a stored procedure
&#8220;OUT&#8221; parameter.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._BindParamClause.compare">
<tt class="descname">compare</tt><big>(</big><em>other</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._BindParamClause.compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare this <a class="reference internal" href="#sqlalchemy.sql.expression._BindParamClause" title="sqlalchemy.sql.expression._BindParamClause"><tt class="xref py py-class docutils literal"><span class="pre">_BindParamClause</span></tt></a> to the given
clause.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.ClauseElement">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">ClauseElement</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.visitors.Visitable</span></tt></p>
<p>Base class for elements of a programmatically constructed SQL
expression.</p>
<dl class="attribute">
<dt id="sqlalchemy.sql.expression.ClauseElement.bind">
<tt class="descname">bind</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.bind" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the Engine or Connection to which this ClauseElement is
bound, or None if none found.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.compare">
<tt class="descname">compare</tt><big>(</big><em>other</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare this ClauseElement to the given ClauseElement.</p>
<p>Subclasses should override the default behavior, which is a
straight identity comparison.</p>
<p>**kw are arguments consumed by subclass compare() methods and
may be used to modify the criteria for comparison.
(see <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>)</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.compile">
<tt class="descname">compile</tt><big>(</big><em>bind=None</em>, <em>dialect=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.compile" title="Permalink to this definition">¶</a></dt>
<dd><p>Compile this SQL expression.</p>
<p>The return value is a <tt class="xref py py-class docutils literal"><span class="pre">Compiled</span></tt> object.
Calling <tt class="docutils literal"><span class="pre">str()</span></tt> or <tt class="docutils literal"><span class="pre">unicode()</span></tt> on the returned value will yield a
string representation of the result. The
<tt class="xref py py-class docutils literal"><span class="pre">Compiled</span></tt> object also can return a
dictionary of bind parameter names and values
using the <tt class="docutils literal"><span class="pre">params</span></tt> accessor.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>bind</strong> &#8211; An <tt class="docutils literal"><span class="pre">Engine</span></tt> or <tt class="docutils literal"><span class="pre">Connection</span></tt> from which a
<tt class="docutils literal"><span class="pre">Compiled</span></tt> will be acquired. This argument takes precedence over
this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>&#8216;s bound engine, if any.</li>
<li><strong>column_keys</strong> &#8211; Used for INSERT and UPDATE statements, a list of
column names which should be present in the VALUES clause of the
compiled statement. If <tt class="xref docutils literal"><span class="pre">None</span></tt>, all columns from the target table
object are rendered.</li>
<li><strong>dialect</strong> &#8211; A <tt class="docutils literal"><span class="pre">Dialect</span></tt> instance frmo which a <tt class="docutils literal"><span class="pre">Compiled</span></tt>
will be acquired. This argument takes precedence over the <cite>bind</cite>
argument as well as this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>&#8216;s bound engine, if
any.</li>
<li><strong>inline</strong> &#8211; Used for INSERT statements, for a dialect which does
not support inline retrieval of newly generated primary key
columns, will force the expression used to create the new primary
key value to be rendered inline within the INSERT statement&#8217;s
VALUES clause. This typically refers to Sequence execution but may
also refer to any server-side default generation function
associated with a primary key <cite>Column</cite>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.execute">
<tt class="descname">execute</tt><big>(</big><em>*multiparams</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>Compile and execute this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 0.7: </span>(pending) Only SQL expressions which subclass <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a> may provide the <tt class="xref py py-func docutils literal"><span class="pre">execute()</span></tt> method.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.get_children">
<tt class="descname">get_children</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>Return immediate child elements of this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</p>
<p>This is used for visit traversal.</p>
<p>**kwargs may contain flags that change the collection that is
returned, for example to return a subset of items in order to
cut down on larger traversals, or to return child items from a
different context (such as schema-level collections instead of
clause-level).</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.params">
<tt class="descname">params</tt><big>(</big><em>*optionaldict</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.params" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a copy with <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a> elments replaced.</p>
<p>Returns a copy of this ClauseElement with <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a>
elements replaced with values taken from the given dictionary:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">clause</span> <span class="o">=</span> <span class="n">column</span><span class="p">(</span><span class="s">&#39;x&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="n">bindparam</span><span class="p">(</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">clause</span><span class="o">.</span><span class="n">compile</span><span class="p">()</span><span class="o">.</span><span class="n">params</span>
<span class="go">{&#39;foo&#39;:None}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">clause</span><span class="o">.</span><span class="n">params</span><span class="p">({</span><span class="s">&#39;foo&#39;</span><span class="p">:</span><span class="mi">7</span><span class="p">})</span><span class="o">.</span><span class="n">compile</span><span class="p">()</span><span class="o">.</span><span class="n">params</span>
<span class="go">{&#39;foo&#39;:7}</span></pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.scalar">
<tt class="descname">scalar</tt><big>(</big><em>*multiparams</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.scalar" title="Permalink to this definition">¶</a></dt>
<dd><p>Compile and execute this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>, returning</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 0.7: </span>(pending) Only SQL expressions which subclass <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a> may provide the <tt class="xref py py-func docutils literal"><span class="pre">scalar()</span></tt> method.</p>
<p>the result&#8217;s scalar representation.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.self_group">
<tt class="descname">self_group</tt><big>(</big><em>against=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.self_group" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply a &#8216;grouping&#8217; to this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>.</p>
<p>This method is overridden by subclasses to return a 
&#8220;grouping&#8221; construct, i.e. parenthesis.   In particular
it&#8217;s used by &#8220;binary&#8221; expressions to provide a grouping
around themselves when placed into a larger expression, 
as well as by <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> constructs when placed into
the FROM clause of another <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>.  (Note that 
subqueries should be normally created using the 
<tt class="xref py py-func docutils literal"><span class="pre">Select.alias()</span></tt> method, as many platforms require
nested SELECT statements to be named).</p>
<p>As expressions are composed together, the application of
<a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement.self_group" title="sqlalchemy.sql.expression.ClauseElement.self_group"><tt class="xref py py-meth docutils literal"><span class="pre">self_group()</span></tt></a> is automatic - end-user code should never 
need to use this method directly.  Note that SQLAlchemy&#8217;s
clause constructs take operator precedence into account - 
so parenthesis might not be needed, for example, in 
an expression like <tt class="docutils literal"><span class="pre">x</span> <span class="pre">OR</span> <span class="pre">(y</span> <span class="pre">AND</span> <span class="pre">z)</span></tt> - AND takes precedence
over OR.</p>
<p>The base <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement.self_group" title="sqlalchemy.sql.expression.ClauseElement.self_group"><tt class="xref py py-meth docutils literal"><span class="pre">self_group()</span></tt></a> method of <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>
just returns self.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ClauseElement.unique_params">
<tt class="descname">unique_params</tt><big>(</big><em>*optionaldict</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ClauseElement.unique_params" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a copy with <a class="reference internal" href="#sqlalchemy.sql.expression.bindparam" title="sqlalchemy.sql.expression.bindparam"><tt class="xref py py-func docutils literal"><span class="pre">bindparam()</span></tt></a> elments replaced.</p>
<p>Same functionality as <tt class="docutils literal"><span class="pre">params()</span></tt>, except adds <cite>unique=True</cite>
to affected bind parameters so that multiple statements can be
used.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.ColumnClause">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">ColumnClause</tt><big>(</big><em>text</em>, <em>selectable=None</em>, <em>type_=None</em>, <em>is_literal=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnClause" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._Immutable</span></tt>, <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ColumnElement</span></tt></a></p>
<p>Represents a generic column expression from any textual string.</p>
<p>This includes columns associated with tables, aliases and select
statements, but also any arbitrary text.  May or may not be bound
to an underlying <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a>.</p>
<p><a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a> is constructed by itself typically via
the <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> function.  It may be placed directly
into constructs such as <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> constructs:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">column</span><span class="p">,</span> <span class="n">select</span>

<span class="n">c1</span><span class="p">,</span> <span class="n">c2</span> <span class="o">=</span> <span class="n">column</span><span class="p">(</span><span class="s">&quot;c1&quot;</span><span class="p">),</span> <span class="n">column</span><span class="p">(</span><span class="s">&quot;c2&quot;</span><span class="p">)</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">select</span><span class="p">([</span><span class="n">c1</span><span class="p">,</span> <span class="n">c2</span><span class="p">])</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">c1</span><span class="o">==</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>There is also a variant on <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> known
as <a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a> - the difference is that 
in the latter case, the string value is assumed to be an exact
expression, rather than a column name, so that no quoting rules
or similar are applied:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">literal_column</span><span class="p">,</span> <span class="n">select</span>

<span class="n">s</span> <span class="o">=</span> <span class="n">select</span><span class="p">([</span><span class="n">literal_column</span><span class="p">(</span><span class="s">&quot;5 + 7&quot;</span><span class="p">)])</span></pre></div>
</div>
<p><a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a> can also be used in a table-like 
fashion by combining the <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> function 
with the <a class="reference internal" href="#sqlalchemy.sql.expression.table" title="sqlalchemy.sql.expression.table"><tt class="xref py py-func docutils literal"><span class="pre">table()</span></tt></a> function, to produce
a &#8220;lightweight&#8221; form of table metadata:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">table</span><span class="p">,</span> <span class="n">column</span>

<span class="n">user</span> <span class="o">=</span> <span class="n">table</span><span class="p">(</span><span class="s">&quot;user&quot;</span><span class="p">,</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">),</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;name&quot;</span><span class="p">),</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;description&quot;</span><span class="p">),</span>
<span class="p">)</span></pre></div>
</div>
<p>The above construct can be created in an ad-hoc fashion and is
not associated with any <a class="reference internal" href="schema.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><tt class="xref py py-class docutils literal"><span class="pre">schema.MetaData</span></tt></a>, unlike it&#8217;s
more full fledged <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">schema.Table</span></tt></a> counterpart.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>text</strong> &#8211; the text of the element.</li>
<li><strong>selectable</strong> &#8211; parent selectable.</li>
<li><strong>type</strong> &#8211; <a class="reference internal" href="types.html#sqlalchemy.types.TypeEngine" title="sqlalchemy.types.TypeEngine"><tt class="xref py py-class docutils literal"><span class="pre">types.TypeEngine</span></tt></a> object which can associate 
this <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a> with a type.</li>
<li><strong>is_literal</strong> &#8211; if True, the <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a> is assumed to 
be an exact expression that will be delivered to the output with no
quoting rules applied regardless of case sensitive settings. the
<a class="reference internal" href="#sqlalchemy.sql.expression.literal_column" title="sqlalchemy.sql.expression.literal_column"><tt class="xref py py-func docutils literal"><span class="pre">literal_column()</span></tt></a> function is usually used to create such a
<a class="reference internal" href="#sqlalchemy.sql.expression.ColumnClause" title="sqlalchemy.sql.expression.ColumnClause"><tt class="xref py py-class docutils literal"><span class="pre">ColumnClause</span></tt></a>.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnClause.__init__">
<tt class="descname">__init__</tt><big>(</big><em>text</em>, <em>selectable=None</em>, <em>type_=None</em>, <em>is_literal=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnClause.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.ColumnCollection">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">ColumnCollection</tt><big>(</big><em>*cols</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.util.OrderedProperties</span></tt></p>
<p>An ordered dictionary that stores a list of ColumnElement
instances.</p>
<p>Overrides the <tt class="docutils literal"><span class="pre">__eq__()</span></tt> method to produce SQL clauses between
sets of correlated columns.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnCollection.__init__">
<tt class="descname">__init__</tt><big>(</big><em>*cols</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnCollection.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnCollection.add">
<tt class="descname">add</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnCollection.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a column to this collection.</p>
<p>The key attribute of the column will be used as the hash key
for this dictionary.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnCollection.replace">
<tt class="descname">replace</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnCollection.replace" title="Permalink to this definition">¶</a></dt>
<dd><p>add the given column to this collection, removing unaliased
versions of this column  as well as existing columns with the
same key.</p>
<blockquote>
<div><p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">Table</span><span class="p">(</span><span class="s">&#39;sometable&#39;</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">Column</span><span class="p">(</span><span class="s">&#39;col1&#39;</span><span class="p">,</span> <span class="n">Integer</span><span class="p">))</span>
<span class="n">t</span><span class="o">.</span><span class="n">columns</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">Column</span><span class="p">(</span><span class="s">&#39;col1&#39;</span><span class="p">,</span> <span class="n">Integer</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s">&#39;columnone&#39;</span><span class="p">))</span></pre></div>
</div>
<p>will remove the original &#8216;col1&#8217; from the collection, and add
the new column under the name &#8216;columnname&#8217;.</p>
</div></blockquote>
<p>Used by schema.Column to override columns during table reflection.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.ColumnElement">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">ColumnElement</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ClauseElement</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._CompareMixin</span></tt></a></p>
<p>Represent an element that is usable within the &#8220;column clause&#8221; portion
of a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement.</p>
<p>This includes columns associated with tables, aliases, and
subqueries, expressions, function calls, SQL keywords such as
<tt class="docutils literal"><span class="pre">NULL</span></tt>, literals, etc.  <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> is the ultimate base
class for all such elements.</p>
<p><a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> supports the ability to be a <em>proxy</em> element,
which indicates that the <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> may be associated with
a <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a> which was derived from another <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a>.
An example of a &#8220;derived&#8221; <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a> is an <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> of a
<a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>.</p>
<p>A <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>, by subclassing the <a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a> mixin
class, provides the ability to generate new <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>
objects using Python expressions.  See the <a class="reference internal" href="#sqlalchemy.sql.expression._CompareMixin" title="sqlalchemy.sql.expression._CompareMixin"><tt class="xref py py-class docutils literal"><span class="pre">_CompareMixin</span></tt></a>
docstring for more details.</p>
<dl class="attribute">
<dt id="sqlalchemy.sql.expression.ColumnElement.anon_label">
<tt class="descname">anon_label</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnElement.anon_label" title="Permalink to this definition">¶</a></dt>
<dd><p>provides a constant &#8216;anonymous label&#8217; for this ColumnElement.</p>
<p>This is a label() expression which will be named at compile time.
The same label() is returned each time anon_label is called so
that expressions can reference anon_label multiple times, producing
the same label name at compile time.</p>
<p>the compiler uses this function automatically at compile time
for expressions that are known to be &#8216;unnamed&#8217; like binary
expressions and function calls.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnElement.compare">
<tt class="descname">compare</tt><big>(</big><em>other</em>, <em>use_proxies=False</em>, <em>equivalents=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnElement.compare" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare this ColumnElement to another.</p>
<p>Special arguments understood:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>use_proxies</strong> &#8211; when True, consider two columns that
share a common base column as equivalent (i.e. shares_lineage())</li>
<li><strong>equivalents</strong> &#8211; a dictionary of columns as keys mapped to sets
of columns. If the given &#8220;other&#8221; column is present in this
dictionary, if any of the columns in the correponding set() pass the
comparison test, the result is True. This is used to expand the
comparison to other columns that may be known to be equivalent to
this one via foreign key or other criterion.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnElement.shares_lineage">
<tt class="descname">shares_lineage</tt><big>(</big><em>othercolumn</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnElement.shares_lineage" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if the given <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> 
has a common ancestor to this <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression._CompareMixin">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">_CompareMixin</tt><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnOperators" title="sqlalchemy.sql.expression.ColumnOperators"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ColumnOperators</span></tt></a></p>
<p>Defines comparison and math operations for <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a>
instances.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.asc" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a ASC clause, i.e. <tt class="docutils literal"><span class="pre">&lt;columnname&gt;</span> <span class="pre">ASC</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.between" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a BETWEEN clause, i.e. <tt class="docutils literal"><span class="pre">&lt;column&gt;</span> <span class="pre">BETWEEN</span> <span class="pre">&lt;cleft&gt;</span> <span class="pre">AND</span>
<span class="pre">&lt;cright&gt;</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.collate" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a COLLATE clause, i.e. <tt class="docutils literal"><span class="pre">&lt;column&gt;</span> <span class="pre">COLLATE</span> <span class="pre">utf8_bin</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%&lt;other&gt;%'</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a DESC clause, i.e. <tt class="docutils literal"><span class="pre">&lt;columnname&gt;</span> <span class="pre">DESC</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.distinct" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a DISTINCT clause, i.e. <tt class="docutils literal"><span class="pre">DISTINCT</span> <span class="pre">&lt;columnname&gt;</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.endswith" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'%&lt;other&gt;'</span></tt></p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.in_" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare this element to the given element or collection using IN.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.label">
<tt class="descname">label</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.label" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a column label, i.e. <tt class="docutils literal"><span class="pre">&lt;columnname&gt;</span> <span class="pre">AS</span> <span class="pre">&lt;name&gt;</span></tt>.</p>
<p>This is a shortcut to the <a class="reference internal" href="#sqlalchemy.sql.expression.label" title="sqlalchemy.sql.expression.label"><tt class="xref py py-func docutils literal"><span class="pre">label()</span></tt></a> function.</p>
<p>if &#8216;name&#8217; is None, an anonymous label name will be generated.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.match">
<tt class="descname">match</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.match" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce a MATCH clause, i.e. <tt class="docutils literal"><span class="pre">MATCH</span> <span class="pre">'&lt;other&gt;'</span></tt></p>
<p>The allowed contents of <tt class="docutils literal"><span class="pre">other</span></tt> are database backend specific.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.op">
<tt class="descname">op</tt><big>(</big><em>operator</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.op" title="Permalink to this definition">¶</a></dt>
<dd><p>produce a generic operator function.</p>
<p>e.g.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">)(</span><span class="mi">5</span><span class="p">)</span></pre></div>
</div>
<p>produces:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span> <span class="o">*</span> <span class="mi">5</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>operator</strong> &#8211; a string which will be output as the infix operator
between this <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">ClauseElement</span></tt></a> and the expression passed to the
generated function.</td>
</tr>
</tbody>
</table>
<p>This function can also be used to make bitwise operators explicit. For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">somecolumn</span><span class="o">.</span><span class="n">op</span><span class="p">(</span><span class="s">&#39;&amp;&#39;</span><span class="p">)(</span><span class="mh">0xff</span><span class="p">)</span></pre></div>
</div>
<p>is a bitwise AND of the value in somecolumn.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.operate">
<tt class="descname">operate</tt><big>(</big><em>op</em>, <em>*other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.operate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.reverse_operate">
<tt class="descname">reverse_operate</tt><big>(</big><em>op</em>, <em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.reverse_operate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._CompareMixin.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._CompareMixin.startswith" title="Permalink to this definition">¶</a></dt>
<dd><p>Produce the clause <tt class="docutils literal"><span class="pre">LIKE</span> <span class="pre">'&lt;other&gt;%'</span></tt></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.ColumnOperators">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">ColumnOperators</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators" title="Permalink to this definition">¶</a></dt>
<dd><p>Defines comparison and math operations.</p>
<dl class="attribute">
<dt id="sqlalchemy.sql.expression.ColumnOperators.__init__">
<tt class="descname">__init__</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>x.__init__(...) initializes x; see help(type(x)) for signature</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.asc">
<tt class="descname">asc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.asc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.between">
<tt class="descname">between</tt><big>(</big><em>cleft</em>, <em>cright</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.between" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.collate">
<tt class="descname">collate</tt><big>(</big><em>collation</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.collate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.concat">
<tt class="descname">concat</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.concat" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.contains">
<tt class="descname">contains</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.contains" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.desc">
<tt class="descname">desc</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.desc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.distinct" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.endswith">
<tt class="descname">endswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.endswith" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.ilike">
<tt class="descname">ilike</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.ilike" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.in_">
<tt class="descname">in_</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.in_" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.like">
<tt class="descname">like</tt><big>(</big><em>other</em>, <em>escape=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.like" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.match">
<tt class="descname">match</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.match" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.op">
<tt class="descname">op</tt><big>(</big><em>opstring</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.op" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.operate">
<tt class="descname">operate</tt><big>(</big><em>op</em>, <em>*other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.operate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.reverse_operate">
<tt class="descname">reverse_operate</tt><big>(</big><em>op</em>, <em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.reverse_operate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.ColumnOperators.startswith">
<tt class="descname">startswith</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.startswith" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.ColumnOperators.timetuple">
<tt class="descname">timetuple</tt><a class="headerlink" href="#sqlalchemy.sql.expression.ColumnOperators.timetuple" title="Permalink to this definition">¶</a></dt>
<dd><p>Hack, allows datetime objects to be compared on the LHS.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.CompoundSelect">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">CompoundSelect</tt><big>(</big><em>keyword</em>, <em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.CompoundSelect" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression._SelectBaseMixin" title="sqlalchemy.sql.expression._SelectBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._SelectBaseMixin</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>Forms the basis of <tt class="docutils literal"><span class="pre">UNION</span></tt>, <tt class="docutils literal"><span class="pre">UNION</span> <span class="pre">ALL</span></tt>, and other 
SELECT-based set operations.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.CompoundSelect.__init__">
<tt class="descname">__init__</tt><big>(</big><em>keyword</em>, <em>*selects</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.CompoundSelect.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Delete">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Delete</tt><big>(</big><em>table</em>, <em>whereclause</em>, <em>bind=None</em>, <em>returning=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._UpdateBase</span></tt></p>
<p>Represent a DELETE construct.</p>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.Delete" title="sqlalchemy.sql.expression.Delete"><tt class="xref py py-class docutils literal"><span class="pre">Delete</span></tt></a> object is created using the <a class="reference internal" href="#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><tt class="xref py py-func docutils literal"><span class="pre">delete()</span></tt></a> function.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Delete.where">
<tt class="descname">where</tt><big>(</big><em>whereclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Delete.where" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the given WHERE clause to a newly returned delete construct.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Executable">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Executable</tt><a class="headerlink" href="#sqlalchemy.sql.expression.Executable" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._Generative</span></tt></p>
<p>Mark a ClauseElement as supporting execution.</p>
<p><a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a> is a superclass for all &#8220;statement&#8221; types
of objects, including <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><tt class="xref py py-func docutils literal"><span class="pre">delete()</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt></a>,
<a class="reference internal" href="#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><tt class="xref py py-func docutils literal"><span class="pre">insert()</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><tt class="xref py py-func docutils literal"><span class="pre">text()</span></tt></a>.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Executable.execute">
<tt class="descname">execute</tt><big>(</big><em>*multiparams</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Executable.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>Compile and execute this <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Executable.execution_options">
<tt class="descname">execution_options</tt><big>(</big><em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Executable.execution_options" title="Permalink to this definition">¶</a></dt>
<dd><p>Set non-SQL options for the statement which take effect during
execution.</p>
<p>Current options include:</p>
<ul>
<li><p class="first">autocommit - when True, a COMMIT will be invoked after execution 
when executed in &#8216;autocommit&#8217; mode, i.e. when an explicit
transaction is not begun on the connection. Note that DBAPI
connections by default are always in a transaction - SQLAlchemy uses
rules applied to different kinds of statements to determine if
COMMIT will be invoked in order to provide its &#8220;autocommit&#8221; feature.
Typically, all INSERT/UPDATE/DELETE statements as well as
CREATE/DROP statements have autocommit behavior enabled; SELECT
constructs do not. Use this option when invoking a SELECT or other
specific SQL construct where COMMIT is desired (typically when
calling stored procedures and such).</p>
</li>
<li><p class="first">stream_results - indicate to the dialect that results should be 
&#8220;streamed&#8221; and not pre-buffered, if possible.  This is a limitation
of many DBAPIs.  The flag is currently understood only by the
psycopg2 dialect.</p>
</li>
<li><p class="first">compiled_cache - a dictionary where <tt class="xref py py-class docutils literal"><span class="pre">Compiled</span></tt> objects
will be cached when the <tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt> compiles a clause 
expression into a dialect- and parameter-specific 
<tt class="xref py py-class docutils literal"><span class="pre">Compiled</span></tt> object.   It is the user&#8217;s responsibility to
manage the size of this dictionary, which will have keys
corresponding to the dialect, clause element, the column
names within the VALUES or SET clause of an INSERT or UPDATE, 
as well as the &#8220;batch&#8221; mode for an INSERT or UPDATE statement.
The format of this dictionary is not guaranteed to stay the
same in future releases.</p>
<p>This option is usually more appropriate
to use via the 
<a class="reference internal" href="connections.html#sqlalchemy.engine.base.Connection.execution_options" title="sqlalchemy.engine.base.Connection.execution_options"><tt class="xref py py-meth docutils literal"><span class="pre">sqlalchemy.engine.base.Connection.execution_options()</span></tt></a>
method of <tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt>, rather than upon individual 
statement objects, though the effect is the same.</p>
</li>
</ul>
<p>See also:</p>
<blockquote>
<div><p><a class="reference internal" href="connections.html#sqlalchemy.engine.base.Connection.execution_options" title="sqlalchemy.engine.base.Connection.execution_options"><tt class="xref py py-meth docutils literal"><span class="pre">sqlalchemy.engine.base.Connection.execution_options()</span></tt></a></p>
<p><a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.execution_options" title="sqlalchemy.orm.query.Query.execution_options"><tt class="xref py py-meth docutils literal"><span class="pre">sqlalchemy.orm.query.Query.execution_options()</span></tt></a></p>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Executable.scalar">
<tt class="descname">scalar</tt><big>(</big><em>*multiparams</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Executable.scalar" title="Permalink to this definition">¶</a></dt>
<dd><p>Compile and execute this <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">Executable</span></tt></a>, returning the
result&#8217;s scalar representation.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.FunctionElement">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">FunctionElement</tt><big>(</big><em>*clauses</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FunctionElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.Executable</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ColumnElement</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>Base for SQL function-oriented constructs.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.FunctionElement.__init__">
<tt class="descname">__init__</tt><big>(</big><em>*clauses</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FunctionElement.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Function">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Function</tt><big>(</big><em>name</em>, <em>*clauses</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Function" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.FunctionElement" title="sqlalchemy.sql.expression.FunctionElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FunctionElement</span></tt></a></p>
<p>Describe a named SQL function.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Function.__init__">
<tt class="descname">__init__</tt><big>(</big><em>name</em>, <em>*clauses</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Function.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.FromClause">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">FromClause</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.Selectable</span></tt></a></p>
<p>Represent an element that can be used within the <tt class="docutils literal"><span class="pre">FROM</span></tt> 
clause of a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.alias">
<tt class="descname">alias</tt><big>(</big><em>name=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.alias" title="Permalink to this definition">¶</a></dt>
<dd><p>return an alias of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
<p>This is shorthand for calling:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">alias</span>
<span class="n">a</span> <span class="o">=</span> <span class="n">alias</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span></pre></div>
</div>
<p>See <a class="reference internal" href="#sqlalchemy.sql.expression.alias" title="sqlalchemy.sql.expression.alias"><tt class="xref py py-func docutils literal"><span class="pre">alias()</span></tt></a> for details.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.FromClause.c">
<tt class="descname">c</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.c" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the collection of Column objects contained by this
FromClause.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.FromClause.columns">
<tt class="descname">columns</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.columns" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the collection of Column objects contained by this
FromClause.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.correspond_on_equivalents">
<tt class="descname">correspond_on_equivalents</tt><big>(</big><em>column</em>, <em>equivalents</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.correspond_on_equivalents" title="Permalink to this definition">¶</a></dt>
<dd><p>Return corresponding_column for the given column, or if None
search for a match in the given dictionary.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.corresponding_column">
<tt class="descname">corresponding_column</tt><big>(</big><em>column</em>, <em>require_embedded=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.corresponding_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>, return the exported
<a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> object from this <a class="reference internal" href="#sqlalchemy.sql.expression.Selectable" title="sqlalchemy.sql.expression.Selectable"><tt class="xref py py-class docutils literal"><span class="pre">Selectable</span></tt></a>
which corresponds to that original
<a class="reference internal" href="schema.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt></a> via a common anscestor
column.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>column</strong> &#8211; the target <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> to be matched</li>
<li><strong>require_embedded</strong> &#8211; only return corresponding columns for</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>the given <a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a>, if the given
<a class="reference internal" href="#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><tt class="xref py py-class docutils literal"><span class="pre">ColumnElement</span></tt></a> is actually present within a sub-element
of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.  Normally the column will match if
it merely shares a common anscestor with one of the exported
columns of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.count">
<tt class="descname">count</tt><big>(</big><em>whereclause=None</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.count" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SELECT COUNT generated against this
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.FromClause.description">
<tt class="descname">description</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.description" title="Permalink to this definition">¶</a></dt>
<dd><p>a brief description of this FromClause.</p>
<p>Used primarily for error message formatting.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.FromClause.foreign_keys">
<tt class="descname">foreign_keys</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.foreign_keys" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the collection of ForeignKey objects which this
FromClause references.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.is_derived_from">
<tt class="descname">is_derived_from</tt><big>(</big><em>fromclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.is_derived_from" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if this FromClause is &#8216;derived&#8217; from the given
FromClause.</p>
<p>An example would be an Alias of a Table is derived from that Table.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.join">
<tt class="descname">join</tt><big>(</big><em>right</em>, <em>onclause=None</em>, <em>isouter=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.join" title="Permalink to this definition">¶</a></dt>
<dd><p>return a join of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> against another
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.outerjoin">
<tt class="descname">outerjoin</tt><big>(</big><em>right</em>, <em>onclause=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.outerjoin" title="Permalink to this definition">¶</a></dt>
<dd><p>return an outer join of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> against another
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.FromClause.primary_key">
<tt class="descname">primary_key</tt><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.primary_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the collection of Column objects which comprise the
primary key of this FromClause.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.replace_selectable">
<tt class="descname">replace_selectable</tt><big>(</big><em>old</em>, <em>alias</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.replace_selectable" title="Permalink to this definition">¶</a></dt>
<dd><p>replace all occurrences of FromClause &#8216;old&#8217; with the given Alias 
object, returning a copy of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.FromClause.select">
<tt class="descname">select</tt><big>(</big><em>whereclause=None</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.FromClause.select" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SELECT of this <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Insert">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Insert</tt><big>(</big><em>table</em>, <em>values=None</em>, <em>inline=False</em>, <em>bind=None</em>, <em>prefixes=None</em>, <em>returning=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._ValuesBase</span></tt></p>
<p>Represent an INSERT construct.</p>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><tt class="xref py py-class docutils literal"><span class="pre">Insert</span></tt></a> object is created using the <a class="reference internal" href="#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><tt class="xref py py-func docutils literal"><span class="pre">insert()</span></tt></a> function.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Insert.prefix_with">
<tt class="descname">prefix_with</tt><big>(</big><em>clause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Insert.prefix_with" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a word or expression between INSERT and INTO. Generative.</p>
<p>If multiple prefixes are supplied, they will be separated with
spaces.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Insert.values">
<tt class="descname">values</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Insert.values" title="Permalink to this definition">¶</a></dt>
<dd><p>specify the VALUES clause for an INSERT statement, or the SET
clause for an UPDATE.</p>
<blockquote>
<div><dl class="docutils">
<dt>**kwargs</dt>
<dd>key=&lt;somevalue&gt; arguments</dd>
<dt>*args</dt>
<dd>A single dictionary can be sent as the first positional
argument. This allows non-string based keys, such as Column
objects, to be used.</dd>
</dl>
</div></blockquote>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Join">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Join</tt><big>(</big><em>left</em>, <em>right</em>, <em>onclause=None</em>, <em>isouter=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Join" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>represent a <tt class="docutils literal"><span class="pre">JOIN</span></tt> construct between two <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a>
elements.</p>
<p>The public constructor function for <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> is the module-level
<a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a> function, as well as the <a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a> method available
off all <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> subclasses.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Join.__init__">
<tt class="descname">__init__</tt><big>(</big><em>left</em>, <em>right</em>, <em>onclause=None</em>, <em>isouter=False</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Join.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>.</p>
<p>The usual entrypoint here is the <a class="reference internal" href="#sqlalchemy.sql.expression.join" title="sqlalchemy.sql.expression.join"><tt class="xref py py-func docutils literal"><span class="pre">join()</span></tt></a>
function or the <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause.join" title="sqlalchemy.sql.expression.FromClause.join"><tt class="xref py py-meth docutils literal"><span class="pre">FromClause.join()</span></tt></a> method of any
<a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> object.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Join.alias">
<tt class="descname">alias</tt><big>(</big><em>name=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Join.alias" title="Permalink to this definition">¶</a></dt>
<dd><p>return an alias of this <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>.</p>
<p>Used against a <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> object,
<a class="reference internal" href="#sqlalchemy.sql.expression.Join.alias" title="sqlalchemy.sql.expression.Join.alias"><tt class="xref py py-meth docutils literal"><span class="pre">alias()</span></tt></a> calls the <a class="reference internal" href="#sqlalchemy.sql.expression.Join.select" title="sqlalchemy.sql.expression.Join.select"><tt class="xref py py-meth docutils literal"><span class="pre">select()</span></tt></a>
method first so that a subquery against a 
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> construct is generated.
the <tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt> construct also has the 
<tt class="docutils literal"><span class="pre">correlate</span></tt> flag set to <tt class="xref docutils literal"><span class="pre">False</span></tt> and will not
auto-correlate inside an enclosing <tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt>
construct.</p>
<p>The equivalent long-hand form, given a <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> object
<tt class="docutils literal"><span class="pre">j</span></tt>, is:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">select</span><span class="p">,</span> <span class="n">alias</span>
<span class="n">j</span> <span class="o">=</span> <span class="n">alias</span><span class="p">(</span>
    <span class="n">select</span><span class="p">([</span><span class="n">j</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">j</span><span class="o">.</span><span class="n">right</span><span class="p">])</span><span class="o">.</span>\
        <span class="n">select_from</span><span class="p">(</span><span class="n">j</span><span class="p">)</span><span class="o">.</span>\
        <span class="n">with_labels</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span><span class="o">.</span>\
        <span class="n">correlate</span><span class="p">(</span><span class="bp">False</span><span class="p">),</span>
    <span class="n">name</span>
<span class="p">)</span></pre></div>
</div>
<p>See <a class="reference internal" href="#sqlalchemy.sql.expression.alias" title="sqlalchemy.sql.expression.alias"><tt class="xref py py-func docutils literal"><span class="pre">alias()</span></tt></a> for further details on 
aliases.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Join.select">
<tt class="descname">select</tt><big>(</big><em>whereclause=None</em>, <em>fold_equivalents=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Join.select" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> from this <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>.</p>
<p>The equivalent long-hand form, given a <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a> object
<tt class="docutils literal"><span class="pre">j</span></tt>, is:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">select</span>
<span class="n">j</span> <span class="o">=</span> <span class="n">select</span><span class="p">([</span><span class="n">j</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">j</span><span class="o">.</span><span class="n">right</span><span class="p">],</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span><span class="o">.</span>\
            <span class="n">where</span><span class="p">(</span><span class="n">whereclause</span><span class="p">)</span><span class="o">.</span>\
            <span class="n">select_from</span><span class="p">(</span><span class="n">j</span><span class="p">)</span></pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>whereclause</strong> &#8211; the WHERE criterion that will be sent to 
the <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> function</li>
<li><strong>fold_equivalents</strong> &#8211; based on the join criterion of this 
<a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>, do not include
repeat column names in the column list of the resulting
select, for columns that are calculated to be &#8220;equivalent&#8221;
based on the join criterion of this <a class="reference internal" href="#sqlalchemy.sql.expression.Join" title="sqlalchemy.sql.expression.Join"><tt class="xref py py-class docutils literal"><span class="pre">Join</span></tt></a>. This will
recursively apply to any joins directly nested by this one
as well.</li>
<li><strong>**kwargs</strong> &#8211; all other kwargs are sent to the 
underlying <a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> function.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Select">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Select</tt><big>(</big><em>columns</em>, <em>whereclause=None</em>, <em>from_obj=None</em>, <em>distinct=False</em>, <em>having=None</em>, <em>correlate=True</em>, <em>prefixes=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression._SelectBaseMixin" title="sqlalchemy.sql.expression._SelectBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._SelectBaseMixin</span></tt></a>, <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>Represents a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement.</p>
<p>Select statements support appendable clauses, as well as the
ability to execute themselves and return a result set.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.__init__">
<tt class="descname">__init__</tt><big>(</big><em>columns</em>, <em>whereclause=None</em>, <em>from_obj=None</em>, <em>distinct=False</em>, <em>having=None</em>, <em>correlate=True</em>, <em>prefixes=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a Select object.</p>
<p>The public constructor for Select is the
<a class="reference internal" href="#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><tt class="xref py py-func docutils literal"><span class="pre">select()</span></tt></a> function; see that function for
argument descriptions.</p>
<p>Additional generative and mutator methods are available on the
<a class="reference internal" href="#sqlalchemy.sql.expression._SelectBaseMixin" title="sqlalchemy.sql.expression._SelectBaseMixin"><tt class="xref py py-class docutils literal"><span class="pre">_SelectBaseMixin</span></tt></a> superclass.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_column">
<tt class="descname">append_column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_column" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given column expression to the columns clause of this
select() construct.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_correlation">
<tt class="descname">append_correlation</tt><big>(</big><em>fromclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_correlation" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given correlation expression to this select()
construct.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_from">
<tt class="descname">append_from</tt><big>(</big><em>fromclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_from" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given FromClause expression to this select() construct&#8217;s
FROM clause.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_having">
<tt class="descname">append_having</tt><big>(</big><em>having</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_having" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given expression to this select() construct&#8217;s HAVING
criterion.</p>
<p>The expression will be joined to existing HAVING criterion via AND.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_prefix">
<tt class="descname">append_prefix</tt><big>(</big><em>clause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_prefix" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given columns clause prefix expression to this select()
construct.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.append_whereclause">
<tt class="descname">append_whereclause</tt><big>(</big><em>whereclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.append_whereclause" title="Permalink to this definition">¶</a></dt>
<dd><p>append the given expression to this select() construct&#8217;s WHERE
criterion.</p>
<p>The expression will be joined to existing WHERE criterion via AND.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.column">
<tt class="descname">column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.column" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct with the given column expression 
added to its columns clause.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.correlate">
<tt class="descname">correlate</tt><big>(</big><em>*fromclauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.correlate" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct which will correlate the given FROM
clauses to that of an enclosing select(), if a match is found.</p>
<p>By &#8220;match&#8221;, the given fromclause must be present in this select&#8217;s
list of FROM objects and also present in an enclosing select&#8217;s list of
FROM objects.</p>
<p>Calling this method turns off the select&#8217;s default behavior of
&#8220;auto-correlation&#8221;. Normally, select() auto-correlates all of its FROM
clauses to those of an embedded select when compiled.</p>
<p>If the fromclause is None, correlation is disabled for the returned
select().</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.distinct">
<tt class="descname">distinct</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.distinct" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct which will apply DISTINCT to its
columns clause.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.except_">
<tt class="descname">except_</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.except_" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL EXCEPT of this select() construct against the given
selectable.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.except_all">
<tt class="descname">except_all</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.except_all" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL EXCEPT ALL of this select() construct against the
given selectable.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.Select.froms">
<tt class="descname">froms</tt><a class="headerlink" href="#sqlalchemy.sql.expression.Select.froms" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the displayed list of FromClause elements.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.get_children">
<tt class="descname">get_children</tt><big>(</big><em>column_collections=True</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>return child elements as per the ClauseElement specification.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.having">
<tt class="descname">having</tt><big>(</big><em>having</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.having" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct with the given expression added to
its HAVING clause, joined to the existing clause via AND, if any.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.Select.inner_columns">
<tt class="descname">inner_columns</tt><a class="headerlink" href="#sqlalchemy.sql.expression.Select.inner_columns" title="Permalink to this definition">¶</a></dt>
<dd><p>an iterator of all ColumnElement expressions which would
be rendered into the columns clause of the resulting SELECT statement.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.intersect">
<tt class="descname">intersect</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.intersect" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL INTERSECT of this select() construct against the given
selectable.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.intersect_all">
<tt class="descname">intersect_all</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.intersect_all" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL INTERSECT ALL of this select() construct against the
given selectable.</p>
</dd></dl>

<dl class="attribute">
<dt id="sqlalchemy.sql.expression.Select.locate_all_froms">
<tt class="descname">locate_all_froms</tt><a class="headerlink" href="#sqlalchemy.sql.expression.Select.locate_all_froms" title="Permalink to this definition">¶</a></dt>
<dd><p>return a Set of all FromClause elements referenced by this Select.</p>
<blockquote>
<div>This set is a superset of that returned by the <tt class="docutils literal"><span class="pre">froms</span></tt> property,</div></blockquote>
<p>which is specifically for those FromClause elements that would
actually be rendered.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.prefix_with">
<tt class="descname">prefix_with</tt><big>(</big><em>clause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.prefix_with" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct which will apply the given
expression to the start of its columns clause, not using any commas.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.select_from">
<tt class="descname">select_from</tt><big>(</big><em>fromclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.select_from" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct with the given FROM expression
applied to its list of FROM objects.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.self_group">
<tt class="descname">self_group</tt><big>(</big><em>against=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.self_group" title="Permalink to this definition">¶</a></dt>
<dd><p>return a &#8216;grouping&#8217; construct as per the ClauseElement
specification.</p>
<blockquote>
<div>This produces an element that can be embedded in an expression. Note</div></blockquote>
<p>that this method is called automatically as needed when constructing
expressions.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.union">
<tt class="descname">union</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.union" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL UNION of this select() construct against the given
selectable.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.union_all">
<tt class="descname">union_all</tt><big>(</big><em>other</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.union_all" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SQL UNION ALL of this select() construct against the given
selectable.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.where">
<tt class="descname">where</tt><big>(</big><em>whereclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.where" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct with the given expression added to
its WHERE clause, joined to the existing clause via AND, if any.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.with_hint">
<tt class="descname">with_hint</tt><big>(</big><em>selectable</em>, <em>text</em>, <em>dialect_name='*'</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.with_hint" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an indexing hint for the given selectable to this
<a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a>.</p>
<p>The text of the hint is rendered in the appropriate
location for the database backend in use, relative
to the given <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> or <a class="reference internal" href="#sqlalchemy.sql.expression.Alias" title="sqlalchemy.sql.expression.Alias"><tt class="xref py py-class docutils literal"><span class="pre">Alias</span></tt></a> passed as the
<em>selectable</em> argument. The dialect implementation
typically uses Python string substitution syntax
with the token <tt class="docutils literal"><span class="pre">%(name)s</span></tt> to render the name of
the table or alias. E.g. when using Oracle, the
following:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">mytable</span><span class="p">])</span><span class="o">.</span>\
    <span class="n">with_hint</span><span class="p">(</span><span class="n">mytable</span><span class="p">,</span> <span class="s">&quot;+ index(</span><span class="si">%(name)s</span><span class="s"> ix_mytable)&quot;</span><span class="p">)</span></pre></div>
</div>
<p>Would render SQL as:</p>
<div class="highlight-python"><pre>select /*+ index(mytable ix_mytable) */ ... from mytable</pre>
</div>
<p>The <tt class="docutils literal"><span class="pre">dialect_name</span></tt> option will limit the rendering of a particular
hint to a particular backend. Such as, to add hints for both Oracle
and Sybase simultaneously:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">mytable</span><span class="p">])</span><span class="o">.</span>\
    <span class="n">with_hint</span><span class="p">(</span><span class="n">mytable</span><span class="p">,</span> <span class="s">&quot;+ index(</span><span class="si">%(name)s</span><span class="s"> ix_mytable)&quot;</span><span class="p">,</span> <span class="s">&#39;oracle&#39;</span><span class="p">)</span><span class="o">.</span>\
    <span class="n">with_hint</span><span class="p">(</span><span class="n">mytable</span><span class="p">,</span> <span class="s">&quot;WITH INDEX ix_mytable&quot;</span><span class="p">,</span> <span class="s">&#39;sybase&#39;</span><span class="p">)</span></pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Select.with_only_columns">
<tt class="descname">with_only_columns</tt><big>(</big><em>columns</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Select.with_only_columns" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new select() construct with its columns clause replaced 
with the given columns.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Selectable">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Selectable</tt><a class="headerlink" href="#sqlalchemy.sql.expression.Selectable" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.ClauseElement" title="sqlalchemy.sql.expression.ClauseElement"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.ClauseElement</span></tt></a></p>
<p>mark a class as being selectable</p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">_SelectBaseMixin</tt><big>(</big><em>use_labels=False</em>, <em>for_update=False</em>, <em>limit=None</em>, <em>offset=None</em>, <em>order_by=None</em>, <em>group_by=None</em>, <em>bind=None</em>, <em>autocommit=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.Executable" title="sqlalchemy.sql.expression.Executable"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.Executable</span></tt></a></p>
<p>Base class for <a class="reference internal" href="#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><tt class="xref py py-class docutils literal"><span class="pre">Select</span></tt></a> and <tt class="docutils literal"><span class="pre">CompoundSelects</span></tt>.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.__init__">
<tt class="descname">__init__</tt><big>(</big><em>use_labels=False</em>, <em>for_update=False</em>, <em>limit=None</em>, <em>offset=None</em>, <em>order_by=None</em>, <em>group_by=None</em>, <em>bind=None</em>, <em>autocommit=None</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.append_group_by">
<tt class="descname">append_group_by</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.append_group_by" title="Permalink to this definition">¶</a></dt>
<dd><p>Append the given GROUP BY criterion applied to this selectable.</p>
<p>The criterion will be appended to any pre-existing GROUP BY criterion.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.append_order_by">
<tt class="descname">append_order_by</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.append_order_by" title="Permalink to this definition">¶</a></dt>
<dd><p>Append the given ORDER BY criterion applied to this selectable.</p>
<p>The criterion will be appended to any pre-existing ORDER BY criterion.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.apply_labels">
<tt class="descname">apply_labels</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.apply_labels" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the &#8216;use_labels&#8217; flag set to True.</p>
<p>This will result in column expressions being generated using labels
against their table name, such as &#8220;SELECT somecolumn AS
tablename_somecolumn&#8221;. This allows selectables which contain multiple
FROM clauses to produce a unique set of column names regardless of
name conflicts among the individual FROM clauses.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.as_scalar">
<tt class="descname">as_scalar</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.as_scalar" title="Permalink to this definition">¶</a></dt>
<dd><p>return a &#8216;scalar&#8217; representation of this selectable, which can be
used as a column expression.</p>
<p>Typically, a select statement which has only one column in its columns
clause is eligible to be used as a scalar expression.</p>
<p>The returned object is an instance of 
<tt class="xref py py-class docutils literal"><span class="pre">_ScalarSelect</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.autocommit">
<tt class="descname">autocommit</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.autocommit" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the &#8216;autocommit&#8217; flag set to</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 0.6: </span><tt class="xref py py-func docutils literal"><span class="pre">autocommit()</span></tt> is deprecated. Use <tt class="xref py py-func docutils literal"><span class="pre">Executable.execution_options()</span></tt> with the &#8216;autocommit&#8217; flag.</p>
<p>True.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.group_by">
<tt class="descname">group_by</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.group_by" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the given list of GROUP BY
criterion applied.</p>
<p>The criterion will be appended to any pre-existing GROUP BY
criterion.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.label">
<tt class="descname">label</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.label" title="Permalink to this definition">¶</a></dt>
<dd><p>return a &#8216;scalar&#8217; representation of this selectable, embedded as a
subquery with a label.</p>
<p>See also <tt class="docutils literal"><span class="pre">as_scalar()</span></tt>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.limit">
<tt class="descname">limit</tt><big>(</big><em>limit</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.limit" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the given LIMIT criterion
applied.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.offset">
<tt class="descname">offset</tt><big>(</big><em>offset</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.offset" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the given OFFSET criterion
applied.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression._SelectBaseMixin.order_by">
<tt class="descname">order_by</tt><big>(</big><em>*clauses</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression._SelectBaseMixin.order_by" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new selectable with the given list of ORDER BY
criterion applied.</p>
<p>The criterion will be appended to any pre-existing ORDER BY
criterion.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.TableClause">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">TableClause</tt><big>(</big><em>name</em>, <em>*columns</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._Immutable</span></tt>, <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.FromClause</span></tt></a></p>
<p>Represents a minimal &#8220;table&#8221; construct.</p>
<p>The constructor for <a class="reference internal" href="#sqlalchemy.sql.expression.TableClause" title="sqlalchemy.sql.expression.TableClause"><tt class="xref py py-class docutils literal"><span class="pre">TableClause</span></tt></a> is the
<a class="reference internal" href="#sqlalchemy.sql.expression.table" title="sqlalchemy.sql.expression.table"><tt class="xref py py-func docutils literal"><span class="pre">table()</span></tt></a> function.   This produces 
a lightweight table object that has only a name and a 
collection of columns, which are typically produced
by the <a class="reference internal" href="#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><tt class="xref py py-func docutils literal"><span class="pre">column()</span></tt></a> function:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlalchemy.sql</span> <span class="kn">import</span> <span class="n">table</span><span class="p">,</span> <span class="n">column</span>

<span class="n">user</span> <span class="o">=</span> <span class="n">table</span><span class="p">(</span><span class="s">&quot;user&quot;</span><span class="p">,</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">),</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;name&quot;</span><span class="p">),</span>
        <span class="n">column</span><span class="p">(</span><span class="s">&quot;description&quot;</span><span class="p">),</span>
<span class="p">)</span></pre></div>
</div>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.TableClause" title="sqlalchemy.sql.expression.TableClause"><tt class="xref py py-class docutils literal"><span class="pre">TableClause</span></tt></a> construct serves as the base for
the more commonly used <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> object, providing
the usual set of <a class="reference internal" href="#sqlalchemy.sql.expression.FromClause" title="sqlalchemy.sql.expression.FromClause"><tt class="xref py py-class docutils literal"><span class="pre">FromClause</span></tt></a> services including
the <tt class="docutils literal"><span class="pre">.c.</span></tt> collection and statement generation methods.</p>
<p>It does <strong>not</strong> provide all the additional schema-level services
of <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a>, including constraints, references to other 
tables, or support for <a class="reference internal" href="schema.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt></a>-level services.  It&#8217;s useful
on its own as an ad-hoc construct used to generate quick SQL
statements when a more fully fledged <a class="reference internal" href="schema.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt></a> is not on hand.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.TableClause.__init__">
<tt class="descname">__init__</tt><big>(</big><em>name</em>, <em>*columns</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.TableClause.count">
<tt class="descname">count</tt><big>(</big><em>whereclause=None</em>, <em>**params</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause.count" title="Permalink to this definition">¶</a></dt>
<dd><p>return a SELECT COUNT generated against this
<a class="reference internal" href="#sqlalchemy.sql.expression.TableClause" title="sqlalchemy.sql.expression.TableClause"><tt class="xref py py-class docutils literal"><span class="pre">TableClause</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.TableClause.delete">
<tt class="descname">delete</tt><big>(</big><em>whereclause=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a <a class="reference internal" href="#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><tt class="xref py py-func docutils literal"><span class="pre">delete()</span></tt></a> construct.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.TableClause.insert">
<tt class="descname">insert</tt><big>(</big><em>values=None</em>, <em>inline=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate an <a class="reference internal" href="#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><tt class="xref py py-func docutils literal"><span class="pre">insert()</span></tt></a> construct.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.TableClause.update">
<tt class="descname">update</tt><big>(</big><em>whereclause=None</em>, <em>values=None</em>, <em>inline=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.TableClause.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate an <a class="reference internal" href="#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt></a> construct.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.expression.Update">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.expression.</tt><tt class="descname">Update</tt><big>(</big><em>table</em>, <em>whereclause</em>, <em>values=None</em>, <em>inline=False</em>, <em>bind=None</em>, <em>returning=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Update" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression._ValuesBase</span></tt></p>
<p>Represent an Update construct.</p>
<p>The <a class="reference internal" href="#sqlalchemy.sql.expression.Update" title="sqlalchemy.sql.expression.Update"><tt class="xref py py-class docutils literal"><span class="pre">Update</span></tt></a> object is created using the <a class="reference internal" href="#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt></a> function.</p>
<dl class="method">
<dt id="sqlalchemy.sql.expression.Update.where">
<tt class="descname">where</tt><big>(</big><em>whereclause</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Update.where" title="Permalink to this definition">¶</a></dt>
<dd><p>return a new update() construct with the given expression added to
its WHERE clause, joined to the existing clause via AND, if any.</p>
</dd></dl>

<dl class="method">
<dt id="sqlalchemy.sql.expression.Update.values">
<tt class="descname">values</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.expression.Update.values" title="Permalink to this definition">¶</a></dt>
<dd><p>specify the VALUES clause for an INSERT statement, or the SET
clause for an UPDATE.</p>
<blockquote>
<div><dl class="docutils">
<dt>**kwargs</dt>
<dd>key=&lt;somevalue&gt; arguments</dd>
<dt>*args</dt>
<dd>A single dictionary can be sent as the first positional
argument. This allows non-string based keys, such as Column
objects, to be used.</dd>
</dl>
</div></blockquote>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="generic-functions">
<span id="id1"></span><h2>Generic Functions<a class="headerlink" href="#generic-functions" title="Permalink to this headline">¶</a></h2>
<p>SQL functions which are known to SQLAlchemy with regards to database-specific
rendering, return types and argument behavior. Generic functions are invoked
like all SQL functions, using the <a class="reference internal" href="#sqlalchemy.sql.expression.func" title="sqlalchemy.sql.expression.func"><tt class="xref py py-attr docutils literal"><span class="pre">func</span></tt></a> attribute:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">select</span><span class="p">([</span><span class="n">func</span><span class="o">.</span><span class="n">count</span><span class="p">()])</span><span class="o">.</span><span class="n">select_from</span><span class="p">(</span><span class="n">sometable</span><span class="p">)</span></pre></div>
</div>
<p>Note that any name not known to <a class="reference internal" href="#sqlalchemy.sql.expression.func" title="sqlalchemy.sql.expression.func"><tt class="xref py py-attr docutils literal"><span class="pre">func</span></tt></a> generates the function name as is
- there is no restriction on what SQL functions can be called, known or
unknown to SQLAlchemy, built-in or user defined. The section here only
describes those functions where SQLAlchemy already knows what argument and
return types are in use.</p>
<span class="target" id="module-sqlalchemy.sql.functions"></span><dl class="class">
<dt id="sqlalchemy.sql.functions.AnsiFunction">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">AnsiFunction</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.AnsiFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.AnsiFunction.__init__">
<tt class="descname">__init__</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.AnsiFunction.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.GenericFunction">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">GenericFunction</tt><big>(</big><em>type_=None</em>, <em>args=()</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.GenericFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.expression.Function" title="sqlalchemy.sql.expression.Function"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.expression.Function</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.GenericFunction.__init__">
<tt class="descname">__init__</tt><big>(</big><em>type_=None</em>, <em>args=()</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.GenericFunction.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.ReturnTypeFromArgs">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">ReturnTypeFromArgs</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<p>Define a function whose return type is the same as its arguments.</p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.ReturnTypeFromArgs.__init__">
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.char_length">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">char_length</tt><big>(</big><em>arg</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.char_length" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.char_length.__init__">
<tt class="descname">__init__</tt><big>(</big><em>arg</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.char_length.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.coalesce">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">coalesce</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.coalesce" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs" title="sqlalchemy.sql.functions.ReturnTypeFromArgs"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.ReturnTypeFromArgs</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.concat">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">concat</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.concat" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.concat.__init__">
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.concat.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.count">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">count</tt><big>(</big><em>expression=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.count" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<p>The ANSI COUNT aggregate function.  With no arguments, emits COUNT *.</p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.count.__init__">
<tt class="descname">__init__</tt><big>(</big><em>expression=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.count.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.current_date">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">current_date</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.current_date" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.current_time">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">current_time</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.current_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.current_timestamp">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">current_timestamp</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.current_timestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.current_user">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">current_user</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.current_user" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.localtime">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">localtime</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.localtime" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.localtimestamp">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">localtimestamp</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.localtimestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.max">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">max</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.max" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs" title="sqlalchemy.sql.functions.ReturnTypeFromArgs"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.ReturnTypeFromArgs</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.min">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">min</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.min" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs" title="sqlalchemy.sql.functions.ReturnTypeFromArgs"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.ReturnTypeFromArgs</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.now">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">now</tt><big>(</big><em>type_=None</em>, <em>args=()</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.now" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.random">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">random</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.random" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.GenericFunction" title="sqlalchemy.sql.functions.GenericFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.GenericFunction</span></tt></a></p>
<dl class="method">
<dt id="sqlalchemy.sql.functions.random.__init__">
<tt class="descname">__init__</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.random.__init__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.session_user">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">session_user</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.session_user" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.sum">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">sum</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.ReturnTypeFromArgs" title="sqlalchemy.sql.functions.ReturnTypeFromArgs"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.ReturnTypeFromArgs</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.sysdate">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">sysdate</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.sysdate" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="sqlalchemy.sql.functions.user">
<em class="property">class </em><tt class="descclassname">sqlalchemy.sql.functions.</tt><tt class="descname">user</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#sqlalchemy.sql.functions.user" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sqlalchemy.sql.functions.AnsiFunction" title="sqlalchemy.sql.functions.AnsiFunction"><tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.sql.functions.AnsiFunction</span></tt></a></p>
</dd></dl>

</div>
</div>

    </div>
</div>


    <div class="bottomnav">
            Previous:
            <a href="tutorial.html" title="previous chapter">SQL Expression Language Tutorial</a>
            Next:
            <a href="engines.html" title="next chapter">Engine Configuration</a>
        <div class="doc_copyright">
            &copy; <a href="../copyright.html">Copyright</a> 2007-2011, the SQLAlchemy authors and contributors.
            Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
        </div>
    </div>




    </body>
</html>