Sqlalchemy

Latest version: v2.0.30

Safety actively analyzes 629564 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 38 of 50

0.7.0

Not secure
:released: Fri May 20 2011

.. change::
:tags:
:tickets:

This section documents those changes from 0.7b4
to 0.7.0. For an overview of what's new in
SQLAlchemy 0.7, see
https://docs.sqlalchemy.org/en/latest/changelog/migration_07.html

.. change::
:tags: orm
:tickets: 2069

Fixed regression introduced in 0.7b4 (!) whereby
query.options(someoption("nonexistent name")) would
fail to raise an error. Also added additional
error catching for cases where the option would
try to build off a column-based element, further
fixed up some of the error messages tailored
in

.. change::
:tags: orm
:tickets: 2162

query.count() emits "count(*)" instead of
"count(1)".

.. change::
:tags: orm
:tickets: 2155

Fine tuning of Query clause adaptation when
from_self(), union(), or other "select from
myself" operation, such that plain SQL expression
elements added to filter(), order_by() etc.
which are present in the nested "from myself"
query *will* be adapted in the same way an ORM
expression element will, since these
elements are otherwise not easily accessible.

.. change::
:tags: orm
:tickets: 2149

Fixed bug where determination of "self referential"
relationship would fail with no workaround
for joined-inh subclass related to itself,
or joined-inh subclass related to a subclass
of that with no cols in the sub-sub class
in the join condition.
Also in 0.6.8.

.. change::
:tags: orm
:tickets: 2153

mapper() will ignore non-configured foreign keys
to unrelated tables when determining inherit
condition between parent and child class,
but will raise as usual for unresolved
columns and table names regarding the inherited
table. This is an enhanced generalization of
behavior that was already applied to declarative
previously. 0.6.8 has a more
conservative version of this which doesn't
fundamentally alter how join conditions
are determined.

.. change::
:tags: orm
:tickets: 2144

It is an error to call query.get() when the
given entity is not a single, full class
entity or mapper (i.e. a column). This is
a deprecation warning in 0.6.8.

.. change::
:tags: orm
:tickets: 2148

Fixed a potential KeyError which under some
circumstances could occur with the identity
map, part of

.. change::
:tags: orm
:tickets:

added Query.with_session() method, switches
Query to use a different session.

.. change::
:tags: orm
:tickets: 2131

horizontal shard query should use execution
options per connection as per

.. change::
:tags: orm
:tickets: 2151

a non_primary mapper will inherit the _identity_class
of the primary mapper. This so that a non_primary
established against a class that's normally in an
inheritance mapping will produce results that are
identity-map compatible with that of the primary
mapper (also in 0.6.8)

.. change::
:tags: orm
:tickets: 2163

Fixed the error message emitted for "can't
execute syncrule for destination column 'q';
mapper 'X' does not map this column" to
reference the correct mapper. .
Also in 0.6.8.

.. change::
:tags: orm
:tickets: 1502

polymorphic_union() gets a "cast_nulls" option,
disables the usage of CAST when it renders
the labeled NULL columns.

.. change::
:tags: orm
:tickets:

polymorphic_union() renders the columns in their
original table order, as according to the first
table/selectable in the list of polymorphic
unions in which they appear. (which is itself
an unordered mapping unless you pass an OrderedDict).

.. change::
:tags: orm
:tickets: 2171

Fixed bug whereby mapper mapped to an anonymous
alias would fail if logging were used, due to
unescaped % sign in the alias name.
Also in 0.6.8.

.. change::
:tags: sql
:tickets: 2167

Fixed bug whereby nesting a label of a select()
with another label in it would produce incorrect
exported columns. Among other things this would
break an ORM column_property() mapping against
another column_property(). .
Also in 0.6.8

.. change::
:tags: sql
:tickets:

Changed the handling in determination of join
conditions such that foreign key errors are
only considered between the two given tables.
That is, t1.join(t2) will report FK errors
that involve 't1' or 't2', but anything
involving 't3' will be skipped. This affects
join(), as well as ORM relationship and
inherit condition logic.

.. change::
:tags: sql
:tickets:

Some improvements to error handling inside
of the execute procedure to ensure auto-close
connections are really closed when very
unusual DBAPI errors occur.

.. change::
:tags: sql
:tickets:

metadata.reflect() and reflection.Inspector()
had some reliance on GC to close connections
which were internally procured, fixed this.

.. change::
:tags: sql
:tickets: 2140

Added explicit check for when Column .name
is assigned as blank string

.. change::
:tags: sql
:tickets: 2147

Fixed bug whereby if FetchedValue was passed
to column server_onupdate, it would not
have its parent "column" assigned, added
test coverage for all column default assignment
patterns. also in 0.6.8

.. change::
:tags: postgresql
:tickets:

Fixed the psycopg2_version parsing in the
psycopg2 dialect.

.. change::
:tags: postgresql
:tickets: 2141

Fixed bug affecting PG 9 whereby index reflection
would fail if against a column whose name
had changed. . Also in 0.6.8.

.. change::
:tags: mssql
:tickets: 2169

Fixed bug in MSSQL dialect whereby the aliasing
applied to a schema-qualified table would leak
into enclosing select statements.
Also in 0.6.8.

.. change::
:tags: documentation
:tickets: 2152

Removed the usage of the "collections.MutableMapping"
abc from the ext.mutable docs as it was being used
incorrectly and makes the example more difficult
to understand in any case.

.. change::
:tags: examples
:tickets:

removed the ancient "polymorphic association"
examples and replaced with an updated set of
examples that use declarative mixins,
"generic_associations". Each presents an alternative
table layout.

.. change::
:tags: ext
:tickets: 2143

Fixed bugs in sqlalchemy.ext.mutable extension where
`None` was not appropriately handled, replacement
events were not appropriately handled.

.. changelog::
:version: 0.7.0b4
:released: Sun Apr 17 2011

.. change::
:tags: general
:tickets:

Changes to the format of CHANGES, this file.
The format changes have been applied to
the 0.7 releases.

.. change::
:tags: general
:tickets:

The "-declarative" changes will now be listed
directly under the "-orm" section, as these
are closely related.

.. change::
:tags: general
:tickets:

The 0.5 series changes have been moved to
the file CHANGES_PRE_06 which replaces
CHANGES_PRE_05.

.. change::
:tags: general
:tickets:

The changelog for 0.6.7 and subsequent within
the 0.6 series is now listed only in the
CHANGES file within the 0.6 branch.
In the 0.7 CHANGES file (i.e. this file), all the
0.6 changes are listed inline within the 0.7
section in which they were also applied
(since all 0.6 changes are in 0.7 as well).
Changes that apply to an 0.6 version here
are noted as are if any differences in
implementation/behavior are present.

.. change::
:tags: orm
:tickets: 2122

Some fixes to "evaluate" and "fetch" evaluation
when query.update(), query.delete() are called.
The retrieval of records is done after autoflush
in all cases, and before update/delete is
emitted, guarding against unflushed data present
as well as expired objects failing during
the evaluation.

.. change::
:tags: orm
:tickets: 2063

Reworded the exception raised when a flush
is attempted of a subclass that is not polymorphic
against the supertype.

.. change::
:tags: orm
:tickets:

Still more wording adjustments when a query option
can't find the target entity. Explain that the
path must be from one of the root entities.

.. change::
:tags: orm
:tickets: 2123

Some fixes to the state handling regarding
backrefs, typically when autoflush=False, where
the back-referenced collection wouldn't
properly handle add/removes with no net
change. Thanks to Richard Murri for the
test case + patch.
(also in 0.6.7).

.. change::
:tags: orm
:tickets: 2127

Added checks inside the UOW to detect the unusual
condition of being asked to UPDATE or DELETE
on a primary key value that contains NULL
in it.

.. change::
:tags: orm
:tickets: 2127

Some refinements to attribute history. More
changes are pending possibly in 0.8, but
for now history has been modified such that
scalar history doesn't have a "side effect"
of populating None for a non-present value.
This allows a slightly better ability to
distinguish between a None set and no actual
change, affects as well.

.. change::
:tags: orm
:tickets: 2130

