Mike Bayer [Sun, 11 Apr 2010 20:37:49 +0000 (16:37 -0400)]
- The functionality of result.rowcount is now disabled
by default, and can be re-enabled using the 'enable_rowcount'
flag with create_engine(), as well as the 'enable_rowcount'
execution context flag on a per-execute basis. This because
cursor.rowcount requires cursor access (can't be evaluated
lazily since the result auto-closes) and also incurs an
expensive round-trip.
Mike Bayer [Sun, 11 Apr 2010 19:37:20 +0000 (15:37 -0400)]
- added a test for the solution in [ticket:1757].
- this does imply that a lot of the "test the RowProxy" tests in sql/test_query might be better off in engine/test_execute or perhaps engine/test_resultproxy
Mike Bayer [Sun, 11 Apr 2010 16:03:41 +0000 (12:03 -0400)]
- somejoin.select(fold_equivalents=True) is no longer
deprecated, and will eventually be rolled into a more
comprehensive version of the feature for [ticket:1729].
Mike Bayer [Thu, 8 Apr 2010 01:00:16 +0000 (21:00 -0400)]
- make it exceedlingly obvious that all topological/unitofwork code is
being rewritten, and nothing here should be consulted for any
future activity.
- underscore current topological methods as their API behavior
is changing, possibly in 0.6.1 if [ticket:1742] remains on track
Mike Bayer [Wed, 7 Apr 2010 19:20:20 +0000 (15:20 -0400)]
- ah. oursql didn't have "extra steps" here, the previous system within execution_options()
used by oursql would generate a proxied connection from within the dialect.initialize() phase. the new
clone system bypasses that.
Mike Bayer [Wed, 7 Apr 2010 17:59:18 +0000 (13:59 -0400)]
- Added new 'compiled_cache' execution option. A dictionary
where Compiled objects will be cached when the Connection
compiles a clause expression into a dialect- and parameter-
specific Compiled object. It is the user's responsibility to
manage the size of this dictionary, which will have keys
corresponding to the dialect, clause element, the column
names within the VALUES or SET clause of an INSERT or UPDATE,
as well as the "batch" mode for an INSERT or UPDATE statement.
Mike Bayer [Wed, 7 Apr 2010 17:42:31 +0000 (13:42 -0400)]
- Fixed bug in execution_options() feature whereby the existing
Transaction and other state information from the parent
connection would not be propagated to the sub-connection.
Mike Bayer [Wed, 7 Apr 2010 16:30:02 +0000 (12:30 -0400)]
- dict_ becomes explicit on _get_state_attr_by_column, _set_state_attr_by_column, others,
to reduce on expensive state.dict calls.
- internal getattr(), setattr(), getcommitted() methods
on ColumnProperty, CompositeProperty, RelationshipProperty
have been underscored, signature has changed.
Mike Bayer [Tue, 6 Apr 2010 22:53:51 +0000 (18:53 -0400)]
- Postgresql now reflects sequence names associated with
SERIAL columns correctly, after the name of of the sequence
has been changed. Thanks to Kumar McMillan for the patch.
[ticket:1071]
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 [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 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 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().