Sqlalchemy

Latest version: v2.0.30

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

Scan your dependencies

Page 39 of 50

0.6.4

Not secure
:released: Tue Sep 07 2010

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

The name ConcurrentModificationError has been
changed to StaleDataError, and descriptive
error messages have been revised to reflect
exactly what the issue is. Both names will
remain available for the foreseeable future
for schemes that may be specifying
ConcurrentModificationError in an "except:"
clause.

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

Added a mutex to the identity map which mutexes
remove operations against iteration methods,
which now pre-buffer before returning an
iterable. This because asynchronous gc
can remove items via the gc thread at any time.

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

The Session class is now present in sqlalchemy.orm.*.
We're moving away from the usage of create_session(),
which has non-standard defaults, for those situations
where a one-step Session constructor is desired. Most
users should stick with sessionmaker() for general use,
however.

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

query.with_parent() now accepts transient objects
and will use the non-persistent values of their pk/fk
attributes in order to formulate the criterion.
Docs are also clarified as to the purpose of with_parent().

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

The include_properties and exclude_properties arguments
to mapper() now accept Column objects as members in
addition to strings. This so that same-named Column
objects, such as those within a join(), can be
disambiguated.

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

A warning is now emitted if a mapper is created against a
join or other single selectable that includes multiple
columns with the same name in its .c. collection,
and those columns aren't explicitly named as part of
the same or separate attributes (or excluded).
In 0.7 this warning will be an exception. Note that
this warning is not emitted when the combination occurs
as a result of inheritance, so that attributes
still allow being overridden naturally.. In 0.7 this will be improved further.

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

The primary_key argument to mapper() can now specify
a series of columns that are only a subset of
the calculated "primary key" columns of the mapped
selectable, without an error being raised. This
helps for situations where a selectable's effective
primary key is simpler than the number of columns
in the selectable that are actually marked as
"primary_key", such as a join against two
tables on their primary key columns.

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

An object that's been deleted now gets a flag
'deleted', which prohibits the object from
being re-add()ed to the session, as previously
the object would live in the identity map
silently until its attributes were accessed.
The make_transient() function now resets this
flag along with the "key" flag.

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

make_transient() can be safely called on an
already transient instance.

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

a warning is emitted in mapper() if the polymorphic_on
column is not present either in direct or derived
form in the mapped selectable or in the
with_polymorphic selectable, instead of silently
ignoring it. Look for this to become an
exception in 0.7.

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

Another pass through the series of error messages
emitted when relationship() is configured with
ambiguous arguments. The "foreign_keys"
setting is no longer mentioned, as it is almost
never needed and it is preferable users set up
correct ForeignKey metadata, which is now the
recommendation. If 'foreign_keys'
is used and is incorrect, the message suggests
the attribute is probably unnecessary. Docs
for the attribute are beefed up. This
because all confused relationship() users on the
ML appear to be attempting to use foreign_keys
due to the message, which only confuses them
further since Table metadata is much clearer.

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

If the "secondary" table has no ForeignKey metadata
and no foreign_keys is set, even though the
user is passing screwed up information, it is assumed
that primary/secondaryjoin expressions should
consider only and all cols in "secondary" to be
foreign. It's not possible with "secondary" for
the foreign keys to be elsewhere in any case.
A warning is now emitted instead of an error,
and the mapping succeeds.

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

Moving an o2m object from one collection to
another, or vice versa changing the referenced
object by an m2o, where the foreign key is also a
member of the primary key, will now be more
carefully checked during flush if the change in
value of the foreign key on the "many" side is the
result of a change in the primary key of the "one"
side, or if the "one" is just a different object.
In one case, a cascade-capable DB would have
cascaded the value already and we need to look at
the "new" PK value to do an UPDATE, in the other we
need to continue looking at the "old". We now look
at the "old", assuming passive_updates=True,
unless we know it was a PK switch that
triggered the change.

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

The value of version_id_col can be changed
manually, and this will result in an UPDATE
of the row. Versioned UPDATEs and DELETEs
now use the "committed" value of the
version_id_col in the WHERE clause and
not the pending changed value. The
version generator is also bypassed if
manual changes are present on the attribute.

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