a "having" clause would be copied from the
inside to the outside query if from_self()
were used; in particular this would break
an 0.7 style count() query.
(also in 0.6.7)

.. change::
:tags: orm
:tickets: 2131

the Query.execution_options() method now passes
those options to the Connection rather than
the SELECT statement, so that all available
options including isolation level and
compiled cache may be used.

.. change::
:tags: sql
:tickets: 2131

The "compiled_cache" execution option now raises
an error when passed to a SELECT statement
rather than a Connection. Previously it was
being ignored entirely. We may look into
having this option work on a per-statement
level at some point.

.. change::
:tags: sql
:tickets:

Restored the "catchall" constructor on the base
TypeEngine class, with a deprecation warning.
This so that code which does something like
Integer(11) still succeeds.

.. change::
:tags: sql
:tickets: 2104

Fixed regression whereby MetaData() coming
back from unpickling did not keep track of
new things it keeps track of now, i.e.
collection of Sequence objects, list
of schema names.

.. change::
:tags: sql
:tickets: 2116

The limit/offset keywords to select() as well
as the value passed to select.limit()/offset()
will be coerced to integer.
(also in 0.6.7)

.. change::
:tags: sql
:tickets:

fixed bug where "from" clause gathering from an
over() clause would be an itertools.chain() and
not a list, causing "can only concatenate list"
TypeError when combined with other clauses.

.. change::
:tags: sql
:tickets: 2134

Fixed incorrect usage of "," in over() clause
being placed between the "partition" and "order by"
clauses.

.. change::
:tags: sql
:tickets: 2105

Before/after attach events for PrimaryKeyConstraint
now function, tests added for before/after events
on all constraint types.

.. change::
:tags: sql
:tickets: 2117

Added explicit true()/false() constructs to expression
lib - coercion rules will intercept "False"/"True"
into these constructs. In 0.6, the constructs were
typically converted straight to string, which was
no longer accepted in 0.7.

.. change::
:tags: engine
:tickets: 2129

The C extension is now enabled by default on CPython
2.x with a fallback to pure python if it fails to
compile.

.. change::
:tags: schema
:tickets: 2109

The 'useexisting' flag on Table has been superseded
by a new pair of flags 'keep_existing' and
'extend_existing'. 'extend_existing' is equivalent
to 'useexisting' - the existing Table is returned,
and additional constructor elements are added.
With 'keep_existing', the existing Table is returned,
but additional constructor elements are not added -
these elements are only applied when the Table
is newly created.

.. change::
:tags: types
:tickets: 2081

REAL has been added to the core types. Supported
by PostgreSQL, SQL Server, MySQL, SQLite. Note
that the SQL Server and MySQL versions, which
add extra arguments, are also still available
from those dialects.

.. change::
:tags: types
:tickets: 2106

Added event.listens_for() decorator, given
target + event name, applies the decorated
function as a listener.

.. change::
:tags: pool
:tickets: 2103

AssertionPool now stores the traceback indicating
where the currently checked out connection was
acquired; this traceback is reported within
the assertion raised upon a second concurrent
checkout; courtesy Gunnlaugur Briem

.. change::
:tags: pool
:tickets:

The "pool.manage" feature doesn't use pickle
anymore to hash the arguments for each pool.

.. change::
:tags: sqlite
:tickets: 2115

Fixed bug where reflection of foreign key
created as "REFERENCES <tablename>" without
col name would fail.
(also in 0.6.7)

.. change::
:tags: postgresql
:tickets:

Psycopg2 for Python 3 is now supported.

.. change::
:tags: postgresql
:tickets: 2132

Fixed support for precision numerics when using
pg8000.

.. change::
:tags: oracle
:tickets: 2100

Using column names that would require quotes
for the column itself or for a name-generated
bind parameter, such as names with special
characters, underscores, non-ascii characters,
now properly translate bind parameter keys when
talking to cx_oracle. (Also
in 0.6.7)

.. change::
:tags: oracle
:tickets: 2116

Oracle dialect adds use_binds_for_limits=False
create_engine() flag, will render the LIMIT/OFFSET
values inline instead of as binds, reported to
modify the execution plan used by Oracle. (Also in 0.6.7)

.. change::
:tags: documentation
:tickets: 2029

Documented SQLite DATE/TIME/DATETIME types. (also in 0.6.7)

.. change::
:tags: documentation
:tickets: 2118

Fixed mutable extension docs to show the
correct type-association methods.

.. changelog::
:version: 0.7.0b3
:released: Sun Mar 20 2011

.. change::
:tags: general
:tickets:

Lots of fixes to unit tests when run under PyPy
(courtesy Alex Gaynor).

.. change::
:tags: orm
:tickets: 2093

Changed the underlying approach to query.count().
query.count() is now in all cases exactly:

query.
from_self(func.count(literal_column('1'))).
scalar()

That is, "select count(1) from (<full query>)".
This produces a subquery in all cases, but
vastly simplifies all the guessing count()
tried to do previously, which would still
fail in many scenarios particularly when
joined table inheritance and other joins
were involved. If the subquery produced
for an otherwise very simple count is really
an issue, use query(func.count()) as an
optimization.

.. change::
:tags: orm
:tickets: 2087

some changes to the identity map regarding
rare weakref callbacks during iterations.
The mutex has been removed as it apparently
can cause a reentrant (i.e. in one thread) deadlock,
perhaps when gc collects objects at the point of
iteration in order to gain more memory. It is hoped
that "dictionary changed during iteration" will
be exceedingly rare as iteration methods internally
acquire the full list of objects in a single values()
call. Note 0.6.7 has a more conservative fix here
which still keeps the mutex in place.

.. change::
:tags: orm
:tickets: 2082

A tweak to the unit of work causes it to order
the flush along relationship() dependencies even if
the given objects don't have any inter-attribute
references in memory, which was the behavior in
0.5 and earlier, so a flush of Parent/Child with
only foreign key/primary key set will succeed.
This while still maintaining 0.6 and above's not
generating a ton of useless internal dependency
structures within the flush that don't correspond
to state actually within the current flush.

.. change::
:tags: orm
:tickets: 2069

Improvements to the error messages emitted when
querying against column-only entities in conjunction
with (typically incorrectly) using loader options,
where the parent entity is not fully present.

.. change::
:tags: orm
:tickets: 2098

Fixed bug in query.options() whereby a path
applied to a lazyload using string keys could
overlap a same named attribute on the wrong
entity. Note 0.6.7 has a more conservative fix
to this.

.. change::
:tags: declarative
:tickets: 2091

Arguments in __mapper_args__ that aren't "hashable"
aren't mistaken for always-hashable, possibly-column
arguments. (also in 0.6.7)

.. change::
:tags: sql
:tickets:

Added a fully descriptive error message for the
case where Column is subclassed and _make_proxy()
fails to make a copy due to TypeError on the
constructor. The method _constructor should
be implemented in this case.

.. change::
:tags: sql
:tickets: 2095

Added new event "column_reflect" for Table objects.
Receives the info dictionary about a Column before
the object is generated within reflection, and allows
modification to the dictionary for control over
most aspects of the resulting Column including
key, name, type, info dictionary.

.. change::
:tags: sql
:tickets:

To help with the "column_reflect" event being used
with specific Table objects instead of all instances
of Table, listeners can be added to a Table object
inline with its construction using a new argument
"listeners", a list of tuples of the form
(<eventname>, <fn>), which are applied to the Table
before the reflection process begins.

.. change::
:tags: sql
:tickets: 2085

Added new generic function "next_value()", accepts
a Sequence object as its argument and renders the
appropriate "next value" generation string on the
target platform, if supported. Also provides
".next_value()" method on Sequence itself.

.. change::
:tags: sql
:tickets: 2084

func.next_value() or other SQL expression can
be embedded directly into an insert() construct,
and if implicit or explicit "returning" is used
in conjunction with a primary key column,
the newly generated value will be present in
result.inserted_primary_key.

.. change::
:tags: sql
:tickets: 2089

Added accessors to ResultProxy "returns_rows",
"is_insert" (also in 0.6.7)

.. change::
:tags: engine
:tickets: 2097

Fixed AssertionPool regression bug.

