1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml">
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13
SQLAlchemy 0.7 Documentation
17
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
18
<link rel="stylesheet" href="../_static/docs.css" type="text/css" />
20
<script type="text/javascript">
21
var DOCUMENTATION_OPTIONS = {
24
COLLAPSE_MODINDEX: false,
28
<script type="text/javascript" src="../_static/jquery.js"></script>
29
<script type="text/javascript" src="../_static/underscore.js"></script>
30
<script type="text/javascript" src="../_static/doctools.js"></script>
31
<script type="text/javascript" src="../_static/init.js"></script>
32
<link rel="index" title="Index" href="../genindex.html" />
33
<link rel="search" title="Search" href="../search.html" />
34
<link rel="copyright" title="Copyright" href="../copyright.html" />
35
<link rel="top" title="SQLAlchemy 0.7 Documentation" href="../index.html" />
36
<link rel="up" title="Dialects" href="index.html" />
37
<link rel="next" title="Microsoft Access" href="access.html" />
38
<link rel="prev" title="Informix" href="informix.html" />
53
<div id="docs-container">
57
<div id="docs-header">
58
<h1>SQLAlchemy 0.7 Documentation</h1>
60
<div id="docs-search">
62
<form class="search" action="../search.html" method="get">
63
<input type="text" name="q" size="18" /> <input type="submit" value="Search" />
64
<input type="hidden" name="check_keywords" value="yes" />
65
<input type="hidden" name="area" value="default" />
69
<div id="docs-version-header">
70
Release: <span class="version-num">0.7.9</span> | Release Date: October 1, 2012
77
<div id="docs-top-navigation">
78
<div id="docs-top-page-control" class="docs-navigation-links">
81
<a href="informix.html" title="previous chapter">Informix</a>
84
<a href="access.html" title="next chapter">Microsoft Access</a>
88
<a href="../contents.html">Table of Contents</a> |
89
<a href="../genindex.html">Index</a>
90
| <a href="../_sources/dialects/maxdb.txt">view source
95
<div id="docs-navigation-banner">
96
<a href="../index.html">SQLAlchemy 0.7 Documentation</a>
97
» <a href="index.html" title="Dialects">Dialects</a>
111
<div id="docs-body-container">
113
<div id="docs-sidebar">
114
<h3><a href="../index.html">Table of Contents</a></h3>
116
<li><a class="reference internal" href="#">MaxDB</a><ul>
117
<li><a class="reference internal" href="#overview">Overview</a></li>
118
<li><a class="reference internal" href="#connecting">Connecting</a></li>
119
<li><a class="reference internal" href="#implementation-notes">Implementation Notes</a><ul>
120
<li><a class="reference internal" href="#sapdb-dbapi">sapdb.dbapi</a></li>
128
<h4>Previous Topic</h4>
130
<a href="informix.html" title="previous chapter">Informix</a>
134
<a href="access.html" title="next chapter">Microsoft Access</a>
138
<h4>Quick Search</h4>
140
<form class="search" action="../search.html" method="get">
141
<input type="text" name="q" size="18" /> <input type="submit" value="Search" />
142
<input type="hidden" name="check_keywords" value="yes" />
143
<input type="hidden" name="area" value="default" />
149
<div id="docs-body" class="withsidebar" >
151
<div class="section" id="module-sqlalchemy.dialects.maxdb.base">
152
<span id="maxdb"></span><span id="maxdb-toplevel"></span><h1>MaxDB<a class="headerlink" href="#module-sqlalchemy.dialects.maxdb.base" title="Permalink to this headline">¶</a></h1>
153
<p>Support for the MaxDB database.</p>
154
<div class="admonition note">
155
<p class="first admonition-title">Note</p>
156
<p class="last">The MaxDB dialect is <strong>non-functional as of SQLAlchemy 0.6</strong>,
157
pending development efforts to bring it up-to-date.</p>
159
<div class="section" id="overview">
160
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
161
<p>The <tt class="docutils literal"><span class="pre">maxdb</span></tt> dialect is <strong>experimental</strong> and has only been tested on 7.6.03.007
162
and 7.6.00.037. Of these, <strong>only 7.6.03.007 will work</strong> with SQLAlchemy’s ORM.
163
The earlier version has severe <tt class="docutils literal"><span class="pre">LEFT</span> <span class="pre">JOIN</span></tt> limitations and will return
164
incorrect results from even very simple ORM queries.</p>
165
<p>Only the native Python DB-API is currently supported. ODBC driver support
166
is a future enhancement.</p>
168
<div class="section" id="connecting">
169
<h2>Connecting<a class="headerlink" href="#connecting" title="Permalink to this headline">¶</a></h2>
170
<p>The username is case-sensitive. If you usually connect to the
171
database with sqlcli and other tools in lower case, you likely need to
172
use upper case for DB-API.</p>
174
<div class="section" id="implementation-notes">
175
<h2>Implementation Notes<a class="headerlink" href="#implementation-notes" title="Permalink to this headline">¶</a></h2>
176
<p>With the 7.6.00.37 driver and Python 2.5, it seems that all DB-API
177
generated exceptions are broken and can cause Python to crash.</p>
178
<p>For ‘somecol.in_([])’ to work, the IN operator’s generation must be changed
179
to cast ‘NULL’ to a numeric, i.e. NUM(NULL). The DB-API doesn’t accept a
180
bind parameter there, so that particular generation must inline the NULL value,
181
which depends on [ticket:807].</p>
182
<p>The DB-API is very picky about where bind params may be used in queries.</p>
183
<p>Bind params for some functions (e.g. MOD) need type information supplied.
184
The dialect does not yet do this automatically.</p>
185
<p>Max will occasionally throw up ‘bad sql, compile again’ exceptions for
186
perfectly valid SQL. The dialect does not currently handle these, more
187
research is needed.</p>
188
<p>MaxDB 7.5 and Sap DB <= 7.4 reportedly do not support schemas. A very
189
slightly different version of this dialect would be required to support
190
those versions, and can easily be added if there is demand. Some other
191
required components such as an Max-aware ‘old oracle style’ join compiler
192
(thetas with (+) outer indicators) are already done and available for
193
integration- email the devel list if you’re interested in working on
195
<p>Versions tested: 7.6.03.07 and 7.6.00.37, native Python DB-API</p>
197
<li>MaxDB has severe limitations on OUTER JOINs, which are essential to ORM
198
eager loading. And rather than raise an error if a SELECT can’t be serviced,
199
the database simply returns incorrect results.</li>
200
<li>Version 7.6.03.07 seems to JOIN properly, however the docs do not show the
201
OUTER restrictions being lifted (as of this writing), and no changelog is
202
available to confirm either. If you are using a different server version and
203
your tasks require the ORM or any semi-advanced SQL through the SQL layer,
204
running the SQLAlchemy test suite against your database is HIGHLY
205
recommended before you begin.</li>
206
<li>Version 7.6.00.37 is LHS/RHS sensitive in <cite>FROM lhs LEFT OUTER JOIN rhs ON
207
lhs.col=rhs.col</cite> vs <cite>rhs.col=lhs.col</cite>!</li>
208
<li>Version 7.6.00.37 is confused by <cite>SELECT DISTINCT col as alias FROM t ORDER
209
BY col</cite> - these aliased, DISTINCT, ordered queries need to be re-written to
210
order by the alias name.</li>
211
<li>Version 7.6.x supports creating a SAVEPOINT but not its RELEASE.</li>
212
<li>MaxDB supports autoincrement-style columns (DEFAULT SERIAL) and independent
213
sequences. When including a DEFAULT SERIAL column in an insert, 0 needs to
214
be inserted rather than NULL to generate a value.</li>
215
<li>MaxDB supports ANSI and “old Oracle style” theta joins with (+) outer join
217
<li>The SQLAlchemy dialect is schema-aware and probably won’t function correctly
218
on server versions (pre-7.6?). Support for schema-less server versions could
219
be added if there’s call.</li>
220
<li>ORDER BY is not supported in subqueries. LIMIT is not supported in
221
subqueries. In 7.6.00.37, TOP does work in subqueries, but without limit not
222
so useful. OFFSET does not work in 7.6 despite being in the docs. Row number
223
tricks in WHERE via ROWNO may be possible but it only seems to allow
224
less-than comparison!</li>
225
<li>Version 7.6.03.07 can’t LIMIT if a derived table is in FROM: <cite>SELECT * FROM
226
(SELECT * FROM a) LIMIT 2</cite></li>
227
<li>MaxDB does not support sql’s CAST and can only usefullly cast two types.
228
There isn’t much implicit type conversion, so be precise when creating
229
<cite>PassiveDefaults</cite> in DDL generation: <cite>‘3’</cite> and <cite>3</cite> aren’t the same.</li>
231
<div class="section" id="sapdb-dbapi">
232
<h3>sapdb.dbapi<a class="headerlink" href="#sapdb-dbapi" title="Permalink to this headline">¶</a></h3>
234
<li>As of 2007-10-22 the Python 2.4 and 2.5 compatible versions of the DB-API
235
are no longer available. A forum posting at SAP states that the Python
236
driver will be available again “in the future”. The last release from MySQL
237
AB works if you can find it.</li>
238
<li>sequence.NEXTVAL skips every other value!</li>
239
<li>No rowcount for executemany()</li>
240
<li>If an INSERT into a table with a DEFAULT SERIAL column inserts the results
241
of a function <cite>INSERT INTO t VALUES (LENGTH(‘foo’))</cite>, the cursor won’t have
242
the serial id. It needs to be manually yanked from tablename.CURRVAL.</li>
243
<li>Super-duper picky about where bind params can be placed. Not smart about
244
converting Python types for some functions, such as <cite>MOD(5, ?)</cite>.</li>
245
<li>LONG (text, binary) values in result sets are read-once. The dialect uses a
246
caching RowProxy when these types are present.</li>
247
<li>Connection objects seem like they want to be either <a href="#id1"><span class="problematic" id="id2">`</span></a>close()`d or garbage
248
collected, but not both. There’s a warning issued but it seems harmless.</li>
258
<div id="docs-bottom-navigation" class="docs-navigation-links">
260
<a href="informix.html" title="previous chapter">Informix</a>
262
<a href="access.html" title="next chapter">Microsoft Access</a>
264
<div id="docs-copyright">
265
© <a href="../copyright.html">Copyright</a> 2007-2012, the SQLAlchemy authors and contributors.
266
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.