Mike Bayer [Tue, 6 Apr 2010 16:27:01 +0000 (12:27 -0400)]
- Further reworked the "mixin" logic in declarative to
additionally allow __mapper_args__ as a @classproperty
on a mixin, such as to dynamically assign polymorphic_identity.
Mike Bayer [Mon, 5 Apr 2010 21:49:58 +0000 (17:49 -0400)]
so here is kind of the idea. but it doesn't work like it used to.
so I think I want to try to build a smarter "find everything without a dependency"
system that is more inline with how this is running now anyway - i.e.
go through the whole list, find nodes with no dependencies. maybe the
original topological.sort() can do that, not sure.
Mike Bayer [Mon, 5 Apr 2010 21:24:00 +0000 (17:24 -0400)]
looks like most of the issues are because we're losing insert ordering
on cycles. so lets reintroduce the organize as tree component, which
works here. still need to make it meaningful by teaching the save/delete state
actions to receive a set of items to match up
Mike Bayer [Mon, 5 Apr 2010 20:52:56 +0000 (16:52 -0400)]
- many-to-many is up.
- now running on the full suite of tests. unsurprisingly, it appears
there are subtle self-referential issues causing many tests to fail.
Mike Bayer [Mon, 5 Apr 2010 18:53:19 +0000 (14:53 -0400)]
these are some assertions that would make things easier, if they can be maintained.
otherwise, if listonly can go from True to False, then there's the whole cascades issue
to deal with, same for delete moving from False to True and vice versa.
Mike Bayer [Mon, 5 Apr 2010 18:49:35 +0000 (14:49 -0400)]
- enabled the DetectKeySwitch, and additionally added that it need
not execute at all when a one-to-many is present on the reverse side.
- OneToMany can establish a state as "listonly" when passive_updates are enabled
and the change is due to key switch.
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]