:released: Sun Oct 22 2006
.. change::
:tags: general
:tickets:
logging is now implemented via standard python "logging" module.
"echo" keyword parameters are still functional but set/unset
log levels for their respective classes/instances. all logging
can be controlled directly through the Python API by setting
INFO and DEBUG levels for loggers in the "sqlalchemy" namespace.
class-level logging is under "sqlalchemy.<module>.<classname>",
instance-level logging under "sqlalchemy.<module>.<classname>.0x..<00-FF>".
Test suite includes "--log-info" and "--log-debug" arguments
which work independently of --verbose/--quiet. Logging added
to orm to allow tracking of mapper configurations, row iteration.
.. change::
:tags: general
:tickets:
the documentation-generation system has been overhauled to be
much simpler in design and more integrated with Markdown
.. change::
:tags: sqlite
:tickets:
sqlite boolean datatype converts False/True to 0/1 by default
.. change::
:tags: sqlite
:tickets: 335
fixes to Date/Time (SLDate/SLTime) types; works as good as postgres
now
.. change::
:tags: ms-sql
:tickets:
fixes bug 261 (table reflection broken for MS-SQL case-sensitive
databases)
.. change::
:tags: ms-sql
:tickets:
can now specify port for pymssql
.. change::
:tags: ms-sql
:tickets:
introduces new "auto_identity_insert" option for auto-switching
between "SET IDENTITY_INSERT" mode when values specified for IDENTITY columns
.. change::
:tags: ms-sql
:tickets:
now supports multi-column foreign keys
.. change::
:tags: ms-sql
:tickets:
fix to reflecting date/datetime columns
.. change::
:tags: ms-sql
:tickets:
NCHAR and NVARCHAR type support added
.. change::
:tags: oracle
:tickets:
Oracle has experimental support for cx_Oracle.TIMESTAMP, which requires
a setinputsizes() call on the cursor that is now enabled via the
'auto_setinputsizes' flag to the oracle dialect.
.. change::
:tags: firebird
:tickets:
aliases do not use "AS"
.. change::
:tags: firebird
:tickets:
correctly raises NoSuchTableError when reflecting non-existent table
.. change::
:tags: schema
:tickets:
a fair amount of cleanup to the schema package, removal of ambiguous
methods, methods that are no longer needed. slightly more constrained
usage, greater emphasis on explicitness
.. change::
:tags: schema
:tickets:
the "primary_key" attribute of Table and other selectables becomes
a setlike ColumnCollection object; is ordered but not numerically
indexed. a comparison clause between two pks that are derived from the
same underlying tables (i.e. such as two Alias objects) can be generated
via table1.primary_key==table2.primary_key
.. change::
:tags: schema
:tickets:
ForeignKey(Constraint) supports "use_alter=True", to create/drop a foreign key
via ALTER. this allows circular foreign key relationships to be set up.
.. change::
:tags: schema
:tickets:
append_item() methods removed from Table and Column; preferably
construct Table/Column/related objects inline, but if needed use
append_column(), append_foreign_key(), append_constraint(), etc.
.. change::
:tags: schema
:tickets:
table.create() no longer returns the Table object, instead has no
return value. the usual case is that tables are created via metadata,
which is preferable since it will handle table dependencies.
.. change::
:tags: schema
:tickets:
added UniqueConstraint (goes at Table level), CheckConstraint
(goes at Table or Column level).
.. change::
:tags: schema
:tickets:
index=False/unique=True on Column now creates a UniqueConstraint,
index=True/unique=False creates a plain Index,
index=True/unique=True on Column creates a unique Index. 'index'
and 'unique' keyword arguments to column are now boolean only; for
explicit names and groupings of indexes or unique constraints, use the
UniqueConstraint/Index constructs explicitly.
.. change::
:tags: schema
:tickets:
added autoincrement=True to Column; will disable schema generation
of SERIAL/AUTO_INCREMENT/identity seq for postgres/mysql/mssql if
explicitly set to False
.. change::
:tags: schema
:tickets:
TypeEngine objects now have methods to deal with copying and comparing
values of their specific type. Currently used by the ORM, see below.
.. change::
:tags: schema
:tickets:
fixed condition that occurred during reflection when a primary key
column was explicitly overridden, where the PrimaryKeyConstraint would
get both the reflected and the programmatic column doubled up
.. change::
:tags: schema
:tickets:
the "foreign_key" attribute on Column and ColumnElement in general
is deprecated, in favor of the "foreign_keys" list/set-based attribute,
which takes into account multiple foreign keys on one column.
"foreign_key" will return the first element in the "foreign_keys" list/set
or None if the list is empty.
.. change::
:tags: connections/pooling/execution
:tickets:
connection pool tracks open cursors and automatically closes them
if connection is returned to pool with cursors still opened. Can be
affected by options which cause it to raise an error instead, or to
do nothing. fixes issues with MySQL, others
.. change::
:tags: connections/pooling/execution
:tickets:
fixed bug where Connection wouldn't lose its Transaction
after commit/rollback
.. change::
:tags: connections/pooling/execution
:tickets:
added scalar() method to ComposedSQLEngine, ResultProxy
.. change::
:tags: connections/pooling/execution
:tickets:
ResultProxy will close() the underlying cursor when the ResultProxy
itself is closed. this will auto-close cursors for ResultProxy objects
that have had all their rows fetched (or had scalar() called).
.. change::
:tags: connections/pooling/execution
:tickets:
ResultProxy.fetchall() internally uses DBAPI fetchall() for better efficiency,
added to mapper iteration as well (courtesy Michael Twomey)
.. change::
:tags: construction, sql
:tickets: 292
changed "for_update" parameter to accept False/True/"nowait"
and "read", the latter two of which are interpreted only by
Oracle and MySQL
.. change::
:tags: construction, sql
:tickets:
added extract() function to sql dialect
(SELECT extract(field FROM expr))
.. change::
:tags: construction, sql
:tickets:
BooleanExpression includes new "negate" argument to specify
the appropriate negation operator if one is available.
.. change::
:tags: construction, sql
:tickets:
calling a negation on an "IN" or "IS" clause will result in
"NOT IN", "IS NOT" (as opposed to NOT (x IN y)).
.. change::
:tags: construction, sql
:tickets: 172
Function objects know what to do in a FROM clause now. their
behavior should be the same, except now you can also do things like
select(['*'], from_obj=[func.my_function()]) to get multiple
columns from the result, or even use sql.column() constructs to name the
return columns
.. change::
:tags: orm
:tickets:
attribute tracking modified to be more intelligent about detecting
changes, particularly with mutable types. TypeEngine objects now
take a greater role in defining how to compare two scalar instances,
including the addition of a MutableType mixin which is implemented by
PickleType. unit-of-work now tracks the "dirty" list as an expression
of all persistent objects where the attribute manager detects changes.
The basic issue that's fixed is detecting changes on PickleType
objects, but also generalizes type handling and "modified" object
checking to be more complete and extensible.
.. change::
:tags: orm
:tickets:
a wide refactoring to "attribute loader" and "options" architectures.
ColumnProperty and PropertyLoader define their loading behavior via switchable
"strategies", and MapperOptions no longer use mapper/property copying
in order to function; they are instead propagated via QueryContext
and SelectionContext objects at query/instances time.
All of the internal copying of mappers and properties that was used to handle
inheritance as well as options() has been removed; the structure
of mappers and properties is much simpler than before and is clearly laid out
in the new 'interfaces' module.
.. change::
:tags: orm
:tickets:
related to the mapper/property overhaul, internal refactoring to
mapper instances() method to use a SelectionContext object to track
state during the operation.
SLIGHT API BREAKAGE: the append_result() and populate_instances()
methods on MapperExtension have a slightly different method signature
now as a result of the change; hoping that these methods are not
in widespread use as of yet.
.. change::
:tags: orm
:tickets:
instances() method moved to Query now, backwards-compatible
version remains on Mapper.
.. change::
:tags: orm
:tickets:
added contains_eager() MapperOption, used in conjunction with
instances() to specify properties that should be eagerly loaded
from the result set, using their plain column names by default, or translated
given an custom row-translation function.
.. change::
:tags: orm
:tickets:
more rearrangements of unit-of-work commit scheme to better allow
dependencies within circular flushes to work properly...updated
task traversal/logging implementation
.. change::
:tags: orm
:tickets: 321
polymorphic mappers (i.e. using inheritance) now produces INSERT
statements in order of tables across all inherited classes
.. change::
:tags: orm
:tickets:
added an automatic "row switch" feature to mapping, which will
detect a pending instance/deleted instance pair with the same
identity key and convert the INSERT/DELETE to a single UPDATE
.. change::
:tags: orm
:tickets:
"association" mappings simplified to take advantage of
automatic "row switch" feature
.. change::
:tags: orm
:tickets: 212
"custom list classes" is now implemented via the "collection_class"
keyword argument to relation(). the old way still works but is
deprecated
.. change::
:tags: orm
:tickets:
added "viewonly" flag to relation(), allows construction of
relations that have no effect on the flush() process.
.. change::
:tags: orm
:tickets: 292
added "lockmode" argument to base Query select/get functions,
including "with_lockmode" function to get a Query copy that has
a default locking mode. Will translate "read"/"update"
arguments into a for_update argument on the select side.
.. change::
:tags: orm
:tickets:
implemented "version check" logic in Query/Mapper, used
when version_id_col is in effect and query.with_lockmode()
is used to get() an instance that's already loaded
.. change::
:tags: orm
:tickets: 208
post_update behavior improved; does a better job at not
updating too many rows, updates only required columns
.. change::
:tags: orm
:tickets: 308
adjustments to eager loading so that its "eager chain" is
kept separate from the normal mapper setup, thereby
preventing conflicts with lazy loader operation, fixes
.. change::
:tags: orm
:tickets:
fix to deferred group loading
.. change::
:tags: orm
:tickets: 346
session.flush() won't close a connection it opened
.. change::
:tags: orm
:tickets:
added "batch=True" flag to mapper; if False, save_obj
will fully save one object at a time including calls
to before_XXXX and after_XXXX
.. change::
:tags: orm
:tickets:
added "column_prefix=None" argument to mapper; prepends the
given string (typically '_') to column-based attributes automatically
set up from the mapper's Table
.. change::
:tags: orm
:tickets: 315
specifying joins in the from_obj argument of query.select() will
replace the main table of the query, if the table is somewhere within
the given from_obj. this makes it possible to produce custom joins and
outerjoins in queries without the main table getting added twice.
.. change::
:tags: orm
:tickets:
eagerloading is adjusted to more thoughtfully attach its LEFT OUTER JOINs
to the given query, looking for custom "FROM" clauses that may have
already been set up.
.. change::
:tags: orm
:tickets:
added join_to and outerjoin_to transformative methods to SelectResults,
to build up join/outerjoin conditions based on property names. also
added select_from to explicitly set from_obj parameter.
.. change::
:tags: orm
:tickets:
removed "is_primary" flag from mapper.
=============
0.4 Changelog
=============
.. changelog::