Sophie

Sophie

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

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>
                Overview
             &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="next" title="SQLAlchemy ORM" href="orm/index.html" />
        <link rel="prev" title="Table of Contents" href="contents.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="contents.html" title="previous chapter">Table of Contents</a>
            </li>
            <li>Next:
            <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>
            </li>

        <li>
            <a href="contents.html">Table of Contents</a> |
            <a href="genindex.html">Index</a>
            | <a href="_sources/intro.txt">view source
        </li>
        </ul>
    </div>
    <div id="navbanner">
        <a class="totoc" href="index.html">SQLAlchemy 0.6.8 Documentation</a>
        » 
                Overview
             

        <h2>
            
                Overview
            
        </h2>
        <ul>
<li><a class="reference internal" href="#">Overview</a><ul>
<li><a class="reference internal" href="#id1">Overview</a></li>
<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="#installing-with-setuptools-or-pip">Installing with setuptools 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-6-migration">0.5 to 0.6 Migration</a></li>
</ul>
</li>
</ul>

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

<div class="document">
    <div class="body">
        
<div class="section" id="overview">
<span id="overview-toplevel"></span><h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<span id="id2"></span><h2>Overview<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<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 below. The
arrows represent the general dependencies of components:</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>
<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">http://www.sqlalchemy.org/trac/wiki/UsageRecipes</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>
<p>SQLAlchemy builds using the standard <a class="reference external" href="http://docs.python.org/distutils/">Python Distutils</a> approach.</p>
<div class="section" id="installing-with-setuptools-or-pip">
<h3>Installing with setuptools or pip<a class="headerlink" href="#installing-with-setuptools-or-pip" title="Permalink to this headline">¶</a></h3>
<p>Installing SQLAlchemy from scratch is most easily achieved with <a class="reference external" href="http://pypi.python.org/pypi/setuptools/">setuptools</a>, or alternatively
<a class="reference external" href="http://pypi.python.org/pypi/pip/">pip</a>. Assuming it&#8217;s installed, just run this from the command-line:</p>
<div class="highlight-none"><div class="highlight"><pre># easy_install SQLAlchemy</pre></div>
</div>
<p>Or with pip:</p>
<div class="highlight-none"><div class="highlight"><pre># pip install SQLAlchemy</pre></div>
</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>
<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-none"><div class="highlight"><pre># python setup.py install</pre></div>
</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.  In version 0.6, these extensions must be explicitly
enabled (in 0.7 they will build by default).</p>
<p>To install including building the C extensions, use the <tt class="docutils literal"><span class="pre">--with-cextensions</span></tt> flag.
This flag must be on the command line before the actual install or build command:</p>
<div class="highlight-python"><pre>python setup.py --with-cextensions install</pre>
</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.   Using the Python 3 interpreter with <tt class="docutils literal"><span class="pre">setup.py</span></tt> or a Python 3 version of easy_install or pip is all that&#8217;s needed.</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 external" href="http://www.python.org/doc/peps/pep-0249/">DB-API</a> implementation built for a particular database, and includes support for the most popular databases.  The current list is at <a class="reference internal" href="core/engines.html#supported-dbapis"><em>Supported Databases</em></a>.</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.6.  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.6</span><span class="o">.</span><span class="mi">0</span></pre></div>
</div>
</div>
</div>
<div class="section" id="to-0-6-migration">
<span id="migration"></span><h2>0.5 to 0.6 Migration<a class="headerlink" href="#to-0-6-migration" title="Permalink to this headline">¶</a></h2>
<p>Notes on what&#8217;s changed from 0.5 to 0.6 is available on the SQLAlchemy wiki at <a class="reference external" href="http://www.sqlalchemy.org/trac/wiki/06Migration">06Migration</a>.</p>
</div>
</div>

    </div>
</div>


    <div class="bottomnav">
            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 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>