Mike Bayer [Sun, 4 Apr 2010 16:24:01 +0000 (12:24 -0400)]
- further reduce what topological has to do, expects full list of nodes
- fix some side-effect-dependent behaviors in uow. we can now
unconditionally remove "disabled" actions without rewriting
Mike Bayer [Sun, 4 Apr 2010 14:18:16 +0000 (10:18 -0400)]
- apparently [ticket:1761] was covered in tests already.
- Usage of version_id_col on a backend that supports
cursor.rowcount for execute() but not executemany() now works
when a delete is issued (already worked for saves, since those
don't use executemany()). For a backend that doesn't support
cursor.rowcount at all, a warning is emitted the same
as with saves. [ticket:1761]
Mike Bayer [Sat, 3 Apr 2010 21:03:12 +0000 (17:03 -0400)]
- basic inheritance behavior
- we do need dependencies between an object and its dep when the other object
has no save or delete pending. the other object
like before isn't needed, but right now we make the dependency just 'None',
and it gets thrown away.
Mike Bayer [Sat, 3 Apr 2010 19:33:55 +0000 (15:33 -0400)]
- Now using cx_oracle output converters so that the
DBAPI returns natively the kinds of values we prefer:
- NUMBER values with positive precision + scale convert
to cx_oracle.STRING and then to Decimal. This
allows perfect precision for the Numeric type when
using cx_oracle. [ticket:1759]
- STRING/FIXED_CHAR now convert to unicode natively.
SQLAlchemy's String types then don't need to
apply any kind of conversions.
Mike Bayer [Sat, 3 Apr 2010 14:58:13 +0000 (10:58 -0400)]
- the Numeric type raises an *enormous* warning when expected
to convert floats to Decimal from a DBAPI that returns floats.
This includes SQLite, Oracle, Sybase, MS-SQL.
[ticket:1759]
Mike Bayer [Fri, 2 Apr 2010 21:22:16 +0000 (17:22 -0400)]
- The ORM will set the docstring of all generated descriptors
to None by default. This can be overridden using 'doc'
(or if using Sphinx, attribute docstrings work too).
- Added kw argument 'doc' to all mapper property callables
as well as Column(). Will assemble the string 'doc' as
the '__doc__' attribute on the descriptor.
Mike Bayer [Fri, 2 Apr 2010 17:10:55 +0000 (13:10 -0400)]
- Updated attribute_shard.py example to use a more robust
method of searching a Query for binary expressions which
compare columns against literal values.
Mike Bayer [Wed, 31 Mar 2010 17:01:40 +0000 (13:01 -0400)]
- Restored some bind-labeling logic from 0.5 which ensures
that tables with column names that overlap another column
of the form "<tablename>_<columnname>" won't produce
errors if column._label is used as a bind name during
an UPDATE. Test coverage which wasn't present in 0.5
has been added. [ticket:1755]
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