Sqlalchemy

Latest version: v2.0.36

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

Scan your dependencies

Page 43 of 51

0.5.0

Not secure
:released: Tue Jan 06 2009

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

Documentation has been converted to Sphinx. In particular,
the generated API documentation has been constructed into a
full blown "API Reference" section which organizes editorial
documentation combined with generated docstrings. Cross
linking between sections and API docs are vastly improved, a
javascript-powered search feature is provided, and a full
index of all classes, functions and members is provided.

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

setup.py now imports setuptools only optionally. If not
present, distutils is used. The new "pip" installer is
recommended over easy_install as it installs in a more
simplified way.

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

added an extremely basic illustration of a PostGIS integration
to the examples folder.

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

Query.with_polymorphic() now accepts a third argument
"discriminator" which will replace the value of
mapper.polymorphic_on for that query. Mappers themselves no
longer require polymorphic_on to be set, even if the mapper
has a polymorphic_identity. When not set, the mapper will
load non-polymorphically by default. Together, these two
features allow a non-polymorphic concrete inheritance setup to
use polymorphic loading on a per-query basis, since concrete
setups are prone to many issues when used polymorphically in
all cases.

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

dynamic_loader accepts a query_class= to customize the Query
classes used for both the dynamic collection and the queries
built from it.

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

query.order_by() accepts None which will remove any pending
order_by state from the query, as well as cancel out any
mapper/relation configured ordering. This is primarily useful
for overriding the ordering specified on a dynamic_loader().

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

RowProxy objects can be used in place of dictionary arguments
sent to connection.execute() and friends.

.. change::
:tags: dialect
:tickets:

Added a new description_encoding attribute on the dialect that
is used for encoding the column name when processing the
metadata. This usually defaults to utf-8.

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

Added in a new MSGenericBinary type. This maps to the Binary
type so it can implement the specialized behavior of treating
length specified types as fixed-width Binary types and
non-length types as an unbound variable length Binary type.

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

Added in new types: MSVarBinary and MSImage.

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

Added in the MSReal, MSNText, MSSmallDateTime, MSTime,
MSDateTimeOffset, and MSDateTime2 types

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

Table reflection now stores the actual DefaultClause value for
the column.

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

bugfixes, behavioral changes

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

Exceptions raised during compile_mappers() are now preserved
to provide "sticky behavior" - if a hasattr() call on a
pre-compiled mapped attribute triggers a failing compile and
suppresses the exception, subsequent compilation is blocked
and the exception will be reiterated on the next compile()
call. This issue occurs frequently when using declarative.

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

property.of_type() is now recognized on a single-table
inheriting target, when used in the context of
prop.of_type(..).any()/has(), as well as
query.join(prop.of_type(...)).

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

query.join() raises an error when the target of the join
doesn't match the property-based attribute - while it's
unlikely anyone is doing this, the SQLAlchemy author was
guilty of this particular loosey-goosey behavior.

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

Fixed bug when using weak_instance_map=False where modified
events would not be intercepted for a flush().

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

Fixed some deep "column correspondence" issues which could
impact a Query made against a selectable containing multiple
versions of the same table, as well as unions and similar
which contained the same table columns in different column
positions at different levels.

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

Custom comparator classes used in conjunction with
column_property(), relation() etc. can define new comparison
methods on the Comparator, which will become available via
__getattr__() on the InstrumentedAttribute. In the case of
synonym() or comparable_property(), attributes are resolved
first on the user-defined descriptor, then on the user-defined
comparator.

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

Added ScopedSession.is_active accessor.

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

Can pass mapped attributes and column objects as keys to
query.update({}).

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

Mapped attributes passed to the values() of an expression
level insert() or update() will use the keys of the mapped
columns, not that of the mapped attribute.

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

Corrected problem with Query.delete() and Query.update() not
working properly with bind parameters.

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

Query.select_from(), from_statement() ensure that the given
argument is a FromClause, or Text/Select/Union, respectively.

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