.. change::
:tags: engine
:tickets: 2060

Changed exception raised to ArgumentError when an
invalid dialect is specified.

.. change::
:tags: postgresql
:tickets: 2092

Added RESERVED_WORDS for postgresql dialect.
(also in 0.6.7)

.. change::
:tags: postgresql
:tickets: 2073

Fixed the BIT type to allow a "length" parameter, "varying"
parameter. Reflection also fixed.
(also in 0.6.7)

.. change::
:tags: mssql
:tickets: 2071

Rewrote the query used to get the definition of a view,
typically when using the Inspector interface, to
use sys.sql_modules instead of the information schema,
thereby allowing views definitions longer than 4000
characters to be fully returned.
(also in 0.6.7)

.. change::
:tags: firebird
:tickets: 2083

The "implicit_returning" flag on create_engine() is
honored if set to False. (also in 0.6.7)

.. change::
:tags: informix
:tickets: 2092

Added RESERVED_WORDS informix dialect.
(also in 0.6.7)

.. change::
:tags: ext
:tickets: 2090

The horizontal_shard ShardedSession class accepts the common
Session argument "query_cls" as a constructor argument,
to enable further subclassing of ShardedQuery. (also in 0.6.7)

.. change::
:tags: examples
:tickets:

Updated the association, association proxy examples
to use declarative, added a new example
dict_of_sets_with_default.py, a "pushing the envelope"
example of association proxy.

.. change::
:tags: examples
:tickets: 2090

The Beaker caching example allows a "query_cls" argument
to the query_callable() function.
(also in 0.6.7)

.. changelog::
:version: 0.7.0b2
:released: Sat Feb 19 2011

.. change::
:tags: orm
:tickets: 2053

Fixed bug whereby Session.merge() would call the
load() event with one too few arguments.

.. change::
:tags: orm
:tickets: 2052

Added logic which prevents the generation of
events from a MapperExtension or SessionExtension
from generating do-nothing events for all the methods
not overridden.

.. change::
:tags: declarative
:tickets: 2058

Fixed regression whereby composite() with
Column objects placed inline would fail
to initialize. The Column objects can now
be inline with the composite() or external
and pulled in via name or object ref.

.. change::
:tags: declarative
:tickets: 2061

Fix error message referencing old classproperty
name to reference declared_attr
(also in 0.6.7)

.. change::
:tags: declarative
:tickets: 1468

the dictionary at the end of the __table_args__
tuple is now optional.

.. change::
:tags: sql
:tickets: 2059

Renamed the EngineEvents event class to
ConnectionEvents. As these classes are never
accessed directly by end-user code, this strictly
is a documentation change for end users. Also
simplified how events get linked to engines
and connections internally.

.. change::
:tags: sql
:tickets: 2055

The Sequence() construct, when passed a MetaData()
object via its 'metadata' argument, will be
included in CREATE/DROP statements within
metadata.create_all() and metadata.drop_all(),
including "checkfirst" logic.

.. change::
:tags: sql
:tickets: 2064

The Column.references() method now returns True
if it has a foreign key referencing the
given column exactly, not just its parent
table.

.. change::
:tags: postgresql
:tickets: 2065

Fixed regression from 0.6 where SMALLINT and
BIGINT types would both generate SERIAL
on an integer PK column, instead of
SMALLINT and BIGSERIAL

.. change::
:tags: ext
:tickets: 2054

Association proxy now has correct behavior for
any(), has(), and contains() when proxying
a many-to-one scalar attribute to a one-to-many
collection (i.e. the reverse of the 'typical'
association proxy use case)

.. change::
:tags: examples
:tickets:

Beaker example now takes into account 'limit'
and 'offset', bind params within embedded
FROM clauses (like when you use union() or
from_self()) when generating a cache key.

.. changelog::
:version: 0.7.0b1
:released: Sat Feb 12 2011

.. change::
:tags:
:tickets:

Detailed descriptions of each change below are
described at:
https://docs.sqlalchemy.org/en/latest/changelog/migration_07.html

.. change::
:tags: general
:tickets: 1902

New event system, supersedes all extensions, listeners,
etc.

.. change::
:tags: general
:tickets: 1926

Logging enhancements

.. change::
:tags: general
:tickets: 1949

Setup no longer installs a Nose plugin

.. change::
:tags: general
:tickets:

The "sqlalchemy.exceptions" alias in sys.modules
has been removed. Base SQLA exceptions are
available via "from sqlalchemy import exc".
The "exceptions" alias for "exc" remains in
"sqlalchemy" for now, it's just not patched into
sys.modules.

.. change::
:tags: orm
:tickets: 1923

More succinct form of query.join(target, onclause)

.. change::
:tags: orm
:tickets: 1903

Hybrid Attributes, implements/supersedes synonym()

.. change::
:tags: orm
:tickets: 2008

Rewrite of composites

.. change::
:tags: orm
:tickets:

Mutation Event Extension, supersedes "mutable=True"

.. seealso::

:ref:`07_migration_mutation_extension`

.. change::
:tags: orm
:tickets: 1980

PickleType and ARRAY mutability turned off by default

.. change::
:tags: orm
:tickets: 1895

Simplified polymorphic_on assignment

.. change::
:tags: orm
:tickets: 1912

Flushing of Orphans that have no parent is allowed

.. change::
:tags: orm
:tickets: 2041

Adjusted flush accounting step to occur before
the commit in the case of autocommit=True. This allows
autocommit=True to work appropriately with
expire_on_commit=True, and also allows post-flush session
hooks to operate in the same transactional context
as when autocommit=False.

.. change::
:tags: orm
:tickets: 1973

Warnings generated when collection members, scalar referents
not part of the flush

.. change::
:tags: orm
:tickets: 1876

Non-`Table`-derived constructs can be mapped

.. change::
:tags: orm
:tickets: 1942

Tuple label names in Query Improved

.. change::
:tags: orm
:tickets: 1892

Mapped column attributes reference the most specific
column first

.. change::
:tags: orm
:tickets: 1896

Mapping to joins with two or more same-named columns
requires explicit declaration

.. change::
:tags: orm
:tickets: 1875

Mapper requires that polymorphic_on column be present
in the mapped selectable

.. change::
:tags: orm
:tickets: 1966

compile_mappers() renamed configure_mappers(), simplified
configuration internals

.. change::
:tags: orm
:tickets: 2018

the aliased() function, if passed a SQL FromClause element
(i.e. not a mapped class), will return element.alias()
instead of raising an error on AliasedClass.

.. change::
:tags: orm
:tickets: 2027

Session.merge() will check the version id of the incoming
state against that of the database, assuming the mapping
uses version ids and incoming state has a version_id
assigned, and raise StaleDataError if they don't
match.

.. change::
:tags: orm
:tickets: 1996

Session.connection(), Session.execute() accept 'bind',
to allow execute/connection operations to participate
in the open transaction of an engine explicitly.

.. change::
:tags: orm
:tickets:

Query.join(), Query.outerjoin(), eagerload(),
eagerload_all(), others no longer allow lists
of attributes as arguments (i.e. option([x, y, z])
form, deprecated since 0.5)

.. change::
:tags: orm
:tickets:

ScopedSession.mapper is removed (deprecated since 0.5).

.. change::
:tags: orm
:tickets: 2031

Horizontal shard query places 'shard_id' in
context.attributes where it's accessible by the
"load()" event.

.. change::
:tags: orm
:tickets: 2032

A single contains_eager() call across
multiple entities will indicate all collections
along that path should load, instead of requiring
distinct contains_eager() calls for each endpoint
(which was never correctly documented).

.. change::
:tags: orm
:tickets:

The "name" field used in orm.aliased() now renders
in the resulting SQL statement.

.. change::
:tags: orm
:tickets: 1473

Session weak_instance_dict=False is deprecated.

.. change::
:tags: orm
:tickets: 2046

An exception is raised in the unusual case that an
append or similar event on a collection occurs after
the parent object has been dereferenced, which
prevents the parent from being marked as "dirty"
in the session. Was a warning in 0.6.6.

.. change::
:tags: orm
:tickets: 1069

