PageRenderTime 27ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/sqlalchemy/doc/intro.html

https://github.com/mozilla/kuma-lib
HTML | 206 lines | 165 code | 41 blank | 0 comment | 0 complexity | 0d5b9b60959b893389f2fc4d17c18d6a MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>
  7. Overview / Installation
  8. &mdash; SQLAlchemy 0.6.4 Documentation</title>
  9. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  10. <link rel="stylesheet" href="_static/docs.css" type="text/css" />
  11. <script type="text/javascript">
  12. var DOCUMENTATION_OPTIONS = {
  13. URL_ROOT: '#',
  14. VERSION: '0.6.4',
  15. COLLAPSE_MODINDEX: false,
  16. FILE_SUFFIX: '.html'
  17. };
  18. </script>
  19. <script type="text/javascript" src="_static/jquery.js"></script>
  20. <script type="text/javascript" src="_static/underscore.js"></script>
  21. <script type="text/javascript" src="_static/doctools.js"></script>
  22. <script type="text/javascript" src="_static/init.js"></script>
  23. <link rel="index" title="Index" href="genindex.html" />
  24. <link rel="search" title="Search" href="search.html" />
  25. <link rel="copyright" title="Copyright" href="copyright.html" />
  26. <link rel="top" title="SQLAlchemy 0.6.4 Documentation" href="index.html" />
  27. <link rel="next" title="SQLAlchemy ORM" href="orm/index.html" />
  28. <link rel="prev" title="Table of Contents" href="index.html" />
  29. </head>
  30. <body>
  31. <h1>SQLAlchemy 0.6.4 Documentation</h1>
  32. <div id="search">
  33. Search:
  34. <form class="search" action="search.html" method="get">
  35. <input type="text" name="q" size="18" /> <input type="submit" value="Search" />
  36. <input type="hidden" name="check_keywords" value="yes" />
  37. <input type="hidden" name="area" value="default" />
  38. </form>
  39. </div>
  40. <div class="versionheader">
  41. Version: <span class="versionnum">0.6.4</span> Last Updated: 09/07/2010 13:07:48
  42. </div>
  43. <div class="clearboth"></div>
  44. <div class="topnav">
  45. <div id="pagecontrol">
  46. <a href="genindex.html">Index</a>
  47. <div class="sourcelink">(<a href="_sources/intro.txt">view source)</div>
  48. </div>
  49. <div class="navbanner">
  50. <a class="totoc" href="index.html">Table of Contents</a>
  51. »
  52. Overview / Installation
  53. <div class="prevnext">
  54. Previous:
  55. <a href="index.html" title="previous chapter">Table of Contents</a>
  56. Next:
  57. <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>
  58. </div>
  59. <h2>
  60. Overview / Installation
  61. </h2>
  62. </div>
  63. <ul>
  64. <li><a class="reference internal" href="#">Overview / Installation</a><ul>
  65. <li><a class="reference internal" href="#overview">Overview</a></li>
  66. <li><a class="reference internal" href="#documentation-overview">Documentation Overview</a></li>
  67. <li><a class="reference internal" href="#code-examples">Code Examples</a></li>
  68. <li><a class="reference internal" href="#installing-sqlalchemy">Installing SQLAlchemy</a></li>
  69. <li><a class="reference internal" href="#installing-a-database-api">Installing a Database API</a></li>
  70. <li><a class="reference internal" href="#checking-the-installed-sqlalchemy-version">Checking the Installed SQLAlchemy Version</a></li>
  71. <li><a class="reference internal" href="#to-0-6-migration">0.5 to 0.6 Migration</a></li>
  72. </ul>
  73. </li>
  74. </ul>
  75. <div class="clearboth"></div>
  76. </div>
  77. <div class="document">
  78. <div class="body">
  79. <div class="section" id="overview-installation">
  80. <span id="overview-toplevel"></span><h1>Overview / Installation<a class="headerlink" href="#overview-installation" title="Permalink to this headline"></a></h1>
  81. <div class="section" id="overview">
  82. <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline"></a></h2>
  83. <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>
  84. <img alt="_images/sqla_arch_small.jpg" src="_images/sqla_arch_small.jpg" />
  85. <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>
  86. </div>
  87. <div class="section" id="documentation-overview">
  88. <h2>Documentation Overview<a class="headerlink" href="#documentation-overview" title="Permalink to this headline"></a></h2>
  89. <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>
  90. <p>In <a class="reference internal" href="orm/index.html"><em>SQLAlchemy ORM</em></a>, the Object Relational Mapper is introduced and fully
  91. described. New users should begin with the <a class="reference internal" href="orm/tutorial.html"><em>Object Relational Tutorial</em></a>. If you
  92. want to work with higher-level SQL which is constructed automatically for you,
  93. as well as management of Python objects, proceed to this tutorial.</p>
  94. <p>In <a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>, the breadth of SQLAlchemy&#8217;s SQL and database
  95. integration and description services are documented, the core of which is the
  96. SQL Expression language. The SQL Expression Language is a toolkit all its own,
  97. independent of the ORM package, which can be used to construct manipulable SQL
  98. expressions which can be programmatically constructed, modified, and executed,
  99. returning cursor-like result sets. In contrast to the ORM&#8217;s domain-centric
  100. mode of usage, the expression language provides a schema-centric usage
  101. paradigm. New users should begin here with <a class="reference internal" href="core/tutorial.html"><em>SQL Expression Language Tutorial</em></a>.
  102. SQLAlchemy engine, connection, and pooling services are also described in
  103. <a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>.</p>
  104. <p>In <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a>, reference documentation for all provided
  105. database and DBAPI backends is provided.</p>
  106. </div>
  107. <div class="section" id="code-examples">
  108. <h2>Code Examples<a class="headerlink" href="#code-examples" title="Permalink to this headline"></a></h2>
  109. <p>Working code examples, mostly regarding the ORM, are included in the
  110. SQLAlchemy distribution. A description of all the included example
  111. applications is at <a class="reference internal" href="orm/examples.html"><em>Examples</em></a>.</p>
  112. <p>There is also a wide variety of examples involving both core SQLAlchemy
  113. constructs as well as the ORM on the wiki. See
  114. <a class="reference external" href="http://www.sqlalchemy.org/trac/wiki/UsageRecipes">http://www.sqlalchemy.org/trac/wiki/UsageRecipes</a>.</p>
  115. </div>
  116. <div class="section" id="installing-sqlalchemy">
  117. <h2>Installing SQLAlchemy<a class="headerlink" href="#installing-sqlalchemy" title="Permalink to this headline"></a></h2>
  118. <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
  119. <a class="reference external" href="http://pypi.python.org/pypi/pip/">pip</a>. Assuming it&#8217;s installed, just run
  120. this from the command-line:</p>
  121. <div class="highlight-none"><div class="highlight"><pre># easy_install SQLAlchemy</pre></div>
  122. </div>
  123. <p>Or with pip:</p>
  124. <div class="highlight-none"><div class="highlight"><pre># pip install SQLAlchemy</pre></div>
  125. </div>
  126. <p>This command will download the latest version of SQLAlchemy from the <a class="reference external" href="http://pypi.python.org/pypi/SQLAlchemy">Python
  127. Cheese Shop</a> and install it to your
  128. system.</p>
  129. <p>Otherwise, you can install from the distribution using the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script:</p>
  130. <div class="highlight-none"><div class="highlight"><pre># python setup.py install</pre></div>
  131. </div>
  132. </div>
  133. <div class="section" id="installing-a-database-api">
  134. <h2>Installing a Database API<a class="headerlink" href="#installing-a-database-api" title="Permalink to this headline"></a></h2>
  135. <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>
  136. </div>
  137. <div class="section" id="checking-the-installed-sqlalchemy-version">
  138. <h2>Checking the Installed SQLAlchemy Version<a class="headerlink" href="#checking-the-installed-sqlalchemy-version" title="Permalink to this headline"></a></h2>
  139. <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>
  140. <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>
  141. <span class="o">&gt;&gt;&gt;</span> <span class="n">sqlalchemy</span><span class="o">.</span><span class="n">__version__</span>
  142. <span class="mf">0.6</span><span class="o">.</span><span class="mi">0</span></pre></div>
  143. </div>
  144. </div>
  145. <div class="section" id="to-0-6-migration">
  146. <h2>0.5 to 0.6 Migration<a class="headerlink" href="#to-0-6-migration" title="Permalink to this headline"></a></h2>
  147. <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>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. <div class="bottomnav">
  153. <div class="prevnext">
  154. Previous:
  155. <a href="index.html" title="previous chapter">Table of Contents</a>
  156. Next:
  157. <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>
  158. </div>
  159. <div class="doc_copyright">
  160. &copy; <a href="copyright.html">Copyright</a> 2007, 2008, 2009, 2010, the SQLAlchemy authors and contributors.
  161. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
  162. </div>
  163. </div>
  164. </body>
  165. </html>