1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
==============
1.0 Changelog
==============
.. changelog_imports::
.. include:: changelog_09.rst
:start-line: 5
.. include:: changelog_08.rst
:start-line: 5
.. include:: changelog_07.rst
:start-line: 5
.. changelog::
:version: 1.0.0
Version 1.0.0 is the first release of the 1.0 series. Many changes
described here are also present in the 0.9 and sometimes the 0.8
series as well. For changes that are specific to 1.0 with an emphasis
on compatibility concerns, see :doc:`/changelog/migration_10`.
.. change::
:tags: feature, orm
The :class:`.Query` will raise an exception when :meth:`.Query.yield_per`
is used with mappings or options where either
subquery eager loading, or joined eager loading with collections,
would take place. These loading strategies are
not currently compatible with yield_per, so by raising this error,
the method is safer to use. Eager loads can be disabled with
the ``lazyload('*')`` option or :meth:`.Query.enable_eagerloads`.
.. seealso::
:ref:`migration_yield_per_eager_loading`
.. change::
:tags: bug, orm
:tickets: 3177
Changed the approach by which the "single inheritance criterion"
is applied, when using :meth:`.Query.from_self`, or its common
user :meth:`.Query.count`. The criteria to limit rows to those
with a certain type is now indicated on the inside subquery,
not the outside one, so that even if the "type" column is not
available in the columns clause, we can filter on it on the "inner"
query.
.. seealso::
:ref:`migration_3177`
.. change::
:tags: change, orm
The ``proc()`` callable passed to the ``create_row_processor()``
method of custom :class:`.Bundle` classes now accepts only a single
"row" argument.
.. seealso::
:ref:`bundle_api_change`
.. change::
:tags: change, orm
Deprecated event hooks removed: ``populate_instance``,
``create_instance``, ``translate_row``, ``append_result``
.. seealso::
:ref:`migration_deprecated_orm_events`
.. change::
:tags: bug, orm
:tickets: 3145
Made a small adjustment to the mechanics of lazy loading,
such that it has less chance of interfering with a joinload() in the
very rare circumstance that an object points to itself; in this
scenario, the object refers to itself while loading its attributes
which can cause a mixup between loaders. The use case of
"object points to itself" is not fully supported, but the fix also
removes some overhead so for now is part of testing.
.. change::
:tags: feature, orm
:tickets: 3176
A new implementation for :class:`.KeyedTuple` used by the
:class:`.Query` object offers dramatic speed improvements when
fetching large numbers of column-oriented rows.
.. seealso::
:ref:`feature_3176`
.. change::
:tags: feature, orm
:tickets: 3008
The behavior of :paramref:`.joinedload.innerjoin` as well as
:paramref:`.relationship.innerjoin` is now to use "nested"
inner joins, that is, right-nested, as the default behavior when an
inner join joined eager load is chained to an outer join eager load.
.. seealso::
:ref:`migration_3008`
.. change::
:tags: bug, orm
:tickets: 3171
The "resurrect" ORM event has been removed. This event hook had
no purpose since the old "mutable attribute" system was removed
in 0.8.
.. change::
:tags: bug, sql
:tickets: 3169
Using :meth:`.Insert.from_select` now implies ``inline=True``
on :func:`.insert`. This helps to fix a bug where an
INSERT...FROM SELECT construct would inadvertently be compiled
as "implicit returning" on supporting backends, which would
cause breakage in the case of an INSERT that inserts zero rows
(as implicit returning expects a row), as well as arbitrary
return data in the case of an INSERT that inserts multiple
rows (e.g. only the first row of many).
A similar change is also applied to an INSERT..VALUES
with multiple parameter sets; implicit RETURNING will no longer emit
for this statement either. As both of these constructs deal
with varible numbers of rows, the
:attr:`.ResultProxy.inserted_primary_key` accessor does not
apply. Previously, there was a documentation note that one
may prefer ``inline=True`` with INSERT..FROM SELECT as some databases
don't support returning and therefore can't do "implicit" returning,
but there's no reason an INSERT...FROM SELECT needs implicit returning
in any case. Regular explicit :meth:`.Insert.returning` should
be used to return variable numbers of result rows if inserted
data is needed.
.. change::
:tags: bug, orm
:tickets: 3167
Fixed bug where attribute "set" events or columns with
``@validates`` would have events triggered within the flush process,
when those columns were the targets of a "fetch and populate"
operation, such as an autoincremented primary key, a Python side
default, or a server-side default "eagerly" fetched via RETURNING.
.. change::
:tags: feature, postgresql
:tickets: 2051
Added support for PG table options TABLESPACE, ON COMMIT,
WITH(OUT) OIDS, and INHERITS, when rendering DDL via
the :class:`.Table` construct. Pull request courtesy
malikdiarra.
.. seealso::
:ref:`postgresql_table_options`
.. change::
:tags: bug, orm, py3k
The :class:`.IdentityMap` exposed from :class:`.Session.identity`
now returns lists for ``items()`` and ``values()`` in Py3K.
Early porting to Py3K here had these returning iterators, when
they technically should be "iterable views"..for now, lists are OK.
.. change::
:tags: orm, feature
UPDATE statements can now be batched within an ORM flush
into more performant executemany() call, similarly to how INSERT
statements can be batched; this will be invoked within flush
to the degree that subsequent UPDATE statements for the
same mapping and table involve the identical columns within the
VALUES clause, that no SET-level SQL expressions
are embedded, and that the versioning requirements for the mapping
are compatible with the backend dialect's ability to return
a correct rowcount for an executemany operation.
.. change::
:tags: engine, bug
:tickets: 3163
Removing (or adding) an event listener at the same time that the event
is being run itself, either from inside the listener or from a
concurrent thread, now raises a RuntimeError, as the collection used is
now an instance of ``colletions.deque()`` and does not support changes
while being iterated. Previously, a plain Python list was used where
removal from inside the event itself would produce silent failures.
.. change::
:tags: orm, feature
:tickets: 2963
The ``info`` parameter has been added to the constructor for
:class:`.SynonymProperty` and :class:`.ComparableProperty`.
.. change::
:tags: sql, feature
:tickets: 2963
The ``info`` parameter has been added as a constructor argument
to all schema constructs including :class:`.MetaData`,
:class:`.Index`, :class:`.ForeignKey`, :class:`.ForeignKeyConstraint`,
:class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`,
:class:`.CheckConstraint`.
.. change::
:tags: orm, feature
:tickets: 2971
The :meth:`.InspectionAttr.info` collection is now moved down to
:class:`.InspectionAttr`, where in addition to being available
on all :class:`.MapperProperty` objects, it is also now available
on hybrid properties, association proxies, when accessed via
:attr:`.Mapper.all_orm_descriptors`.
.. change::
:tags: sql, feature
:tickets: 3027
:pullrequest: bitbucket:29
The :paramref:`.Table.autoload_with` flag now implies that
:paramref:`.Table.autoload` should be ``True``. Pull request
courtesy Malik Diarra.
.. change::
:tags: postgresql, feature
:pullreq: github:126
Added new method :meth:`.PGInspector.get_enums`, when using the
inspector for Postgresql will provide a list of ENUM types.
Pull request courtesy Ilya Pekelny.
.. change::
:tags: mysql, bug
The MySQL dialect will now disable :meth:`.ConnectionEvents.handle_error`
events from firing for those statements which it uses internally
to detect if a table exists or not. This is achieved using an
execution option ``skip_user_error_events`` that disables the handle
error event for the scope of that execution. In this way, user code
that rewrites exceptions doesn't need to worry about the MySQL
dialect or other dialects that occasionally need to catch
SQLAlchemy specific exceptions.
.. change::
:tags: mysql, bug
:tickets: 2515
Changed the default value of "raise_on_warnings" to False for
MySQLconnector. This was set at True for some reason. The "buffered"
flag unfortunately must stay at True as MySQLconnector does not allow
a cursor to be closed unless all results are fully fetched.
.. change::
:tags: bug, orm
:tickets: 3117
The "evaulator" for query.update()/delete() won't work with multi-table
updates, and needs to be set to `synchronize_session=False` or
`synchronize_session='fetch'`; this now raises an exception, with a
message to change the synchronize setting.
This is upgraded from a warning emitted as of 0.9.7.
.. change::
:tags: removed
The Drizzle dialect has been removed from the Core; it is now
available as `sqlalchemy-drizzle <https://bitbucket.org/zzzeek/sqlalchemy-drizzle>`_,
an independent, third party dialect. The dialect is still based
almost entirely off of the MySQL dialect present in SQLAlchemy.
.. seealso::
:ref:`change_2984`
.. change::
:tags: enhancement, orm
:tickets: 3061
Adjustment to attribute mechanics concerning when a value is
implicitly initialized to None via first access; this action,
which has always resulted in a population of the attribute,
no longer does so; the None value is returned but the underlying
attribute receives no set event. This is consistent with how collections
work and allows attribute mechanics to behave more consistently;
in particular, getting an attribute with no value does not squash
the event that should proceed if the value is actually set to None.
.. seealso::
:ref:`migration_3061`
.. change::
:tags: feature, sql
:tickets: 3034
The :meth:`.Select.limit` and :meth:`.Select.offset` methods
now accept any SQL expression, in addition to integer values, as
arguments. Typically this is used to allow a bound parameter to be
passed, which can be substituted with a value later thus allowing
Python-side caching of the SQL query. The implementation
here is fully backwards compatible with existing third party dialects,
however those dialects which implement special LIMIT/OFFSET systems
will need modification in order to take advantage of the new
capabilities. Work on this feature is courtesy of Dobes Vandermeer.
.. seealso::
:ref:`feature_3034`.
|