Query.distinct() now accepts column expressions
as \*args, interpreted by the PostgreSQL dialect
as DISTINCT ON (<expr>).

.. change::
:tags: orm
:tickets: 2049

Additional tuning to "many-to-one" relationship
loads during a flush(). A change in version 0.6.6
([ticket:2002]) required that more "unnecessary" m2o
loads during a flush could occur. Extra loading modes have
been added so that the SQL emitted in this
specific use case is trimmed back, while still
retrieving the information the flush needs in order
to not miss anything.

.. change::
:tags: orm
:tickets:

the value of "passive" as passed to
attributes.get_history() should be one of the
constants defined in the attributes package. Sending
True or False is deprecated.

.. change::
:tags: orm
:tickets: 2030

Added a `name` argument to `Query.subquery()`, to allow
a fixed name to be assigned to the alias object. (also in 0.6.7)

.. change::
:tags: orm
:tickets: 2019

A warning is emitted when a joined-table inheriting mapper
has no primary keys on the locally mapped table
(but has pks on the superclass table).
(also in 0.6.7)

.. change::
:tags: orm
:tickets: 2038

Fixed bug where "middle" class in a polymorphic hierarchy
would have no 'polymorphic_on' column if it didn't also
specify a 'polymorphic_identity', leading to strange
errors upon refresh, wrong class loaded when querying
from that target. Also emits the correct WHERE criterion
when using single table inheritance.
(also in 0.6.7)

.. change::
:tags: orm
:tickets: 1995

Fixed bug where a column with a SQL or server side default
that was excluded from a mapping with include_properties
or exclude_properties would result in UnmappedColumnError. (also in 0.6.7)

.. change::
:tags: orm
:tickets: 2046

A warning is emitted in the unusual case that an
append or similar event on a collection occurs after
the parent object has been dereferenced, which
prevents the parent from being marked as "dirty"
in the session. This will be an exception in 0.7. (also in 0.6.7)

.. change::
:tags: declarative
:tickets: 2050

Added an explicit check for the case that the name
'metadata' is used for a column attribute on a
declarative class. (also in 0.6.7)

.. change::
:tags: sql
:tickets: 1844

Added over() function, method to FunctionElement
classes, produces the _Over() construct which
in turn generates "window functions", i.e.
"<window function> OVER (PARTITION BY <partition by>,
ORDER BY <order by>)".

.. change::
:tags: sql
:tickets: 805

LIMIT/OFFSET clauses now use bind parameters

.. change::
:tags: sql
:tickets: 1069

select.distinct() now accepts column expressions
as \*args, interpreted by the PostgreSQL dialect
as DISTINCT ON (<expr>). Note this was already
available via passing a list to the `distinct`
keyword argument to select().

.. change::
:tags: sql
:tickets:

select.prefix_with() accepts multiple expressions
(i.e. \*expr), 'prefix' keyword argument to select()
accepts a list or tuple.

.. change::
:tags: sql
:tickets:

Passing a string to the `distinct` keyword argument
of `select()` for the purpose of emitting special
MySQL keywords (DISTINCTROW etc.) is deprecated -
use `prefix_with()` for this.

.. change::
:tags: sql
:tickets: 2006, 2005

TypeDecorator works with primary key columns

.. change::
:tags: sql
:tickets: 1897

DDL() constructs now escape percent signs

.. change::
:tags: sql
:tickets: 1917, 1893

Table.c / MetaData.tables refined a bit, don't allow direct
mutation

.. change::
:tags: sql
:tickets: 1950

Callables passed to `bindparam()` don't get evaluated

.. change::
:tags: sql
:tickets: 1870

types.type_map is now private, types._type_map

.. change::
:tags: sql
:tickets: 1982

Non-public Pool methods underscored

.. change::
:tags: sql
:tickets: 723

Added NULLS FIRST and NULLS LAST support. It's implemented
as an extension to the asc() and desc() operators, called
nullsfirst() and nullslast().

.. change::
:tags: sql
:tickets:

The Index() construct can be created inline with a Table
definition, using strings as column names, as an alternative
to the creation of the index outside of the Table.

.. change::
:tags: sql
:tickets: 2001

execution_options() on Connection accepts
"isolation_level" argument, sets transaction isolation
level for that connection only until returned to the
connection pool, for those backends which support it
(SQLite, PostgreSQL)

.. change::
:tags: sql
:tickets: 2005

A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
as well as the "sqlite_autoincrement" flag will honor
the underlying database type as being Integer-based.

.. change::
:tags: sql
:tickets: 2020, 2021

Established consistency when server_default is present
on an Integer PK column. SQLA doesn't pre-fetch these,
nor do they come back in cursor.lastrowid (DBAPI).
Ensured all backends consistently return None
in result.inserted_primary_key for these. Regarding
reflection for this case, reflection of an int PK col
with a server_default sets the "autoincrement" flag to False,
except in the case of a PG SERIAL col where we detected a
sequence default.

.. change::
:tags: sql
:tickets: 2006

Result-row processors are applied to pre-executed SQL
defaults, as well as cursor.lastrowid, when determining
the contents of result.inserted_primary_key.

.. change::
:tags: sql
:tickets:

Bind parameters present in the "columns clause" of a select
are now auto-labeled like other "anonymous" clauses,
which among other things allows their "type" to be meaningful
when the row is fetched, as in result row processors.

.. change::
:tags: sql
:tickets:

TypeDecorator is present in the "sqlalchemy" import space.

.. change::
:tags: sql
:tickets: 2015

Non-DBAPI errors which occur in the scope of an `execute()`
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included. This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.

.. change::
:tags: sql
:tickets: 2048

The concept of associating a ".bind" directly with a
ClauseElement has been explicitly moved to Executable,
i.e. the mixin that describes ClauseElements which represent
engine-executable constructs. This change is an improvement
to internal organization and is unlikely to affect any
real-world usage.

.. change::
:tags: sql
:tickets: 2028

Column.copy(), as used in table.tometadata(), copies the
'doc' attribute. (also in 0.6.7)

.. change::
:tags: sql
:tickets: 2023

Added some defs to the resultproxy.c extension so that
the extension compiles and runs on Python 2.4. (also in 0.6.7)

.. change::
:tags: sql
:tickets: 2042

The compiler extension now supports overriding the default
compilation of expression._BindParamClause including that
the auto-generated binds within the VALUES/SET clause
of an insert()/update() statement will also use the new
compilation rules. (also in 0.6.7)

.. change::
:tags: sql
:tickets: 1921

SQLite dialect now uses `NullPool` for file-based databases

.. change::
:tags: sql
:tickets: 2036

The path given as the location of a sqlite database is now
normalized via os.path.abspath(), so that directory changes
within the process don't affect the ultimate location
of a relative file path.

.. change::
:tags: postgresql
:tickets: 1083

When explicit sequence execution derives the name
of the auto-generated sequence of a SERIAL column,
which currently only occurs if implicit_returning=False,
now accommodates if the table + column name is greater
than 63 characters using the same logic PostgreSQL uses. (also in 0.6.7)

.. change::
:tags: postgresql
:tickets: 2044

Added an additional libpq message to the list of "disconnect"
exceptions, "could not receive data from server" (also in 0.6.7)

.. change::
:tags: mssql
:tickets: 1833

the String/Unicode types, and their counterparts VARCHAR/
NVARCHAR, emit "max" as the length when no length is
specified, so that the default length, normally '1'
as per SQL server documentation, is instead
'unbounded'. This also occurs for the VARBINARY type..

This behavior makes these types more closely compatible
with PostgreSQL's VARCHAR type which is similarly unbounded
when no length is specified.

.. change::
:tags: mysql
:tickets: 1991

New DBAPI support for pymysql, a pure Python port
of MySQL-python.

.. change::
:tags: mysql
:tickets: 2047

oursql dialect accepts the same "ssl" arguments in
create_engine() as that of MySQLdb.
(also in 0.6.7)

.. change::
:tags: firebird
:tickets: 1885

Some adjustments so that Interbase is supported as well.
FB/Interbase version idents are parsed into a structure
such as (8, 1, 1, 'interbase') or (2, 1, 588, 'firebird')
so they can be distinguished.


=============
0.8 Changelog
=============