Query() can be passed a "composite" attribute as a column
expression and it will be expanded. Somewhat related to.

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

Query() is a little more robust when passed various column
expressions such as strings, clauselists, text() constructs
(which may mean it just raises an error more nicely).

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

first() works as expected with Query.from_statement().

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

Fixed bug introduced in 0.5rc4 involving eager loading not
functioning for properties which were added to a mapper
post-compile using add_property() or equivalent.

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

Fixed bug where many-to-many relation() with viewonly=True
would not correctly reference the link between
secondary->remote.

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

Duplicate items in a list-based collection will be maintained
when issuing INSERTs to a "secondary" table in a many-to-many
relation. Assuming the m2m table has a unique or primary key
constraint on it, this will raise the expected constraint
violation instead of silently dropping the duplicate
entries. Note that the old behavior remains for a one-to-many
relation since collection entries in that case don't result in
INSERT statements and SQLA doesn't manually police
collections.

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

Query.add_column() can accept FromClause objects in the same
manner as session.query() can.

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

Comparison of many-to-one relation to NULL is properly
converted to IS NOT NULL based on not_().

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

Extra checks added to ensure explicit
primaryjoin/secondaryjoin are ClauseElement instances, to
prevent more confusing errors later on.

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

Improved mapper() check for non-class classes.

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

comparator_factory argument is now documented and supported by
all MapperProperty types, including column_property(),
relation(), backref(), and synonym().

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

Changed the name of PropertyLoader to RelationProperty, to be
consistent with all the other names. PropertyLoader is still
present as a synonym.

.. change::
:tags: orm
:tickets: 1099, 1228

fixed "double iter()" call causing bus errors in shard API,
removed errant result.close() left over from the 0.4
version.

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

made Session.merge cascades not trigger autoflush. Fixes
merged instances getting prematurely inserted with missing
values.

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

Two fixes to help prevent out-of-band columns from being
rendered in polymorphic_union inheritance scenarios (which
then causes extra tables to be rendered in the FROM clause
causing cartesian products):

- improvements to "column adaption" for a->b->c inheritance
situations to better locate columns that are related to
one another via multiple levels of indirection, rather
than rendering the non-adapted column.

- the "polymorphic discriminator" column is only rendered
for the actual mapper being queried against. The column
won't be "pulled in" from a subclass or superclass mapper
since it's not needed.

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

Fixed shard_id argument on ShardedSession.execute().

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

Columns can again contain percent signs within their
names.

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

sqlalchemy.sql.expression.Function is now a public class. It
can be subclassed to provide user-defined SQL functions in an
imperative style, including with pre-established behaviors.
The postgis.py example illustrates one usage of this.

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

PickleType now favors == comparison by default, if the
incoming object (such as a dict) implements __eq__(). If the
object does not implement __eq__() and mutable=True, a
deprecation warning is raised.

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

Fixed the import weirdness in sqlalchemy.sql to not export
__names__.

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

Using the same ForeignKey object repeatedly raises an error
instead of silently failing later.

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

Added NotImplementedError for params() method on
Insert/Update/Delete constructs. These items currently don't
support this functionality, which also would be a little
misleading compared to values().

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

Reflected foreign keys will properly locate their referenced
column, even if the column was given a "key" attribute
different from the reflected name. This is achieved via a new
flag on ForeignKey/ForeignKeyConstraint called "link_to_name",
if True means the given name is the referred-to column's name,
not its assigned key.

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

select() can accept a ClauseList as a column in the same way
as a Table or other selectable and the interior expressions
will be used as column elements.

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

the "passive" flag on session.is_modified() is correctly
propagated to the attribute manager.

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

union() and union_all() will not whack any order_by() that has
been applied to the select()s inside. If you union() a
select() with order_by() (presumably to support LIMIT/OFFSET),
you should also call self_group() on it to apply parenthesis.

.. change::
:tags: engine/pool
:tickets: 1246

Connection.invalidate() checks for closed status to avoid
attribute errors.