Repaired the usage of merge() when used with
concrete inheriting mappers. Such mappers frequently
have so-called "concrete" attributes, which are
subclass attributes that "disable" propagation from
the parent - these needed to allow a merge()
operation to pass through without effect.

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

Specifying a non-column based argument
for column_mapped_collection, including string,
text() etc., will raise an error message that
specifically asks for a column element, no longer
misleads with incorrect information about
text() or literal().

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

Similarly, for relationship(), foreign_keys,
remote_side, order_by - all column-based
expressions are enforced - lists of strings
are explicitly disallowed since this is a
very common error

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

Dynamic attributes don't support collection
population - added an assertion for when
set_committed_value() is called, as well as
when joinedload() or subqueryload() options
are applied to a dynamic attribute, instead
of failure / silent failure.

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

Fixed bug whereby generating a Query derived
from one which had the same column repeated
with different label names, typically
in some UNION situations, would fail to
propagate the inner columns completely to
the outer query.

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

object_session() raises the proper
UnmappedInstanceError when presented with an
unmapped instance.

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

Applied further memoizations to calculated Mapper
properties, with significant (~90%) runtime mapper.py
call count reduction in heavily polymorphic mapping
configurations.

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

mapper _get_col_to_prop private method used
by the versioning example is deprecated;
now use mapper.get_property_by_column() which
will remain the public method for this.

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

the versioning example works correctly now
if versioning on a col that was formerly
NULL.

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

Calling execute() on an alias() construct is pending
deprecation for 0.7, as it is not itself an
"executable" construct. It currently "proxies" its
inner element and is conditionally "executable" but
this is not the kind of ambiguity we like these days.

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

The execute() and scalar() methods of ClauseElement
are now moved appropriately to the Executable
subclass. ClauseElement.execute()/ scalar() are still
present and are pending deprecation in 0.7, but note
these would always raise an error anyway if you were
not an Executable (unless you were an alias(), see
previous note).

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

Added basic math expression coercion for
Numeric->Integer,
so that resulting type is Numeric regardless
of the direction of the expression.

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

Changed the scheme used to generate truncated
"auto" index names when using the "index=True"
flag on Column. The truncation only takes
place with the auto-generated name, not one
that is user-defined (an error would be
raised instead), and the truncation scheme
itself is now based on a fragment of an md5
hash of the identifier name, so that multiple
indexes on columns with similar names still
have unique names.

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

The generated index name also is based on
a "max index name length" attribute which is
separate from the "max identifier length" -
this to appease MySQL who has a max length
of 64 for index names, separate from their
overall max length of 255.

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

the text() construct, if placed in a column
oriented situation, will at least return NULLTYPE
for its type instead of None, allowing it to
be used a little more freely for ad-hoc column
expressions than before. literal_column()
is still the better choice, however.

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

Added full description of parent table/column,
target table/column in error message raised when
ForeignKey can't resolve target.

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

Fixed bug whereby replacing composite foreign key
columns in a reflected table would cause an attempt
to remove the reflected constraint from the table
a second time, raising a KeyError.

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

the _Label construct, i.e. the one that is produced
whenever you say somecol.label(), now counts itself
in its "proxy_set" unioned with that of its
contained column's proxy set, instead of
directly returning that of the contained column.
This allows column correspondence
operations which depend on the identity of the
_Labels themselves to return the correct result

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

fixes ORM bug.

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

Calling fetchone() or similar on a result that
has already been exhausted, has been closed,
or is not a result-returning result now
raises ResourceClosedError, a subclass of
InvalidRequestError, in all cases, regardless
of backend. Previously, some DBAPIs would
raise ProgrammingError (i.e. pysqlite), others
would return None leading to downstream breakages
(i.e. MySQL-python).

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

Fixed bug in Connection whereby if a "disconnect"
event occurred in the "initialize" phase of the
first connection pool connect, an AttributeError
would be raised when the Connection would attempt
to invalidate the DBAPI connection.

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

Connection, ResultProxy, as well as Session use
ResourceClosedError for all "this
connection/transaction/result is closed" types of
errors.

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

Connection.invalidate() can be called more than
once and subsequent calls do nothing.

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

if classproperty is used with a regular class-bound
mapper property attribute, it will be called to get the
actual attribute value during initialization. Currently,
there's no advantage to using classproperty on a column
or relationship attribute of a declarative class that
isn't a mixin - evaluation is at the same time as if
classproperty weren't used. But here we at least allow
it to function as expected.

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