.. changelog_imports::

.. include:: changelog_07.rst
:start-line: 5


.. changelog::

0.6.9

Not secure
:released: Sat May 05 2012

.. change::
:tags: general
:tickets: 2279

Adjusted the "importlater" mechanism, which is
used internally to resolve import cycles,
such that the usage of __import__ is completed
when the import of sqlalchemy or sqlalchemy.orm
is done, thereby avoiding any usage of __import__
after the application starts new threads,
fixes.

.. change::
:tags: orm
:tickets: 2197

Fixed bug whereby the source clause
used by query.join() would be inconsistent
if against a column expression that combined
multiple entities together.

.. change::
:tags: orm, bug
:tickets: 2310

fixed inappropriate evaluation of user-mapped
object in a boolean context within query.get().

.. change::
:tags: orm
:tickets: 2228

Fixed bug apparent only in Python 3 whereby
sorting of persistent + pending objects during
flush would produce an illegal comparison,
if the persistent object primary key
is not a single integer.

.. change::
:tags: orm
:tickets: 2234

Fixed bug where query.join() + aliased=True
from a joined-inh structure to itself on
relationship() with join condition on the child
table would convert the lead entity into the
joined one inappropriately.

.. change::
:tags: orm
:tickets: 2287

Fixed bug whereby mapper.order_by attribute would
be ignored in the "inner" query within a
subquery eager load. .

.. change::
:tags: orm
:tickets: 2215

Fixed bug whereby if a mapped class
redefined __hash__() or __eq__() to something
non-standard, which is a supported use case
as SQLA should never consult these,
the methods would be consulted if the class
was part of a "composite" (i.e. non-single-entity)
result set.

.. change::
:tags: orm
:tickets: 2188

Fixed subtle bug that caused SQL to blow
up if: column_property() against subquery +
joinedload + LIMIT + order by the column
property() occurred. .

.. change::
:tags: orm
:tickets: 2207

The join condition produced by with_parent
as well as when using a "dynamic" relationship
against a parent will generate unique
bindparams, rather than incorrectly repeating
the same bindparam. .

.. change::
:tags: orm
:tickets: 2199

Repaired the "no statement condition"
assertion in Query which would attempt
to raise if a generative method were called
after from_statement() were called..

.. change::
:tags: orm
:tickets: 1776

Cls.column.collate("some collation") now
works.

.. change::
:tags: orm, bug
:tickets: 2297

Fixed the error formatting raised when
a tuple is inadvertently passed to session.query().

.. change::
:tags: engine
:tickets: 2317

Backported the fix for introduced
in 0.7.4, which ensures that the connection
is in a valid state before attempting to call
rollback()/prepare()/release() on savepoint
and two-phase transactions.

.. change::
:tags: sql
:tickets: 2188

Fixed two subtle bugs involving column
correspondence in a selectable,
one with the same labeled subquery repeated, the other
when the label has been "grouped" and
loses itself. Affects.

.. change::
:tags: sql
:tickets:

Fixed bug whereby "warn on unicode" flag
would get set for the String type
when used with certain dialects. This
bug is not in 0.7.

.. change::
:tags: sql
:tickets: 2270

Fixed bug whereby with_only_columns() method of
Select would fail if a selectable were passed.. However, the FROM behavior is
still incorrect here, so you need 0.7 in
any case for this use case to be usable.

.. change::
:tags: schema
:tickets:

Added an informative error message when
ForeignKeyConstraint refers to a column name in
the parent that is not found.

.. change::
:tags: postgresql
:tickets: 2291, 2141

Fixed bug related to whereby the
same modified index behavior in PG 9 affected
primary key reflection on a renamed column..

.. change::
:tags: mysql
:tickets: 2186

Fixed OurSQL dialect to use ansi-neutral
quote symbol "'" for XA commands instead
of '"'. .

.. change::
:tags: mysql
:tickets: 2225

a CREATE TABLE will put the COLLATE option
after CHARSET, which appears to be part of
MySQL's arbitrary rules regarding if it will actually
work or not.

.. 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: oracle
:tickets: 2200

Added ORA-00028 to disconnect codes, use
cx_oracle _Error.code to get at the code,.

.. change::
:tags: oracle
:tickets: 2220

repaired the oracle.RAW type which did not
generate the correct DDL.

.. change::
:tags: oracle
:tickets: 2212

added CURRENT to reserved word list.

.. change::
:tags: examples
:tickets: 2266

Adjusted dictlike-polymorphic.py example
to apply the CAST such that it works on
PG, other databases.

.. changelog::

0.6.8

Not secure
:released: Sun Jun 05 2011

.. change::
:tags: orm
:tickets: 2144

Calling query.get() against a column-based entity is
invalid, this condition now raises a deprecation warning.

.. change::
:tags: orm
:tickets: 2151

a non_primary mapper will inherit the _identity_class
of the primary mapper. This so that a non_primary
established against a class that's normally in an
inheritance mapping will produce results that are
identity-map compatible with that of the primary
mapper

.. change::
:tags: orm
:tickets: 2148

Backported 0.7's identity map implementation, which
does not use a mutex around removal. This as some users
were still getting deadlocks despite the adjustments
in 0.6.7; the 0.7 approach that doesn't use a mutex
does not appear to produce "dictionary changed size"
issues, the original rationale for the mutex.

.. change::
:tags: orm
:tickets: 2163

Fixed the error message emitted for "can't
execute syncrule for destination column 'q';
mapper 'X' does not map this column" to
reference the correct mapper. .

.. change::
:tags: orm
:tickets: 2149

Fixed bug where determination of "self referential"
relationship would fail with no workaround
for joined-inh subclass related to itself,
or joined-inh subclass related to a subclass
of that with no cols in the sub-sub class
in the join condition.

.. change::
:tags: orm
:tickets: 2153

mapper() will ignore non-configured foreign keys
to unrelated tables when determining inherit
condition between parent and child class.
This is equivalent to behavior already
applied to declarative. Note that 0.7 has a
more comprehensive solution to this, altering
how join() itself determines an FK error.

.. change::
:tags: orm
:tickets: 2171

Fixed bug whereby mapper mapped to an anonymous
alias would fail if logging were used, due to
unescaped % sign in the alias name.

.. change::
:tags: orm
:tickets: 2170

Modify the text of the message which occurs
when the "identity" key isn't detected on
flush, to include the common cause that
the Column isn't set up to detect
auto-increment correctly;.

.. change::
:tags: orm
:tickets: 2182

Fixed bug where transaction-level "deleted"
collection wouldn't be cleared of expunged
states, raising an error if they later
became transient.

.. change::
:tags: sql
:tickets: 2147

Fixed bug whereby if FetchedValue was passed
to column server_onupdate, it would not
have its parent "column" assigned, added
test coverage for all column default assignment
patterns.

.. change::
:tags: sql
:tickets: 2167

Fixed bug whereby nesting a label of a select()
with another label in it would produce incorrect
exported columns. Among other things this would
break an ORM column_property() mapping against
another column_property(). .

.. change::
:tags: engine
:tickets: 2178

Adjusted the __contains__() method of
a RowProxy result row such that no exception
throw is generated internally;
NoSuchColumnError() also will generate its
message regardless of whether or not the column
construct can be coerced to a string..

.. change::
:tags: postgresql
:tickets: 2141

Fixed bug affecting PG 9 whereby index reflection
would fail if against a column whose name
had changed. .

.. change::
:tags: postgresql
:tickets: 2175

Some unit test fixes regarding numeric arrays,
MATCH operator. A potential floating-point
inaccuracy issue was fixed, and certain tests
of the MATCH operator only execute within an
EN-oriented locale for now. .

.. change::
:tags: mssql
:tickets: 2169

Fixed bug in MSSQL dialect whereby the aliasing
applied to a schema-qualified table would leak
into enclosing select statements.

.. change::
:tags: mssql
:tickets: 2159

Fixed bug whereby DATETIME2 type would fail on
the "adapt" step when used in result sets or
bound parameters. This issue is not in 0.7.

.. changelog::

0.6.7

Not secure
:released: Wed Apr 13 2011

.. change::
:tags: orm
:tickets: 2087

