:released: Fri Dec 09 2011
.. change::
:tags: orm, bug
:tickets: 2315
Fixed backref behavior when "popping" the
value off of a many-to-one in response to
a removal from a stale one-to-many - the operation
is skipped, since the many-to-one has since
been updated.
.. change::
:tags: orm, bug
:tickets: 2264
After some years of not doing this, added
more granularity to the "is X a parent of Y"
functionality, which is used when determining
if the FK on "Y" needs to be "nulled out" as well
as if "Y" should be deleted with delete-orphan
cascade. The test now takes into account the
Python identity of the parent as well its identity
key, to see if the last known parent of Y is
definitely X. If a decision
can't be made, a StaleDataError is raised. The
conditions where this error is raised are fairly
rare, requiring that the previous parent was
garbage collected, and previously
could very well inappropriately update/delete
a record that's since moved onto a new parent,
though there may be some cases where
"silent success" occurred previously that will now
raise in the face of ambiguity.
Expiring "Y" resets the "parent" tracker, meaning
X.remove(Y) could then end up deleting Y even
if X is stale, but this is the same behavior
as before; it's advised to expire X also in that
case.
.. change::
:tags: orm, bug
:tickets: 2310
fixed inappropriate evaluation of user-mapped
object in a boolean context within query.get(). Also in 0.6.9.
.. change::
:tags: orm, bug
:tickets: 2304
Added missing comma to PASSIVE_RETURN_NEVER_SET
symbol
.. change::
:tags: orm, bug
:tickets: 1776
Cls.column.collate("some collation") now
works. Also in 0.6.9
.. change::
:tags: orm, bug
:tickets: 2309
the value of a composite attribute is now
expired after an insert or update operation, instead
of regenerated in place. This ensures that a
column value which is expired within a flush
will be loaded first, before the composite
is regenerated using that value.
.. change::
:tags: orm, bug
:tickets: 2309, 2308
The fix in also emits the
"refresh" event when the composite value is
loaded on access, even if all column
values were already present, as is appropriate.
This fixes the "mutable" extension which relies
upon the "load" event to ensure the _parents
dictionary is up to date, fixes.
Thanks to Scott Torborg for the test case here.
.. change::
:tags: orm, bug
:tickets: 2312
Fixed bug whereby a subclass of a subclass
using concrete inheritance in conjunction with
the new ConcreteBase or AbstractConcreteBase
would fail to apply the subclasses deeper than
one level to the "polymorphic loader" of each
base
.. change::
:tags: orm, bug
:tickets: 2312
Fixed bug whereby a subclass of a subclass
using the new AbstractConcreteBase would fail
to acquire the correct "base_mapper" attribute
when the "base" mapper was generated, thereby
causing failures later on.
.. change::
:tags: orm, bug
:tickets: 2316
Fixed bug whereby column_property() created
against ORM-level column could be treated as
a distinct entity when producing certain
kinds of joined-inh joins.
.. change::
:tags: orm, bug
:tickets: 2297
Fixed the error formatting raised when
a tuple is inadvertently passed to session.query(). Also in 0.6.9.
.. change::
:tags: orm, bug
:tickets: 2328
Calls to query.join() to a single-table
inheritance subclass are now tracked, and
are used to eliminate the additional WHERE..
IN criterion normally tacked on with single
table inheritance, since the join should
accommodate it. This allows OUTER JOIN
to a single table subclass to produce
the correct results, and overall will produce
fewer WHERE criterion when dealing with
single table inheritance joins.
.. change::
:tags: orm, bug
:tickets: 2339
__table_args__ can now be passed as
an empty tuple as well as an empty dict.. Thanks to Fayaz Yusuf Khan
for the patch.
.. change::
:tags: orm, bug
:tickets: 2325
Updated warning message when setting
delete-orphan without delete to no longer
refer to 0.6, as we never got around to
upgrading this to an exception. Ideally
this might be better as an exception but
it's not critical either way.
.. change::
:tags: orm, feature
:tickets: 2345, 2238
polymorphic_on now accepts many
new kinds of values:
* standalone expressions that aren't
otherwise mapped
* column_property() objects
* string names of any column_property()
or attribute name of a mapped Column
The docs include an example using
the case() construct, which is likely to be
a common constructed used here. and part of
Standalone expressions in polymorphic_on
propagate to single-table inheritance
subclasses so that they are used in the
WHERE /JOIN clause to limit rows to that
subclass as is the usual behavior.
.. change::
:tags: orm, feature
:tickets: 2301
IdentitySet supports the - operator
as the same as difference(), handy when dealing
with Session.dirty etc.
.. change::
:tags: orm, feature
:tickets:
Added new value for Column autoincrement
called "ignore_fk", can be used to force autoincrement
on a column that's still part of a ForeignKeyConstraint.
New example in the relationship docs illustrates
its use.
.. change::
:tags: orm, bug
:tickets:
Fixed bug in get_history() when referring
to a composite attribute that has no value;
added coverage for get_history() regarding
composites which is otherwise just a userland
function.
.. change::
:tags: bug, sql
:tickets: 2316, 2261
related to, made some
adjustments to the change from
regarding the "from" list on a select(). The
_froms collection is no longer memoized, as this
simplifies various use cases and removes the
need for a "warning" if a column is attached
to a table after it was already used in an
expression - the select() construct will now
always produce the correct expression.
There's probably no real-world
performance hit here; select() objects are
almost always made ad-hoc, and systems that
wish to optimize the re-use of a select()
would be using the "compiled_cache" feature.
A hit which would occur when calling select.bind
has been reduced, but the vast majority
of users shouldn't be using "bound metadata"
anyway :).
.. change::
:tags: feature, sql
:tickets: 2166, 1944
The update() construct can now accommodate
multiple tables in the WHERE clause, which will
render an "UPDATE..FROM" construct, recognized by
PostgreSQL and MSSQL. When compiled on MySQL,
will instead generate "UPDATE t1, t2, ..". MySQL
additionally can render against multiple tables in the
SET clause, if Column objects are used as keys
in the "values" parameter or generative method.
.. change::
:tags: feature, sql
:tickets: 77
Added accessor to types called "python_type",
returns the rudimentary Python type object
for a particular TypeEngine instance, if known,
else raises NotImplementedError.
.. change::
:tags: bug, sql
:tickets: 2261, 2319
further tweak to the fix from,
so that generative methods work a bit better
off of cloned (this is almost a non-use case though).
In particular this allows with_only_columns()
to behave more consistently. Added additional
documentation to with_only_columns() to clarify
expected behavior, which changed as a result
of.
.. change::
:tags: engine, bug
:tickets: 2317
Fixed bug whereby transaction.rollback()
would throw an error on an invalidated
connection if the transaction were a
two-phase or savepoint transaction.
For plain transactions, rollback() is a no-op
if the connection is invalidated, so while
it wasn't 100% clear if it should be a no-op,
at least now the interface is consistent.
.. change::
:tags: feature, schema
:tickets:
Added new support for remote "schemas":
.. change::
:tags: schema
:tickets:
MetaData() accepts "schema" and "quote_schema"
arguments, which will be applied to the same-named
arguments of a Table
or Sequence which leaves these at their default
of ``None``.
.. change::
:tags: schema
:tickets:
Sequence accepts "quote_schema" argument
.. change::
:tags: schema
:tickets:
tometadata() for Table will use the "schema"
of the incoming MetaData for the new Table
if the schema argument is explicitly "None"
.. change::
:tags: schema
:tickets:
Added CreateSchema and DropSchema DDL
constructs - these accept just the string
name of a schema and a "quote" flag.
.. change::
:tags: schema
:tickets:
When using default "schema" with MetaData,
ForeignKey will also assume the "default" schema
when locating remote table. This allows the "schema"
argument on MetaData to be applied to any
set of Table objects that otherwise don't have
a "schema".
.. change::
:tags: schema
:tickets: 1679
a "has_schema" method has been implemented
on dialect, but only works on PostgreSQL so far.
Courtesy Manlio Perillo.
.. change::
:tags: feature, schema
:tickets: 1410
The "extend_existing" flag on Table
now allows for the reflection process to take
effect for a Table object that's already been
defined; when autoload=True and extend_existing=True
are both set, the full set of columns will be
reflected from the Table which will then
*overwrite* those columns already present,
rather than no activity occurring. Columns that
are present directly in the autoload run
will be used as always, however.
.. change::
:tags: bug, schema
:tickets:
Fixed bug whereby TypeDecorator would
return a stale value for _type_affinity, when
using a TypeDecorator that "switches" types,
like the CHAR/UUID type.
.. change::
:tags: bug, schema
:tickets:
Fixed bug whereby "order_by='foreign_key'"
option to Inspector.get_table_names
wasn't implementing the sort properly, replaced
with the existing sort algorithm
.. change::
:tags: bug, schema
:tickets: 2305
the "name" of a column-level CHECK constraint,
if present, is now rendered in the CREATE TABLE
statement using "CONSTRAINT <name> CHECK <expression>".
.. change::
:tags: pyodbc, bug
:tickets: 2318
pyodbc-based dialects now parse the
pyodbc accurately as far as observed
pyodbc strings, including such gems
as "py3-3.0.1-beta4"
.. change::
:tags: postgresql, bug
:tickets: 2311
PostgreSQL dialect memoizes that an ENUM of a
particular name was processed
during a create/drop sequence. This allows
a create/drop sequence to work without any
calls to "checkfirst", and also means with
"checkfirst" turned on it only needs to
check for the ENUM once.
.. change::
:tags: postgresql, feature
:tickets:
Added create_type constructor argument
to pg.ENUM. When False, no CREATE/DROP or
checking for the type will be performed as part
of a table create/drop event; only the
create()/drop)() methods called directly
will do this. Helps with Alembic "offline"
scripts.
.. change::
:tags: mssql, feature
:tickets: 822
lifted the restriction on SAVEPOINT
for SQL Server. All tests pass using it,
it's not known if there are deeper issues
however.
.. change::
:tags: mssql, bug
:tickets: 2336
repaired the with_hint() feature which
wasn't implemented correctly on MSSQL -
usually used for the "WITH (NOLOCK)" hint
(which you shouldn't be using anyway !
use snapshot isolation instead :) )
.. change::
:tags: mssql, bug
:tickets: 2318
use new pyodbc version detection for
_need_decimal_fix option.
.. change::
:tags: mssql, bug
:tickets: 2343
don't cast "table name" as NVARCHAR
on SQL Server 2000. Still mostly in the dark
what incantations are needed to make PyODBC
work fully with FreeTDS 0.91 here, however.
.. change::
:tags: mssql, bug
:tickets: 2269
Decode incoming values when retrieving
list of index names and the names of columns
within those indexes.
.. change::
:tags: bug, mysql
:tickets:
Unicode adjustments allow latest pymysql
(post 0.4) to pass 100% on Python 2.
.. change::
:tags: ext, feature
:tickets:
Added an example to the hybrid docs
of a "transformer" - a hybrid that returns a
query-transforming callable in combination
with a custom comparator. Uses a new method
on Query called with_transformation(). The use
case here is fairly experimental, but only
adds one line of code to Query.
.. change::
:tags: ext, bug
:tickets:
the compiles decorator raises an
informative error message when no "default"
compilation handler is present, rather
than KeyError.
.. change::
:tags: examples, bug
:tickets:
Fixed bug in history_meta.py example where
the "unique" flag was not removed from a
single-table-inheritance subclass which
generates columns to put up onto the base.
.. changelog::