Fixed bug where "Can't add additional column" message
would display the wrong name.

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

Fixed the psycopg2 dialect to use its
set_isolation_level() method instead of relying
upon the base "SET SESSION ISOLATION" command,
as psycopg2 resets the isolation level on each new
transaction otherwise.

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

Fixed "default schema" query to work with
pymssql backend.

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

Fixed bug whereby a column default would fail to
reflect if the "default" keyword were lower case.

.. change::
:tags: oracle
:tickets: 1879

Added ROWID type to the Oracle dialect, for those
cases where an explicit CAST might be needed.

.. change::
:tags: oracle
:tickets: 1867

Oracle reflection of indexes has been tuned so
that indexes which include some or all primary
key columns, but not the same set of columns
as that of the primary key, are reflected.
Indexes which contain the identical columns
as that of the primary key are skipped within
reflection, as the index in that case is assumed
to be the auto-generated primary key index.
Previously, any index with PK columns present
would be skipped. Thanks to Kent Bower
for the patch.

.. change::
:tags: oracle
:tickets: 1868

Oracle now reflects the names of primary key
constraints - also thanks to Kent Bower.

.. change::
:tags: informix
:tickets: 1904

Applied patches from to get
basic Informix functionality up again. We
rely upon end-user testing to ensure that
Informix is working to some degree.

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

The docs have been reorganized such that the "API
Reference" section is gone - all the docstrings from
there which were public API are moved into the
context of the main doc section that talks about it.
Main docs divided into "SQLAlchemy Core" and
"SQLAlchemy ORM" sections, mapper/relationship docs
have been broken out. Lots of sections rewritten
and/or reorganized.

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

The beaker_caching example has been reorganized
such that the Session, cache manager,
declarative_base are part of environment, and
custom cache code is portable and now within
"caching_query.py". This allows the example to
be easier to "drop in" to existing projects.

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

the history_meta versioning recipe sets "unique=False"
when copying columns, so that the versioning
table handles multiple rows with repeating values.

.. changelog::

0.6.3

Not secure
:released: Thu Jul 15 2010

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

Removed errant many-to-many load in unitofwork
which triggered unnecessarily on expired/unloaded
collections. This load now takes place only if
passive_updates is False and the parent primary
key has changed, or if passive_deletes is False
and a delete of the parent has occurred.

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

Column-entities (i.e. query(Foo.id)) copy their
state more fully when queries are derived from
themselves + a selectable (i.e. from_self(),
union(), etc.), so that join() and such have the
correct state to work from.

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

Fixed bug where Query.join() would fail if
querying a non-ORM column then joining without
an on clause when a FROM clause is already
present, now raises a checked exception the
same way it does when the clause is not
present.

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

Improved the check for an "unmapped class",
including the case where the superclass is mapped
but the subclass is not. Any attempts to access
cls._sa_class_manager.mapper now raise
UnmappedClassError().

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

Added "column_descriptions" accessor to Query,
returns a list of dictionaries containing
naming/typing information about the entities
the Query will return. Can be helpful for
building GUIs on top of ORM queries.

.. change::
:tags: mysql
:tickets: 1848

The _extract_error_code() method now works
correctly with each MySQL dialect (
MySQL-python, OurSQL, MySQL-Connector-Python,
PyODBC). Previously,
the reconnect logic would fail for OperationalError
conditions, however since MySQLdb and OurSQL
have their own reconnect feature, there was no
symptom for these drivers here unless one
watched the logs.

.. change::
:tags: oracle
:tickets: 1840

More tweaks to cx_oracle Decimal handling.
"Ambiguous" numerics with no decimal place
are coerced to int at the connection handler
level. The advantage here is that ints
come back as ints without SQLA type
objects being involved and without needless
conversion to Decimal first.

Unfortunately, some exotic subquery cases
can even see different types between
individual result rows, so the Numeric
handler, when instructed to return Decimal,
can't take full advantage of "native decimal"
mode and must run isinstance() on every value
to check if its Decimal already. Reopen of

.. changelog::

0.6.2

Not secure
:released: Tue Jul 06 2010

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