Tightened the iterate vs. remove mutex around the
identity map iteration, attempting to reduce the
chance of an (extremely rare) reentrant gc operation
causing a deadlock. Might remove the mutex in
0.7.

.. change::
:tags: orm
:tickets: 2030

Added a `name` argument to `Query.subquery()`, to allow
a fixed name to be assigned to the alias object.

.. change::
:tags: orm
:tickets: 2019

A warning is emitted when a joined-table inheriting mapper
has no primary keys on the locally mapped table
(but has pks on the superclass table).

.. change::
:tags: orm
:tickets: 2038

Fixed bug where "middle" class in a polymorphic hierarchy
would have no 'polymorphic_on' column if it didn't also
specify a 'polymorphic_identity', leading to strange
errors upon refresh, wrong class loaded when querying
from that target. Also emits the correct WHERE criterion
when using single table inheritance.

.. change::
:tags: orm
:tickets: 1995

Fixed bug where a column with a SQL or server side default
that was excluded from a mapping with include_properties
or exclude_properties would result in UnmappedColumnError.

.. change::
:tags: orm
:tickets: 2046

A warning is emitted in the unusual case that an
append or similar event on a collection occurs after
the parent object has been dereferenced, which
prevents the parent from being marked as "dirty"
in the session. This will be an exception in 0.7.

.. change::
:tags: orm
:tickets: 2098

Fixed bug in query.options() whereby a path
applied to a lazyload using string keys could
overlap a same named attribute on the wrong
entity. Note 0.7 has an updated version of this
fix.

.. change::
:tags: orm
:tickets: 2063

Reworded the exception raised when a flush
is attempted of a subclass that is not polymorphic
against the supertype.

.. change::
:tags: orm
:tickets: 2123

Some fixes to the state handling regarding
backrefs, typically when autoflush=False, where
the back-referenced collection wouldn't
properly handle add/removes with no net
change. Thanks to Richard Murri for the
test case + patch.

.. change::
:tags: orm
:tickets: 2130

a "having" clause would be copied from the
inside to the outside query if from_self()
were used..

.. change::
:tags: sql
:tickets: 2028

Column.copy(), as used in table.tometadata(), copies the
'doc' attribute.

.. change::
:tags: sql
:tickets: 2023

Added some defs to the resultproxy.c extension so that
the extension compiles and runs on Python 2.4.

.. change::
:tags: sql
:tickets: 2042

The compiler extension now supports overriding the default
compilation of expression._BindParamClause including that
the auto-generated binds within the VALUES/SET clause
of an insert()/update() statement will also use the new
compilation rules.

.. change::
:tags: sql
:tickets: 2089

Added accessors to ResultProxy "returns_rows", "is_insert"

.. change::
:tags: sql
:tickets: 2116

The limit/offset keywords to select() as well
as the value passed to select.limit()/offset()
will be coerced to integer.

.. change::
:tags: engine
:tickets: 2102

Fixed bug in QueuePool, SingletonThreadPool whereby
connections that were discarded via overflow or periodic
cleanup() were not explicitly closed, leaving garbage
collection to the task instead. This generally only
affects non-reference-counting backends like Jython
and PyPy. Thanks to Jaimy Azle for spotting
this.

.. change::
:tags: sqlite
:tickets: 2115

Fixed bug where reflection of foreign key
created as "REFERENCES <tablename>" without
col name would fail.

.. change::
:tags: postgresql
:tickets: 1083

When explicit sequence execution derives the name
of the auto-generated sequence of a SERIAL column,
which currently only occurs if implicit_returning=False,
now accommodates if the table + column name is greater
than 63 characters using the same logic PostgreSQL uses.

.. change::
:tags: postgresql
:tickets: 2044

Added an additional libpq message to the list of "disconnect"
exceptions, "could not receive data from server"

.. change::
:tags: postgresql
:tickets: 2092

Added RESERVED_WORDS for postgresql dialect.

.. change::
:tags: postgresql
:tickets: 2073

Fixed the BIT type to allow a "length" parameter, "varying"
parameter. Reflection also fixed.

.. change::
:tags: informix
:tickets: 2092

Added RESERVED_WORDS informix dialect.

.. change::
:tags: mssql
:tickets: 2071

Rewrote the query used to get the definition of a view,
typically when using the Inspector interface, to
use sys.sql_modules instead of the information schema,
thereby allowing views definitions longer than 4000
characters to be fully returned.

.. change::
:tags: mysql
:tickets: 2047

oursql dialect accepts the same "ssl" arguments in
create_engine() as that of MySQLdb.

.. change::
:tags: firebird
:tickets: 2083

The "implicit_returning" flag on create_engine() is
honored if set to False.

.. change::
:tags: oracle
:tickets: 2100

Using column names that would require quotes
for the column itself or for a name-generated
bind parameter, such as names with special
characters, underscores, non-ascii characters,
now properly translate bind parameter keys when
talking to cx_oracle.

.. change::
:tags: oracle
:tickets: 2116

Oracle dialect adds use_binds_for_limits=False
create_engine() flag, will render the LIMIT/OFFSET
values inline instead of as binds, reported to
modify the execution plan used by Oracle.

.. change::
:tags: ext
:tickets: 2090

The horizontal_shard ShardedSession class accepts the common
Session argument "query_cls" as a constructor argument,
to enable further subclassing of ShardedQuery.

.. change::
:tags: declarative
:tickets: 2050

Added an explicit check for the case that the name
'metadata' is used for a column attribute on a
declarative class.

.. change::
:tags: declarative
:tickets: 2061

Fix error message referencing old classproperty
name to reference declared_attr

.. change::
:tags: declarative
:tickets: 2091

Arguments in __mapper_args__ that aren't "hashable"
aren't mistaken for always-hashable, possibly-column
arguments.

.. change::
:tags: documentation
:tickets: 2029

Documented SQLite DATE/TIME/DATETIME types.

.. change::
:tags: examples
:tickets: 2090

The Beaker caching example allows a "query_cls" argument
to the query_callable() function.

.. changelog::

0.6.6

Not secure
:released: Sat Jan 08 2011

.. change::
:tags: orm
:tickets:

Fixed bug whereby a non-"mutable" attribute modified event
which occurred on an object that was clean except for
preceding mutable attribute changes would fail to strongly
reference itself in the identity map. This would cause the
object to be garbage collected, losing track of any changes
that weren't previously saved in the "mutable changes"
dictionary.

.. change::
:tags: orm
:tickets: 2013

Fixed bug whereby "passive_deletes='all'" wasn't passing
the correct symbols to lazy loaders during flush, thereby
causing an unwarranted load.

.. change::
:tags: orm
:tickets: 1997

Fixed bug which prevented composite mapped
attributes from being used on a mapped select statement.. Note the workings of composite are slated to
change significantly in 0.7.

.. change::
:tags: orm
:tickets: 1976

active_history flag also added to composite().
The flag has no effect in 0.6, but is instead
a placeholder flag for forwards compatibility,
as it applies in 0.7 for composites.

.. change::
:tags: orm
:tickets: 2002

Fixed uow bug whereby expired objects passed to
Session.delete() would not have unloaded references
or collections taken into account when deleting
objects, despite passive_deletes remaining at
its default of False.

.. change::
:tags: orm
:tickets: 1987

A warning is emitted when version_id_col is specified
on an inheriting mapper when the inherited mapper
already has one, if those column expressions are not
the same.

.. change::
:tags: orm
:tickets: 1954

"innerjoin" flag doesn't take effect along the chain
of joinedload() joins if a previous join in that chain
is an outer join, thus allowing primary rows without
a referenced child row to be correctly returned
in results.

.. change::
:tags: orm
:tickets: 1964

Fixed bug regarding "subqueryload" strategy whereby
strategy would fail if the entity was an aliased()
construct.

.. change::
:tags: orm
:tickets: 2014

Fixed bug regarding "subqueryload" strategy whereby
the join would fail if using a multi-level load
of the form from A->joined-subclass->C

.. change::
:tags: orm
:tickets: 1968

Fixed indexing of Query objects by -1. It was erroneously
transformed to the empty slice -1:0 that resulted in
IndexError.

