File: intro.html

package info (click to toggle)
sqlalchemy 0.6.3-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,744 kB
  • ctags: 15,132
  • sloc: python: 93,431; ansic: 787; makefile: 137; xml: 17
file content (205 lines) | stat: -rw-r--r-- 12,649 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!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 / Installation
 &mdash; SQLAlchemy 0.6.3 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.3',
          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="top" title="SQLAlchemy 0.6.3 Documentation" href="index.html" />
        <link rel="next" title="Object Relational Tutorial" href="ormtutorial.html" />
        <link rel="prev" title="Table of Contents" href="index.html" />
    

    </head>
    <body>
        




        <h1>SQLAlchemy 0.6.3 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.3</span> Last Updated: 07/15/2010 12:35:47
        </div>
        <div class="clearboth"></div>

        <div class="topnav">
            <div id="pagecontrol">
                <a href="reference/index.html">API Reference</a>
                |
                <a href="genindex.html">Index</a>
            
                <div class="sourcelink">(<a href="_sources/intro.txt">view source)</div>
            </div>
            
            <div class="navbanner">
                <a class="totoc" href="index.html">Table of Contents</a>
                » 
    Overview / Installation
 
                
                
<div class="prevnext">
        Previous:
        <a href="index.html" title="previous chapter">Table of Contents</a>
        Next:
        <a href="ormtutorial.html" title="next chapter">Object Relational Tutorial</a>
</div>

                <h2>
                    
    Overview / Installation
 
                </h2>
            </div>
                <ul>
<li><a class="reference internal" href="#">Overview / Installation</a><ul>
<li><a class="reference internal" href="#overview">Overview</a></li>
<li><a class="reference internal" href="#tutorials">Tutorials</a></li>
<li><a class="reference internal" href="#main-documentation">Main Documentation</a></li>
<li><a class="reference internal" href="#code-examples">Code Examples</a></li>
<li><a class="reference internal" href="#api-reference">API Reference</a></li>
<li><a class="reference internal" href="#installing-sqlalchemy">Installing SQLAlchemy</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>
<li><a class="reference internal" href="#to-0-6-migration">0.5 to 0.6 Migration</a></li>
</ul>
</li>
</ul>

            <div class="clearboth"></div>
        </div>
        
        <div class="document">
            <div class="body">
                
<div class="section" id="overview-installation">
<span id="overview-toplevel"></span><h1>Overview / Installation<a class="headerlink" href="#overview-installation" title="Permalink to this headline">¶</a></h1>
<div class="section" id="overview">
<h2>Overview<a class="headerlink" href="#overview" 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.jpg" src="_images/sqla_arch_small.jpg" />
<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="tutorials">
<h2>Tutorials<a class="headerlink" href="#tutorials" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="ormtutorial.html"><em>Object Relational Tutorial</em></a> - This describes the richest feature of SQLAlchemy, its object relational mapper.  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.</li>
<li><a class="reference internal" href="sqlexpression.html"><em>SQL Expression Language Tutorial</em></a> - The core of SQLAlchemy is its 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.  It&#8217;s a lot more lightweight than the ORM and is appropriate for higher scaling SQL operations.  It&#8217;s also heavily present within the ORM&#8217;s public facing API, so advanced ORM users will want to master this language as well.</li>
</ul>
</div>
<div class="section" id="main-documentation">
<h2>Main Documentation<a class="headerlink" href="#main-documentation" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="mappers.html"><em>Mapper Configuration</em></a> - A comprehensive walkthrough of major ORM patterns and techniques.</li>
<li><a class="reference internal" href="session.html"><em>Using the Session</em></a> - A detailed description of SQLAlchemy&#8217;s Session object</li>
<li><a class="reference internal" href="dbengine.html"><em>Database Engines</em></a> - Describes SQLAlchemy&#8217;s database-connection facilities, including connection documentation and working with connections and transactions.</li>
<li><a class="reference internal" href="metadata.html"><em>Database Meta Data</em></a> - All about schema management using <a class="reference internal" href="reference/sqlalchemy/schema.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt></a> and <a class="reference internal" href="reference/sqlalchemy/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; reading database schemas into your application, creating and dropping tables, constraints, defaults, sequences, indexes.</li>
<li><a class="reference internal" href="reference/sqlalchemy/pooling.html"><em>Connection Pooling</em></a> - Further detail about SQLAlchemy&#8217;s connection pool library.</li>
<li><a class="reference internal" href="reference/sqlalchemy/types.html#types"><em>Column and Data Types</em></a> - Datatypes included with SQLAlchemy, their functions, as well as how to create your own types.</li>
<li><a class="reference internal" href="reference/ext/index.html#plugins"><em>sqlalchemy.ext</em></a> - Included addons for SQLAlchemy</li>
</ul>
</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 are included in the SQLAlchemy distribution, and there are also usage recipes on the SQLAlchemy wiki.   A description of all the included example applications is at <a class="reference internal" href="examples.html"><em>Examples</em></a>.</p>
</div>
<div class="section" id="api-reference">
<h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h2>
<p>An organized section of all SQLAlchemy APIs is at <a class="reference internal" href="reference/index.html"><em>API Reference</em></a>.</p>
</div>
<div class="section" id="installing-sqlalchemy">
<h2>Installing SQLAlchemy<a class="headerlink" href="#installing-sqlalchemy" title="Permalink to this headline">¶</a></h2>
<p>Installing SQLAlchemy from scratch is most easily achieved with <a class="reference external" href="http://pypi.python.org/pypi/setuptools/">setuptools</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>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>
<ul class="simple">
<li><a class="reference external" href="http://pypi.python.org/pypi/setuptools/">setuptools</a></li>
<li><a class="reference external" href="http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions">install setuptools</a></li>
<li><a class="reference external" href="http://pypi.python.org/pypi/SQLAlchemy">pypi</a></li>
</ul>
<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-a-database-api">
<h2>Installing a Database API<a class="headerlink" href="#installing-a-database-api" title="Permalink to this headline">¶</a></h2>
<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="dbengine.html#supported-dbapis"><em>Supported Databases</em></a>.</p>
</div>
<div class="section" id="checking-the-installed-sqlalchemy-version">
<h2>Checking the Installed SQLAlchemy Version<a class="headerlink" href="#checking-the-installed-sqlalchemy-version" title="Permalink to this headline">¶</a></h2>
<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 class="section" id="to-0-6-migration">
<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">
                
<div class="prevnext">
        Previous:
        <a href="index.html" title="previous chapter">Table of Contents</a>
        Next:
        <a href="ormtutorial.html" title="next chapter">Object Relational Tutorial</a>
</div>

                <div class="doc_copyright">
                    &copy; Copyright 2007, 2008, 2009, 2010, the SQLAlchemy authors and contributors.
                    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b2+.
                </div>
            </div>
        






    </body>
</html>