Query.join() will check for a call of the
form query.join(target, clause_expression),
i.e. missing the tuple, and raise an informative
error message that this is the wrong calling form.

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

Fixed bug regarding flushes on self-referential
bi-directional many-to-many relationships, where
two objects made to mutually reference each other
in one flush would fail to insert a row for both
sides. Regression from 0.5.

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

the post_update feature of relationship() has been
reworked architecturally to integrate more closely
with the new 0.6 unit of work. The motivation
for the change is so that multiple "post update"
calls, each affecting different foreign key
columns of the same row, are executed in a single
UPDATE statement, rather than one UPDATE
statement per column per row. Multiple row
updates are also batched into executemany()s as
possible, while maintaining consistent row ordering.

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

Query.statement, Query.subquery(), etc. now transfer
the values of bind parameters, i.e. those specified
by query.params(), into the resulting SQL expression.
Previously the values would not be transferred
and bind parameters would come out as None.

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

Subquery-eager-loading now works with Query objects
which include params(), as well as get() Queries.

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

Can now call make_transient() on an instance that
is referenced by parent objects via many-to-one,
without the parent's foreign key value getting
temporarily set to None - this was a function
of the "detect primary key switch" flush handler.
It now ignores objects that are no longer
in the "persistent" state, and the parent's
foreign key identifier is left unaffected.

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

query.order_by() now accepts False, which cancels
any existing order_by() state on the Query, allowing
subsequent generative methods to be called which do
not support ORDER BY. This is not the same as the
already existing feature of passing None, which
suppresses any existing order_by() settings, including
those configured on the mapper. False will make it
as though order_by() was never called, while
None is an active setting.

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

An instance which is moved to "transient", has
an incomplete or missing set of primary key
attributes, and contains expired attributes, will
raise an InvalidRequestError if an expired attribute
is accessed, instead of getting a recursion overflow.

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

The make_transient() function is now in the generated
documentation.

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

make_transient() removes all "loader" callables from
the state being made transient, removing any
"expired" state - all unloaded attributes reset back
to undefined, None/empty on access.

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

The warning emitted by the Unicode and String types
with convert_unicode=True no longer embeds the actual
value passed. This so that the Python warning
registry does not continue to grow in size, the warning
is emitted once as per the warning filter settings,
and large string values don't pollute the output.

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

Fixed bug that would prevent overridden clause
compilation from working for "annotated" expression
elements, which are often generated by the ORM.

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

The argument to "ESCAPE" of a LIKE operator or similar
is passed through render_literal_value(), which may
implement escaping of backslashes.

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

Fixed bug in Enum type which blew away native_enum
flag when used with TypeDecorators or other adaption
scenarios.

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

Inspector hits bind.connect() when invoked to ensure
initialize has been called. the internal name ".conn"
is changed to ".bind", since that's what it is.

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

Modified the internals of "column annotation" such that
a custom Column subclass can safely override
_constructor to return Column, for the purposes of
making "configurational" column classes that aren't
involved in proxying, etc.

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

Column.copy() takes along the "unique" attribute
among others, fixes regarding declarative
mixins

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

render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions.
Ultimately this will have to detect the value of
"standard_conforming_strings" for full behavior.

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

Won't generate "CREATE TYPE" / "DROP TYPE" if
using types.Enum on a PG version prior to 8.3 -
the supports_native_enum flag is fully
honored.

.. change::
:tags: mysql
:tickets: 1826

MySQL dialect doesn't emit CAST() for MySQL version
detected < 4.0.2. This allows the unicode
check on connect to proceed.

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

MySQL dialect now detects NO_BACKSLASH_ESCAPES sql
mode, in addition to ANSI_QUOTES.

.. change::
:tags: mysql
:tickets: 1400

render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions. This behavior
is derived from detecting the value of
NO_BACKSLASH_ESCAPES.

.. change::
:tags: oracle
:tickets: 1819

Fixed ora-8 compatibility flags such that they
don't cache a stale value from before the first
database connection actually occurs.

.. change::
:tags: oracle
:tickets: 1840