.. change::
:tags: engine/pool
:tickets: 1094

NullPool supports reconnect on failure behavior.

.. change::
:tags: engine/pool
:tickets: 799

Added a mutex for the initial pool creation when using
pool.manage(dbapi). This prevents a minor case of "dogpile"
behavior which would otherwise occur upon a heavy load
startup.

.. change::
:tags: engine/pool
:tickets:

_execute_clauseelement() goes back to being a private method.
Subclassing Connection is not needed now that ConnectionProxy
is available.

.. change::
:tags: documentation
:tickets: 1149, 1200

Tickets.

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

Added note about create_session() defaults.

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

Added section about metadata.reflect().

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

Updated `TypeDecorator` section.

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

Rewrote the "threadlocal" strategy section of the docs due to
recent confusion over this feature.

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

Removed badly out of date 'polymorphic_fetch' and
'select_table' docs from inheritance, reworked the second half
of "joined table inheritance".

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

Documented `comparator_factory` kwarg, added new doc section
"Custom Comparators".

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

Refactored the Date/Time types. The ``smalldatetime`` data
type no longer truncates to a date only, and will now be
mapped to the MSSmallDateTime type.

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

Corrected an issue with Numerics to accept an int.

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

Mapped ``char_length`` to the ``LEN()`` function.

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

If an ``INSERT`` includes a subselect the ``INSERT`` is
converted from an ``INSERT INTO VALUES`` construct to a
``INSERT INTO SELECT`` construct.

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

If the column is part of a ``primary_key`` it will be ``NOT
NULL`` since MSSQL doesn't allow ``NULL`` in primary_key
columns.

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

``MSBinary`` now returns a ``BINARY`` instead of an
``IMAGE``. This is a backwards incompatible change in that
``BINARY`` is a fixed length data type whereas ``IMAGE`` is a
variable length data type.

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

``get_default_schema_name`` is now reflected from the database
based on the user's default schema. This only works with MSSQL
2005 and later.

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

Added collation support through the use of a new collation
argument. This is supported on the following types: char,
nchar, varchar, nvarchar, text, ntext.

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

Changes to the connection string parameters favor DSN as the
default specification for pyodbc. See the mssql.py docstring
for detailed usage instructions.

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

Added experimental support of savepoints. It currently does
not work fully with sessions.

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

Support for three levels of column nullability: NULL, NOT
NULL, and the database's configured default. The default
Column configuration (nullable=True) will now generate NULL in
the DDL. Previously no specification was emitted and the
database default would take effect (usually NULL, but not
always). To explicitly request the database default,
configure columns with nullable=None and no specification will
be emitted in DDL. This is backwards incompatible
behavior.

.. change::
:tags: postgres
:tickets: 1267

"%" signs in text() constructs are automatically escaped to
"%%". Because of the backwards incompatible nature of this
change, a warning is emitted if '%%' is detected in the
string.

.. change::
:tags: postgres
:tickets:

Calling alias.execute() in conjunction with
server_side_cursors won't raise AttributeError.

.. change::
:tags: postgres
:tickets: 714

Added Index reflection support to PostgreSQL, using a great
patch we long neglected, submitted by Ken
Kuhlman.

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

Adjusted the format of create_xid() to repair two-phase
commit. We now have field reports of Oracle two-phase commit
working properly with this change.

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

Added OracleNVarchar type, produces NVARCHAR2, and also
subclasses Unicode so that convert_unicode=True by default.
NVARCHAR2 reflects into this type automatically so these
columns pass unicode on a reflected table with no explicit
convert_unicode=True flags.

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

Fixed bug which was preventing out params of certain types
from being received; thanks a ton to huddlej at wwu.edu !

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

"%" signs in text() constructs are automatically escaped to
"%%". Because of the backwards incompatible nature of this
change, a warning is emitted if '%%' is detected in the
string.

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

Fixed bug in exception raise when FK columns not present
during reflection.

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

Fixed bug involving reflection of a remote-schema table with a
foreign key ref to another table in that schema.

