Mike Bayer [Sun, 4 Feb 2007 03:43:22 +0000 (03:43 +0000)]
- added literal_column() to specify a column clause that should not undergo any quoting
- straight text sent to select() added as literal_column
- fix for issue in [ticket:450]
Mike Bayer [Sun, 4 Feb 2007 03:12:27 +0000 (03:12 +0000)]
- more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals)
- got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests
to pass in non-mysql system for [ticket:457]. all the dialects should be changed to pass in their usual
paramstyle.
Mike Bayer [Fri, 2 Feb 2007 18:18:31 +0000 (18:18 +0000)]
- added a "supports_execution()" method to ClauseElement, so that individual
kinds of clauses can express if they are appropriate for executing...such as,
you can execute a "select", but not a "Table" or a "Join".
Mike Bayer [Thu, 1 Feb 2007 21:38:16 +0000 (21:38 +0000)]
- clear_mappers() just blows away all of ArgSingleton for now
- lazy clause goes against parent.mapped_table instead of parent.local_table,
helps it to recognize self-referential condition between a descendant joined-table-inheritance mapper
Mike Bayer [Thu, 1 Feb 2007 03:18:08 +0000 (03:18 +0000)]
- the "polymorphic_primaryjoin" again goes against the parent's non-polymorphic local table.
lazy load clause evaluation is plenty solid enough to handle it this time.
- the join_to() method on PropertyLoader takes the parent mapper as an argument and alisiazes
the primaryjoin against that mapper's selectable, so that the same primary join can be used against
the base mapper, any inheriting mapper, etc., whether or not it uses a polymorphic union (although
needs to be tested against alternate polymorphic unions added on subclasses). fixes [ticket:448]
Mike Bayer [Thu, 1 Feb 2007 01:47:54 +0000 (01:47 +0000)]
- improved support for complex queries embedded into "where" criterion
for query.select() [ticket:449]
- contains_eager('foo') automatically implies eagerload('foo')
- query.options() can take a combiantion MapperOptions and tuples of MapperOptions,
so that functions can return groups
- refactoring to Aliasizer and ClauseAdapter so that they share a common base methodology,
which addresses all sql.ColumnElements instead of just schema.Column. common list-processing
methods added.
- query.compile and eagerloader._aliasize_orderby make usage of improved list processing on
above.
- query.compile, within the "nested select generate" step processes the order_by clause using
the ClauseAdapter instead of Aliasizer since there is only one "target"
Mike Bayer [Tue, 30 Jan 2007 01:01:22 +0000 (01:01 +0000)]
further work on insuring clear_mappers() really works. assignmapper identified
as a much trickier thing to clean out. added a unit test so that if any new collections get introduced
we are still testing.
Mike Bayer [Sun, 28 Jan 2007 23:33:53 +0000 (23:33 +0000)]
merged the polymorphic relationship refactoring branch in. i want to go further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far.
- relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin.
- lazy/eagerloaders work from those polymorphic join objects.
- the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly.
- Query builds itself against the base Mapper again, not the "polymorphic" mapper. uses the "polymorphic" version
only as appropriate. this helps join_by/join_to/etc to work with polymorphic mappers.
- Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically.
- quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself).
- the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
Mike Bayer [Wed, 24 Jan 2007 23:37:03 +0000 (23:37 +0000)]
- calling corresponding_column with keys_ok matches columns on name, not key, since
the name is meaningful with regards to SQL relationships, the key is not
- adjustments to the recent polymorphic relationship refactorings, specifically
for many-to-one relationships to polymorphic unions that did not contain the
base table [ticket:439]. the lazy/eager clause adaption to the selectable
will match up on straight column names (i.e. its a more liberal policy)
- lazy loader will not attempt to adapt the clause to the selectable if
loads_polymorphic is not enabled, since the more liberal policy of adapting
columns fails for more elaborate join conditions
- will have to see if ppl want to do complex joins with polymorphic relations...
may have to add "polymorphic_primaryjoin" in that case as a last resort (would make
working around these issues a snap, tho...)
Mike Bayer [Wed, 24 Jan 2007 03:21:26 +0000 (03:21 +0000)]
oracle can conditionally decide if it wants to say "use rowid" in a select statement.
needs to be tweaked vs. when ROW NUMBER OVER ORDER BY is being used, but currently
fixes [ticket:436]
Mike Bayer [Tue, 23 Jan 2007 20:25:48 +0000 (20:25 +0000)]
- *slight* support for binary, but still need to figure out how to insert reasonably large
values (over 4K). requires auto_setinputsizes=True sent to create_engine(), rows must
be fully fetched individually, etc.
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