Oracle's "native decimal" metadata begins to return
ambiguous typing information about numerics
when columns are embedded in subqueries as well
as when ROWNUM is consulted with subqueries, as we
do for limit/offset. We've added these ambiguous
conditions to the cx_oracle "convert to Decimal()"
handler, so that we receive numerics as Decimal
in more cases instead of as floats. These are
then converted, if requested, into Integer
or Float, or otherwise kept as the lossless
Decimal.

.. change::
:tags: mssql
:tickets: 1825

If server_version_info is outside the usual
range of (8, ), (9, ), (10, ), a warning is emitted
which suggests checking that the FreeTDS version
configuration is using 7.0 or 8.0, not 4.2.

.. change::
:tags: firebird
:tickets: 1823

Fixed incorrect signature in do_execute(), error
introduced in 0.6.1.

.. change::
:tags: firebird
:tickets: 1813

Firebird dialect adds CHAR, VARCHAR types which
accept a "charset" flag, to support Firebird
"CHARACTER SET" clause.

.. change::
:tags: declarative
:tickets: 1805, 1796, 1751

Added support for classproperty to provide
any kind of schema/mapping construct from a
declarative mixin, including columns with foreign
keys, relationships, column_property, deferred.
This solves all such issues on declarative mixins.
An error is raised if any MapperProperty subclass
is specified on a mixin without using classproperty.

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

a mixin class can now define a column that matches
one which is present on a __table__ defined on a
subclass. It cannot, however, define one that is
not present in the __table__, and the error message
here now works.

.. change::
:tags: extension, compiler
:tickets: 1838

The 'default' compiler is automatically copied over
when overriding the compilation of a built in
clause construct, so no KeyError is raised if the
user-defined compiler is specific to certain
backends and compilation for a different backend
is invoked.

.. change::
:tags: documentation
:tickets: 1820

Added documentation for the Inspector.

.. change::
:tags: documentation
:tickets: 1830

Fixed memoized_property and memoized_instancemethod
decorators so that Sphinx documentation picks up
these attributes and methods, such as
ResultProxy.inserted_primary_key.

.. changelog::

0.6.1

Not secure
:released: Mon May 31 2010

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

Fixed regression introduced in 0.6.0 involving improper
history accounting on mutable attributes.

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

Fixed regression introduced in 0.6.0 unit of work refactor
that broke updates for bi-directional relationship()
with post_update=True.

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

session.merge() will not expire attributes on the returned
instance if that instance is "pending".

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

fixed __setstate__ method of CollectionAdapter to not
fail during deserialize where parent InstanceState not
yet unserialized.

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

Added internal warning in case an instance without a
full PK happened to be expired and then was asked
to refresh.

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

Added more aggressive caching to the mapper's usage of
UPDATE, INSERT, and DELETE expressions. Assuming the
statement has no per-object SQL expressions attached,
the expression objects are cached by the mapper after
the first create, and their compiled form is stored
persistently in a cache dictionary for the duration of
the related Engine. The cache is an LRUCache for the
rare case that a mapper receives an extremely
high number of different column patterns as UPDATEs.

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

expr.in_() now accepts a text() construct as the argument.
Grouping parenthesis are added automatically, i.e. usage
is like `col.in_(text("select id from table"))`.

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

Columns of _Binary type (i.e. LargeBinary, BLOB, etc.)
will coerce a "basestring" on the right side into a
_Binary as well so that required DBAPI processing
takes place.

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

Added table.add_is_dependent_on(othertable), allows manual
placement of dependency rules between two Table objects
for use within create_all(), drop_all(), sorted_tables.

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

Fixed bug that prevented implicit RETURNING from functioning
properly with composite primary key that contained zeroes.

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

Fixed errant space character when generating ADD CONSTRAINT
for a named UNIQUE constraint.

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

Fixed "table" argument on constructor of ForeignKeyConstraint

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

Fixed bug in connection pool cursor wrapper whereby if a
cursor threw an exception on close(), the logging of the
message would fail.

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

the _make_proxy() method of ColumnClause and Column now use
self.__class__ to determine the class of object to be returned
instead of hardcoding to ColumnClause/Column, making it slightly
easier to produce specific subclasses of these which work in
alias/subquery situations.

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

func.XXX() doesn't inadvertently resolve to non-Function
classes (e.g. fixes func.text()).

.. change::
:tags: engines
:tickets: 1781

Fixed building the C extensions on Python 2.4.