.. change::
:tags: associationproxy
:tickets:

The association proxy properties are make themselves available
at the class level, e.g. MyClass.aproxy. Previously this
evaluated to None.

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

The full list of arguments accepted as string by backref()
includes 'primaryjoin', 'secondaryjoin', 'secondary',
'foreign_keys', 'remote_side', 'order_by'.

.. changelog::

0.5.0rc4

Not secure
:released: Fri Nov 14 2008

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

Query.count() has been enhanced to do the "right thing" in a
wider variety of cases. It can now count multiple-entity
queries, as well as column-based queries. Note that this means
if you say query(A, B).count() without any joining criterion,
it's going to count the cartesian product of A*B. Any query
which is against column-based entities will automatically
issue "SELECT count(1) FROM (SELECT...)" so that the real
rowcount is returned, meaning a query such as
query(func.count(A.name)).count() will return a value of one,
since that query would return one row.

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

Lots of performance tuning. A rough guesstimate over various
ORM operations places it 10% faster over 0.5.0rc3, 25-30% over
0.4.8.

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

bugfixes and behavioral changes

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

global "propigate"->"propagate" change.

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

Adjustments to the enhanced garbage collection on
InstanceState to better guard against errors due to lost
state.

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

Query.get() returns a more informative error message when
executed against multiple entities.

.. change::
:tags: orm
:tickets: 1140, 1221

Restored NotImplementedError on Cls.relation.in_()

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

Fixed PendingDeprecationWarning involving order_by parameter
on relation().

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

Removed the 'properties' attribute of the Connection object,
Connection.info should be used.

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

Restored "active rowcount" fetch before ResultProxy autocloses
the cursor. This was removed in 0.5rc3.

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

Rearranged the `load_dialect_impl()` method in `TypeDecorator`
such that it will take effect even if the user-defined
`TypeDecorator` uses another `TypeDecorator` as its impl.

.. change::
:tags: access
:tickets:

Added support for Currency type.

.. change::
:tags: access
:tickets: 1017

Functions were not return their result.

.. change::
:tags: access
:tickets: 1017

Corrected problem with joins. Access only support LEFT OUTER
or INNER not just JOIN by itself.

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

Lots of cleanup and fixes to correct problems with limit and
offset.

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

Correct situation where subqueries as part of a binary
expression need to be translated to use the IN and NOT IN
syntax.

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

Fixed E Notation issue that prevented the ability to insert
decimal values less than 1E-6.

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

Corrected problems with reflection when dealing with schemas,
particularly when those schemas are the default
schema.

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

Corrected problem with casting a zero length item to a
varchar. It now correctly adjusts the CAST.

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

Can now use a custom "inherit_condition" in __mapper_args__
when using declarative.

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

fixed string-based "remote_side", "order_by" and others not
propagating correctly when used in backref().

.. changelog::

0.5.0rc3

Not secure
:released: Fri Nov 07 2008

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

Added two new hooks to SessionExtension: after_bulk_delete()
and after_bulk_update(). after_bulk_delete() is called after
a bulk delete() operation on a query. after_bulk_update() is
called after a bulk update() operation on a query.

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

SQL compiler optimizations and complexity reduction. The call
count for compiling a typical select() construct is 20% less
versus 0.5.0rc2.

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

Dialects can now generate label names of adjustable
length. Pass in the argument "label_length=<value>" to
create_engine() to adjust how many characters max will be
present in dynamically generated column labels, i.e.
"somecolumn AS somelabel". Any value less than 6 will result
in a label of minimal size, consisting of an underscore and a
numeric counter. The compiler uses the value of
dialect.max_identifier_length as a default.

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

