Mike Bayer [Sun, 15 Nov 2009 20:11:42 +0000 (20:11 +0000)]
- Fixed the behavior of extract() to apply operator
precedence rules to the "::" operator when applying
the "timestamp" cast - ensures proper parenthesization.
[ticket:1611]
Mike Bayer [Wed, 4 Nov 2009 13:28:28 +0000 (13:28 +0000)]
- Fixed bug where Query would crash if a join() with no clear
"left" side were called when a non-mapped column entity
appeared in the columns list. [ticket:1602]
Mike Bayer [Sun, 25 Oct 2009 01:40:17 +0000 (01:40 +0000)]
- Fixed a slight inaccuracy in the sharding example.
Comparing equivalence of columns in the ORM is best
accomplished using col1.shares_lineage(col2).
[ticket:1491]
Mike Bayer [Fri, 23 Oct 2009 19:46:36 +0000 (19:46 +0000)]
- Mutable collection passed to the "extension" attribute
of relation(), column_property() etc. will not be mutated
or shared among multiple instrumentation calls, preventing
duplicate extensions, such as backref populators,
from being inserted into the list.
[ticket:1585]
Mike Bayer [Tue, 20 Oct 2009 16:56:15 +0000 (16:56 +0000)]
- Repeat expressions in the columns clause of a select
are deduped based on the identity of each clause element,
not the actual string. This allows positional
elements to render correctly even if they all render
identically, such as "qmark" style bind parameters.
[ticket:1574]
Mike Bayer [Thu, 15 Oct 2009 20:52:30 +0000 (20:52 +0000)]
- A column can be added to a joined-table declarative
superclass after the class has been constructed
(i.e. via class-level attribute assignment), and
the column will be propagated down to
subclasses. [ticket:1570] This is the reverse
situation as that of [ticket:1523], fixed in 0.5.6.
Mike Bayer [Wed, 30 Sep 2009 20:57:40 +0000 (20:57 +0000)]
- Added support for reflecting the DOUBLE PRECISION type,
via a new postgres.PGDoublePrecision object.
This is postgresql.DOUBLE_PRECISION in 0.6.
[ticket:1085]
Mike Bayer [Wed, 16 Sep 2009 20:35:27 +0000 (20:35 +0000)]
- move the tests to test_query
- the option needs the original mapper to pull the prop from, in the case the eagerload is *from* a joined-table subclass mapper.
had to change the contract of PropertyOption to pass
an additional list "mappers" which contains the actual parent mappers.
Mike Bayer [Fri, 28 Aug 2009 20:29:39 +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 [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]
Mike Bayer [Fri, 17 Jul 2009 15:10:54 +0000 (15:10 +0000)]
- Fixed a bug in extract() introduced in 0.5.4 whereby
the string "field" argument was getting treated as a
ClauseElement, causing various errors within more
complex SQL transformations.
Mike Bayer [Fri, 10 Jul 2009 20:01:56 +0000 (20:01 +0000)]
- Fixed potential memory leak whereby previously pickled objects
placed back in a session would not be fully garbage collected
unless the Session were explicitly closed out.
Mike Bayer [Tue, 7 Jul 2009 17:17:22 +0000 (17:17 +0000)]
- Fixed a bug involving contains_eager(), which would apply itself
to a secondary (i.e. lazy) load in a particular rare case,
producing cartesian products. improved the targeting
of query.options() on secondary loads overall [ticket:1461].
Mike Bayer [Fri, 3 Jul 2009 15:31:29 +0000 (15:31 +0000)]
Session.mapper is now *deprecated*.
Call session.add() if you'd like a free-standing object to be
part of your session. Otherwise, a DIY version of
Session.mapper is now documented at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
The method will remain deprecated throughout 0.6.
M test/ext/test_declarative.py
M test/orm/test_scoping.py
M lib/sqlalchemy/orm/scoping.py
M CHANGES
Mike Bayer [Tue, 16 Jun 2009 19:23:43 +0000 (19:23 +0000)]
- Trimmed the pickle format for InstanceState which should further
reduce the memory footprint of pickled instances. The format
should be backwards compatible with that of 0.5.4 and previous.
Mike Bayer [Sat, 13 Jun 2009 03:31:30 +0000 (03:31 +0000)]
- The "foreign_keys" argument of relation() will now propagate
automatically to the backref in the same way that
primaryjoin and secondaryjoin do. For the extremely
rare use case where the backref of a relation() has
intentionally different "foreign_keys" configured, both sides
now need to be configured explicity (if they do in fact require
this setting, see the next note...).
- ...the only known (and really, really rare) use case where a
different foreign_keys setting was used on the forwards/backwards
side, a composite foreign key that partially points to its own
columns, has been enhanced such that the fk->itself aspect of the
relation won't be used to determine relation direction.
Mike Bayer [Fri, 5 Jun 2009 21:23:11 +0000 (21:23 +0000)]
- Fixed Query being able to join() from individual columns of
a joined-table subclass entity, i.e.
query(SubClass.foo, SubcClass.bar).join(<anything>).
In most cases, an error "Could not find a FROM clause to join
from" would be raised. In a few others, the result would be
returned in terms of the base class rather than the subclass -
so applications which relied on this erroneous result need to be
adjusted. [ticket:1431]
Mike Bayer [Mon, 1 Jun 2009 22:42:14 +0000 (22:42 +0000)]
- Fixed another 0.5.4 bug whereby mutable attributes (i.e. PickleType)
wouldn't be deserialized correctly when the whole object
was serialized. [ticket:1426]
Mike Bayer [Fri, 29 May 2009 18:56:50 +0000 (18:56 +0000)]
- sql
- Removed an obscure feature of execute() (including connection,
engine, Session) whereby a bindparam() construct can be sent as
a key to the params dictionary. This usage is undocumented
and is at the core of an issue whereby the bindparam() object
created implicitly by a text() construct may have the same
hash value as a string placed in the params dictionary and
may result in an inappropriate match when computing the final
bind parameters. Internal checks for this condition would
add significant latency to the critical task of parameter
rendering, so the behavior is removed. This is a backwards
incompatible change for any application that may have been
using this feature, however the feature has never been
documented.
Mike Bayer [Tue, 26 May 2009 01:00:46 +0000 (01:00 +0000)]
- added unit test for exception formatting
- Deprecated the hardcoded TIMESTAMP function, which when
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
This breaks on some platforms as Postgres doesn't allow
bind parameters to be used in this context. The hard-coded
uppercase is also inappropriate and there's lots of other
PG casts that we'd need to support. So instead, use
text constructs i.e. select(["timestamp '12/05/09'"]).
Mike Bayer [Sun, 17 May 2009 22:58:21 +0000 (22:58 +0000)]
- Back-ported the "compiler" extension from SQLA 0.6. This
is a standardized interface which allows the creation of custom
ClauseElement subclasses and compilers. In particular it's
handy as an alternative to text() when you'd like to
build a construct that has database-specific compilations.
See the extension docs for details.