.. change::
:tags: engines
:tickets:

Pool classes will reuse the same "pool_logging_name" setting
after a dispose() occurs.

.. change::
:tags: engines
:tickets:

Engine gains an "execution_options" argument and
update_execution_options() method, which will apply to
all connections generated by this engine.

.. change::
:tags: mysql
:tickets: 1794

func.sysdate() emits "SYSDATE()", i.e. with the ending
parenthesis, on MySQL.

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

Fixed concatenation of constraints when "PRIMARY KEY"
constraint gets moved to column level due to SQLite
AUTOINCREMENT keyword being rendered.

.. change::
:tags: oracle
:tickets: 1775

Added a check for cx_oracle versions lower than version 5,
in which case the incompatible "output type handler" won't
be used. This will impact decimal accuracy and some
unicode handling issues.

.. change::
:tags: oracle
:tickets: 1790

Fixed use_ansi=False mode, which was producing broken
WHERE clauses in pretty much all cases.

.. change::
:tags: oracle
:tickets: 1808

Re-established support for Oracle 8 with cx_oracle,
including that use_ansi is set to False automatically,
NVARCHAR2 and NCLOB are not rendered for Unicode,
"native unicode" check doesn't fail, cx_oracle
"native unicode" mode is disabled, VARCHAR() is emitted
with bytes count instead of char count.

.. change::
:tags: oracle
:tickets: 1670

oracle_xe 5 doesn't accept a Python unicode object in
its connect string in normal Python 2.x mode - so we coerce
to str() directly. non-ascii characters aren't supported
in connect strings here since we don't know what encoding
we could use.

.. change::
:tags: oracle
:tickets: 1815

FOR UPDATE is emitted in the syntactically correct position
when limit/offset is used, i.e. the ROWNUM subquery.
However, Oracle can't really handle FOR UPDATE with ORDER BY
or with subqueries, so its still not very usable, but at
least SQLA gets the SQL past the Oracle parser.

.. change::
:tags: firebird
:tickets: 1521

Added a label to the query used within has_table() and
has_sequence() to work with older versions of Firebird
that don't provide labels for result columns.

.. change::
:tags: firebird
:tickets: 1779

Added integer coercion to the "type_conv" attribute when
passed via query string, so that it is properly interpreted
by Kinterbasdb.

.. change::
:tags: firebird
:tickets: 1646

Added 'connection shutdown' to the list of exception strings
which indicate a dropped connection.

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

the SqlSoup constructor accepts a `base` argument which specifies
the base class to use for mapped classes, the default being
`object`.

.. changelog::

0.6.0

Not secure
:released: Sun Apr 18 2010

.. change::
:tags: orm
:tickets: 1742, 1081

Unit of work internals have been rewritten. Units of work
with large numbers of objects interdependent objects
can now be flushed without recursion overflows
as there is no longer reliance upon recursive calls. The number of internal structures now stays
constant for a particular session state, regardless of
how many relationships are present on mappings. The flow
of events now corresponds to a linear list of steps,
generated by the mappers and relationships based on actual
work to be done, filtered through a single topological sort
for correct ordering. Flush actions are assembled using
far fewer steps and less memory.

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

Along with the UOW rewrite, this also removes an issue
introduced in 0.6beta3 regarding topological cycle detection
for units of work with long dependency cycles. We now use
an algorithm written by Guido (thanks Guido!).

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

one-to-many relationships now maintain a list of positive
parent-child associations within the flush, preventing
previous parents marked as deleted from cascading a
delete or NULL foreign key set on those child objects,
despite the end-user not removing the child from the old
association.

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

A collection lazy load will switch off default
eagerloading on the reverse many-to-one side, since
that loading is by definition unnecessary.

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

Session.refresh() now does an equivalent expire()
on the given instance first, so that the "refresh-expire"
cascade is propagated. Previously, refresh() was
not affected in any way by the presence of "refresh-expire"
cascade. This is a change in behavior versus that
of 0.6beta2, where the "lockmode" flag passed to refresh()
would cause a version check to occur. Since the instance
is first expired, refresh() always upgrades the object
to the most recent version.

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

The 'refresh-expire' cascade, when reaching a pending object,
will expunge the object if the cascade also includes
"delete-orphan", or will simply detach it otherwise.

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

