Hello list - Another month (more or less), another release. SQLAlchemy 0.6.2 is out. Highlights of this release:
- one showstopper was fixed. Firebird support was busted for 0.6.1, repaired that. - one semi-showstopper, though we've all been putting up with it for a long time, was fixed. The "non unicode warning" message doesn't embed the value anymore - the reason this is important is so that warning strings don't pile up in memory. - If you were on an ancient MySQL 3.2.3 type of version, your show was similarly stopped. Kludged around one particular issue there (case() is ignored on that platform). - ever do this ? query.join(Destination, Destiantion.id==Parent.dest_id). Yeah me too. That will raise an error now. (in case you don't know what I'm talking about, the subtlety is: query.join((Destination, Destination.id==Parent.dest_id)). - Declarative mixins can do everything now. You need to use sqlalchemy.util.classproperty in most cases to do it. It's all in the docs. - The new numeric approach we use with Oracle needed some tweaking. - I'm using "post_update" heavily in my current project. Historically, if you flushed 1000 objects with three post_update relationships each, you'd get 3000 UPDATE statements. Now you'll usually get a single UPDATE statement with 1000 sets of parameters. This is thanks to the unit of work rewrite of 0.6. - a bunch of bug fixes, quirky things other people bugged me to change and/or fix, or that I stumbled over. - improvements to the little-known make_transient() method, again because I'm using it. There's a cool new recipe that uses it at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/VersionedRows . - the docs slowly get better, less obsolete, more complete. Everyone should stroll through them periodically both to catch up on new / previously unknown things, as well as to alert me of fixes that are needed. Download SQLAlchemy 0.6.2 at: http://www.sqlalchemy.org/download.html 0.6.2 ===== - orm - 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. - 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. [ticket:1824] - 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. - 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. - Subquery-eager-loading now works with Query objects which include params(), as well as get() Queries. - 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. - 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. - 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. - The make_transient() function is now in the generated documentation. - 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. - sql - 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. [ticket:1822] - Fixed bug that would prevent overridden clause compilation from working for "annotated" expression elements, which are often generated by the ORM. - The argument to "ESCAPE" of a LIKE operator or similar is passed through render_literal_value(), which may implement escaping of backslashes. [ticket:1400] - Fixed bug in Enum type which blew away native_enum flag when used with TypeDecorators or other adaption scenarios. - 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. - 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. - Column.copy() takes along the "unique" attribute among others, fixes [ticket:1829] regarding declarative mixins - postgresql - 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. [ticket:1400] - 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. [ticket:1836] - mysql - MySQL dialect doesn't emit CAST() for MySQL version detected < 4.0.2. This allows the unicode check on connect to proceed. [ticket:1826] - MySQL dialect now detects NO_BACKSLASH_ESCAPES sql mode, in addition to ANSI_QUOTES. - 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. [ticket:1400] - oracle: - Fixed ora-8 compatibility flags such that they don't cache a stale value from before the first database connection actually occurs. [ticket:1819] - 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 [ticket:1840]. - mssql - 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. [ticket:1825] - firebird - Fixed incorrect signature in do_execute(), error introduced in 0.6.1. [ticket:1823] - Firebird dialect adds CHAR, VARCHAR types which accept a "charset" flag, to support Firebird "CHARACTER SET" clause. [ticket:1813] - declarative - 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. [ticket:1751] [ticket:1796] [ticket:1805] - 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. [ticket:1821] - compiler extension - 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. [ticket:1838] - documentation - Added documentation for the Inspector. [ticket:1820] - Fixed @memoized_property and @memoized_instancemethod decorators so that Sphinx documentation picks up these attributes and methods, such as ResultProxy.inserted_primary_key. [ticket:1830] -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.