Mike Bayer [Thu, 17 May 2007 22:33:52 +0000 (22:33 +0000)]
- the "primary_key" argument to mapper() is propigated to the "polymorphic"
mapper. primary key columns in this list get normalized to that of the mapper's
local table.
Mike Bayer [Thu, 17 May 2007 15:11:34 +0000 (15:11 +0000)]
- fix to select_by(<propname>=<object instance>) -style joins in conjunction
with many-to-many relationships, bug introduced in r2556
- the "reverse_direction" flag in _create_lazy_clause works correctly for a many-to-many
relationship (i.e. the reverse is on which clause, not which column in the clause, in the
case of m2m)
Mike Bayer [Mon, 14 May 2007 22:25:36 +0000 (22:25 +0000)]
- parenthesis are applied to clauses via a new _Grouping construct.
uses operator precedence to more intelligently apply parenthesis
to clauses, provides cleaner nesting of clauses (doesnt mutate
clauses placed in other clauses, i.e. no 'parens' flag)
- added 'modifier' keyword, works like func.<foo> except does not
add parenthesis. e.g. select([modifier.DISTINCT(...)]) etc.
Mike Bayer [Fri, 4 May 2007 18:27:12 +0000 (18:27 +0000)]
- many-to-many relationships properly set the type of bind params
for delete operations on the association table
- many-to-many relationships check that the number of rows deleted
from the association table by a delete operation matches the expected
results
Mike Bayer [Fri, 4 May 2007 01:54:34 +0000 (01:54 +0000)]
clarifying some cascade-based unit tests, adding a little more coverage,
and trying to remove unneeded parts of dependency.py cascades.
also de-emphasizing the whole session.flush([oneobject]) thing since i dont really
agree it should be supported
Mike Bayer [Thu, 3 May 2007 22:31:52 +0000 (22:31 +0000)]
- _Label class overrides compare_self to return its ultimate object.
meaning, if you say someexpr.label('foo') == 5, it produces
the correct "someexpr == 5".
Jason Kirtland [Wed, 2 May 2007 00:41:52 +0000 (00:41 +0000)]
- MySQL ENUM types can now optionally ensure that values are within the
enum's allowed range on insert and update, with strict=True
- Added new 'dialect' category of unit tests, and migrated MySQL-specific
dialect tests there.
- Noted the max identifier length in the MySQL dialect (the max alias length,
actually)
Jason Kirtland [Tue, 1 May 2007 00:05:47 +0000 (00:05 +0000)]
- allow MySQL column-level CHARACTER SET and COLLATE, plus shortcuts like
ASCII, UNICODE, and BINARY. support NATIONAL.
- added MySQL-specific reserved words
- added tests for MySQL numeric and string column DDL generation
- various minor cleanups, also tweak regex to not break emacs syntax hilighting
Mike Bayer [Sun, 29 Apr 2007 22:26:39 +0000 (22:26 +0000)]
- restored old "column_property()" ORM function (used to be called
"column()") to force any column expression to be added as a property
on a mapper, particularly those that aren't present in the mapped
selectable. this allows "scalar expressions" of any kind to be
added as relations (though they have issues with eager loads).
Mike Bayer [Sun, 29 Apr 2007 21:33:05 +0000 (21:33 +0000)]
- the label() method on ColumnElement will properly propigate the
TypeEngine of the base element out to the label, including a label()
created from a scalar=True select() statement.
Mike Bayer [Sun, 29 Apr 2007 20:08:55 +0000 (20:08 +0000)]
- mysql uses "DESCRIBE [<schemaname>].<tablename>", catching exceptions
if table doesnt exist, in order to determine if a table exists.
this supports unicode table names as well as schema names. tested
with MySQL5 but should work with 4.1 series as well. (#557)
Rick Morrison [Sun, 29 Apr 2007 20:00:43 +0000 (20:00 +0000)]
- mssql: replace "select @@identity" with "select @@scope_identity". Should help avoid returning wrong ID when insert triggers are used. Also add unit test (thanks paj)
- mssql: if no db-api module specified, probe in the order [pyodbc, pymssql, adodbapi]
Mike Bayer [Fri, 27 Apr 2007 17:19:39 +0000 (17:19 +0000)]
- the usual adjustments to relationships between inheriting mappers,
in this case establishing relation()s to subclass mappers where
the join conditions come from the superclass' table
- specifically, places where PropertyLoader limits its search to mapper.local_table had to be expanded
to search separately within mapper.mapped_table as well. in the case of determining primary/secondaryjoin, it starts more specifically first with local table then out to mapped table if not found. in the case of determining direction, it starts more generally with mapped table, then if ambiguous direction, goes to the local tables.
Mike Bayer [Thu, 26 Apr 2007 18:04:09 +0000 (18:04 +0000)]
- generative test doesnt apply to mysql, others
- refactoring to unitofwork.py. low-hanging cruft
removed, UOWTask structure simplified particuularly with the
per-instance sort phase, most methods docstring'ed extensively.
this is a merge from the 'uowsimplify' branch. (only slightly simpler, tho)
- mapper delete_obj works across multiple mappers to be consistent
with the operation of save_obj
Mike Bayer [Thu, 26 Apr 2007 16:25:13 +0000 (16:25 +0000)]
- _with_parent_criterion generalized into _with_lazy_criterion
- _create_lazy_clause now includes a 'reverse_direction' flag to generate lazy criterion
in from parent->child or vice versa
- changed join_by() in query to use the "reverse" _create_lazy_clause for instance comparisons
so conditions like AND can work [ticket:554]
Mike Bayer [Tue, 24 Apr 2007 21:33:07 +0000 (21:33 +0000)]
- fix to case() construct to propigate the type of the first
WHEN condition as the return type of the case statement
- various unit test tweaks to get oracle working
Mike Bayer [Sat, 21 Apr 2007 23:29:03 +0000 (23:29 +0000)]
- informix support added ! courtesy James Zhang
- tweak to oracle default execution code to use local connection for compilation
- tweak to connection.execute_text() to generate None for parameters when no params sent
Jason Kirtland [Thu, 19 Apr 2007 23:44:26 +0000 (23:44 +0000)]
- Promoted mysql's dburl query string helper to util + fixed
- Coercing sqlite connect args provided in query string to their expected type
(e.g. 'timeout' as float, fixes #544)
- Coerce mysql's client_flag to int too
Jason Kirtland [Thu, 19 Apr 2007 19:07:51 +0000 (19:07 +0000)]
- fixed issue where slice assignment on relation properties truncates the relation (#529)
- fix for #530, don't require collection classes to respond to len requests
Mike Bayer [Wed, 18 Apr 2007 22:54:40 +0000 (22:54 +0000)]
- the "where" criterion of an update() and delete() now correlates
embedded select() statements against the table being updated or
deleted. this works the same as nested select() statement
correlation, and can be disabled via the correlate=False flag on
the embedded select().
Mike Bayer [Wed, 18 Apr 2007 22:33:53 +0000 (22:33 +0000)]
- fixed critical issue when, after options(eagerload()) is used,
the mapper would then always apply query "wrapping" behavior
for all subsequent LIMIT/OFFSET/DISTINCT queries, even if no
eager loading was applied on those subsequent queries.
Mike Bayer [Tue, 17 Apr 2007 20:49:35 +0000 (20:49 +0000)]
- the dialects within sqlalchemy.databases become a setuptools
entry points. loading the built-in database dialects works the
same as always, but if none found will fall back to trying
pkg_resources to load an external module [ticket:521]