8
.. include:: changelog_07.rst
12
:released: October 26, 2013
19
Fixed bug where Oracle table reflection using synonyms would fail
20
if the synonym and the table were in different remote schemas.
21
Patch to fix courtesy Kyle Derr.
28
Fixed bug where :func:`.type_coerce` would not interpret ORM
29
elements with a ``__clause_element__()`` method properly.
36
The :class:`.Enum` and :class:`.Boolean` types now bypass
37
any custom (e.g. TypeDecorator) type in use when producing the
38
CHECK constraint for the "non native" type. This so that the custom type
39
isn't involved in the expression within the CHECK, since this
40
expression is against the "impl" value and not the "decorated" value.
43
:tags: bug, postgresql
47
Removed a 128-character truncation from the reflection of the
48
server default for a column; this code was original from
49
PG system views which truncated the string for readability.
56
The change in :ticket:`2721`, which is that the ``deferrable`` keyword
57
of :class:`.ForeignKeyConstraint` is silently ignored on the MySQL
58
backend, will be reverted as of 0.9; this keyword will now render again, raising
59
errors on MySQL as it is not understood - the same behavior will also
60
apply to the ``initially`` keyword. In 0.8, the keywords will remain
61
ignored but a warning is emitted. Additionally, the ``match`` keyword
62
now raises a :class:`.CompileError` on 0.9 and emits a warning on 0.8;
63
this keyword is not only silently ignored by MySQL but also breaks
64
the ON UPDATE/ON DELETE options.
66
To use a :class:`.ForeignKeyConstraint`
67
that does not render or renders differently on MySQL, use a custom
68
compilation option. An example of this usage has been added to the
69
documentation, see :ref:`mysql_foreign_keys`.
76
The ``.unique`` flag on :class:`.Index` could be produced as ``None``
77
if it was generated from a :class:`.Column` that didn't specify ``unique``
78
(where it defaults to ``None``). The flag will now always be ``True`` or
86
Added new option to :func:`.relationship` ``distinct_target_key``.
87
This enables the subquery eager loader strategy to apply a DISTINCT
88
to the innermost SELECT subquery, to assist in the case where
89
duplicate rows are generated by the innermost query which corresponds
90
to this relationship (there's not yet a general solution to the issue
91
of dupe rows within subquery eager loading, however, when joins outside
92
of the innermost subquery produce dupes). When the flag
93
is set to ``True``, the DISTINCT is rendered unconditionally, and when
94
it is set to ``None``, DISTINCT is rendered if the innermost relationship
95
targets columns that do not comprise a full primary key.
96
The option defaults to False in 0.8 (e.g. off by default in all cases),
97
None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval
105
MySQL-connector dialect now allows options in the create_engine
106
query string to override those defaults set up in the connect,
107
including "buffered" and "raise_on_warnings".
110
:tags: bug, postgresql
114
Parenthesis will be applied to a compound SQL expression as
115
rendered in the column list of a CREATE INDEX statement.
122
Fixed bug in default compiler plus those of postgresql, mysql, and
123
mssql to ensure that any literal SQL expression values are
124
rendered directly as literals, instead of as bound parameters,
125
within a CREATE INDEX statement. This also changes the rendering
126
scheme for other DDL such as constraints.
133
A :func:`.select` that is made to refer to itself in its FROM clause,
134
typically via in-place mutation, will raise an informative error
135
message rather than causing a recursion overflow.
142
Fixed bug where using an annotation such as :func:`.remote` or
143
:func:`.foreign` on a :class:`.Column` before association with a parent
144
:class:`.Table` could produce issues related to the parent table not
145
rendering within joins, due to the inherent copy operation performed
152
Non-working "schema" argument on :class:`.ForeignKey` is deprecated;
153
raises a warning. Removed in 0.9.
156
:tags: bug, postgresql
160
Fixed bug where Postgresql version strings that had a prefix preceding
161
the words "Postgresql" or "EnterpriseDB" would not parse.
162
Courtesy Scott Schaefer.
165
:tags: feature, engine
169
``repr()`` for the :class:`.URL` of an :class:`.Engine`
170
will now conceal the password using asterisks.
171
Courtesy Gunnlaugur Þór Briem.
178
Fixed bug where :meth:`.Query.exists` failed to work correctly
179
without any WHERE criterion. Courtesy Vladimir Magamedov.
186
Fixed bug where using the ``column_reflect`` event to change the ``.key``
187
of the incoming :class:`.Column` would prevent primary key constraints,
188
indexes, and foreign key constraints from being correctly reflected.
194
Added a new flag ``system=True`` to :class:`.Column`, which marks
195
the column as a "system" column which is automatically made present
196
by the database (such as Postgresql ``oid`` or ``xmin``). The
197
column will be omitted from the ``CREATE TABLE`` statement but will
198
otherwise be available for querying. In addition, the
199
:class:`.CreateColumn` construct can be appled to a custom
200
compilation rule which allows skipping of columns, by producing
201
a rule that returns ``None``.
207
Backported a change from 0.9 whereby the iteration of a hierarchy
208
of mappers used in polymorphic inheritance loads is sorted,
209
which allows the SELECT statements generated for polymorphic queries
210
to have deterministic rendering, which in turn helps with caching
211
schemes that cache on the SQL string itself.
218
Fixed a potential issue in an ordered sequence implementation used
219
by the ORM to iterate mapper hierarchies; under the Jython interpreter
220
this implementation wasn't ordered, even though cPython and Pypy
227
Added "autoincrement=False" to the history table created in the
228
versioning example, as this table shouldn't have autoinc on it
229
in any case, courtesy Patrick Schmid.
235
The :meth:`.Operators.notin_` operator added in 0.8 now properly
236
produces the negation of the expression "IN" returns
237
when used against an empty collection.
240
:tags: feature, examples
243
Improved the examples in ``examples/generic_associations``, including
244
that ``discriminator_on_association.py`` makes use of single table
245
inheritance do the work with the "discriminator". Also
246
added a true "generic foreign key" example, which works similarly
247
to other popular frameworks in that it uses an open-ended integer
248
to point to any other table, foregoing traditional referential
249
integrity. While we don't recommend this pattern, information wants
253
:tags: feature, orm, declarative
256
Added a convenience class decorator :func:`.as_declarative`, is
257
a wrapper for :func:`.declarative_base` which allows an existing base
258
class to be applied using a nifty class-decorated approach.
265
Fixed bug in ORM-level event registration where the "raw" or
266
"propagate" flags could potentially be mis-configured in some
267
"unmapped base class" configurations.
274
A performance fix related to the usage of the :func:`.defer` option
275
when loading mapped entities. The function overhead of applying
276
a per-object deferred callable to an instance at load time was
277
significantly higher than that of just loading the data from the row
278
(note that ``defer()`` is meant to reduce DB/network overhead, not
279
necessarily function call count); the function call overhead is now
280
less than that of loading data from the column in all cases. There
281
is also a reduction in the number of "lazy callable" objects created
282
per load from N (total deferred values in the result) to 1 (total
283
number of deferred cols).
290
The newly added SQLite DATETIME arguments storage_format and
291
regexp apparently were not fully implemented correctly; while the
292
arguments were accepted, in practice they would have no effect;
296
:tags: bug, sql, postgresql
300
Fixed bug where the expression system relied upon the ``str()``
301
form of a some expressions when referring to the ``.c`` collection
302
on a ``select()`` construct, but the ``str()`` form isn't available
303
since the element relies on dialect-specific compilation constructs,
304
notably the ``__getitem__()`` operator as used with a Postgresql
305
``ARRAY`` element. The fix also adds a new exception class
306
:class:`.UnsupportedCompilationError` which is raised in those cases
307
where a compiler is asked to compile something it doesn't know
311
:tags: bug, engine, oracle
315
Dialect.initialize() is not called a second time if an :class:`.Engine`
316
is recreated, due to a disconnect error. This fixes a particular
317
issue in the Oracle 8 dialect, but in general the dialect.initialize()
318
phase should only be once per dialect.
324
Added new method to the :func:`.insert` construct
325
:meth:`.Insert.from_select`. Given a list of columns and
326
a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``.
332
The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs
333
will now interpret ORM entities as target tables clauses to be operated upon,
336
from sqlalchemy import insert, update, delete
338
ins = insert(SomeMappedClass).values(x=5)
340
del_ = delete(SomeMappedClass).where(SomeMappedClass.id == 5)
342
upd = update(SomeMappedClass).where(SomeMappedClass.id == 5).values(name='ed')
349
Fixed bug whereby attribute history functions would fail
350
when an object we moved from "persistent" to "pending"
351
using the :func:`.make_transient` function, for operations
352
involving collection-based backrefs.
355
:tags: bug, engine, pool
359
Fixed bug where :class:`.QueuePool` would lose the correct
360
checked out count if an existing pooled connection failed to reconnect
361
after an invalidate or recycle event.
8
365
:released: July 3, 2013