Skip to content

Commit bb79e2e

Browse files
committed
merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1
1 parent 4fc3a06 commit bb79e2e

116 files changed

Lines changed: 10188 additions & 7576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGES

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
1-
next
2-
- anonymous indexes (via Column(unique=True) etc) use column._label for naming
3-
to avoid collisions
4-
0.1.7
5-
- some fixes to topological sort algorithm
6-
- added DISTINCT ON support to Postgres (just supply distinct=[col1,col2..])
7-
- added __mod__ (% operator) to sql expressions
8-
- "order_by" mapper property inherited from inheriting mapper
9-
- fix to column type used when mapper UPDATES/DELETEs
10-
- with convert_unicode=True, reflection was failing, has been fixed
11-
- types types types! still werent working....have to use TypeDecorator again :(
12-
- mysql binary type converts array output to buffer, fixes PickleType
13-
- fixed the attributes.py memory leak once and for all
14-
- unittests are qualified based on the databases that support each one
15-
- fixed bug where column defaults would clobber VALUES clause of insert objects
16-
- fixed bug where table def w/ schema name would force engine connection
17-
- fix for parenthesis to work correctly with subqueries in INSERT/UPDATE
18-
- HistoryArraySet gets extend() method
19-
- fixed lazyload support for other comparison operators besides =
20-
- lazyload fix where two comparisons in the join condition point to the
21-
samem column
22-
- added "construct_new" flag to mapper, will use __new__ to create instances
23-
instead of __init__ (standard in 0.2)
24-
- added selectresults.py to SVN, missed it last time
25-
- tweak to allow a many-to-many relationship from a table to itself via
26-
an association table
27-
- small fix to "translate_row" function used by polymorphic example
28-
- create_engine uses cgi.parse_qsl to read query string (out the window in 0.2)
29-
- tweaks to CAST operator
30-
- fixed function names LOCAL_TIME/LOCAL_TIMESTAMP -> LOCALTIME/LOCALTIMESTAMP
31-
- fixed order of ORDER BY/HAVING in compile
1+
0.2
2+
- overhaul to Engine system so that what was formerly the SQLEngine
3+
is now a ComposedSQLEngine which consists of a variety of components,
4+
including a Dialect, ConnectionProvider, etc. This impacted all the
5+
db modules as well as Session and Mapper.
6+
- create_engine now takes only RFC-1738-style strings:
7+
driver://user:password@host:port/database
8+
- total rewrite of connection-scoping methodology, Connection objects
9+
can now execute clause elements directly, added explicit "close" as
10+
well as support throughout Engine/ORM to handle closing properly,
11+
no longer relying upon __del__ internally to return connections
12+
to the pool [ticket:152].
13+
- overhaul to Session interface and scoping. uses hibernate-style
14+
methods, including query(class), save(), save_or_update(), etc.
15+
no threadlocal scope is installed by default. Provides a binding
16+
interface to specific Engines and/or Connections so that underlying
17+
Schema objects do not need to be bound to an Engine. Added a basic
18+
SessionTransaction object that can simplistically aggregate transactions
19+
across multiple engines.
20+
- overhaul to mapper's dependency and "cascade" behavior; dependency logic
21+
factored out of properties.py into a separate module "dependency.py".
22+
"cascade" behavior is now explicitly controllable, proper implementation
23+
of "delete", "delete-orphan", etc. dependency system can now determine at
24+
flush time if a child object has a parent or not so that it makes better
25+
decisions on how that child should be updated in the DB with regards to deletes.
26+
- overhaul to Schema to build upon MetaData object instead of an Engine.
27+
Entire SQL/Schema system can be used with no Engines whatsoever, executed
28+
solely by an explicit Connection object. the "bound" methodlogy exists via the
29+
BoundMetaData for schema objects. ProxyEngine is generally not needed
30+
anymore and is replaced by DynamicMetaData.
31+
- true polymorphic behavior implemented, fixes [ticket:167]
32+
- "oid" system has been totally moved into compile-time behavior;
33+
if they are used in an order_by where they are not available, the order_by
34+
doesnt get compiled, fixes [ticket:147]
35+
- overhaul to packaging; "mapping" is now "orm", "objectstore" is now
36+
"session", the old "objectstore" namespace gets loaded in via the
37+
"threadlocal" mod if used
38+
- mods now called in via "import <modname>". extensions favored over
39+
mods as mods are globally-monkeypatching
40+
- fix to add_property so that it propigates properties to inheriting
41+
mappers [ticket:154]
42+
- backrefs create themselves against primary mapper of its originating
43+
property, priamry/secondary join arguments can be specified to override.
44+
helps their usage with polymorphic mappers
45+
- "table exists" function has been implemented [ticket:31]
46+
- "create_all/drop_all" added to MetaData object [ticket:98]
47+
- improvements and fixes to topological sort algorithm, as well as more
48+
unit tests
49+
- tutorial page added to docs which also can be run with a custom doctest
50+
runner to insure its properly working. docs generally overhauled to
51+
deal with new code patterns
3252

3353
0.1.6
3454
- support for MS-SQL added courtesy Rick Morrison, Runar Petursson

doc/alphaapi.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<html>
2+
<head>
3+
<link href="style.css" rel="stylesheet" type="text/css"></link>
4+
<link href="docs.css" rel="stylesheet" type="text/css"></link>
5+
<script src="scripts.js"></script>
6+
<title>SQLAlchemy Documentation</title>
7+
</head>
8+
<body>
9+
<h3>What is an Alpha API Feature?</h3>
10+
<p><b>Alpha API</b> indicates that the best way for a particular feature to be presented hasn't been firmly settled on as of yet, and the current way is being introduced on a trial basis. Its spirit is not as much a warning that "this API might change", its more an invitation to the users saying, "heres a new idea I had. I'm not sure if this is the best way to do it. Do you like it ? Should we do this differently? Or is it good the way it is ?". Alpha API features are always small in scope and are presented in releases so that the greatest number of users get some hands-on experience with it; large-scoped API or architectural changes will always be discussed on the mailing list/Wiki first.</p>
11+
12+
<p>Reasons why a feature might want to change include:
13+
<ul>
14+
<li>The API for the feature is too difficult to use for the typical task, and needs to be more "convenient"</li>
15+
<li>The feature only implements a subsection of what it really should be doing</li>
16+
<li>The feature's interface is inconsistent with that of other features which operate at a similar level</li>
17+
<li>The feature is confusing and is often misunderstood, and would be better replaced by a more manual feature that makes the task clearer</li>
18+
<li>The feature overlaps with another feature and effectively provides too many ways to do the same thing</li>
19+
<li>The feature made some assumptions about the total field of use cases which is not really true, and it breaks in other scenarios</li>
20+
</ul>
21+
22+
</p>
23+
<p>A good example of what was essentially an "alpha feature" is the <code>private=True</code> flag. This flag on a <code>relation()</code> indicates that child objects should be deleted along with the parent. After this flag experienced some usage by the SA userbase, some users remarked that a more generic and configurable way was Hibernates <code>cascade="all, delete-orphan"</code>, and also that the term <code>cascade</code> was clearer in purpose than the more ambiguous <code>private</code> keyword, which could be construed as a "private variable".</p>
24+
25+
<center><input type="button" value="close window" onclick="window.close()"></center>
26+
</body>
27+
</html>

doc/alphaimplementation.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<html>
2+
<head>
3+
<link href="style.css" rel="stylesheet" type="text/css"></link>
4+
<link href="docs.css" rel="stylesheet" type="text/css"></link>
5+
<script src="scripts.js"></script>
6+
<title>SQLAlchemy Documentation</title>
7+
</head>
8+
<body>
9+
<h3>What is an Alpha Implementation Feature?</h3>
10+
<p><b>Alpha Implementation</b> indicates a feature where developer confidence in its functionality has not yet been firmly established. This typically includes brand new features for which adequate unit tests have not been completed, and/or features whose scope is broad enough that its not clear what additional unit tests might be needed.</p>
11+
12+
<p>Alpha implementation is not meant to discourage the usage of a feature, it is only meant to indicate that some difficulties in getting full functionality from the feature may occur, and to encourage the reporting of these difficulties either via the mailing list or through <a href="http://www.sqlalchemy.org/trac/newticket" target="_blank">submitting a ticket</a>.</p>
13+
14+
<center><input type="button" value="close window" onclick="window.close()"></center>
15+
</body>
16+
</html>

doc/build/compile_docstrings.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,32 @@
77

88
import sqlalchemy.schema as schema
99
import sqlalchemy.engine as engine
10+
import sqlalchemy.engine.strategies as strategies
1011
import sqlalchemy.sql as sql
1112
import sqlalchemy.pool as pool
12-
import sqlalchemy.mapping as mapping
13+
import sqlalchemy.orm as orm
1314
import sqlalchemy.exceptions as exceptions
1415
import sqlalchemy.ext.proxy as proxy
16+
import sqlalchemy.ext.sessioncontext as sessioncontext
17+
import sqlalchemy.mods.threadlocal as threadlocal
1518

1619
objects = []
1720
def make_doc(obj, classes=None, functions=None):
1821
objects.append(docstring.ObjectDoc(obj, classes=classes, functions=functions))
1922

23+
make_doc(obj=sql, classes=[sql.Engine, sql.AbstractDialect, sql.ClauseParameters, sql.Compiled, sql.ClauseElement, sql.TableClause, sql.ColumnClause])
2024
make_doc(obj=schema)
21-
make_doc(obj=engine, classes=[engine.SQLSession, engine.SQLEngine, engine.ResultProxy, engine.RowProxy])
22-
make_doc(obj=sql, classes=[sql.ClauseParameters, sql.Compiled, sql.ClauseElement, sql.TableClause, sql.ColumnClause])
23-
make_doc(obj=pool, classes=[pool.DBProxy, pool.Pool, pool.QueuePool, pool.SingletonThreadPool])
24-
make_doc(obj=mapping, classes=[mapping.Mapper, mapping.MapperExtension])
25-
make_doc(obj=mapping.query, classes=[mapping.query.Query])
26-
make_doc(obj=mapping.objectstore, classes=[mapping.objectstore.Session, mapping.objectstore.Session.SessionTrans])
25+
make_doc(obj=engine, classes=[engine.ComposedSQLEngine, engine.Connection, engine.Transaction, engine.Dialect, engine.ConnectionProvider, engine.ExecutionContext, engine.ResultProxy, engine.RowProxy])
26+
make_doc(obj=strategies)
27+
make_doc(obj=orm, classes=[orm.Mapper, orm.MapperExtension])
28+
make_doc(obj=orm.query, classes=[orm.query.Query])
29+
make_doc(obj=orm.session, classes=[orm.session.Session, orm.session.SessionTransaction])
30+
make_doc(obj=sessioncontext)
31+
make_doc(obj=threadlocal)
2732
make_doc(obj=exceptions)
33+
make_doc(obj=pool, classes=[pool.DBProxy, pool.Pool, pool.QueuePool, pool.SingletonThreadPool])
2834
make_doc(obj=proxy)
2935

36+
3037
output = os.path.join(os.getcwd(), 'content', "compiled_docstrings.pickle")
31-
pickle.dump(objects, file(output, 'w'))
38+
pickle.dump(objects, file(output, 'w'))

doc/build/components/formatting.myt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
title = None
262262
syntaxtype = 'python'
263263
html_escape = False
264+
use_sliders = False
264265
</%args>
265266

266267
<%init>
@@ -289,7 +290,7 @@
289290
return "<pre>" + highlight.highlight(fix_indent(match.group(1)), html_escape = html_escape, syntaxtype = syntaxtype) + "</pre>"
290291
content = p.sub(hlight, "<pre>" + m.content() + "</pre>")
291292
</%init>
292-
<div class="code">
293+
<div class="<% use_sliders and "sliding_code" or "code" %>">
293294
% if title is not None:
294295
<div class="codetitle"><% title %></div>
295296
%

0 commit comments

Comments
 (0)