Sophie

Sophie

distrib > Fedora > 20 > i386 > by-pkgid > 05d9cf179789e23021b5913b4cd77ca6 > files > 614

python3-sqlalchemy-0.8.7-1.fc20.i686.rpm

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

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        
        <title>
            
    
                Overview
             &mdash;
    SQLAlchemy 0.8 Documentation

        </title>

        
            <!-- begin iterate through SQLA + sphinx environment css_files -->
                <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
                <link rel="stylesheet" href="_static/docs.css" type="text/css" />
                <link rel="stylesheet" href="_static/changelog.css" type="text/css" />
                <link rel="stylesheet" href="_static/sphinx_paramlinks.css" type="text/css" />
            <!-- end iterate through SQLA + sphinx environment css_files -->
        

        

    

    <!-- begin layout.mako headers -->

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
          URL_ROOT:    './',
          VERSION:     '0.8.7',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>

    <!-- begin iterate through sphinx environment script_files -->
        <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>
    <!-- end iterate through sphinx environment script_files -->

    <script type="text/javascript" src="_static/detectmobile.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.8 Documentation" href="index.html" />
        <link rel="next" title="SQLAlchemy ORM" href="orm/index.html" />
        <link rel="prev" title="Table of Contents" href="contents.html" />
    <!-- end layout.mako headers -->


    </head>
    <body>
        












<div id="docs-container">





<div id="docs-top-navigation-container" class="body-background">
<div id="docs-header">
    <div id="docs-version-header">
        Release: <span class="version-num">0.8.7</span> | Release Date: July 22, 2014
    </div>

    <h1>SQLAlchemy 0.8 Documentation</h1>

</div>
</div>

<div id="docs-body-container">

    <div id="fixed-sidebar" class="withsidebar">


        <div id="docs-sidebar-popout">
            <h3><a href="index.html">SQLAlchemy 0.8 Documentation</a></h3>

            <p id="sidebar-paginate">
                    <a href="index.html" title="SQLAlchemy 0.8 Documentation">Up</a> |

                    <a href="contents.html" title="Table of Contents">Prev</a> |
                    <a href="orm/index.html" title="SQLAlchemy ORM">Next</a>
            </p>

            <p id="sidebar-topnav">
                <a href="index.html">Contents</a> |
                <a href="genindex.html">Index</a>
            </p>

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

        </div>

        <div id="docs-sidebar">

        <h3><a href="#">            
                Overview
            
        </a></h3>
        <ul>
<li><a class="reference internal" href="#">Overview</a><ul>
<li><a class="reference internal" href="#documentation-overview">Documentation Overview</a></li>
<li><a class="reference internal" href="#code-examples">Code Examples</a></li>
<li><a class="reference internal" href="#installation-guide">Installation Guide</a><ul>
<li><a class="reference internal" href="#supported-platforms">Supported Platforms</a></li>
<li><a class="reference internal" href="#supported-installation-methods">Supported Installation Methods</a></li>
<li><a class="reference internal" href="#install-via-easy-install-or-pip">Install via easy_install or pip</a></li>
<li><a class="reference internal" href="#installing-using-setup-py">Installing using setup.py</a></li>
<li><a class="reference internal" href="#installing-the-c-extensions">Installing the C Extensions</a></li>
<li><a class="reference internal" href="#installing-on-python-3">Installing on Python 3</a></li>
<li><a class="reference internal" href="#installing-a-database-api">Installing a Database API</a></li>
<li><a class="reference internal" href="#checking-the-installed-sqlalchemy-version">Checking the Installed SQLAlchemy Version</a></li>
</ul>
</li>
<li><a class="reference internal" href="#to-0-8-migration">0.7 to 0.8 Migration</a></li>
</ul>
</li>
</ul>




        </div>

    </div>

    

    <div id="docs-body" class="withsidebar" >
        