Added a new extension sqlalchemy.ext.serializer. Provides
Serializer/Deserializer "classes" which mirror
Pickle/Unpickle, as well as dumps() and loads(). This
serializer implements an "external object" pickler which keeps
key context-sensitive objects, including engines, sessions,
metadata, Tables/Columns, and mappers, outside of the pickle
stream, and can later restore the pickle using any
engine/metadata/session provider. This is used not for
pickling regular object instances, which are pickleable
without any special logic, but for pickling expression objects
and full Query objects, such that all mapper/engine/session
dependencies can be restored at unpickle time.

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

Wrote a docstring for Oracle dialect. Apparently that Ohloh
"few source code comments" label is starting to string :).

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

Removed FIRST_ROWS() optimize flag when using LIMIT/OFFSET,
can be re-enabled with optimize_limits=True create_engine()
flag.

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

bugfixes and behavioral changes

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

"not equals" comparisons of simple many-to-one relation to an
instance will not drop into an EXISTS clause and will compare
foreign key columns instead.

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

Removed not-really-working use cases of comparing a collection
to an iterable. Use contains() to test for collection
membership.

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

Improved the behavior of aliased() objects such that they more
accurately adapt the expressions generated, which helps
particularly with self-referential comparisons.

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

Fixed bug involving primaryjoin/secondaryjoin conditions
constructed from class-bound attributes (as often occurs when
using declarative), which later would be inappropriately
aliased by Query, particularly with the various EXISTS based
comparators.

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

Fixed bug when using multiple query.join() with an
aliased-bound descriptor which would lose the left alias.

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

Improved weakref identity map memory management to no longer
require mutexing, resurrects garbage collected instance on a
lazy basis for an InstanceState with pending changes.

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

InstanceState object now removes circular references to itself
upon disposal to keep it outside of cyclic garbage collection.

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

relation() won't hide unrelated ForeignKey errors inside of
the "please specify primaryjoin" message when determining join
condition.

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

Fixed bug in Query involving order_by() in conjunction with
multiple aliases of the same class (will add tests in)

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

When using Query.join() with an explicit clause for the ON
clause, the clause will be aliased in terms of the left side
of the join, allowing scenarios like query(Source).
from_self().join((Dest, Source.id==Dest.source_id)) to work
properly.

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

polymorphic_union() function respects the "key" of each Column
if they differ from the column's name.

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

Repaired support for "passive-deletes" on a many-to-one
relation() with "delete" cascade.

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

Fixed bug in composite types which prevented a primary-key
composite type from being mutated.

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

Added more granularity to internal attribute access, such that
cascade and flush operations will not initialize unloaded
attributes and collections, leaving them intact for a
lazy-load later on. Backref events still initialize attributes
and collections for pending instances.

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

Simplified the check for ResultProxy "autoclose without
results" to be based solely on presence of
cursor.description. All the regexp-based guessing about
statements returning rows has been removed.

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

Direct execution of a union() construct will properly set up
result-row processing.

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

The internal notion of an "OID" or "ROWID" column has been
removed. It's basically not used by any dialect, and the
possibility of its usage with psycopg2's cursor.lastrowid is
basically gone now that INSERT..RETURNING is available.

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

Removed "default_order_by()" method on all FromClause objects.

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

Repaired the table.tometadata() method so that a passed-in
schema argument is propagated to ForeignKey constructs.

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

Slightly changed behavior of IN operator for comparing to
empty collections. Now results in inequality comparison
against self. More portable, but breaks with stored procedures
that aren't pure functions.

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

Setting the auto_convert_lobs to False on create_engine() will
also instruct the OracleBinary type to return the cx_oracle
LOB object unchanged.

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

Fixed foreign key reflection in the edge case where a Table's
explicit schema= is the same as the schema (database) the
connection is attached to.

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

No longer expects include_columns in table reflection to be
lower case.

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

Fixed bug preventing declarative-bound "column" objects from
being used in column_mapped_collection().

.. change::
:tags: misc
:tickets: 1077

util.flatten_iterator() func doesn't interpret strings with
__iter__() methods as iterators, such as in pypy.

.. changelog::

0.5.0rc2

Not secure
:released: Sun Oct 12 2008

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

