Mike Bayer [Sat, 5 Sep 2009 03:29:20 +0000 (03:29 +0000)]
- the Binary type now returns data as a Python string
(or a "bytes" type in Python 3), instead of the built-
in "buffer" type. This allows symmetric round trips
of binary data. [ticket:1524]
Mike Bayer [Tue, 1 Sep 2009 22:55:59 +0000 (22:55 +0000)]
- Fixed bug which prevented two entities from mutually
replacing each other's primary key values within a single
flush() for some orderings of operations. [ticket:1519]
Mike Bayer [Tue, 1 Sep 2009 22:26:23 +0000 (22:26 +0000)]
- A column can be added to a joined-table subclass after
the class has been constructed (i.e. via class-level
attribute assignment). The column is added to the underlying
Table as always, but now the mapper will rebuild its
"join" to include the new column, instead of raising
an error about "no such column, use column_property()
instead". [ticket:1523]
- added an additional test in test_mappers for "added nonexistent column",
even though this test is already in test_query its more appropriate within
"mapper configuration" tests.
Mike Bayer [Tue, 1 Sep 2009 22:14:22 +0000 (22:14 +0000)]
- Fixed the error message for "could not find a FROM clause"
in query.join() which would fail to issue correctly
if the query was against a pure SQL construct.
[ticket:1522]
Mike Bayer [Mon, 31 Aug 2009 20:54:19 +0000 (20:54 +0000)]
- the allow_null_pks flag on mapper() is deprecated, and
the feature is turned "on" by default. This means that
a row which has a non-null value for any of its primary key
columns will be considered an identity. The need for this
scenario typically only occurs when mapping to an outer join.
[ticket:1339]
- streamlined the NULL check to use set operations
Mike Bayer [Mon, 31 Aug 2009 20:38:14 +0000 (20:38 +0000)]
- Inserting NULL into a primary key + foreign key column
will allow the "not null constraint" error to raise,
not an attempt to execute a nonexistent "col_id_seq"
sequence. [ticket:1516]
- autoincrement SELECT statements, i.e. those which
select from a procedure that modifies rows, now work
with server-side cursor mode (the named cursor isn't
used for such statements.)
Gaëtan de Menten [Mon, 31 Aug 2009 15:14:28 +0000 (15:14 +0000)]
Remove NCLOB from types.__all__, since it's not defined there. Not sure if this
is the proper fix but the former situation made it impossible to do "from
sqlalchemy.types import *", which Elixir does.
Mike Bayer [Fri, 28 Aug 2009 20:29:08 +0000 (20:29 +0000)]
- Fixed an obscure issue whereby a joined-table subclass
with a self-referential eager load on the base class
would populate the related object's "subclass" table with
data from the "subclass" table of the parent.
[ticket:1485]
Mike Bayer [Mon, 10 Aug 2009 04:48:00 +0000 (04:48 +0000)]
- simplify MySQLIdentifierPreparer into standard pattern,
thus allowing easy subclassing
- move % sign logic for MySQLIdentifierPreparer into MySQLdb dialect
- paramterize the escape/unescape quote char in IdentifierPreparer
- cut out MySQLTableDefinitionParser cruft
Mike Bayer [Sun, 9 Aug 2009 23:46:06 +0000 (23:46 +0000)]
- the Oracle dialect now features NUMBER which intends
to act justlike Oracle's NUMBER type. It is the primary
numeric type returned by table reflection and attempts
to return Decimal()/float/int based on the precision/scale
parameters. [ticket:885]
Mike Bayer [Sun, 9 Aug 2009 22:11:40 +0000 (22:11 +0000)]
- PG: somewhat better support for % signs in table/column names;
psycopg2 can't handle a bind parameter name of
%(foobar)s however and SQLA doesn't want to add overhead
just to treat that one non-existent use case.
[ticket:1279]
- MySQL: somewhat better support for % signs in table/column names;
MySQLdb can't handle % signs in SQL when executemany() is used,
and SQLA doesn't want to add overhead just to treat that one
non-existent use case. [ticket:1279]
Mike Bayer [Sat, 8 Aug 2009 22:21:02 +0000 (22:21 +0000)]
- added **kw to ClauseElement.compare(), so that we can smarten up the "use_get" operation
- many-to-one relation to a joined-table subclass now uses get()
for a simple load (known as the "use_get" condition),
i.e. Related->Sub(Base), without the need
to redefine the primaryjoin condition in terms of the base
table. [ticket:1186]
- specifying a foreign key with a declarative column,
i.e. ForeignKey(MyRelatedClass.id) doesn't break the "use_get"
condition from taking place [ticket:1492]
Mike Bayer [Sat, 8 Aug 2009 15:26:43 +0000 (15:26 +0000)]
- turned on auto-returning for oracle, some errors
- added make_transient() [ticket:1052]
- ongoing refactor of compiler _get_colparams() (more to come)
Mike Bayer [Fri, 7 Aug 2009 21:14:32 +0000 (21:14 +0000)]
- renamed PASSIVE_NORESULT to PASSIVE_NO_RESULT
- renamed PASSIVE_NO_CALLABLES to PASSIVE_NO_FETCH
- passive now propagates all the way through lazy callables,
all the way into query._get(), so that many-to-one lazy load
can load the instance via the local session but not trigger
any SQL if not available, fixes [ticket:1298] without
messing up consistency of tests added in r6201
- many-to-one also handles returning PASSIVE_NO_RESULT
for the "old" value thus eliminating the need for the
previous value even if the new value is None
- query._get() uses identity_map.get(), which has been
changed to no longer raise KeyError, thus providing
mythical time savings that didn't seem to make any
difference in how fast the unit tests ran.
Mike Bayer [Sun, 2 Aug 2009 18:13:07 +0000 (18:13 +0000)]
- UPDATE and DELETE do not support ORDER BY, LIMIT, OFFSET,
etc. in standard SQL. Query.update() and Query.delete()
now raise an exception if any of limit(), offset(),
order_by(), group_by(), or distinct() have been
called. [ticket:1487]
Mike Bayer [Sun, 2 Aug 2009 17:51:33 +0000 (17:51 +0000)]
- Simplified the sweep of instrumentation in strategies._register_attribute
- Improved support for MapperProperty objects overriding
that of an inherited mapper for non-concrete
inheritance setups - attribute extensions won't randomly
collide with each other. [ticket:1488]
- Added AttributeExtension to sqlalchemy.orm.__all__
Mike Bayer [Sun, 26 Jul 2009 01:46:41 +0000 (01:46 +0000)]
- Squeezed a few more unnecessary "lazy loads" out of
relation(). When a collection is mutated, many-to-one
backrefs on the other side will not fire off to load
the "old" value, unless "single_parent=True" is set.
A direct assignment of a many-to-one still loads
the "old" value in order to update backref collections
on that value, which may be present in the session
already, thus maintaining the 0.5 behavioral contract.
[ticket:1483]
Mike Bayer [Sat, 25 Jul 2009 21:26:28 +0000 (21:26 +0000)]
- Fixed bug whereby a load/refresh of joined table
inheritance attributes which were based on
column_property() or similar would fail to evaluate.
[ticket:1480]
Mike Bayer [Sat, 25 Jul 2009 20:27:33 +0000 (20:27 +0000)]
- fixed the test for FalseDiscriminator to use Boolean for picky postgresql
- added Query.enable_assertions(False) as a mediocre solution for [ticket:1424].
updated the recipe at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery to
reflect.
- moved most default Query state to be class level variables to start. the dicts could
go as well but being overly careful to not place mutables there for the moment.
- a visit by the "dunder-private method names aren't cool" police
- continued undisciplined pep-8ness
Mike Bayer [Sat, 25 Jul 2009 19:34:02 +0000 (19:34 +0000)]
- Unary expressions such as DISTINCT propagate their
type handling to result sets, allowing conversions like
unicode and such to take place. [ticket:1420]
Mike Bayer [Sat, 25 Jul 2009 17:08:38 +0000 (17:08 +0000)]
- The collection proxies produced by associationproxy are now
pickleable. A user-defined proxy_factory however
is still not pickleable unless it defines __getstate__
and __setstate__. [ticket:1446]
Mike Bayer [Tue, 21 Jul 2009 21:47:03 +0000 (21:47 +0000)]
- relations() now have greater ability to be "overridden",
meaning a subclass that explicitly specifies a relation()
overriding that of the parent class will be honored
during a flush. This is currently to support
many-to-many relations from concrete inheritance setups.
Outside of that use case, YMMV. [ticket:1477]