.. change::
:tags: orm
:tickets: 1971

The mapper argument "primary_key" can be passed as a
single column as well as a list or tuple.
The documentation examples that illustrated it as a
scalar value have been changed to lists.

.. change::
:tags: orm
:tickets: 1961

Added active_history flag to relationship()
and column_property(), forces attribute events to
always load the "old" value, so that it's available to
attributes.get_history().

.. change::
:tags: orm
:tickets: 1977

Query.get() will raise if the number of params
in a composite key is too large, as well as too
small.

.. change::
:tags: orm
:tickets: 1992

Backport of "optimized get" fix from 0.7,
improves the generation of joined-inheritance
"load expired row" behavior.

.. change::
:tags: orm
:tickets:

A little more verbiage to the "primaryjoin" error,
in an unusual condition that the join condition
"works" for viewonly but doesn't work for non-viewonly,
and foreign_keys wasn't used - adds "foreign_keys" to
the suggestion. Also add "foreign_keys" to the
suggestion for the generic "direction" error.

.. change::
:tags: sql
:tickets: 1984

Fixed operator precedence rules for multiple
chains of a single non-associative operator.
I.e. "x - (y - z)" will compile as "x - (y - z)"
and not "x - y - z". Also works with labels,
i.e. "x - (y - z).label('foo')"

.. change::
:tags: sql
:tickets: 1967

The 'info' attribute of Column is copied during
Column.copy(), i.e. as occurs when using columns
in declarative mixins.

.. change::
:tags: sql
:tickets:

Added a bind processor for booleans which coerces
to int, for DBAPIs such as pymssql that naively call
str() on values.

.. change::
:tags: sql
:tickets: 2000

CheckConstraint will copy its 'initially', 'deferrable',
and '_create_rule' attributes within a copy()/tometadata()

.. change::
:tags: engine
:tickets:

The "unicode warning" against non-unicode bind data
is now raised only when the
Unicode type is used explicitly; not when
convert_unicode=True is used on the engine
or String type.

.. change::
:tags: engine
:tickets: 1978

Fixed memory leak in C version of Decimal result
processor.

.. change::
:tags: engine
:tickets: 1871

Implemented sequence check capability for the C
version of RowProxy, as well as 2.7 style
"collections.Sequence" registration for RowProxy.

.. change::
:tags: engine
:tickets: 1998

Threadlocal engine methods rollback(), commit(),
prepare() won't raise if no transaction is in progress;
this was a regression introduced in 0.6.

.. change::
:tags: engine
:tickets: 2004

Threadlocal engine returns itself upon begin(),
begin_nested(); engine then implements contextmanager
methods to allow the "with" statement.

.. change::
:tags: postgresql
:tickets: 1984

Single element tuple expressions inside an IN clause
parenthesize correctly, also from

.. change::
:tags: postgresql
:tickets: 1955

Ensured every numeric, float, int code, scalar + array,
are recognized by psycopg2 and pg8000's "numeric"
base type.

.. change::
:tags: postgresql
:tickets: 1956

Added as_uuid=True flag to the UUID type, will receive
and return values as Python UUID() objects rather than
strings. Currently, the UUID type is only known to
work with psycopg2.

.. change::
:tags: postgresql
:tickets: 1989

Fixed bug whereby KeyError would occur with non-ENUM
supported PG versions after a pool dispose+recreate
would occur.

.. change::
:tags: mysql
:tickets: 1960