Fixed bug involving read/write relation()s that contain
literal or other non-column expressions within their
primaryjoin condition equated to a foreign key column.

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

"non-batch" mode in mapper(), a feature which allows mapper
extension methods to be called as each instance is
updated/inserted, now honors the insert order of the objects
given.

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

Fixed RLock-related bug in mapper which could deadlock upon
reentrant mapper compile() calls, something that occurs when
using declarative constructs inside of ForeignKey objects.

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

ScopedSession.query_property now accepts a query_cls factory,
overriding the session's configured query_cls.

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

Fixed shared state bug interfering with ScopedSession.mapper's
ability to apply default __init__ implementations on object
subclasses.

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

Fixed up slices on Query (i.e. query[x:y]) to work properly
for zero length slices, slices with None on either end.

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

Added an example illustrating Celko's "nested sets" as a
SQLA mapping.

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

contains_eager() with an alias argument works even when
the alias is embedded in a SELECT, as when sent to the
Query via query.select_from().

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

contains_eager() usage is now compatible with a Query that
also contains a regular eager load and limit/offset, in that
the columns are added to the Query-generated subquery.

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

session.execute() will execute a Sequence object passed to
it (regression from 0.4).

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

Removed the "raiseerror" keyword argument from object_mapper()
and class_mapper(). These functions raise in all cases
if the given class/instance is not mapped.

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

Fixed session.transaction.commit() on a autocommit=False
session not starting a new transaction.

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

Some adjustments to Session.identity_map's weak referencing
behavior to reduce asynchronous GC side effects.

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

Adjustment to Session's post-flush accounting of newly
"clean" objects to better protect against operating on
objects as they're asynchronously gc'ed.

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

column.in_(someselect) can now be used as a columns-clause
expression without the subquery bleeding into the FROM clause

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

Overhauled SQLite date/time bind/result processing to use
regular expressions and format strings, rather than
strptime/strftime, to generically support pre-1900 dates,
dates with microseconds.

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

String's (and Unicode's, UnicodeText's, etc.) convert_unicode
logic disabled in the sqlite dialect, to adjust for pysqlite
2.5.0's new requirement that only Python unicode objects are
accepted;
http://web.archive.org/web/20090614054912/https://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html

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

Temporary tables are now reflectable.

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

Oracle will detect string-based statements which contain
comments at the front before a SELECT as SELECT statements.

.. changelog::

0.5.0rc1

Not secure
:released: Thu Sep 11 2008

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

Query now has delete() and update(values) methods. This allows
to perform bulk deletes/updates with the Query object.

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

The RowTuple object returned by Query(\*cols) now features
keynames which prefer mapped attribute names over column keys,
column keys over column names, i.e. Query(Class.foo,
Class.bar) will have names "foo" and "bar" even if those are
not the names of the underlying Column objects. Direct Column
objects such as Query(table.c.col) will return the "key"
attribute of the Column.

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

Added scalar() and value() methods to Query, each return a
single scalar value. scalar() takes no arguments and is
roughly equivalent to first()[0], value()
takes a single column expression and is roughly equivalent to
values(expr).next()[0].

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

Improved the determination of the FROM clause when placing SQL
expressions in the query() list of entities. In particular
scalar subqueries should not "leak" their inner FROM objects
out into the enclosing query.

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

Joins along a relation() from a mapped class to a mapped
subclass, where the mapped subclass is configured with single
table inheritance, will include an IN clause which limits the
subtypes of the joined class to those requested, within the ON
clause of the join. This takes effect for eager load joins as
well as query.join(). Note that in some scenarios the IN
clause will appear in the WHERE clause of the query as well
since this discrimination has multiple trigger points.

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

AttributeExtension has been refined such that the event
is fired before the mutation actually occurs. Additionally,
the append() and set() methods must now return the given value,
which is used as the value to be used in the mutation operation.
This allows creation of validating AttributeListeners which
raise before the action actually occurs, and which can change
the given value into something else before its used.

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