id(obj) is no longer used internally within topological.py,
as the sorting functions now require hashable objects
only.

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

The ORM will set the docstring of all generated descriptors
to None by default. This can be overridden using 'doc'
(or if using Sphinx, attribute docstrings work too).

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

Added kw argument 'doc' to all mapper property callables
as well as Column(). Will assemble the string 'doc' as
the '__doc__' attribute on the descriptor.

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

Usage of version_id_col on a backend that supports
cursor.rowcount for execute() but not executemany() now works
when a delete is issued (already worked for saves, since those
don't use executemany()). For a backend that doesn't support
cursor.rowcount at all, a warning is emitted the same
as with saves.

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

The ORM now short-term caches the "compiled" form of
insert() and update() constructs when flushing lists of
objects of all the same class, thereby avoiding redundant
compilation per individual INSERT/UPDATE within an
individual flush() call.

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

internal getattr(), setattr(), getcommitted() methods
on ColumnProperty, CompositeProperty, RelationshipProperty
have been underscored (i.e. are private), signature has
changed.

.. change::
:tags: engines
:tickets: 1757

The C extension now also works with DBAPIs which use custom
sequences as row (and not only tuples).

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

Restored some bind-labeling logic from 0.5 which ensures
that tables with column names that overlap another column
of the form "<tablename>_<columnname>" won't produce
errors if column._label is used as a bind name during
an UPDATE. Test coverage which wasn't present in 0.5
has been added.

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

somejoin.select(fold_equivalents=True) is no longer
deprecated, and will eventually be rolled into a more
comprehensive version of the feature for.

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

the Numeric type raises an *enormous* warning when expected
to convert floats to Decimal from a DBAPI that returns floats.
This includes SQLite, Sybase, MS-SQL.

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

Fixed an error in expression typing which caused an endless
loop for expressions with two NULL types.

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

Fixed bug in execution_options() feature whereby the existing
Transaction and other state information from the parent
connection would not be propagated to the sub-connection.

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

Added new 'compiled_cache' execution option. A dictionary
where Compiled objects will be cached when the Connection
compiles a clause expression into a dialect- and parameter-
specific Compiled object. It is the user's responsibility to
manage the size of this dictionary, which will have keys
corresponding to the dialect, clause element, the column
names within the VALUES or SET clause of an INSERT or UPDATE,
as well as the "batch" mode for an INSERT or UPDATE statement.

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

Added get_pk_constraint() to reflection.Inspector, similar
to get_primary_keys() except returns a dict that includes the
name of the constraint, for supported backends (PG so far).

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

Table.create() and Table.drop() no longer apply metadata-
level create/drop events.

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

the compiler extension now allows compiles decorators
on base classes that extend to child classes, compiles
decorators on child classes that aren't broken by a
compiles decorator on the base class.

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

Declarative will raise an informative error message
if a non-mapped class attribute is referenced in the
string-based relationship() arguments.

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

Further reworked the "mixin" logic in declarative to
additionally allow __mapper_args__ as a classproperty
on a mixin, such as to dynamically assign polymorphic_identity.

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

PostgreSQL now reflects sequence names associated with
SERIAL columns correctly, after the name of the sequence
has been changed. Thanks to Kumar McMillan for the patch.

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

Repaired missing import in psycopg2._PGNumeric type when
unknown numeric is received.

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

psycopg2/pg8000 dialects now aware of REAL[], FLOAT[],
DOUBLE_PRECISION[], NUMERIC[] return types without
raising an exception.

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

PostgreSQL reflects the name of primary key constraints,
if one exists.

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

Now using cx_oracle output converters so that the
DBAPI returns natively the kinds of values we prefer:

.. change::
:tags: oracle
:tickets: 1759

NUMBER values with positive precision + scale convert
to cx_oracle.STRING and then to Decimal. This
allows perfect precision for the Numeric type when
using cx_oracle.

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

STRING/FIXED_CHAR now convert to unicode natively.
SQLAlchemy's String types then don't need to
apply any kind of conversions.

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

The functionality of result.rowcount can be disabled on a
per-engine basis by setting 'enable_rowcount=False'
on create_engine(). Normally, cursor.rowcount is called
after any UPDATE or DELETE statement unconditionally,
because the cursor is then closed and Firebird requires
an open cursor in order to get a rowcount. This
call is slightly expensive however so it can be disabled.
To re-enable on a per-execution basis, the
'enable_rowcount=True' execution option may be used.

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

Updated attribute_shard.py example to use a more robust
method of searching a Query for binary expressions which
compare columns against literal values.

.. changelog::

0.6beta3

:released: Sun Mar 28 2010

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

Major feature: Added new "subquery" loading capability to
relationship(). This is an eager loading option which
generates a second SELECT for each collection represented
in a query, across all parents at once. The query
re-issues the original end-user query wrapped in a subquery,
applies joins out to the target collection, and loads
all those collections fully in one result, similar to
"joined" eager loading but using all inner joins and not
re-fetching full parent rows repeatedly (as most DBAPIs seem
to do, even if columns are skipped). Subquery loading is
available at mapper config level using "lazy='subquery'" and
at the query options level using "subqueryload(props..)",
"subqueryload_all(props...)".

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

To accommodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all(). The
old names will remain as synonyms for the foreseeable future.

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

The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select". The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.

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

Added with_hint() method to Query() construct. This calls
directly down to select().with_hint() and also accepts
entities as well as tables and aliases. See with_hint() in the
SQL section below.

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

Fixed bug in Query whereby calling q.join(prop).from_self(...).
join(prop) would fail to render the second join outside the
subquery, when joining on the same criterion as was on the
inside.

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

Fixed bug in Query whereby the usage of aliased() constructs
would fail if the underlying table (but not the actual alias)
were referenced inside the subquery generated by
q.from_self() or q.select_from().

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

Fixed bug which affected all eagerload() and similar options
such that "remote" eager loads, i.e. eagerloads off of a lazy
load such as query(A).options(eagerload(A.b, B.c))
wouldn't eagerload anything, but using eagerload("b.c") would
work fine.

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

Query gains an add_columns(\*columns) method which is a multi-
version of add_column(col). add_column(col) is future
deprecated.

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

Query.join() will detect if the end result will be
"FROM A JOIN A", and will raise an error if so.

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

Query.join(Cls.propname, from_joinpoint=True) will check more
carefully that "Cls" is compatible with the current joinpoint,
and act the same way as Query.join("propname", from_joinpoint=True)
in that regard.

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

Added with_hint() method to select() construct. Specify
a table/alias, hint text, and optional dialect name, and
"hints" will be rendered in the appropriate place in the
statement. Works for Oracle, Sybase, MySQL.

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

Fixed bug introduced in 0.6beta2 where column labels would
render inside of column expressions already assigned a label.

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

The psycopg2 dialect will log NOTICE messages via the
"sqlalchemy.dialects.postgresql" logger name.

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

the TIME and TIMESTAMP types are now available from the
postgresql dialect directly, which add the PG-specific
argument 'precision' to both. 'precision' and
'timezone' are correctly reflected for both TIME and
TIMEZONE types.

.. change::
:tags: mysql
:tickets: 1752

No longer guessing that TINYINT(1) should be BOOLEAN
when reflecting - TINYINT(1) is returned. Use Boolean/
BOOLEAN in table definition to get boolean conversion
behavior.

.. change::
:tags: oracle
:tickets: 1744

The Oracle dialect will issue VARCHAR type definitions
using character counts, i.e. VARCHAR2(50 CHAR), so that
the column is sized in terms of characters and not bytes.
Column reflection of character types will also use
ALL_TAB_COLUMNS.CHAR_LENGTH instead of
ALL_TAB_COLUMNS.DATA_LENGTH. Both of these behaviors take
effect when the server version is 9 or higher - for
version 8, the old behaviors are used.

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

Using a mixin won't break if the mixin implements an
unpredictable __getattribute__(), i.e. Zope interfaces.

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

Using classdecorator and similar on mixins to define
__tablename__, __table_args__, etc. now works if
the method references attributes on the ultimate
subclass.

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

relationships and columns with foreign keys aren't
allowed on declarative mixins, sorry.

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

The sqlalchemy.orm.shard module now becomes an extension,
sqlalchemy.ext.horizontal_shard. The old import
works with a deprecation warning.

.. changelog::

Page 39 of 50

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.