SQLAlchemy 0.7b3 is now available. This might be the last of the betas before we release 0.7.0 upon the unsuspecting Pypi community.
Lots of new things here, including lots of fixes and changes that are backported into 0.6 which will be in 0.6.7. We did a bunch of sprinting at Pycon and pretty much the whole thing is just about ready for 0.7.0. SQLAlchemy 0.7 beta3 is available at: http://www.sqlalchemy.org/download.html Note when reading CHANGES, the 0.7b3 as well as the 0.6.7 sections of the file indicate what's new in this release. Both are listed out below. I've also opened a thread on convore in case people want to jot down their impressions of the 0.7 betas: https://convore.com/sqlalchemy/hows-07-beta-testing-going/ Thanks to everyone who helped with this release including all the sprinters at Pycon 11 ! 0.7.0b3 ======= - general - Lots of fixes to unit tests when run under Pypy. - orm - Changed the underlying approach to query.count(). query.count() is now in all cases exactly: query. from_self(func.count(literal_column('1'))). scalar() That is, "select count(1) from (<full query>)". This produces a subquery in all cases, but vastly simplifies all the guessing count() tried to do previously, which would still fail in many scenarios particularly when joined table inheritance and other joins were involved. If the subquery produced for an otherwise very simple count is really an issue, use query(func.count()) as an optimization. [ticket:2093] - some changes to the identity map regarding rare weakref callbacks during iterations. The mutex has been removed as it apparently can cause a reentrant (i.e. in one thread) deadlock, perhaps when gc collects objects at the point of iteration in order to gain more memory. It is hoped that "dictionary changed during iteration" will be exceedingly rare as iteration methods internally acquire the full list of objects in a single values() call. [ticket:2087] - A tweak to the unit of work causes it to order the flush along relationship() dependencies even if the given objects don't have any inter-attribute references in memory, which was the behavior in 0.5 and earlier, so a flush of Parent/Child with only foreign key/primary key set will succeed. This while still maintaining 0.6 and above's not generating a ton of useless internal dependency structures within the flush that don't correspond to state actually within the current flush. [ticket:2082] - Improvements to the error messages emitted when querying against column-only entities in conjunction with (typically incorrectly) using loader options, where the parent entity is not fully present. [ticket:2069] - Fixed bug in query.options() whereby a path applied to a lazyload using string keys could overlap a same named attribute on the wrong entity. Note 0.6 has a more conservative fix to this. [ticket:2098] - sql - Added a fully descriptive error message for the case where Column is subclassed and _make_proxy() fails to make a copy due to TypeError on the constructor. The method _constructor should be implemented in this case. - Added new event "column_reflect" for Table objects. Receives the info dictionary about a Column before the object is generated within reflection, and allows modification to the dictionary for control over most aspects of the resulting Column including key, name, type, info dictionary. [ticket:2095] - To help with the "column_reflect" event being used with specific Table objects instead of all instances of Table, listeners can be added to a Table object inline with its construction using a new argument "listeners", a list of tuples of the form (<eventname>, <fn>), which are applied to the Table before the reflection process begins. - Added new generic function "next_value()", accepts a Sequence object as its argument and renders the appropriate "next value" generation string on the target platform, if supported. Also provides ".next_value()" method on Sequence itself. [ticket:2085] - func.next_value() or other SQL expression can be embedded directly into an insert() construct, and if implicit or explicit "returning" is used in conjunction with a primary key column, the newly generated value will be present in result.inserted_primary_key. [ticket:2084] - engine - Fixed AssertionPool regression bug. [ticket:2097] - dialect - Changed exception raised to ArgumentError when an invalid dialect is specified. [ticket:2060] - examples - Updated the association, association proxy examples to use declarative, added a new example dict_of_sets_with_default.py, a "pushing the envelope" example of association proxy. 0.6.7 - these are also in 0.7b3 except for the first, many were already present in prior 0.7 betas. ===== - orm - Tightened the iterate vs. remove mutex around the identity map iteration, attempting to reduce the chance of an (extremely rare) reentrant gc operation causing a deadlock. Might remove the mutex in 0.7. [ticket:2087] - [note: 0.7 has the mutex removed] - Added a `name` argument to `Query.subquery()`, to allow a fixed name to be assigned to the alias object. [ticket:2030] - A warning is emitted when a joined-table inheriting mapper has no primary keys on the locally mapped table (but has pks on the superclass table). [ticket:2019] - Fixed bug where "middle" class in a polymorphic hierarchy would have no 'polymorphic_on' column if it didn't also specify a 'polymorphic_identity', leading to strange errors upon refresh, wrong class loaded when querying from that target. Also emits the correct WHERE criterion when using single table inheritance. [ticket:2038] - Fixed bug where a column with a SQL or server side default that was excluded from a mapping with include_properties or exclude_properties would result in UnmappedColumnError. [ticket:1995] - A warning is emitted in the unusual case that an append or similar event on a collection occurs after the parent object has been dereferenced, which prevents the parent from being marked as "dirty" in the session. This will be an exception in 0.7. [ticket:2046] - Fixed bug in query.options() whereby a path applied to a lazyload using string keys could overlap a same named attribute on the wrong entity. Note 0.7 has an updated version of this fix. [ticket:2098] - sql - Column.copy(), as used in table.tometadata(), copies the 'doc' attribute. [ticket:2028] - Added some defs to the resultproxy.c extension so that the extension compiles and runs on Python 2.4. [ticket:2023] - The compiler extension now supports overriding the default compilation of expression._BindParamClause including that the auto-generated binds within the VALUES/SET clause of an insert()/update() statement will also use the new compilation rules. [ticket:2042] - Added accessors to ResultProxy "returns_rows", "is_insert" [ticket:2089] - postgresql - When explicit sequence execution derives the name of the auto-generated sequence of a SERIAL column, which currently only occurs if implicit_returning=False, now accommodates if the table + column name is greater than 63 characters using the same logic Postgresql uses. [ticket:1083] - Added an additional libpq message to the list of "disconnect" exceptions, "could not receive data from server" [ticket:2044] - Added RESERVED_WORDS for postgresql dialect. [ticket:2092] - Fixed the BIT type to allow a "length" parameter, "varying" parameter. Reflection also fixed. [ticket:2073] - informix - Added RESERVED_WORDS informix dialect. [ticket:2092] - mssql - Rewrote the query used to get the definition of a view, typically when using the Inspector interface, to use sys.sql_modules instead of the information schema, thereby allowing views definitions longer than 4000 characters to be fully returned. [ticket:2071] - mysql - oursql dialect accepts the same "ssl" arguments in create_engine() as that of MySQLdb. [ticket:2047] - firebird - The "implicit_returning" flag on create_engine() is honored if set to False. [ticket:2083] - ext - The horizontal_shard ShardedSession class accepts the common Session argument "query_cls" as a constructor argument, to enable further subclassing of ShardedQuery. [ticket:2090] - declarative - Added an explicit check for the case that the name 'metadata' is used for a column attribute on a declarative class. [ticket:2050] - Fix error message referencing old @classproperty name to reference @declared_attr [ticket:2061] - Arguments in __mapper_args__ that aren't "hashable" aren't mistaken for always-hashable, possibly-column arguments. [ticket:2091] - examples - The Beaker caching example allows a "query_cls" argument to the query_callable() function. [ticket:2090] -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