Fixed error handling for Jython + zxjdbc, such that
has_table() property works again. Regression from
0.6.3 (we don't have a Jython buildbot, sorry)

.. change::
:tags: sqlite
:tickets: 1851

The REFERENCES clause in a CREATE TABLE that includes
a remote schema to another table with the same schema
name now renders the remote name without
the schema clause, as required by SQLite.

.. change::
:tags: sqlite
:tickets:

On the same theme, the REFERENCES clause in a CREATE TABLE
that includes a remote schema to a *different* schema
than that of the parent table doesn't render at all,
as cross-schema references do not appear to be supported.

.. change::
:tags: mssql
:tickets: 1770

The rewrite of index reflection in was
unfortunately not tested correctly, and returned incorrect
results. This regression is now fixed.

.. change::
:tags: oracle
:tickets: 1953

The cx_oracle "decimal detection" logic, which takes place
for result set columns with ambiguous numeric characteristics,
now uses the decimal point character determined by the locale/
NLS_LANG setting, using an on-first-connect detection of
this character. cx_oracle 5.0.3 or greater is also required
when using a non-period-decimal-point NLS_LANG setting..

.. change::
:tags: firebird
:tickets: 2012

Firebird numeric type now checks for Decimal explicitly,
lets float() pass right through, thereby allowing
special values such as float('inf').

.. change::
:tags: declarative
:tickets: 1972

An error is raised if __table_args__ is not in tuple
or dict format, and is not None.

.. change::
:tags: sqlsoup
:tickets: 1975

Added "map_to()" method to SqlSoup, which is a "master"
method which accepts explicit arguments for each aspect of
the selectable and mapping, including a base class per
mapping.

.. change::
:tags: sqlsoup
:tickets:

Mapped selectables used with the map(), with_labels(),
join() methods no longer put the given argument into the
internal "cache" dictionary. Particularly since the
join() and select() objects are created in the method
itself this was pretty much a pure memory leaking behavior.

.. change::
:tags: examples
:tickets:

The versioning example now supports detection of changes
in an associated relationship().

.. changelog::

0.6.5

Not secure
:released: Sun Oct 24 2010

.. change::
:tags: orm
:tickets: 1914

Added a new "lazyload" option "immediateload".
Issues the usual "lazy" load operation automatically
as the object is populated. The use case
here is when loading objects to be placed in
an offline cache, or otherwise used after
the session isn't available, and straight 'select'
loading, not 'joined' or 'subquery', is desired.

.. change::
:tags: orm
:tickets: 1920

New Query methods: query.label(name), query.as_scalar(),
return the query's statement as a scalar subquery
with /without label;
query.with_entities(\*ent), replaces the SELECT list of
the query with new entities.
Roughly equivalent to a generative form of query.values()
which accepts mapped entities as well as column
expressions.

.. change::
:tags: orm
:tickets:

Fixed recursion bug which could occur when moving
an object from one reference to another, with
backrefs involved, where the initiating parent
was a subclass (with its own mapper) of the
previous parent.

.. change::
:tags: orm
:tickets: 1918

Fixed a regression in 0.6.4 which occurred if you
passed an empty list to "include_properties" on
mapper()

.. change::
:tags: orm
:tickets:

Fixed labeling bug in Query whereby the NamedTuple
would mis-apply labels if any of the column
expressions were un-labeled.

.. change::
:tags: orm
:tickets: 1925

Patched a case where query.join() would adapt the
right side to the right side of the left's join
inappropriately

.. change::
:tags: orm
:tickets:

Query.select_from() has been beefed up to help
ensure that a subsequent call to query.join()
will use the select_from() entity, assuming it's
a mapped entity and not a plain selectable,
as the default "left" side, not the first entity
in the Query object's list of entities.

.. change::
:tags: orm
:tickets:

The exception raised by Session when it is used
subsequent to a subtransaction rollback (which is what
happens when a flush fails in autocommit=False mode) has
now been reworded (this is the "inactive due to a
rollback in a subtransaction" message). In particular,
if the rollback was due to an exception during flush(),
the message states this is the case, and reiterates the
string form of the original exception that occurred
during flush. If the session is closed due to explicit
usage of subtransactions (not very common), the message
just states this is the case.

.. change::
:tags: orm
:tickets:

The exception raised by Mapper when repeated requests to
its initialization are made after initialization already
failed no longer assumes the "hasattr" case, since
there's other scenarios in which this message gets
emitted, and the message also does not compound onto
itself multiple times - you get the same message for
each attempt at usage. The misnomer "compiles" is being
traded out for "initialize".

.. change::
:tags: orm
:tickets: 1935

Fixed bug in query.update() where 'evaluate' or 'fetch'
expiration would fail if the column expression key was
a class attribute with a different keyname as the
actual column name.

.. change::
:tags: orm
:tickets:

Added an assertion during flush which ensures
that no NULL-holding identity keys were generated
on "newly persistent" objects.
This can occur when user defined code inadvertently
triggers flushes on not-fully-loaded objects.

.. change::
:tags: orm
:tickets: 1910

lazy loads for relationship attributes now use
the current state, not the "committed" state,
of foreign and primary key attributes
when issuing SQL, if a flush is not in process.
Previously, only the database-committed state would
be used. In particular, this would cause a many-to-one
get()-on-lazyload operation to fail, as autoflush
is not triggered on these loads when the attributes are
determined and the "committed" state may not be
available.

.. change::
:tags: orm
:tickets:

A new flag on relationship(), load_on_pending, allows
the lazy loader to fire off on pending objects without a
flush taking place, as well as a transient object that's
been manually "attached" to the session. Note that this
flag blocks attribute events from taking place when an
object is loaded, so backrefs aren't available until
after a flush. The flag is only intended for very
specific use cases.

.. change::
:tags: orm
:tickets:

Another new flag on relationship(), cascade_backrefs,
disables the "save-update" cascade when the event was
initiated on the "reverse" side of a bidirectional
relationship. This is a cleaner behavior so that
many-to-ones can be set on a transient object without
it getting sucked into the child object's session,
while still allowing the forward collection to
cascade. We *might* default this to False in 0.7.

.. change::
:tags: orm
:tickets:

Slight improvement to the behavior of
"passive_updates=False" when placed only on the
many-to-one side of a relationship; documentation has
been clarified that passive_updates=False should really
be on the one-to-many side.

.. change::
:tags: orm
:tickets:

Placing passive_deletes=True on a many-to-one emits
a warning, since you probably intended to put it on
the one-to-many side.

.. change::
:tags: orm
:tickets:

Fixed bug that would prevent "subqueryload" from
working correctly with single table inheritance
for a relationship from a subclass - the "where
type in (x, y, z)" only gets placed on the inside,
instead of repeatedly.

.. change::
:tags: orm
:tickets:

When using from_self() with single table inheritance,
the "where type in (x, y, z)" is placed on the outside
of the query only, instead of repeatedly. May make
some more adjustments to this.

.. change::
:tags: orm
:tickets: 1924

scoped_session emits a warning when configure() is
called if a Session is already present (checks only the
current thread)

.. change::
:tags: orm
:tickets: 1932

reworked the internals of mapper.cascade_iterator() to
cut down method calls by about 9% in some circumstances.

.. change::
:tags: sql
:tickets:

Fixed bug in TypeDecorator whereby the dialect-specific
type was getting pulled in to generate the DDL for a
given type, which didn't always return the correct result.

.. change::
:tags: sql
:tickets:

TypeDecorator can now have a fully constructed type
specified as its "impl", in addition to a type class.

.. change::
:tags: sql
:tickets:

TypeDecorator will now place itself as the resulting
type for a binary expression where the type coercion
rules would normally return its impl type - previously,
a copy of the impl type would be returned which would
have the TypeDecorator embedded into it as the "dialect"
impl, this was probably an unintentional way of achieving
the desired effect.

.. change::
:tags: sql
:tickets:

TypeDecorator.load_dialect_impl() returns "self.impl" by
default, i.e. not the dialect implementation type of
"self.impl". This to support compilation correctly.
Behavior can be user-overridden in exactly the same way
as before to the same effect.

.. change::
:tags: sql
:tickets:

Added type_coerce(expr, type\_) expression element.
Treats the given expression as the given type when evaluating
expressions and processing result rows, but does not
affect the generation of SQL, other than an anonymous
label.

.. change::
:tags: sql
:tickets:

Table.tometadata() now copies Index objects associated
with the Table as well.

.. change::
:tags: sql
:tickets:

Table.tometadata() issues a warning if the given Table
is already present in the target MetaData - the existing
Table object is returned.

.. change::
:tags: sql
:tickets:

An informative error message is raised if a Column
which has not yet been assigned a name, i.e. as in
declarative, is used in a context where it is
exported to the columns collection of an enclosing
select() construct, or if any construct involving
that column is compiled before its name is
assigned.

.. change::
:tags: sql
:tickets: 1862

as_scalar(), label() can be called on a selectable
which contains a Column that is not yet named.

.. change::
:tags: sql
:tickets: 1907

Fixed recursion overflow which could occur when operating
with two expressions both of type "NullType", but
not the singleton NULLTYPE instance.

.. change::
:tags: declarative
:tickets: 1922

classproperty (soon/now declared_attr) takes effect for
__mapper_args__, __table_args__, __tablename__ on
a base class that is not a mixin, as well as mixins.

.. change::
:tags: declarative
:tickets: 1915

classproperty 's official name/location for usage
with declarative is sqlalchemy.ext.declarative.declared_attr.
Same thing, but moving there since it is more of a
"marker" that's specific to declarative,
not just an attribute technique.

.. change::
:tags: declarative
:tickets: 1931, 1930

Fixed bug whereby columns on a mixin wouldn't propagate
correctly to a single-table, or joined-table,
inheritance scheme where the attribute name is
different than that of the column.,.

.. change::
:tags: declarative
:tickets:

A mixin can now specify a column that overrides
a column of the same name associated with a superclass.
Thanks to Oystein Haaland.

.. change::
:tags: engine
:tickets:

Fixed a regression in 0.6.4 whereby the change that
allowed cursor errors to be raised consistently broke
the result.lastrowid accessor. Test coverage has
been added for result.lastrowid. Note that lastrowid
is only supported by Pysqlite and some MySQL drivers,
so isn't super-useful in the general case.

.. change::
:tags: engine
:tickets:

the logging message emitted by the engine when
a connection is first used is now "BEGIN (implicit)"
to emphasize that DBAPI has no explicit begin().

.. change::
:tags: engine
:tickets: 1936

added "views=True" option to metadata.reflect(),
will add the list of available views to those
being reflected.

.. change::
:tags: engine
:tickets: 1899

engine_from_config() now accepts 'debug' for
'echo', 'echo_pool', 'force' for 'convert_unicode',
boolean values for 'use_native_unicode'.

.. change::
:tags: postgresql
:tickets:

Added "as_tuple" flag to ARRAY type, returns results
as tuples instead of lists to allow hashing.

.. change::
:tags: postgresql
:tickets: 1933

Fixed bug which prevented "domain" built from a
custom type such as "enum" from being reflected.

.. change::
:tags: mysql
:tickets: 1940

Fixed bug involving reflection of CURRENT_TIMESTAMP
default used with ON UPDATE clause, thanks to
Taavi Burns

.. change::
:tags: oracle
:tickets: 1878

The implicit_returning argument to create_engine()
is now honored regardless of detected version of
Oracle. Previously, the flag would be forced
to False if server version info was < 10.

.. change::
:tags: mssql
:tickets: 1946

Fixed reflection bug which did not properly handle
reflection of unknown types.

.. change::
:tags: mssql
:tickets: 1943

Fixed bug where aliasing of tables with "schema" would
fail to compile properly.

.. change::
:tags: mssql
:tickets: 1770

Rewrote the reflection of indexes to use sys.
catalogs, so that column names of any configuration
(spaces, embedded commas, etc.) can be reflected.
Note that reflection of indexes requires SQL
Server 2005 or greater.

.. change::
:tags: mssql
:tickets: 1952

mssql+pymssql dialect now honors the "port" portion
of the URL instead of discarding it.

.. change::
:tags: informix
:tickets: 1906

*Major* cleanup / modernization of the Informix
dialect for 0.6, courtesy Florian Apolloner.

.. change::
:tags: tests
:tickets:

the NoseSQLAlchemyPlugin has been moved to a
new package "sqlalchemy_nose" which installs
along with "sqlalchemy". This so that the "nosetests"
script works as always but also allows the
--with-coverage option to turn on coverage before
SQLAlchemy modules are imported, allowing coverage
to work correctly.

.. change::
:tags: misc
:tickets: 1890

CircularDependencyError now has .cycles and .edges
members, which are the set of elements involved in
one or more cycles, and the set of edges as 2-tuples.

.. changelog::

Page 38 of 50

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.