<div class="section" id="overview">
<span id="overview-toplevel"></span><span id="id1"></span><h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h1>
<p>The SQLAlchemy SQL Toolkit and Object Relational Mapper
is a comprehensive set of tools for working with
databases and Python. It has several distinct areas of
functionality which can be used individually or combined
together. Its major components are illustrated in below,
with component dependencies organized into layers:</p>
<img alt="_images/sqla_arch_small.png" src="_images/sqla_arch_small.png" />
<p>Above, the two most significant front-facing portions of
SQLAlchemy are the <strong>Object Relational Mapper</strong> and the
<strong>SQL Expression Language</strong>. SQL Expressions can be used
independently of the ORM. When using the ORM, the SQL
Expression language remains part of the public facing API
as it is used within object-relational configurations and
queries.</p>
<div class="section" id="documentation-overview">
<span id="doc-overview"></span><h2>Documentation Overview<a class="headerlink" href="#documentation-overview" title="Permalink to this headline">¶</a></h2>
<p>The documentation is separated into three sections: <a class="reference internal" href="orm/index.html"><em>SQLAlchemy ORM</em></a>,
<a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>, and <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a>.</p>
<p>In <a class="reference internal" href="orm/index.html"><em>SQLAlchemy ORM</em></a>, the Object Relational Mapper is introduced and fully
described. New users should begin with the <a class="reference internal" href="orm/tutorial.html"><em>Object Relational Tutorial</em></a>. If you
want to work with higher-level SQL which is constructed automatically for you,
as well as management of Python objects, proceed to this tutorial.</p>
<p>In <a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>, the breadth of SQLAlchemy&#8217;s SQL and database
integration and description services are documented, the core of which is the
SQL Expression language. The SQL Expression Language is a toolkit all its own,
independent of the ORM package, which can be used to construct manipulable SQL
expressions which can be programmatically constructed, modified, and executed,
returning cursor-like result sets. In contrast to the ORM&#8217;s domain-centric
mode of usage, the expression language provides a schema-centric usage
paradigm. New users should begin here with <a class="reference internal" href="core/tutorial.html"><em>SQL Expression Language Tutorial</em></a>.
SQLAlchemy engine, connection, and pooling services are also described in
<a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>.</p>
<p>In <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a>, reference documentation for all provided
database and DBAPI backends is provided.</p>
</div>
<div class="section" id="code-examples">
<h2>Code Examples<a class="headerlink" href="#code-examples" title="Permalink to this headline">¶</a></h2>
<p>Working code examples, mostly regarding the ORM, are included in the
SQLAlchemy distribution. A description of all the included example
applications is at <a class="reference internal" href="orm/examples.html"><em>Examples</em></a>.</p>
<p>There is also a wide variety of examples involving both core SQLAlchemy
constructs as well as the ORM on the wiki.  See
<a class="reference external" href="http://www.sqlalchemy.org/trac/wiki/UsageRecipes">Theatrum Chemicum</a>.</p>
</div>
<div class="section" id="installation-guide">
<span id="installation"></span><h2>Installation Guide<a class="headerlink" href="#installation-guide" title="Permalink to this headline">¶</a></h2>
<div class="section" id="supported-platforms">
<h3>Supported Platforms<a class="headerlink" href="#supported-platforms" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy has been tested against the following platforms:</p>
<ul class="simple">
<li>cPython since version 2.5, through the 2.xx series</li>
<li>cPython version 3, throughout all 3.xx series</li>
<li><a class="reference external" href="http://www.jython.org/">Jython</a> 2.5 or greater</li>
<li><a class="reference external" href="http://pypy.org/">Pypy</a> 1.5 or greater</li>
</ul>
<div class="versionchanged">
<p><span>Changed in version 0.8: </span>Python 2.5 is now the minimum Python version supported.</p>
</div>
</div>
<div class="section" id="supported-installation-methods">
<h3>Supported Installation Methods<a class="headerlink" href="#supported-installation-methods" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy supports installation using standard Python &#8220;distutils&#8221; or
&#8220;setuptools&#8221; methodologies. An overview of potential setups is as follows:</p>
<ul class="simple">
<li><strong>Plain Python Distutils</strong> - SQLAlchemy can be installed with a clean
Python install using the services provided via <a class="reference external" href="http://docs.python.org/distutils/">Python Distutils</a>,
using the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script. The C extensions as well as Python 3 builds are supported.</li>
<li><strong>Standard Setuptools</strong> - When using <a class="reference external" href="http://pypi.python.org/pypi/setuptools/">setuptools</a>,
SQLAlchemy can be installed via <tt class="docutils literal"><span class="pre">setup.py</span></tt> or <tt class="docutils literal"><span class="pre">easy_install</span></tt>, and the C
extensions are supported.</li>
<li><strong>pip</strong> - <a class="reference external" href="http://pypi.python.org/pypi/pip/">pip</a> is an installer that
rides on top of <tt class="docutils literal"><span class="pre">setuptools</span></tt> or <tt class="docutils literal"><span class="pre">distribute</span></tt>, replacing the usage
of <tt class="docutils literal"><span class="pre">easy_install</span></tt>.  It is often preferred for its simpler mode of usage.</li>
</ul>
</div>
<div class="section" id="install-via-easy-install-or-pip">
<h3>Install via easy_install or pip<a class="headerlink" href="#install-via-easy-install-or-pip" title="Permalink to this headline">¶</a></h3>
<p>When <tt class="docutils literal"><span class="pre">easy_install</span></tt> or <tt class="docutils literal"><span class="pre">pip</span></tt> is available, the distribution can be
downloaded from Pypi and installed in one step:</p>
<div class="highlight-python"><pre>easy_install SQLAlchemy</pre>
</div>
<p>Or with pip:</p>
<div class="highlight-python"><pre>pip install SQLAlchemy</pre>
</div>
<p>This command will download the latest version of SQLAlchemy from the <a class="reference external" href="http://pypi.python.org/pypi/SQLAlchemy">Python
Cheese Shop</a> and install it to your system.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Beta releases of SQLAlchemy may not be present on Pypi, and may instead
require a direct download first.</p>
</div>
</div>
<div class="section" id="installing-using-setup-py">
<h3>Installing using setup.py<a class="headerlink" href="#installing-using-setup-py" title="Permalink to this headline">¶</a></h3>
<p>Otherwise, you can install from the distribution using the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script:</p>
<div class="highlight-python"><pre>python setup.py install</pre>
</div>
</div>
<div class="section" id="installing-the-c-extensions">
<h3>Installing the C Extensions<a class="headerlink" href="#installing-the-c-extensions" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy includes C extensions which provide an extra speed boost for
dealing with result sets. Currently, the extensions are only supported on the
2.xx series of cPython, not Python 3 or Pypy.</p>
<p><tt class="docutils literal"><span class="pre">setup.py</span></tt> will automatically build the extensions if an appropriate platform is
detected. If the build of the C extensions fails, due to missing compiler or
other issue, the setup process will output a warning message, and re-run the
build without the C extensions, upon completion reporting final status.</p>
<p>To run the build/install without even attempting to compile the C extensions,
the <tt class="docutils literal"><span class="pre">DISABLE_SQLALCHEMY_CEXT</span></tt> environment variable may be specified.  The
use case for this is either for special testing circumstances, or in the rare
case of compatibility/build issues not overcome by the usual &#8220;rebuild&#8221;
mechanism:</p>
<div class="highlight-python"><pre># *** only in SQLAlchemy 0.9.4 / 0.8.6 or greater ***
export DISABLE_SQLALCHEMY_CEXT=1; python setup.py install</pre>
</div>
<div class="versionadded">
<p><span>New in version 0.9.4,0.8.6: </span>Support for disabling the build of
C extensions using the <tt class="docutils literal"><span class="pre">DISABLE_SQLALCHEMY_CEXT</span></tt> environment variable
has been added.  This allows control of C extension building whether or not
setuptools is available, and additionally works around the fact that
setuptools will possibly be <strong>removing support</strong> for command-line switches
such as <tt class="docutils literal"><span class="pre">--without-extensions</span></tt> in a future release.</p>
<p>For versions of SQLAlchemy prior to 0.9.4 or 0.8.6, the
<tt class="docutils literal"><span class="pre">--without-cextensions</span></tt> option may be used to disable the attempt to build
C extensions, provided setupools is in use, and provided the <tt class="docutils literal"><span class="pre">Feature</span></tt>
construct is supported by the installed version of setuptools:</p>
<div class="highlight-python"><pre>python setup.py --without-cextensions install</pre>
</div>
<p>Or with pip:</p>
<div class="highlight-python"><pre>pip install --global-option='--without-cextensions' SQLAlchemy</pre>
</div>
</div>
</div>
<div class="section" id="installing-on-python-3">
<h3>Installing on Python 3<a class="headerlink" href="#installing-on-python-3" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy ships as Python 2 code. For Python 3 usage, the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script
will invoke the Python <tt class="docutils literal"><span class="pre">2to3</span></tt> tool on the build, plugging in an extra
&#8220;preprocessor&#8221; as well. The 2to3 step works with Python distutils
(part of the standard Python install) and Distribute - it will <strong>not</strong>
work with a non-Distribute setuptools installation.</p>
</div>
<div class="section" id="installing-a-database-api">
<h3>Installing a Database API<a class="headerlink" href="#installing-a-database-api" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy is designed to operate with a <a class="reference internal" href="glossary.html#term-dbapi"><em class="xref std std-term">DBAPI</em></a> implementation built for a
particular database, and includes support for the most popular databases.
The individual database sections in <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a> enumerate
the available DBAPIs for each database, including external links.</p>
</div>
<div class="section" id="checking-the-installed-sqlalchemy-version">
<h3>Checking the Installed SQLAlchemy Version<a class="headerlink" href="#checking-the-installed-sqlalchemy-version" title="Permalink to this headline">¶</a></h3>
<p>This documentation covers SQLAlchemy version 0.8. If you&#8217;re working on a
system that already has SQLAlchemy installed, check the version from your
Python prompt like this:</p>
<div class="highlight-python+sql"><div class="highlight"><pre><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">sqlalchemy</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">sqlalchemy</span><span class="o">.</span><span class="n">__version__</span> 
<span class="mf">0.8</span><span class="o">.</span><span class="mi">0</span></pre></div>
</div>
</div>
</div>
<div class="section" id="to-0-8-migration">
<span id="migration"></span><h2>0.7 to 0.8 Migration<a class="headerlink" href="#to-0-8-migration" title="Permalink to this headline">¶</a></h2>
<p>Notes on what&#8217;s changed from 0.7 to 0.8 is available here at <a class="reference internal" href="changelog/migration_08.html"><em>What&#8217;s New in SQLAlchemy 0.8?</em></a>.</p>
</div>
</div>

    </div>

</div>

<div id="docs-bottom-navigation" class="docs-navigation-links">
        Previous:
        <a href="contents.html" title="previous chapter">Table of Contents</a>
        Next:
        <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>

    <div id="docs-copyright">
        &copy; <a href="copyright.html">Copyright</a> 2007-2014, the SQLAlchemy authors and contributors.
        Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2b1.
    </div>
</div>

</div>

        
    </body>
</html>