column_property(), composite_property(), and relation() now
accept a single or list of AttributeExtensions using the
"extension" keyword argument.

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

query.order_by().get() silently drops the "ORDER BY" from
the query issued by GET but does not raise an exception.

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

Added a Validator AttributeExtension, as well as a
validates decorator which is used in a similar fashion
as reconstructor, and marks a method as validating
one or more mapped attributes.

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

class.someprop.in_() raises NotImplementedError pending the
implementation of "in\_" for relation

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

Fixed primary key update for many-to-many collections where
the collection had not been loaded yet

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

Fixed bug whereby deferred() columns with a group in conjunction
with an otherwise unrelated synonym() would produce
an AttributeError during deferred load.

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

The before_flush() hook on SessionExtension takes place before
the list of new/dirty/deleted is calculated for the final
time, allowing routines within before_flush() to further
change the state of the Session before the flush proceeds.

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

The "extension" argument to Session and others can now
optionally be a list, supporting events sent to multiple
SessionExtension instances. Session places SessionExtensions
in Session.extensions.

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

Reentrant calls to flush() raise an error. This also serves
as a rudimentary, but not foolproof, check against concurrent
calls to Session.flush().

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

Improved the behavior of query.join() when joining to
joined-table inheritance subclasses, using explicit join
criteria (i.e. not on a relation).

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

orm.attributes.reconstitute and
MapperExtension.reconstitute have been renamed to
orm.reconstructor and MapperExtension.reconstruct_instance

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

Fixed reconstructor hook for subclasses which inherit from a
base class.

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

The composite() property type now supports a
__set_composite_values__() method on the composite class which
is required if the class represents state using attribute
names other than the column's keynames; default-generated
values now get populated properly upon flush. Also,
composites with attributes set to None compare correctly.

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

The 3-tuple of iterables returned by attributes.get_history()
may now be a mix of lists and tuples. (Previously members
were always lists.)

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

Fixed bug whereby changing a primary key attribute on an
entity where the attribute's previous value had been expired
would produce an error upon flush().

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

Fixed custom instrumentation bug whereby get_instance_dict()
was not called for newly constructed instances not loaded
by the ORM.

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

Session.delete() adds the given object to the session if
not already present. This was a regression bug from 0.4.

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

The `echo_uow` flag on `Session` is deprecated, and unit-of-work
logging is now application-level only, not per-session level.

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

Removed conflicting `contains()` operator from
`InstrumentedAttribute` which didn't accept `escape` kwaarg.

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

Fixed bug whereby mapper couldn't initialize if a composite
primary key referenced another table that was not defined
yet.

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

Fixed exception throw which would occur when string-based
primaryjoin condition was used in conjunction with backref.

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

Added "sorted_tables" accessor to MetaData, which returns
Table objects sorted in order of dependency as a list.
This deprecates the MetaData.table_iterator() method.
The "reverse=False" keyword argument has also been
removed from util.sort_tables(); use the Python
'reversed' function to reverse the results.

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

The 'length' argument to all Numeric types has been renamed
to 'scale'. 'length' is deprecated and is still accepted
with a warning.

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

Dropped 0.3-compatibility for user defined types
(convert_result_value, convert_bind_param).

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

Temporarily rolled back the "ORDER BY" enhancement from. This feature is on hold pending further
development.

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

The exists() construct won't "export" its contained list
of elements as FROM clauses, allowing them to be used more
effectively in the columns clause of a SELECT.

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

and_() and or_() now generate a ColumnElement, allowing
boolean expressions as result columns, i.e.
select([and_(1, 0)]).

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

Bind params now subclass ColumnElement which allows them to be
selectable by orm.query (they already had most ColumnElement
semantics).

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

Added select_from() method to exists() construct, which becomes
more and more compatible with a regular select().

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

Added func.min(), func.max(), func.sum() as "generic functions",
which basically allows for their return type to be determined
automatically. Helps with dates on SQLite, decimal types,
others.

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

added decimal.Decimal as an "auto-detect" type; bind parameters
and generic functions will set their type to Numeric when a
Decimal is used.

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

