Mike Bayer [Tue, 30 Mar 2010 23:19:41 +0000 (19:19 -0400)]
This is turning out to be a rewrite of the accounting system of unitofwork.py, but the overarching
method of doing things stays the same. it should be easy to add new dependencies
between actions and to change the structure of how things are done.
Mike Bayer [Tue, 30 Mar 2010 14:39:36 +0000 (10:39 -0400)]
- the compiler extension now allows @compiles decorators
on base classes that extend to child classes, @compiles
decorators on child classes that aren't broken by a
@compiles decorator on the base class.
Mike Bayer [Mon, 29 Mar 2010 21:56:02 +0000 (17:56 -0400)]
- Session.refresh() now does an equivalent expire()
on the given instance first, so that the "refresh-expire"
cascade is propagated. Previously, refresh() was
not affected in any way by the presence of "refresh-expire"
cascade. This is a change in behavior versus that
of 0.6beta2, where the "lockmode" flag passed to refresh()
would cause a version check to occur. Since the instance
is first expired, refresh() always upgrades the object
to the most recent version.
- The 'refresh-expire' cascade, when reaching a pending object,
will expunge the object if the cascade also includes
"delete-orphan", or will simply detach it otherwise.
[ticket:1754]
Mike Bayer [Sun, 28 Mar 2010 20:41:10 +0000 (16:41 -0400)]
- A collection lazy load will switch off default
eagerloading on the reverse many-to-one side, since
that loading is by definition unnecessary. [ticket:1495]
Mike Bayer [Sat, 27 Mar 2010 21:27:28 +0000 (17:27 -0400)]
- No longer guessing that TINYINT(1) should be BOOLEAN
when reflecting - TINYINT(1) is returned. Use Boolean/
BOOLEAN in table definition to get boolean conversion
behavior. [ticket:1752]
Mike Bayer [Sat, 27 Mar 2010 21:18:53 +0000 (17:18 -0400)]
- Added with_hint() method to Query() construct. This calls
directly down to select().with_hint() and also accepts
entities as well as tables and aliases. See with_hint() in the
SQL section below. [ticket:921]
- Added with_hint() method to select() construct. Specify
a table/alias, hint text, and optional dialect name, and
"hints" will be rendered in the appropriate place in the
statement. Works for Oracle, Sybase, MySQL. [ticket:921]
Mike Bayer [Fri, 26 Mar 2010 20:47:53 +0000 (14:47 -0600)]
mssql+mxodbc should use executedirect for all selects and execute for insert/update/delete. To support this, an is_crud property has been added to the DefaultExecutionContext. The behavior is forcable either way per execution using execution_options(native_odbc_parameters=True|False). Some tests have been added to demonstrate usage. (patch by zzzeek committed by bradallen)
Mike Bayer [Fri, 26 Mar 2010 19:16:00 +0000 (15:16 -0400)]
- Using @classdecorator and similar on mixins to define
__tablename__, __table_args__, etc. now works if
the method references attributes on the ultimate
subclass. [ticket:1749]
Mike Bayer [Fri, 26 Mar 2010 16:03:54 +0000 (12:03 -0400)]
- the TIME and TIMESTAMP types are now availble from the
postgresql dialect directly, which add the PG-specific
argument 'precision' to both. 'precision' and
'timezone' are correctly reflected for both TIME and
TIMEZONE types. [ticket:997]
Mike Bayer [Thu, 25 Mar 2010 22:26:11 +0000 (22:26 +0000)]
- The Oracle dialect will issue VARCHAR type definitions
using character counts, i.e. VARCHAR2(50 CHAR), so that
the column is sized in terms of characters and not bytes.
Column reflection of character types will also use
ALL_TAB_COLUMNS.CHAR_LENGTH instead of
ALL_TAB_COLUMNS.DATA_LENGTH. Both of these behaviors take
effect when the server version is 9 or higher - for
version 8, the old behaviors are used. [ticket:1744]
Mike Bayer [Wed, 24 Mar 2010 23:19:03 +0000 (19:19 -0400)]
- converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples
- fixed beaker/advanced.py to reference RelationshipCache
Mike Bayer [Wed, 24 Mar 2010 23:11:01 +0000 (19:11 -0400)]
- To accomodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all(). The
old names will remain as synonyms for the foreseeable future.
- The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select". The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.
- Added documentation to tutorial,mapper doc, api docs
for subqueryload, subqueryload_all, and other options.
Mike Bayer [Wed, 24 Mar 2010 21:54:52 +0000 (17:54 -0400)]
- made final refinements to the feature and we are 100% go on subquery loading.
- Query.join(Cls.propname, from_joinpoint=True) will check more
carefully that "Cls" is compatible with the current joinpoint,
and act the same way as Query.join("propname", from_joinpoint=True)
in that regard.
Mike Bayer [Wed, 24 Mar 2010 16:46:58 +0000 (12:46 -0400)]
this version works with *all* the polymorphic scenarios by putting the subquery into
an aliased(), so that it can be controlled. self ref breaks now. will move the
joining out to use orm.join().
Mike Bayer [Tue, 23 Mar 2010 18:54:26 +0000 (14:54 -0400)]
- Fixed bug in Query whereby the usage of aliased() constructs
would fail if the underlying table (but not the actual alias)
were referenced inside the subquery generated by
q.from_self() or q.select_from().
Mike Bayer [Tue, 23 Mar 2010 00:15:50 +0000 (20:15 -0400)]
- Fixed bug which affected all eagerload() and similar options
such that "remote" eager loads, i.e. eagerloads off of a lazy
load such as query(A).options(eagerload(A.b, B.c))
wouldn't eagerload anything, but using eagerload("b.c") would
work fine.
- subquery eagerloading very close
Mike Bayer [Mon, 22 Mar 2010 17:16:21 +0000 (13:16 -0400)]
- Fixed bug in Query whereby calling q.join(prop).from_self(...).
join(prop) would fail to render the second join outside the
subquery, when joining on the same criterion as was on the
inside.
Brad Allen [Sun, 21 Mar 2010 04:00:51 +0000 (22:00 -0600)]
For cases when mxODBC's cursor.execute can't do the job, raise a warning and fall back on cursor.executedirect which is less picky. This causes a drastic improvement in passing tests.
Mike Bayer [Sat, 20 Mar 2010 01:12:29 +0000 (21:12 -0400)]
- Fixed bug whereby calling query(A).join(A.bs).add_entity(B)
in a joined inheritance scenario would double-add B as a
target and produce an invalid query. [ticket:1188]
Mike Bayer [Fri, 19 Mar 2010 21:51:50 +0000 (17:51 -0400)]
- StaticPool now initializes, disposes and recreates without
opening a new connection - the connection is only opened when
first requested. dispose() also works on AssertionPool now.
[ticket:1728]
Mike Bayer [Fri, 19 Mar 2010 20:59:52 +0000 (16:59 -0400)]
start sketching ideas for a rewritten unit of work.
the basic idea is to bring topological back down to the raw function,
then the whole UOW constructs itself as very fine grained elements with
full dependencies to each other. then a straight execute with a straight sort.
the hope is that the mechanism here would be vastly simpler. while
the presence of a large number of fine-grained records may be expensive
it still is potentially a lot easier to distill into C code, as the
uow's structure now consists of data.
Mike Bayer [Fri, 19 Mar 2010 19:30:48 +0000 (15:30 -0400)]
- join() will now simulate a NATURAL JOIN by default. Meaning,
if the left side is a join, it will attempt to join the right
side to the rightmost side of the left first, and not raise
any exceptions about ambiguous join conditions if successful
even if there are further join targets across the rest of
the left. [ticket:1714]