Mike Bayer [Tue, 23 Jan 2007 04:05:07 +0000 (04:05 +0000)]
relationships no longer compile against the "selectable" mapper (i.e. the polymorphic mapper). join conditions, foreign keys etc. are configured against the actual mappers used in the relationship in all cases. the lazy and eager loaders in turn "adapt" their lazy/eager clauses to that of the "selectable" mapper if one is present. this is because the join conditions between the mapper's base tables are *far* easier to work with and detect direction etc. compared to an enormous polymorphic union; dealing with the polymorphic union is pushed further out into select query construction.
Mike Bayer [Sat, 20 Jan 2007 21:00:08 +0000 (21:00 +0000)]
- mysql table create options work on a generic passthru now, i.e. Table(..., mysql_engine='InnoDB',
mysql_collate="latin1_german2_ci", mysql_auto_increment="5", mysql_<somearg>...),
helps [ticket:418]
Mike Bayer [Sat, 20 Jan 2007 12:31:27 +0000 (12:31 +0000)]
- tightened down conditions used to locate "relation direction", associating
the "foreignkey" of the relationship with the "primaryjoin". the column match now
must be exact, not just "corresponding". this enables self-referential relationships on a
polymorphic mapper.
- a little bit of improvement to the concept of a "concrete" inheritance mapping, though that concept
is not well fleshed out yet (added test case to support concrete mappers on top of a polymorphic base).
Mike Bayer [Fri, 19 Jan 2007 20:32:13 +0000 (20:32 +0000)]
- changed "BooleanExpression" to subclass from "BinaryExpression", so that boolean
expressions can also follow column-clause behaviors (i.e. label(), etc).
- query.select() had to become more picky about what it considers to be a full "selectable"
and what it considers to be a fragment that represents a WHERE criterion - looks for the presence
of a FromClause now (which is still pretty liberal, since i originally intended the check to be
for select() only). the previous exception-catch method also added a little stack tracing
overhead anyway.
Mike Bayer [Fri, 19 Jan 2007 02:19:38 +0000 (02:19 +0000)]
- another fix to subquery correlation so that a subquery which has only one FROM
element will *not* correlate that single element, since at least one FROM element is
required in a query.
Mike Bayer [Thu, 18 Jan 2007 03:33:13 +0000 (03:33 +0000)]
- some deeper error checking when compiling relations, to detect an ambiguous "primaryjoin"
in the case that both sides of the relationship have foreign key references in the primary
join condition
Mike Bayer [Mon, 15 Jan 2007 21:54:16 +0000 (21:54 +0000)]
- added optional constructor to sql.ColumnCollection
- mapper sets its "primary_key" attribute to be the ultimately decided primary_key column collection post-compilation
- added compare() method to MapperProperty, defines a comparison operation of the columns represented by the property to some value
- all the above combines into today's controversial feature: saying query.select_by(somerelationname=someinstance) will create the join of the primary key columns represented by "somerelationname"'s mapper to the actual primary key in "someinstance".
- docs for the above
Mike Bayer [Sun, 14 Jan 2007 20:21:36 +0000 (20:21 +0000)]
- postgres cursor option is now server_side_cursors=False; some users get bad results using them
so theyre off by default
- type system slightly modified to support TypeDecorators that can be overridden by the dialect
- added an NVarchar type to mssql (produces NVARCHAR), also MSUnicode which provides Unicode-translation
for the NVarchar regardless of dialect convert_unicode setting.
Mike Bayer [Fri, 12 Jan 2007 01:57:41 +0000 (01:57 +0000)]
- mysql is inconsistent with what kinds of quotes it uses in foreign keys during a
SHOW CREATE TABLE, reflection updated to accomodate for all three styles [ticket:420]
Mike Bayer [Wed, 10 Jan 2007 07:49:37 +0000 (07:49 +0000)]
- postgres no longer uses client-side cursors, uses more efficient server side
cursors via apparently undocumented psycopg2 behavior recently discovered on the
mailing list. disable it via create_engine('postgres://', client_side_cursors=True)
Mike Bayer [Mon, 8 Jan 2007 19:09:02 +0000 (19:09 +0000)]
- the "op()" function is now treated as an "operation", rather than a "comparison".
the difference is, an operation produces a BinaryExpression from which further operations
can occur whereas comparison produces the more restrictive BooleanExpression
Mike Bayer [Sat, 6 Jan 2007 20:32:47 +0000 (20:32 +0000)]
- added a mutex to the mapper compilation step. ive been reluctant to add any kind
of threading anything to SA but this is one spot that its its really needed since mappers
are typically "global", and while their state does not change during normal operation, the
initial compilation step does modify internal state significantly, and this step usually
occurs not at module-level initialization time (unless you call compile()) but at first-request
time
- added "compile_mappers()" function as a shortcut to compiling all mappers
Mike Bayer [Fri, 5 Jan 2007 18:51:23 +0000 (18:51 +0000)]
- default "timezone" setting is now False. this corresponds to Python's datetime
behavior as well as Postgres' timestamp/time types (which is the only timezone-sensitive
dialect at the moment) [ticket:414]
Mike Bayer [Tue, 2 Jan 2007 03:43:09 +0000 (03:43 +0000)]
- added "none" to the list of cascades, although im not sure if we should really allow "none" since it currently doesnt do anything (what should it do, cancel out the other cascades?)
Mike Bayer [Mon, 1 Jan 2007 00:10:37 +0000 (00:10 +0000)]
- global "insure"->"ensure" change. in US english "insure" is actually
largely interchangeable with "ensure" (so says the dictionary), so I'm not
completely illiterate, but its definitely sub-optimal to "ensure" which is
non-ambiguous.
Mike Bayer [Thu, 28 Dec 2006 00:27:58 +0000 (00:27 +0000)]
- fix to correlation of subqueries when the column list of the select statement
is constructed with individual calls to append_column(); this fixes an ORM
bug whereby nested select statements were not getting correlated with the
main select generated by the Query object.
Mike Bayer [Tue, 12 Dec 2006 19:22:28 +0000 (19:22 +0000)]
- fixes to passive_deletes flag, lazy=None (noload) flag
- added example/docs for dealing with large collections
- added object_session() method to sqlalchemy namespace
Mike Bayer [Sat, 9 Dec 2006 04:00:35 +0000 (04:00 +0000)]
- added onupdate and ondelete keyword arguments to ForeignKey; propigate
to underlying ForeignKeyConstraint if present. (dont propigate in the
other direction, however)
- patched attribute speed enhancement [ticket:389] courtesy Sébastien Lelong
Mike Bayer [Sat, 9 Dec 2006 01:08:25 +0000 (01:08 +0000)]
- identity map in Session is by default *no longer weak referencing*.
to have it be weak referencing, use create_session(weak_identity_map=True)
- some fixes to OrderedProperties