The 'length' argument to MSInteger, MSBigInteger, MSTinyInteger,
MSSmallInteger and MSYear has been renamed to 'display_width'.

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

Added MSMediumInteger type.

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

the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
the parenthesis, which seem to get in the way when using in
conjunction with executemany().

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

limit/offset no longer uses ROW NUMBER OVER to limit rows,
and instead uses subqueries in conjunction with a special
Oracle optimization comment. Allows LIMIT/OFFSET to work
in conjunction with DISTINCT.

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

has_sequence() now takes the current "schema" argument into
account

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

added BFILE to reflected type names

.. changelog::

0.5.0beta3

:released: Mon Aug 04 2008

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

The "entity_name" feature of SQLAlchemy mappers has been
removed. For rationale, see https://tinyurl.com/6nm2ne

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

the "autoexpire" flag on Session, sessionmaker(), and
scoped_session() has been renamed to "expire_on_commit". It
does not affect the expiration behavior of rollback().

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

fixed endless loop bug which could occur within a mapper's
deferred load of inherited attributes.

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

a legacy-support flag "_enable_transaction_accounting" flag
added to Session which when False, disables all
transaction-level object accounting, including expire on
rollback, expire on commit, new/deleted list maintenance, and
autoflush on begin.

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

The 'cascade' parameter to relation() accepts None as a value,
which is equivalent to no cascades.

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

A critical fix to dynamic relations allows the "modified"
history to be properly cleared after a flush().

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

user-defined properties on a class are detected and left in
place during mapper initialization. This means that a
table-bound column of the same name will not be mapped at all
if a property is in the way (and the column is not remapped
to a different name), nor will an instrumented attribute from
an inherited class be applied. The same rules apply for names
excluded using the include_properties/exclude_properties
collections.

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

Added a new SessionExtension hook called after_attach(). This
is called at the point of attachment for objects via add(),
add_all(), delete(), and merge().

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

A mapper which inherits from another, when inheriting the
columns of its inherited mapper, will use any reassigned
property names specified in that inheriting mapper.
Previously, if "Base" had reassigned "base_id" to the name
"id", "SubBase(Base)" would still get an attribute called
"base_id". This could be worked around by explicitly stating
the column in each submapper as well but this is fairly
unworkable and also impossible when using declarative.

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

Fixed a series of potential race conditions in Session whereby
asynchronous GC could remove unmodified, no longer referenced
items from the session as they were present in a list of items
to be processed, typically during session.expunge_all() and
dependent methods.

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

Some improvements to the _CompileOnAttr mechanism which should
reduce the probability of "Attribute x was not replaced during
compile" warnings. (this generally applies to SQLA hackers,
like Elixir devs).

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

Fixed bug whereby the "unsaved, pending instance" FlushError
raised for a pending orphan would not take superclass mappers
into account when generating the list of relations responsible
for the error.

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

func.count() with no arguments renders as COUNT(*), equivalent
to func.count(text('*')).

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

simple label names in ORDER BY expressions render as
themselves, and not as a re-statement of their corresponding
expression. This feature is currently enabled only for
SQLite, MySQL, and PostgreSQL. It can be enabled on other
dialects as each is shown to support this
behavior.

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

Class-bound attributes sent as arguments to relation()'s
remote_side and foreign_keys parameters are now accepted,
allowing them to be used with declarative. Additionally fixed
bugs involving order_by being specified as a class-bound
attribute in conjunction with eager loading.

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

declarative initialization of Columns adjusted so that
non-renamed columns initialize in the same way as a non
declarative mapper. This allows an inheriting mapper to set
up its same-named "id" columns in particular such that the
parent "id" column is favored over the child column, reducing
database round trips when this value is requested.

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

Quoting of MSEnum values for use in CREATE TABLE is now
optional & will be quoted on demand as required. (Quoting was
always optional for use with existing tables.)

.. changelog::

Page 43 of 51

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.