~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to doc/build/changelog/changelog_08.rst

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski, Jakub Wilk, Piotr Ożarowski
  • Date: 2013-07-06 20:53:52 UTC
  • mfrom: (1.4.23) (16.1.17 experimental)
  • Revision ID: package-import@ubuntu.com-20130706205352-ryppl1eto3illd79
Tags: 0.8.2-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Piotr Ożarowski ]
* New upstream release
* Upload to unstable
* Build depend on python3-all instead of -dev, extensions are not built for
  Python 3.X 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
==============
 
3
0.8 Changelog
 
4
==============
 
5
 
 
6
.. changelog::
 
7
    :version: 0.8.2
 
8
    :released: July 3, 2013
 
9
 
 
10
    .. change::
 
11
        :tags: bug, mysql
 
12
        :tickets: 2768
 
13
 
 
14
        Fixed bug when using multi-table UPDATE where a supplemental
 
15
        table is a SELECT with its own bound parameters, where the positioning
 
16
        of the bound parameters would be reversed versus the statement
 
17
        itself when using MySQL's special syntax.
 
18
 
 
19
    .. change::
 
20
        :tags: bug, sqlite
 
21
        :tickets: 2764
 
22
 
 
23
        Added :class:`.BIGINT` to the list of type names that can be
 
24
        reflected by the SQLite dialect; courtesy Russell Stuart.
 
25
 
 
26
    .. change::
 
27
        :tags: feature, orm, declarative
 
28
        :tickets: 2761
 
29
 
 
30
        ORM descriptors such as hybrid properties can now be referenced
 
31
        by name in a string argument used with ``order_by``,
 
32
        ``primaryjoin``, or similar in :func:`.relationship`,
 
33
        in addition to column-bound attributes.
 
34
 
 
35
    .. change::
 
36
        :tags: feature, firebird
 
37
        :tickets: 2763
 
38
 
 
39
        Added new flag ``retaining=True`` to the kinterbasdb and fdb dialects.
 
40
        This controls the value of the ``retaining`` flag sent to the
 
41
        ``commit()`` and ``rollback()`` methods of the DBAPI connection.
 
42
        Due to historical concerns, this flag defaults to ``True``, however
 
43
        in 0.9 this flag will be defaulted to ``False``.
 
44
 
 
45
    .. change::
 
46
        :tags: requirements
 
47
 
 
48
        The Python `mock <https://pypi.python.org/pypi/mock>`_ library
 
49
        is now required in order to run the unit test suite.  While part
 
50
        of the standard library as of Python 3.3, previous Python installations
 
51
        will need to install this in order to run unit tests or to
 
52
        use the ``sqlalchemy.testing`` package for external dialects.
 
53
 
 
54
    .. change::
 
55
        :tags: bug, orm
 
56
        :tickets: 2750
 
57
 
 
58
        A warning is emitted when trying to flush an object of an inherited
 
59
        class where the polymorphic discriminator has been assigned
 
60
        to a value that is invalid for the class.
 
61
 
 
62
    .. change::
 
63
        :tags: bug, postgresql
 
64
        :tickets: 2740
 
65
 
 
66
        The behavior of :func:`.extract` has been simplified on the
 
67
        Postgresql dialect to no longer inject a hardcoded ``::timestamp``
 
68
        or similar cast into the given expression, as this interfered
 
69
        with types such as timezone-aware datetimes, but also
 
70
        does not appear to be at all necessary with modern versions
 
71
        of psycopg2.
 
72
 
 
73
 
 
74
    .. change::
 
75
        :tags: bug, firebird
 
76
        :tickets: 2757
 
77
 
 
78
        Type lookup when reflecting the Firebird types LONG and
 
79
        INT64 has been fixed so that LONG is treated as INTEGER,
 
80
        INT64 treated as BIGINT, unless the type has a "precision"
 
81
        in which case it's treated as NUMERIC.  Patch courtesy
 
82
        Russell Stuart.
 
83
 
 
84
    .. change::
 
85
        :tags: bug, postgresql
 
86
        :tickets: 2766
 
87
 
 
88
        Fixed bug in HSTORE type where keys/values that contained
 
89
        backslashed quotes would not be escaped correctly when
 
90
        using the "non native" (i.e. non-psycopg2) means
 
91
        of translating HSTORE data.  Patch courtesy Ryan Kelly.
 
92
 
 
93
    .. change::
 
94
        :tags: bug, postgresql
 
95
        :tickets: 2767
 
96
 
 
97
        Fixed bug where the order of columns in a multi-column
 
98
        Postgresql index would be reflected in the wrong order.
 
99
        Courtesy Roman Podolyaka.
 
100
 
 
101
    .. change::
 
102
        :tags: bug, sql
 
103
        :tickets: 2746, 2668
 
104
 
 
105
        Multiple fixes to the correlation behavior of
 
106
        :class:`.Select` constructs, first introduced in 0.8.0:
 
107
 
 
108
        * To satisfy the use case where FROM entries should be
 
109
          correlated outwards to a SELECT that encloses another,
 
110
          which then encloses this one, correlation now works
 
111
          across multiple levels when explicit correlation is
 
112
          established via :meth:`.Select.correlate`, provided
 
113
          that the target select is somewhere along the chain
 
114
          contained by a WHERE/ORDER BY/columns clause, not
 
115
          just nested FROM clauses. This makes
 
116
          :meth:`.Select.correlate` act more compatibly to
 
117
          that of 0.7 again while still maintaining the new
 
118
          "smart" correlation.
 
119
 
 
120
        * When explicit correlation is not used, the usual
 
121
          "implicit" correlation limits its behavior to just
 
122
          the immediate enclosing SELECT, to maximize compatibility
 
123
          with 0.7 applications, and also prevents correlation
 
124
          across nested FROMs in this case, maintaining compatibility
 
125
          with 0.8.0/0.8.1.
 
126
 
 
127
        * The :meth:`.Select.correlate_except` method was not
 
128
          preventing the given FROM clauses from correlation in
 
129
          all cases, and also would cause FROM clauses to be incorrectly
 
130
          omitted entirely (more like what 0.7 would do),
 
131
          this has been fixed.
 
132
 
 
133
        * Calling `select.correlate_except(None)` will enter
 
134
          all FROM clauses into correlation as would be expected.
 
135
 
 
136
    .. change::
 
137
        :tags: bug, ext
 
138
 
 
139
        Fixed bug whereby if a composite type were set up
 
140
        with a function instead of a class, the mutable extension
 
141
        would trip up when it tried to check that column
 
142
        for being a :class:`.MutableComposite` (which it isn't).
 
143
        Courtesy asldevi.
 
144
 
 
145
    .. change::
 
146
        :tags: feature, sql
 
147
        :tickets: 2744, 2734
 
148
 
 
149
        Provided a new attribute for :class:`.TypeDecorator`
 
150
        called :attr:`.TypeDecorator.coerce_to_is_types`,
 
151
        to make it easier to control how comparisons using
 
152
        ``==`` or ``!=`` to ``None`` and boolean types goes
 
153
        about producing an ``IS`` expression, or a plain
 
154
        equality expression with a bound parameter.
 
155
 
 
156
    .. change::
 
157
        :tags: feature, postgresql
 
158
 
 
159
        Support for Postgresql 9.2 range types has been added.
 
160
        Currently, no type translation is provided, so works
 
161
        directly with strings or psycopg2 2.5 range extension types
 
162
        at the moment.  Patch courtesy Chris Withers.
 
163
 
 
164
    .. change::
 
165
        :tags: bug, examples
 
166
 
 
167
        Fixed an issue with the "versioning" recipe whereby a many-to-one
 
168
        reference could produce a meaningless version for the target,
 
169
        even though it was not changed, when backrefs were present.
 
170
        Patch courtesy Matt Chisholm.
 
171
 
 
172
    .. change::
 
173
        :tags: feature, postgresql
 
174
        :tickets: 2072
 
175
 
 
176
        Added support for "AUTOCOMMIT" isolation when using the psycopg2
 
177
        DBAPI.   The keyword is available via the ``isolation_level``
 
178
        execution option.  Patch courtesy Roman Podolyaka.
 
179
 
 
180
    .. change::
 
181
        :tags: bug, orm
 
182
        :tickets: 2759
 
183
 
 
184
        Fixed bug in polymorphic SQL generation where multiple joined-inheritance
 
185
        entities against the same base class joined to each other as well
 
186
        would not track columns on the base table independently of each other if
 
187
        the string of joins were more than two entities long.
 
188
 
 
189
    .. change::
 
190
        :tags: bug, engine
 
191
        :pullreq: 6
 
192
 
 
193
        Fixed bug where the ``reset_on_return`` argument to various :class:`.Pool`
 
194
        implementations would not be propagated when the pool was regenerated.
 
195
        Courtesy Eevee.
 
196
 
 
197
    .. change::
 
198
        :tags: bug, orm
 
199
        :tickets: 2754
 
200
 
 
201
        Fixed bug where sending a composite attribute into :meth:`.Query.order_by`
 
202
        would produce a parenthesized expression not accepted by some databases.
 
203
 
 
204
    .. change::
 
205
        :tags: bug, orm
 
206
        :tickets: 2755
 
207
 
 
208
        Fixed the interaction between composite attributes and
 
209
        the :func:`.aliased` function.  Previously, composite attributes
 
210
        wouldn't work correctly in comparison operations when aliasing
 
211
        was applied.
 
212
 
 
213
    .. change::
 
214
        :tags: bug, mysql
 
215
        :tickets: 2715
 
216
 
 
217
        Added another conditional to the ``mysql+gaerdbms`` dialect to
 
218
        detect so-called "development" mode, where we should use the
 
219
        ``rdbms_mysqldb`` DBAPI.  Patch courtesy Brett Slatkin.
 
220
 
 
221
    .. change::
 
222
        :tags: feature, mysql
 
223
        :tickets: 2704
 
224
 
 
225
        The ``mysql_length`` parameter used with :class:`.Index` can now
 
226
        be passed as a dictionary of column names/lengths, for use
 
227
        with composite indexes.  Big thanks to Roman Podolyaka for the
 
228
        patch.
 
229
 
 
230
    .. change::
 
231
        :tags: bug, mssql
 
232
        :tickets: 2747
 
233
 
 
234
        When querying the information schema on SQL Server 2000, removed
 
235
        a CAST call that was added in 0.8.1 to help with driver issues,
 
236
        which apparently is not compatible on 2000.
 
237
        The CAST remains in place for SQL Server 2005 and greater.
 
238
 
 
239
    .. change::
 
240
        :tags: bug, mysql
 
241
        :tickets: 2721
 
242
 
 
243
        The ``deferrable`` keyword argument on :class:`.ForeignKey` and
 
244
        :class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword
 
245
        on the MySQL dialect.  For a long time we left this in place because
 
246
        a non-deferrable foreign key would act very differently than a deferrable
 
247
        one, but some environments just disable FKs on MySQL, so we'll be less
 
248
        opinionated here.
 
249
 
 
250
    .. change::
 
251
        :tags: bug, ext, orm
 
252
        :tickets: 2730
 
253
 
 
254
        Fixed bug where :class:`.MutableDict` didn't report a change event
 
255
        when ``clear()`` was called.
 
256
 
 
257
    .. change::
 
258
        :tags: bug, sql
 
259
        :tickets: 2738
 
260
 
 
261
        Fixed bug whereby joining a select() of a table "A" with multiple
 
262
        foreign key paths to a table "B", to that table "B", would fail
 
263
        to produce the "ambiguous join condition" error that would be
 
264
        reported if you join table "A" directly to "B"; it would instead
 
265
        produce a join condition with multiple criteria.
 
266
 
 
267
    .. change::
 
268
        :tags: bug, sql, reflection
 
269
        :tickets: 2728
 
270
 
 
271
        Fixed bug whereby using :meth:`.MetaData.reflect` across a remote
 
272
        schema as well as a local schema could produce wrong results
 
273
        in the case where both schemas had a table of the same name.
 
274
 
 
275
    .. change::
 
276
        :tags: bug, sql
 
277
        :tickets: 2726
 
278
 
 
279
        Removed the "not implemented" ``__iter__()`` call from the base
 
280
        :class:`.ColumnOperators` class, while this was introduced
 
281
        in 0.8.0 to prevent an endless, memory-growing loop when one also
 
282
        implements a ``__getitem__()`` method on a custom
 
283
        operator and then calls erroneously ``list()`` on that object,
 
284
        it had the effect of causing column elements to report that they
 
285
        were in fact iterable types which then throw an error when you try
 
286
        to iterate.   There's no real way to have both sides here so we
 
287
        stick with Python best practices.  Careful with implementing
 
288
        ``__getitem__()`` on your custom operators!
 
289
 
 
290
    .. change::
 
291
      :tags: feature, orm
 
292
      :tickets: 2736
 
293
 
 
294
      Added a new method :meth:`.Query.select_entity_from` which
 
295
      will in 0.9 replace part of the functionality of
 
296
      :meth:`.Query.select_from`.  In 0.8, the two methods perform
 
297
      the same function, so that code can be migrated to use the
 
298
      :meth:`.Query.select_entity_from` method as appropriate.
 
299
      See the 0.9 migration guide for details.
 
300
 
 
301
    .. change::
 
302
      :tags: bug, orm
 
303
      :tickets: 2737
 
304
 
 
305
      Fixed a regression caused by :ticket:`2682` whereby the
 
306
      evaluation invoked by :meth:`.Query.update` and :meth:`.Query.delete`
 
307
      would hit upon unsupported ``True`` and ``False`` symbols
 
308
      which now appear due to the usage of ``IS``.
 
309
 
 
310
    .. change::
 
311
      :tags: bug, postgresql
 
312
      :tickets: 2735
 
313
 
 
314
      Fixed the HSTORE type to correctly encode/decode for unicode.
 
315
      This is always on, as the hstore is a textual type, and
 
316
      matches the behavior of psycopg2 when using Python 3.
 
317
      Courtesy Dmitry Mugtasimov.
 
318
 
 
319
    .. change::
 
320
      :tags: bug, examples
 
321
 
 
322
      Fixed a small bug in the dogpile example where the generation
 
323
      of SQL cache keys wasn't applying deduping labels to the
 
324
      statement the same way :class:`.Query` normally does.
 
325
 
 
326
    .. change::
 
327
      :tags: bug, engine, sybase
 
328
      :tickets: 2732
 
329
 
 
330
      Fixed a bug where the routine to detect the correct kwargs
 
331
      being sent to :func:`.create_engine` would fail in some cases,
 
332
      such as with the Sybase dialect.
 
333
 
 
334
    .. change::
 
335
      :tags: bug, orm
 
336
      :tickets: 2481
 
337
 
 
338
      Fixed a regression from 0.7 caused by this ticket, which
 
339
      made the check for recursion overflow in self-referential
 
340
      eager joining too loose, missing a particular circumstance
 
341
      where a subclass had lazy="joined" or "subquery" configured
 
342
      and the load was a "with_polymorphic" against the base.
 
343
 
 
344
    .. change::
 
345
      :tags: bug, orm
 
346
      :tickets: 2718
 
347
 
 
348
      Fixed a regression from 0.7 where the contextmanager feature
 
349
      of :meth:`.Session.begin_nested` would fail to correctly
 
350
      roll back the transaction when a flush error occurred, instead
 
351
      raising its own exception while leaving the session still
 
352
      pending a rollback.
 
353
 
 
354
    .. change::
 
355
      :tags: bug, mysql
 
356
 
 
357
      Updated mysqlconnector dialect to check for disconnect based
 
358
      on the apparent string message sent in the exception; tested
 
359
      against mysqlconnector 1.0.9.
 
360
 
 
361
    .. change::
 
362
      :tags: bug, sql, mssql
 
363
      :tickets: 2682
 
364
 
 
365
      Regression from this ticket caused the unsupported keyword
 
366
      "true" to render, added logic to convert this to 1/0
 
367
      for SQL server.
 
368
 
 
369
.. changelog::
 
370
    :version: 0.8.1
 
371
    :released: April 27, 2013
 
372
 
 
373
    .. change::
 
374
      :tags: bug, orm
 
375
      :tickets: 2698
 
376
 
 
377
      Fixes to the ``sqlalchemy.ext.serializer`` extension, including
 
378
      that the "id" passed from the pickler is turned into a string
 
379
      to prevent against bytes being parsed on Py3K, as well as that
 
380
      ``relationship()`` and ``orm.join()`` constructs are now properly
 
381
      serialized.
 
382
 
 
383
    .. change::
 
384
      :tags: bug, orm
 
385
      :tickets: 2714
 
386
 
 
387
      A significant improvement to the inner workings of query.join(),
 
388
      such that the decisionmaking involved on how to join has been
 
389
      dramatically simplified.  New test cases now pass such as
 
390
      multiple joins extending from the middle of an already complex
 
391
      series of joins involving inheritance and such.   Joining from
 
392
      deeply nested subquery structures is still complicated and
 
393
      not without caveats, but with these improvements the edge
 
394
      cases are hopefully pushed even farther out to the edges.
 
395
 
 
396
    .. change::
 
397
      :tags: feature, orm
 
398
      :tickets: 2673
 
399
 
 
400
      Added a convenience method to Query that turns a query into an
 
401
      EXISTS subquery of the form
 
402
      ``EXISTS (SELECT 1 FROM ... WHERE ...)``.
 
403
 
 
404
    .. change::
 
405
      :tags: bug, orm
 
406
 
 
407
      Added a conditional to the unpickling process for ORM
 
408
      mapped objects, such that if the reference to the object
 
409
      were lost when the object was pickled, we don't
 
410
      erroneously try to set up _sa_instance_state - fixes
 
411
      a NoneType error.
 
412
 
 
413
    .. change::
 
414
      :tags: bug, postgresql
 
415
      :tickets: 2712
 
416
 
 
417
      Opened up the checking for "disconnect" with psycopg2/libpq
 
418
      to check for all the various "disconnect" messages within
 
419
      the full exception hierarchy.  Specifically the
 
420
      "closed the connection unexpectedly" message has now been
 
421
      seen in at least three different exception types.
 
422
      Courtesy Eli Collins.
 
423
 
 
424
    .. change::
 
425
      :tags: bug, sql, mysql
 
426
      :tickets: 2682
 
427
 
 
428
      Fully implemented the IS and IS NOT operators with
 
429
      regards to the True/False constants.  An expression like
 
430
      ``col.is_(True)`` will now render ``col IS true``
 
431
      on the target platform, rather than converting the True/
 
432
      False constant to an integer bound parameter.
 
433
      This allows the ``is_()`` operator to work on MySQL when
 
434
      given True/False constants.
 
435
 
 
436
    .. change::
 
437
      :tags: bug, postgresql
 
438
      :tickets: 2681
 
439
 
 
440
      The operators for the Postgresql ARRAY type supports
 
441
      input types of sets, generators, etc. even when
 
442
      a dimension is not specified, by turning the given
 
443
      iterable into a collection unconditionally.
 
444
 
 
445
    .. change::
 
446
      :tags: bug, mysql
 
447
      :pullreq: 55
 
448
 
 
449
      Fixes to support the latest cymysql DBAPI, courtesy
 
450
      Hajime Nakagami.
 
451
 
 
452
    .. change::
 
453
      :tags: bug, mysql
 
454
      :tickets: 2663
 
455
 
 
456
      Improvements to the operation of the pymysql dialect on
 
457
      Python 3, including some important decode/bytes steps.
 
458
      Issues remain with BLOB types due to driver issues.
 
459
      Courtesy Ben Trofatter.
 
460
 
 
461
    .. change::
 
462
      :tags: bug, orm
 
463
      :tickets: 2710
 
464
 
 
465
      Fixed bug where many-to-many relationship with uselist=False
 
466
      would fail to delete the association row and raise an error
 
467
      if the scalar attribute were set to None.  This was a
 
468
      regression introduced by the changes for :ticket:`2229`.
 
469
 
 
470
    .. change::
 
471
      :tags: bug, orm
 
472
      :tickets: 2708
 
473
 
 
474
      Improved the behavior of instance management regarding
 
475
      the creation of strong references within the Session;
 
476
      an object will no longer have an internal reference cycle
 
477
      created if it's in the transient state or moves into the
 
478
      detached state - the strong ref is created only when the
 
479
      object is attached to a Session and is removed when the
 
480
      object is detached.  This makes it somewhat safer for an
 
481
      object to have a `__del__()` method, even though this is
 
482
      not recommended, as relationships with backrefs produce
 
483
      cycles too.  A warning has been added when a class with
 
484
      a `__del__()` method is mapped.
 
485
 
 
486
    .. change::
 
487
      :tags: bug, sql
 
488
      :tickets: 2702
 
489
 
 
490
      A major fix to the way in which a select() object produces
 
491
      labeled columns when apply_labels() is used; this mode
 
492
      produces a SELECT where each column is labeled as in
 
493
      <tablename>_<columnname>, to remove column name collisions
 
494
      for a multiple table select.   The fix is that if two labels
 
495
      collide when combined with the table name, i.e.
 
496
      "foo.bar_id" and "foo_bar.id", anonymous aliasing will be
 
497
      applied to one of the dupes.  This allows the ORM to handle
 
498
      both columns independently; previously, 0.7
 
499
      would in some cases silently emit a second SELECT for the
 
500
      column that was "duped", and in 0.8 an ambiguous column error
 
501
      would be emitted.   The "keys" applied to the .c. collection
 
502
      of the select() will also be deduped, so that the "column
 
503
      being replaced" warning will no longer emit for any select()
 
504
      that specifies use_labels, though the dupe key will be given
 
505
      an anonymous label which isn't generally user-friendly.
 
506
 
 
507
    .. change::
 
508
      :tags: bug, mysql
 
509
      :pullreq: 54
 
510
 
 
511
      Updated a regexp to correctly extract error code on
 
512
      google app engine v1.7.5 and newer.  Courtesy
 
513
      Dan Ring.
 
514
 
 
515
    .. change::
 
516
      :tags: bug, examples
 
517
 
 
518
      Fixed a long-standing bug in the caching example, where
 
519
      the limit/offset parameter values wouldn't be taken into
 
520
      account when computing the cache key.  The
 
521
      _key_from_query() function has been simplified to work
 
522
      directly from the final compiled statement in order to get
 
523
      at both the full statement as well as the fully processed
 
524
      parameter list.
 
525
 
 
526
    .. change::
 
527
      :tags: bug, mssql
 
528
      :tickets: 2355
 
529
 
 
530
      Part of a longer series of fixes needed for pyodbc+
 
531
      mssql, a CAST to NVARCHAR(max) has been added to the bound
 
532
      parameter for the table name and schema name in all information schema
 
533
      queries to avoid the issue of comparing NVARCHAR to NTEXT,
 
534
      which seems to be rejected by the ODBC driver in some cases,
 
535
      such as FreeTDS (0.91 only?) plus unicode bound parameters being passed.
 
536
      The issue seems to be specific to the SQL Server information
 
537
      schema tables and the workaround is harmless for those cases
 
538
      where the problem doesn't exist in the first place.
 
539
 
 
540
    .. change::
 
541
      :tags: bug, sql
 
542
      :tickets: 2691
 
543
 
 
544
      Fixed bug where disconnect detect on error would
 
545
      raise an attribute error if the error were being
 
546
      raised after the Connection object had already
 
547
      been closed.
 
548
 
 
549
    .. change::
 
550
      :tags: bug, sql
 
551
      :tickets: 2703
 
552
 
 
553
      Reworked internal exception raises that emit
 
554
      a rollback() before re-raising, so that the stack
 
555
      trace is preserved from sys.exc_info() before entering
 
556
      the rollback.  This so that the traceback is preserved
 
557
      when using coroutine frameworks which may have switched
 
558
      contexts before the rollback function returns.
 
559
 
 
560
    .. change::
 
561
      :tags: bug, orm
 
562
      :tickets: 2697
 
563
 
 
564
      Fixed bug whereby ORM would run the wrong kind of
 
565
      query when refreshing an inheritance-mapped class
 
566
      where the superclass was mapped to a non-Table
 
567
      object, like a custom join() or a select(),
 
568
      running a query that assumed a hierarchy that's
 
569
      mapped to individual Table-per-class.
 
570
 
 
571
    .. change::
 
572
      :tags: bug, orm
 
573
 
 
574
      Fixed `__repr__()` on mapper property constructs
 
575
      to work before the object is initialized, so
 
576
      that Sphinx builds with recent Sphinx versions
 
577
      can read them.
 
578
 
 
579
    .. change::
 
580
      :tags: bug, sql, postgresql
 
581
 
 
582
      The _Binary base type now converts values through
 
583
      the bytes() callable when run on Python 3; in particular
 
584
      psycopg2 2.5 with Python 3.3 seems to now be returning
 
585
      the "memoryview" type, so this is converted to bytes
 
586
      before return.
 
587
 
 
588
    .. change::
 
589
      :tags: bug, sql
 
590
      :tickets: 2695
 
591
 
 
592
      Improvements to Connection auto-invalidation
 
593
      handling.  If a non-disconnect error occurs,
 
594
      but leads to a delayed disconnect error within error
 
595
      handling (happens with MySQL), the disconnect condition
 
596
      is detected.  The Connection can now also be closed
 
597
      when in an invalid state, meaning it will raise "closed"
 
598
      on next usage, and additionally the "close with result"
 
599
      feature will work even if the autorollback in an error
 
600
      handling routine fails and regardless of whether the
 
601
      condition is a disconnect or not.
 
602
 
 
603
 
 
604
    .. change::
 
605
      :tags: bug, orm, declarative
 
606
      :tickets: 2656
 
607
 
 
608
      Fixed indirect regression regarding :func:`.has_inherited_table`,
 
609
      where since it considers the current class' ``__table__``, was
 
610
      sensitive to when it was called.  This is 0.7's behavior also,
 
611
      but in 0.7 things tended to "work out" within events like
 
612
      ``__mapper_args__()``.  :func:`.has_inherited_table` now only
 
613
      considers superclasses, so should return the same answer
 
614
      regarding the current class no matter when it's called
 
615
      (obviously assuming the state of the superclass).
 
616
 
 
617
    .. change::
 
618
      :tags: bug, orm
 
619
      :tickets: 2699
 
620
 
 
621
      Fixed bug when a query of the form:
 
622
      ``query(SubClass).options(subqueryload(Baseclass.attrname))``,
 
623
      where ``SubClass`` is a joined inh of ``BaseClass``,
 
624
      would fail to apply the ``JOIN`` inside the subquery
 
625
      on the attribute load, producing a cartesian product.
 
626
      The populated results still tended to be correct as additional
 
627
      rows are just ignored, so this issue may be present as a
 
628
      performance degradation in applications that are
 
629
      otherwise working correctly.  Also in 0.7.11.
 
630
 
 
631
    .. change::
 
632
      :tags: bug, orm
 
633
      :tickets: 2689
 
634
 
 
635
      Fixed bug in unit of work whereby a joined-inheritance
 
636
      subclass could insert the row for the "sub" table
 
637
      before the parent table, if the two tables had no
 
638
      ForeignKey constraints set up between them.
 
639
      Also in 0.7.11.
 
640
 
 
641
    .. change::
 
642
      :tags: bug, mssql
 
643
      :pullreq: 47
 
644
 
 
645
      Added support for additional "disconnect" messages
 
646
      to the pymssql dialect.  Courtesy John Anderson.
 
647
 
 
648
    .. change::
 
649
      :tags: feature, sql
 
650
 
 
651
      Loosened the check on dialect-specific argument names
 
652
      passed to Table(); since we want to support external dialects
 
653
      and also want to support args without a certain dialect
 
654
      being installed, it only checks the format of the arg now,
 
655
      rather than looking for that dialect in sqlalchemy.dialects.
 
656
 
 
657
    .. change::
 
658
      :tags: bug, sql
 
659
 
 
660
      Fixed bug whereby a DBAPI that can return "0"
 
661
      for cursor.lastrowid would not function correctly
 
662
      in conjunction with :attr:`.ResultProxy.inserted_primary_key`.
 
663
 
 
664
    .. change::
 
665
      :tags: bug, mssql
 
666
      :tickets: 2683
 
667
      :pullreq: 46
 
668
 
 
669
      Fixed Py3K bug regarding "binary" types and
 
670
      pymssql.  Courtesy Marc Abramowitz.
 
671
 
 
672
    .. change::
 
673
      :tags: bug, postgresql
 
674
      :tickets: 2680
 
675
 
 
676
      Added missing HSTORE type to postgresql type names
 
677
      so that the type can be reflected.
 
678
 
 
679
.. changelog::
 
680
    :version: 0.8.0
 
681
    :released: March 9, 2013
 
682
 
 
683
    .. note::
 
684
 
 
685
      There are some new behavioral changes as of 0.8.0
 
686
      not present in 0.8.0b2.  They are present in the
 
687
      migration document as follows:
 
688
 
 
689
      * :ref:`legacy_is_orphan_addition`
 
690
 
 
691
      * :ref:`metadata_create_drop_tables`
 
692
 
 
693
      * :ref:`correlation_context_specific`
 
694
 
 
695
    .. change::
 
696
        :tags: feature, postgresql
 
697
        :tickets: 2676
 
698
 
 
699
      Added support for Postgresql's traditional SUBSTRING
 
700
      function syntax, renders as "SUBSTRING(x FROM y FOR z)"
 
701
      when regular ``func.substring()`` is used.
 
702
      Also in 0.7.11.  Courtesy Gunnlaugur Þór Briem.
 
703
 
 
704
    .. change::
 
705
        :tags: feature, orm
 
706
        :tickets: 2675
 
707
 
 
708
      A meaningful :attr:`.QueryableAttribute.info` attribute is
 
709
      added, which proxies down to the ``.info`` attribute on either
 
710
      the :class:`.schema.Column` object if directly present, or
 
711
      the :class:`.MapperProperty` otherwise.  The full behavior
 
712
      is documented and ensured by tests to remain stable.
 
713
 
 
714
    .. change::
 
715
        :tags: bug, sql
 
716
        :tickets: 2668
 
717
 
 
718
      The behavior of SELECT correlation has been improved such that
 
719
      the :meth:`.Select.correlate` and :meth:`.Select.correlate_except`
 
720
      methods, as well as their ORM analogues, will still retain
 
721
      "auto-correlation" behavior in that the FROM clause is modified
 
722
      only if the output would be legal SQL; that is, the FROM clause
 
723
      is left intact if the correlated SELECT is not used in the context
 
724
      of an enclosing SELECT inside of the WHERE, columns, or HAVING clause.
 
725
      The two methods now only specify conditions to the default
 
726
      "auto correlation", rather than absolute FROM lists.
 
727
 
 
728
    .. change::
 
729
        :tags: feature, mysql
 
730
        :pullreq: 42
 
731
 
 
732
      New dialect for CyMySQL added, courtesy Hajime Nakagami.
 
733
 
 
734
    .. change::
 
735
        :tags: bug, orm
 
736
        :tickets: 2674
 
737
 
 
738
      Improved checking for an existing backref name conflict during
 
739
      mapper configuration; will now test for name conflicts on
 
740
      superclasses and subclasses, in addition to the current mapper,
 
741
      as these conflicts break things just as much.  This is new for
 
742
      0.8, but see below for a warning that will also be triggered
 
743
      in 0.7.11.
 
744
 
 
745
    .. change::
 
746
        :tags: bug, orm
 
747
        :tickets: 2674
 
748
 
 
749
      Improved the error message emitted when a "backref loop" is detected,
 
750
      that is when an attribute event triggers a bidirectional
 
751
      assignment between two other attributes with no end.
 
752
      This condition can occur not just when an object of the wrong
 
753
      type is assigned, but also when an attribute is mis-configured
 
754
      to backref into an existing backref pair.  Also in 0.7.11.
 
755
 
 
756
    .. change::
 
757
      :tags: bug, orm
 
758
      :tickets: 2674
 
759
 
 
760
      A warning is emitted when a MapperProperty is assigned to a mapper
 
761
      that replaces an existing property, if the properties in question
 
762
      aren't plain column-based properties.   Replacement of relationship
 
763
      properties is rarely (ever?) what is intended and usually refers to a
 
764
      mapper mis-configuration.   Also in 0.7.11.
 
765
 
 
766
    .. change::
 
767
        :tags: feature, orm
 
768
 
 
769
      Can set/change the "cascade" attribute on a :func:`.relationship`
 
770
      construct after it's been constructed already.  This is not
 
771
      a pattern for normal use but we like to change the setting
 
772
      for demonstration purposes in tutorials.
 
773
 
 
774
    .. change::
 
775
        :tags: bug, schema
 
776
        :tickets: 2664
 
777
 
 
778
      :meth:`.MetaData.create_all` and :meth:`.MetaData.drop_all` will
 
779
      now accommodate an empty list as an instruction to not create/drop
 
780
      any items, rather than ignoring the collection.
 
781
 
 
782
 
 
783
    .. change::
 
784
        :tags: bug, tests
 
785
        :tickets: 2669
 
786
        :pullreq: 41
 
787
 
 
788
      Fixed an import of "logging" in test_execute which was not
 
789
      working on some linux platforms.  Also in 0.7.11.
 
790
 
 
791
    .. change::
 
792
        :tags: bug, orm
 
793
        :tickets: 2662
 
794
 
 
795
      A clear error message is emitted if an event handler
 
796
      attempts to emit SQL on a Session within the after_commit()
 
797
      handler, where there is not a viable transaction in progress.
 
798
 
 
799
    .. change::
 
800
        :tags: bug, orm
 
801
        :tickets: 2665
 
802
 
 
803
      Detection of a primary key change within the process
 
804
      of cascading a natural primary key update will succeed
 
805
      even if the key is composite and only some of the
 
806
      attributes have changed.
 
807
 
 
808
    .. change::
 
809
        :tags: feature, orm
 
810
        :tickets: 2658
 
811
 
 
812
      Added new helper function :func:`.was_deleted`, returns True
 
813
      if the given object was the subject of a :meth:`.Session.delete`
 
814
      operation.
 
815
 
 
816
    .. change::
 
817
        :tags: bug, orm
 
818
        :tickets: 2658
 
819
 
 
820
      An object that's deleted from a session will be de-associated with
 
821
      that session fully after the transaction is committed, that is
 
822
      the :func:`.object_session` function will return None.
 
823
 
 
824
    .. change::
 
825
        :tags: bug, oracle
 
826
 
 
827
      The cx_oracle dialect will no longer run the bind parameter names
 
828
      through ``encode()``, as this is not valid on Python 3, and prevented
 
829
      statements from functioning correctly on Python 3.  We now
 
830
      encode only if ``supports_unicode_binds`` is False, which is not
 
831
      the case for cx_oracle when at least version 5 of cx_oracle is used.
 
832
 
 
833
    .. change::
 
834
        :tags: bug, orm
 
835
        :tickets: 2661
 
836
 
 
837
      Fixed bug whereby :meth:`.Query.yield_per` would set the execution
 
838
      options incorrectly, thereby breaking subsequent usage of the
 
839
      :meth:`.Query.execution_options` method.  Courtesy Ryan Kelly.
 
840
 
 
841
    .. change::
 
842
        :tags: bug, orm
 
843
        :tickets: 1768
 
844
 
 
845
      Fixed the consideration of the ``between()`` operator
 
846
      so that it works correctly with the new relationship local/remote
 
847
      system.
 
848
 
 
849
    .. change::
 
850
        :tags: bug, sql
 
851
        :tickets: 2660, 1768
 
852
 
 
853
      Fixed a bug regarding column annotations which in particular
 
854
      could impact some usages of the new :func:`.orm.remote` and
 
855
      :func:`.orm.local` annotation functions, where annotations
 
856
      could be lost when the column were used in a subsequent
 
857
      expression.
 
858
 
 
859
    .. change::
 
860
        :tags: bug, mysql, gae
 
861
        :tickets: 2649
 
862
 
 
863
      Added a conditional import to the ``gaerdbms`` dialect which attempts
 
864
      to import rdbms_apiproxy vs. rdbms_googleapi to work
 
865
      on both dev and production platforms.  Also now honors the
 
866
      ``instance`` attribute.  Courtesy Sean Lynch.
 
867
      Also in 0.7.10.
 
868
 
 
869
    .. change::
 
870
        :tags: bug, sql
 
871
        :tickets: 2496
 
872
 
 
873
      The :meth:`.ColumnOperators.in_` operator will now coerce
 
874
      values of ``None`` to :func:`.null`.
 
875
 
 
876
    .. change::
 
877
        :tags: feature, sql
 
878
        :tickets: 2657
 
879
 
 
880
      Added a new argument to :class:`.Enum` and its base
 
881
      :class:`.SchemaType` ``inherit_schema``.  When set to ``True``,
 
882
      the type will set its ``schema`` attribute of that of the
 
883
      :class:`.Table` to which it is associated.  This also occurs
 
884
      during a :meth:`.Table.tometadata` operation; the :class:`.SchemaType`
 
885
      is now copied in all cases when :meth:`.Table.tometadata` happens,
 
886
      and if ``inherit_schema=True``, the type will take on the new
 
887
      schema name passed to the method.   The ``schema`` is important
 
888
      when used with the Postgresql backend, as the type results in
 
889
      a ``CREATE TYPE`` statement.
 
890
 
 
891
    .. change::
 
892
        :tags: feature, postgresql
 
893
        :pullreq: 40
 
894
 
 
895
      Added :meth:`.postgresql.ARRAY.Comparator.any` and
 
896
      :meth:`.postgresql.ARRAY.Comparator.all`
 
897
      methods, as well as standalone expression constructs.   Big thanks
 
898
      to Audrius Kažukauskas for the terrific work here.
 
899
 
 
900
    .. change::
 
901
        :tags: sql, bug
 
902
        :tickets: 2643
 
903
 
 
904
        Fixed bug where :meth:`.Table.tometadata` would fail if a
 
905
        :class:`.Column` had both a foreign key as well as an
 
906
        alternate ".key" name for the column.   Also in 0.7.10.
 
907
 
 
908
    .. change::
 
909
        :tags: sql, bug
 
910
        :tickets: 2629
 
911
 
 
912
        insert().returning() raises an informative CompileError if attempted
 
913
        to compile on a dialect that doesn't support RETURNING.
 
914
 
 
915
    .. change::
 
916
        :tags: orm, bug
 
917
        :tickets: 2655
 
918
 
 
919
        the consideration of a pending object as
 
920
        an "orphan" has been modified to more closely match the
 
921
        behavior as that of persistent objects, which is that the object
 
922
        is expunged from the :class:`.Session` as soon as it is
 
923
        de-associated from any of its orphan-enabled parents.  Previously,
 
924
        the pending object would be expunged only if de-associated
 
925
        from all of its orphan-enabled parents.  The new flag ``legacy_is_orphan``
 
926
        is added to :func:`.orm.mapper` which re-establishes the
 
927
        legacy behavior.
 
928
 
 
929
        See the change note and example case at :ref:`legacy_is_orphan_addition`
 
930
        for a detailed discussion of this change.
 
931
 
 
932
    .. change::
 
933
        :tags: orm, bug
 
934
        :tickets: 2653
 
935
 
 
936
      Fixed the (most likely never used) "@collection.link" collection
 
937
      method, which fires off each time the collection is associated
 
938
      or de-associated with a mapped object - the decorator
 
939
      was not tested or functional.  The decorator method
 
940
      is now named :meth:`.collection.linker` though the name "link"
 
941
      remains for backwards compatibility.  Courtesy Luca Wehrstedt.
 
942
 
 
943
    .. change::
 
944
        :tags: orm, bug
 
945
        :tickets: 2654
 
946
 
 
947
      Made some fixes to the system of producing custom instrumented
 
948
      collections, mainly that the usage of the @collection decorators
 
949
      will now honor the __mro__ of the given class, applying the
 
950
      logic of the sub-most classes' version of a particular collection
 
951
      method.   Previously, it wasn't predictable when subclassing
 
952
      an existing instrumented class such as :class:`.MappedCollection`
 
953
      whether or not custom methods would resolve correctly.
 
954
 
 
955
    .. change::
 
956
      :tags: orm, removed
 
957
 
 
958
      The undocumented (and hopefully unused) system of producing
 
959
      custom collections using an ``__instrumentation__`` datastructure
 
960
      associated with the collection has been removed, as this was a complex
 
961
      and untested feature which was also essentially redundant versus the
 
962
      decorator approach.   Other internal simplifcations to the
 
963
      orm.collections module have been made as well.
 
964
 
 
965
    .. change::
 
966
        :tags: mssql, feature
 
967
        :pullreq: 35
 
968
 
 
969
      Added ``mssql_include`` and ``mssql_clustered`` options to
 
970
      :class:`.Index`, renders the ``INCLUDE`` and ``CLUSTERED`` keywords,
 
971
      respectively.  Courtesy Derek Harland.
 
972
 
 
973
    .. change::
 
974
        :tags: sql, feature
 
975
        :tickets: 695
 
976
 
 
977
      :class:`.Index` now supports arbitrary SQL expressions and/or
 
978
      functions, in addition to straight columns.   Common modifiers
 
979
      include using ``somecolumn.desc()`` for a descending index and
 
980
      ``func.lower(somecolumn)`` for a case-insensitive index, depending on the
 
981
      capabilities of the target backend.
 
982
 
 
983
    .. change::
 
984
        :tags: mssql, bug
 
985
        :tickets: 2638
 
986
 
 
987
      Added a py3K conditional around unnecessary .decode()
 
988
      call in mssql information schema, fixes reflection
 
989
      in Py3K. Also in 0.7.10.
 
990
 
 
991
    .. change::
 
992
        :tags: orm, bug
 
993
        :tickets: 2650
 
994
 
 
995
      Fixed potential memory leak which could occur if an
 
996
      arbitrary number of :class:`.sessionmaker` objects
 
997
      were created.   The anonymous subclass created by
 
998
      the sessionmaker, when dereferenced, would not be garbage
 
999
      collected due to remaining class-level references from the
 
1000
      event package.  This issue also applies to any custom system
 
1001
      that made use of ad-hoc subclasses in conjunction with
 
1002
      an event dispatcher.  Also in 0.7.10.
 
1003
 
 
1004
    .. change::
 
1005
        :tags: mssql, bug
 
1006
 
 
1007
      Fixed a regression whereby the "collation" parameter
 
1008
      of the character types CHAR, NCHAR, etc. stopped working,
 
1009
      as "collation" is now supported by the base string types.
 
1010
      The TEXT, NCHAR, CHAR, VARCHAR types within the
 
1011
      MSSQL dialect are now synonyms for the base types.
 
1012
 
 
1013
    .. change::
 
1014
        :tags: mssql, feature
 
1015
        :tickets: 2644
 
1016
        :pullreq: 32
 
1017
 
 
1018
      DDL for IDENTITY columns is now supported on
 
1019
      non-primary key columns, by establishing a
 
1020
      :class:`.Sequence` construct on any
 
1021
      integer column.  Courtesy Derek Harland.
 
1022
 
 
1023
    .. change::
 
1024
        :tags: examples, bug
 
1025
 
 
1026
      Fixed a regression in the examples/dogpile_caching example
 
1027
      which was due to the change in :ticket:`2614`.
 
1028
 
 
1029
    .. change::
 
1030
        :tags: orm, bug
 
1031
        :tickets: 2640
 
1032
 
 
1033
      :meth:`.Query.merge_result` can now load rows from an outer join
 
1034
      where an entity may be ``None`` without throwing an error.
 
1035
      Also in 0.7.10.
 
1036
 
 
1037
    .. change::
 
1038
        :tags: sql, bug
 
1039
        :tickets: 2648
 
1040
 
 
1041
      Tweaked the "REQUIRED" symbol used by the compiler to identify
 
1042
      INSERT/UPDATE bound parameters that need to be passed, so that
 
1043
      it's more easily identifiable when writing custom bind-handling
 
1044
      code.
 
1045
 
 
1046
    .. change::
 
1047
        :tags: postgresql, bug
 
1048
 
 
1049
      Fixed bug in :func:`.postgresql.array` construct whereby using it
 
1050
      inside of an :func:`.expression.insert` construct would produce an
 
1051
      error regarding a parameter issue in the ``self_group()`` method.
 
1052
 
 
1053
    .. change::
 
1054
        :tags: orm, feature
 
1055
 
 
1056
      Extended the :doc:`/core/inspection` system so that all Python descriptors
 
1057
      associated with the ORM or its extensions can be retrieved.
 
1058
      This fulfills the common request of being able to inspect
 
1059
      all :class:`.QueryableAttribute` descriptors in addition to
 
1060
      extension types such as :class:`.hybrid_property` and
 
1061
      :class:`.AssociationProxy`.  See :attr:`.Mapper.all_orm_descriptors`.
 
1062
 
 
1063
    .. change::
 
1064
        :tags: mysql, feature
 
1065
        :pullreq: 33
 
1066
 
 
1067
      GAE dialect now accepts username/password arguments in the URL,
 
1068
      courtesy Owen Nelson.
 
1069
 
 
1070
    .. change::
 
1071
        :tags: mysql, bug
 
1072
        :pullreq: 33
 
1073
 
 
1074
      GAE dialect won't fail on None match if the error code can't be extracted
 
1075
      from the exception throw; courtesy Owen Nelson.
 
1076
 
 
1077
    .. change::
 
1078
        :tags: orm, bug
 
1079
        :tickets: 2637
 
1080
 
 
1081
      Fixes to the "dynamic" loader on :func:`.relationship`, includes
 
1082
      that backrefs will work properly even when autoflush is disabled,
 
1083
      history events are more accurate in scenarios where multiple add/remove
 
1084
      of the same object occurs.
 
1085
 
 
1086
.. changelog::
 
1087
    :version: 0.8.0b2
 
1088
    :released: December 14, 2012
 
1089
 
 
1090
    .. change::
 
1091
        :tags: sqlite, bug
 
1092
        :tickets: 2568
 
1093
 
 
1094
      More adjustment to this SQLite related issue which was released in
 
1095
      0.7.9, to intercept legacy SQLite quoting characters when reflecting
 
1096
      foreign keys.  In addition to intercepting double quotes, other
 
1097
      quoting characters such as brackets, backticks, and single quotes
 
1098
      are now also intercepted.  Also in 0.7.10.
 
1099
 
 
1100
    .. change::
 
1101
        :tags: orm, bug
 
1102
        :tickets: 2635
 
1103
 
 
1104
      The :meth:`.Query.select_from` method can now be used with a
 
1105
      :func:`.aliased` construct without it interfering with the entities
 
1106
      being selected.   Basically, a statement like this::
 
1107
 
 
1108
        ua = aliased(User)
 
1109
        session.query(User.name).select_from(ua).join(User, User.name > ua.name)
 
1110
 
 
1111
      Will maintain the columns clause of the SELECT as coming from the
 
1112
      unaliased "user", as specified; the select_from only takes place in the
 
1113
      FROM clause::
 
1114
 
 
1115
        SELECT users.name AS users_name FROM users AS users_1
 
1116
        JOIN users ON users.name < users_1.name
 
1117
 
 
1118
      Note that this behavior is in contrast
 
1119
      to the original, older use case for :meth:`.Query.select_from`, which is that
 
1120
      of restating the mapped entity in terms of a different selectable::
 
1121
 
 
1122
        session.query(User.name).\
 
1123
          select_from(user_table.select().where(user_table.c.id > 5))
 
1124
 
 
1125
      Which produces::
 
1126
 
 
1127
        SELECT anon_1.name AS anon_1_name FROM (SELECT users.id AS id,
 
1128
        users.name AS name FROM users WHERE users.id > :id_1) AS anon_1
 
1129
 
 
1130
      It was the "aliasing" behavior of the latter use case that was
 
1131
      getting in the way of the former use case.   The method now
 
1132
      specifically considers a SQL expression like
 
1133
      :func:`.expression.select` or :func:`.expression.alias`
 
1134
      separately from a mapped entity like a :func:`.aliased`
 
1135
      construct.
 
1136
 
 
1137
    .. change::
 
1138
        :tags: sql, bug
 
1139
        :tickets: 2633
 
1140
 
 
1141
      Fixed a regression caused by :ticket:`2410` whereby a
 
1142
      :class:`.CheckConstraint` would apply itself back to the
 
1143
      original table during a :meth:`.Table.tometadata` operation, as
 
1144
      it would parse the SQL expression for a parent table. The
 
1145
      operation now copies the given expression to correspond to the
 
1146
      new table.
 
1147
 
 
1148
    .. change::
 
1149
        :tags: oracle, bug
 
1150
        :tickets: 2619
 
1151
 
 
1152
      Fixed table reflection for Oracle when accessing a synonym that refers
 
1153
      to a DBLINK remote database; while the syntax has been present in the
 
1154
      Oracle dialect for some time, up until now it has never been tested.
 
1155
      The syntax has been tested against a sample database linking to itself,
 
1156
      however there's still some uncertainty as to what should be used for the
 
1157
      "owner" when querying the remote database for table information.
 
1158
      Currently, the value of "username" from user_db_links is used to
 
1159
      match the "owner".
 
1160
 
 
1161
    .. change::
 
1162
        :tags: orm, feature
 
1163
        :tickets: 2601
 
1164
 
 
1165
      Added :meth:`.KeyedTuple._asdict` and :attr:`.KeyedTuple._fields`
 
1166
      to the :class:`.KeyedTuple` class to provide some degree of compatibility
 
1167
      with the Python standard library ``collections.namedtuple()``.
 
1168
 
 
1169
    .. change::
 
1170
        :tags: sql, bug
 
1171
        :tickets: 2631
 
1172
 
 
1173
      Fixed bug where using server_onupdate=<FetchedValue|DefaultClause>
 
1174
      without passing the "for_update=True" flag would apply the default
 
1175
      object to the server_default, blowing away whatever was there.
 
1176
      The explicit for_update=True argument shouldn't be needed with this usage
 
1177
      (especially since the documentation shows an example without it being
 
1178
      used) so it is now arranged internally using a copy of the given default
 
1179
      object, if the flag isn't set to what corresponds to that argument.
 
1180
      Also in 0.7.10.
 
1181
 
 
1182
    .. change::
 
1183
        :tags: sql, bug
 
1184
        :tickets: 2610
 
1185
 
 
1186
      Fixed bug whereby using a label_length on dialect that was smaller
 
1187
      than the size of actual column identifiers would fail to render
 
1188
      the columns correctly in a SELECT statement.
 
1189
 
 
1190
    .. change::
 
1191
        :tags: sql, feature
 
1192
        :tickets: 2623
 
1193
 
 
1194
      The :class:`.Insert` construct now supports multi-valued inserts,
 
1195
      that is, an INSERT that renders like
 
1196
      "INSERT INTO table VALUES (...), (...), ...".
 
1197
      Supported by Postgresql, SQLite, and MySQL.
 
1198
      Big thanks to Idan Kamara for doing the legwork on this one.
 
1199
 
 
1200
    .. change::
 
1201
        :tags: oracle, bug
 
1202
        :tickets: 2620
 
1203
 
 
1204
      The Oracle LONG type, while an unbounded text type, does not appear
 
1205
      to use the cx_Oracle.LOB type when result rows are returned,
 
1206
      so the dialect has been repaired to exclude LONG from
 
1207
      having cx_Oracle.LOB filtering applied.  Also in 0.7.10.
 
1208
 
 
1209
    .. change::
 
1210
        :tags: oracle, bug
 
1211
        :tickets: 2611
 
1212
 
 
1213
      Repaired the usage of ``.prepare()`` in conjunction with
 
1214
      cx_Oracle so that a return value of ``False`` will result
 
1215
      in no call to ``connection.commit()``, hence avoiding
 
1216
      "no transaction" errors.   Two-phase transactions have
 
1217
      now been shown to work in a rudimental fashion with
 
1218
      SQLAlchemy and cx_oracle, however are subject to caveats
 
1219
      observed with the driver; check the documentation
 
1220
      for details.  Also in 0.7.10.
 
1221
 
 
1222
    .. change::
 
1223
        :tags: sql, bug
 
1224
        :tickets: 2618
 
1225
 
 
1226
      The :class:`.DECIMAL` type now honors the "precision" and
 
1227
      "scale" arguments when rendering DDL.
 
1228
 
 
1229
    .. change::
 
1230
        :tags: orm, bug
 
1231
        :tickets: 2624
 
1232
 
 
1233
      The :class:`.MutableComposite` type did not allow for the
 
1234
      :meth:`.MutableBase.coerce` method to be used, even though
 
1235
      the code seemed to indicate this intent, so this now works
 
1236
      and a brief example is added.  As a side-effect,
 
1237
      the mechanics of this event handler have been changed so that
 
1238
      new :class:`.MutableComposite` types no longer add per-type
 
1239
      global event handlers.  Also in 0.7.10.
 
1240
 
 
1241
    .. change::
 
1242
        :tags: sql, bug
 
1243
        :tickets: 2621
 
1244
 
 
1245
      Made an adjustment to the "boolean", (i.e. ``__nonzero__``)
 
1246
      evaluation of binary expressions, i.e. ``x1 == x2``, such
 
1247
      that the "auto-grouping" applied by :class:`.BinaryExpression`
 
1248
      in some cases won't get in the way of this comparison.
 
1249
      Previously, an expression like::
 
1250
 
 
1251
        expr1 = mycolumn > 2
 
1252
        bool(expr1 == expr1)
 
1253
 
 
1254
      Would evaulate as ``False``, even though this is an identity
 
1255
      comparison, because ``mycolumn > 2`` would be "grouped" before
 
1256
      being placed into the :class:`.BinaryExpression`, thus changing
 
1257
      its identity.   :class:`.BinaryExpression` now keeps track
 
1258
      of the "original" objects passed in.
 
1259
      Additionally the ``__nonzero__`` method now only returns if
 
1260
      the operator is ``==`` or ``!=`` - all others raise ``TypeError``.
 
1261
 
 
1262
    .. change::
 
1263
        :tags: firebird, bug
 
1264
        :tickets: 2622
 
1265
 
 
1266
      Added missing import for "fdb" to the experimental
 
1267
      "firebird+fdb" dialect.
 
1268
 
 
1269
    .. change::
 
1270
        :tags: orm, feature
 
1271
 
 
1272
      Allow synonyms to be used when defining primary and secondary
 
1273
      joins for relationships.
 
1274
 
 
1275
    .. change::
 
1276
        :tags: orm, bug
 
1277
        :tickets: 2614
 
1278
 
 
1279
      A second overhaul of aliasing/internal pathing mechanics
 
1280
      now allows two subclasses to have different relationships
 
1281
      of the same name, supported with subquery or joined eager
 
1282
      loading on both simultaneously when a full polymorphic
 
1283
      load is used.
 
1284
 
 
1285
    .. change::
 
1286
        :tags: orm, bug
 
1287
        :tickets: 2617
 
1288
 
 
1289
      Fixed bug whereby a multi-hop subqueryload within
 
1290
      a particular with_polymorphic load would produce a KeyError.
 
1291
      Takes advantage of the same internal pathing overhaul
 
1292
      as :ticket:`2614`.
 
1293
 
 
1294
    .. change::
 
1295
        :tags: sql, bug
 
1296
 
 
1297
      Fixed a gotcha where inadvertently calling list() on a
 
1298
      :class:`.ColumnElement` would go into an endless loop, if
 
1299
      :meth:`.ColumnOperators.__getitem__` were implemented.
 
1300
      A new NotImplementedError is emitted via ``__iter__()``.
 
1301
 
 
1302
    .. change::
 
1303
        :tags: orm, extensions, feature
 
1304
 
 
1305
      The :mod:`sqlalchemy.ext.mutable` extension now includes the
 
1306
      example :class:`.MutableDict` class as part of the extension.
 
1307
 
 
1308
    .. change::
 
1309
        :tags: postgresql, feature
 
1310
        :tickets: 2606
 
1311
 
 
1312
      :class:`.HSTORE` is now available in the Postgresql dialect.
 
1313
      Will also use psycopg2's extensions if available.  Courtesy
 
1314
      Audrius Kažukauskas.
 
1315
 
 
1316
    .. change::
 
1317
        :tags: sybase, feature
 
1318
        :tickets: 1753
 
1319
 
 
1320
      Reflection support has been added to the Sybase dialect.
 
1321
      Big thanks to Ben Trofatter for all the work developing and
 
1322
      testing this.
 
1323
 
 
1324
    .. change::
 
1325
        :tags: engine, feature
 
1326
 
 
1327
      The :meth:`.Connection.connect` and :meth:`.Connection.contextual_connect`
 
1328
      methods now return a "branched" version so that the :meth:`.Connection.close`
 
1329
      method can be called on the returned connection without affecting the
 
1330
      original.   Allows symmetry when using :class:`.Engine` and
 
1331
      :class:`.Connection` objects as context managers::
 
1332
 
 
1333
        with conn.connect() as c: # leaves the Connection open
 
1334
          c.execute("...")
 
1335
 
 
1336
        with engine.connect() as c:  # closes the Connection
 
1337
          c.execute("...")
 
1338
 
 
1339
    .. change::
 
1340
        :tags: engine
 
1341
 
 
1342
      The "reflect=True" argument to :class:`MetaData` is deprecated.
 
1343
      Please use the :meth:`.MetaData.reflect` method.
 
1344
 
 
1345
    .. change::
 
1346
        :tags: engine, bug
 
1347
        :tickets: 2604
 
1348
 
 
1349
      Fixed :meth:`.MetaData.reflect` to correctly use
 
1350
      the given :class:`.Connection`, if given, without
 
1351
      opening a second connection from that connection's
 
1352
      :class:`.Engine`.  Also in 0.7.10.
 
1353
 
 
1354
    .. change::
 
1355
        :tags: mssql, bug
 
1356
        :tickets: 2607
 
1357
 
 
1358
      Fixed bug whereby using "key" with Column
 
1359
      in conjunction with "schema" for the owning
 
1360
      Table would fail to locate result rows due
 
1361
      to the MSSQL dialect's "schema rendering"
 
1362
      logic's failure to take .key into account.
 
1363
      Also in 0.7.10.
 
1364
 
 
1365
    .. change::
 
1366
        :tags: sql, bug
 
1367
        :tickets: 2603
 
1368
 
 
1369
        Fixed bug in type_coerce() whereby typing information
 
1370
        could be lost if the statement were used as a subquery
 
1371
        inside of another statement, as well as other similar
 
1372
        situations.  Among other things, would cause
 
1373
        typing information to be lost when the Oracle/mssql dialects
 
1374
        would apply limit/offset wrappings.
 
1375
 
 
1376
    .. change::
 
1377
        :tags: orm, bug
 
1378
        :tickets: 2602
 
1379
 
 
1380
        Fixed regression where query.update() would produce
 
1381
        an error if an object matched by the "fetch"
 
1382
        synchronization strategy wasn't locally present.
 
1383
        Courtesy Scott Torborg.
 
1384
 
 
1385
    .. change::
 
1386
        :tags: sql, bug
 
1387
        :tickets: 2597
 
1388
 
 
1389
        Fixed bug whereby the ".key" of a Column wasn't being
 
1390
        used when producing a "proxy" of the column against
 
1391
        a selectable.   This probably didn't occur in 0.7
 
1392
        since 0.7 doesn't respect the ".key" in a wider
 
1393
        range of scenarios.
 
1394
 
 
1395
    .. change::
 
1396
        :tags: mssql, feature
 
1397
        :tickets: 2600
 
1398
 
 
1399
        Support for reflection of the "name" of primary key
 
1400
        constraints added, courtesy Dave Moore.
 
1401
 
 
1402
    .. change::
 
1403
        :tags: informix
 
1404
 
 
1405
        Some cruft regarding informix transaction handling has been
 
1406
        removed, including a feature that would skip calling
 
1407
        commit()/rollback() as well as some hardcoded isolation level
 
1408
        assumptions on begin()..   The status of this dialect is not
 
1409
        well understood as we don't have any users working with it,
 
1410
        nor any access to an Informix database.   If someone with
 
1411
        access to Informix wants to help test this dialect, please
 
1412
        let us know.
 
1413
 
 
1414
    .. change::
 
1415
        :tags: pool, feature
 
1416
 
 
1417
        The :class:`.Pool` will now log all connection.close()
 
1418
        operations equally, including closes which occur for
 
1419
        invalidated connections, detached connections, and connections
 
1420
        beyond the pool capacity.
 
1421
 
 
1422
    .. change::
 
1423
        :tags: pool, feature
 
1424
        :tickets: 2611
 
1425
 
 
1426
        The :class:`.Pool` now consults the :class:`.Dialect` for
 
1427
        functionality regarding how the connection should be
 
1428
        "auto rolled back", as well as closed.   This grants more
 
1429
        control of transaction scope to the dialect, so that we
 
1430
        will be better able to implement transactional workarounds
 
1431
        like those potentially needed for pysqlite and cx_oracle.
 
1432
 
 
1433
    .. change::
 
1434
        :tags: pool, feature
 
1435
 
 
1436
        Added new :meth:`.PoolEvents.reset` hook to capture
 
1437
        the event before a connection is auto-rolled back, upon
 
1438
        return to the pool.   Together with
 
1439
        :meth:`.ConnectionEvents.rollback` this allows all rollback
 
1440
        events to be intercepted.
 
1441
 
 
1442
.. changelog::
 
1443
    :version: 0.8.0b1
 
1444
    :released: October 30, 2012
 
1445
 
 
1446
    .. change::
 
1447
        :tags: sql, bug
 
1448
        :tickets: 2593
 
1449
 
 
1450
        Fixed bug where keyword arguments passed to
 
1451
        :meth:`.Compiler.process` wouldn't get propagated
 
1452
        to the column expressions present in the columns
 
1453
        clause of a SELECT statement.  In particular this would
 
1454
        come up when used by custom compilation schemes that
 
1455
        relied upon special flags.
 
1456
 
 
1457
    .. change::
 
1458
        :tags: sql, feature
 
1459
 
 
1460
      Added a new method :meth:`.Engine.execution_options`
 
1461
      to :class:`.Engine`.  This method works similarly to
 
1462
      :meth:`.Connection.execution_options` in that it creates
 
1463
      a copy of the parent object which will refer to the new
 
1464
      set of options.   The method can be used to build
 
1465
      sharding schemes where each engine shares the same
 
1466
      underlying pool of connections.   The method
 
1467
      has been tested against the horizontal shard
 
1468
      recipe in the ORM as well.
 
1469
 
 
1470
      .. seealso::
 
1471
 
 
1472
          :meth:`.Engine.execution_options`
 
1473
 
 
1474
    .. change::
 
1475
        :tags: sql, orm, bug
 
1476
        :tickets: 2595
 
1477
 
 
1478
      The auto-correlation feature of :func:`.select`, and
 
1479
      by proxy that of :class:`.orm.Query`, will not
 
1480
      take effect for a SELECT statement that is being
 
1481
      rendered directly in the FROM list of the enclosing
 
1482
      SELECT.  Correlation in SQL only applies to column
 
1483
      expressions such as those in the WHERE, ORDER BY,
 
1484
      columns clause.
 
1485
 
 
1486
    .. change::
 
1487
        :tags: sqlite
 
1488
        :pullreq: 23
 
1489
        :changeset: c3addcc9ffad
 
1490
 
 
1491
      Added :class:`.types.NCHAR`, :class:`.types.NVARCHAR`
 
1492
      to the SQLite dialect's list of recognized type names
 
1493
      for reflection.   SQLite returns the name given
 
1494
      to a type as the name returned.
 
1495
 
 
1496
    .. change::
 
1497
        :tags: examples
 
1498
        :tickets: 2589
 
1499
 
 
1500
      The Beaker caching example has been converted
 
1501
      to use `dogpile.cache <http://dogpilecache.readthedocs.org/>`_.
 
1502
      This is a new caching library written by the same
 
1503
      creator of Beaker's caching internals, and represents a
 
1504
      vastly improved, simplified, and modernized system of caching.
 
1505
 
 
1506
      .. seealso::
 
1507
 
 
1508
          :ref:`examples_caching`
 
1509
 
 
1510
    .. change::
 
1511
        :tags: general
 
1512
        :tickets:
 
1513
 
 
1514
      SQLAlchemy 0.8 now targets Python 2.5 and
 
1515
      above.  Python 2.4 is no longer supported.
 
1516
 
 
1517
    .. change::
 
1518
        :tags: removed, general
 
1519
        :tickets: 2433
 
1520
 
 
1521
      The "sqlalchemy.exceptions"
 
1522
      synonym for "sqlalchemy.exc" is removed
 
1523
      fully.
 
1524
 
 
1525
    .. change::
 
1526
        :tags: removed, orm
 
1527
        :tickets: 2442
 
1528
 
 
1529
      The legacy "mutable" system of the
 
1530
      ORM, including the MutableType class as well
 
1531
      as the mutable=True flag on PickleType
 
1532
      and postgresql.ARRAY has been removed.
 
1533
      In-place mutations are detected by the ORM
 
1534
      using the sqlalchemy.ext.mutable extension,
 
1535
      introduced in 0.7.   The removal of MutableType
 
1536
      and associated constructs removes a great
 
1537
      deal of complexity from SQLAlchemy's internals.
 
1538
      The approach performed poorly as it would incur
 
1539
      a scan of the full contents of the Session
 
1540
      when in use.
 
1541
 
 
1542
    .. change::
 
1543
        :tags: orm, moved
 
1544
        :tickets:
 
1545
 
 
1546
      The InstrumentationManager interface
 
1547
      and the entire related system of alternate
 
1548
      class implementation is now moved out
 
1549
      to sqlalchemy.ext.instrumentation.   This is
 
1550
      a seldom used system that adds significant
 
1551
      complexity and overhead to the mechanics of
 
1552
      class instrumentation.  The new architecture
 
1553
      allows it to remain unused until
 
1554
      InstrumentationManager is actually imported,
 
1555
      at which point it is bootstrapped into
 
1556
      the core.
 
1557
 
 
1558
    .. change::
 
1559
        :tags: orm, feature
 
1560
        :tickets: 1401
 
1561
 
 
1562
      Major rewrite of relationship()
 
1563
      internals now allow join conditions which
 
1564
      include columns pointing to themselves
 
1565
      within composite foreign keys.   A new
 
1566
      API for very specialized primaryjoin conditions
 
1567
      is added, allowing conditions based on
 
1568
      SQL functions, CAST, etc. to be handled
 
1569
      by placing the annotation functions
 
1570
      remote() and foreign() inline within the
 
1571
      expression when necessary.  Previous recipes
 
1572
      using the semi-private _local_remote_pairs
 
1573
      approach can be upgraded to this new
 
1574
      approach.
 
1575
 
 
1576
      .. seealso::
 
1577
 
 
1578
          :ref:`feature_relationship_08`
 
1579
 
 
1580
    .. change::
 
1581
        :tags: orm, bug
 
1582
        :tickets: 2527
 
1583
 
 
1584
      ORM will perform extra effort to determine
 
1585
      that an FK dependency between two tables is
 
1586
      not significant during flush if the tables
 
1587
      are related via joined inheritance and the FK
 
1588
      dependency is not part of the inherit_condition,
 
1589
      saves the user a use_alter directive.
 
1590
 
 
1591
    .. change::
 
1592
        :tags: orm, feature
 
1593
        :tickets: 2333
 
1594
 
 
1595
      New standalone function with_polymorphic()
 
1596
      provides the functionality of query.with_polymorphic()
 
1597
      in a standalone form.   It can be applied to any
 
1598
      entity within a query, including as the target
 
1599
      of a join in place of the "of_type()" modifier.
 
1600
 
 
1601
    .. change::
 
1602
        :tags: orm, feature
 
1603
        :tickets: 1106, 2438
 
1604
 
 
1605
      The of_type() construct on attributes
 
1606
      now accepts aliased() class constructs as well
 
1607
      as with_polymorphic constructs, and works with
 
1608
      query.join(), any(), has(), and also
 
1609
      eager loaders subqueryload(), joinedload(),
 
1610
      contains_eager()
 
1611
 
 
1612
    .. change::
 
1613
        :tags: orm, feature
 
1614
        :tickets: 2585
 
1615
 
 
1616
      Improvements to event listening for
 
1617
      mapped classes allows that unmapped classes
 
1618
      can be specified for instance- and mapper-events.
 
1619
      The established events will be automatically
 
1620
      set up on subclasses of that class when the
 
1621
      propagate=True flag is passed, and the
 
1622
      events will be set up for that class itself
 
1623
      if and when it is ultimately mapped.
 
1624
 
 
1625
    .. change::
 
1626
        :tags: orm, bug
 
1627
        :tickets: 2590
 
1628
 
 
1629
      The instrumentation events class_instrument(),
 
1630
      class_uninstrument(), and attribute_instrument()
 
1631
      will now fire off only for descendant classes
 
1632
      of the class assigned to listen().  Previously,
 
1633
      an event listener would be assigned to listen
 
1634
      for all classes in all cases regardless of the
 
1635
      "target" argument passed.
 
1636
 
 
1637
    .. change::
 
1638
        :tags: orm, bug
 
1639
        :tickets: 1900
 
1640
 
 
1641
      with_polymorphic() produces JOINs
 
1642
      in the correct order and with correct inheriting
 
1643
      tables in the case of sending multi-level
 
1644
      subclasses in an arbitrary order or with
 
1645
      intermediary classes missing.
 
1646
 
 
1647
    .. change::
 
1648
        :tags: orm, feature
 
1649
        :tickets: 2485
 
1650
 
 
1651
      The "deferred declarative
 
1652
      reflection" system has been moved into the
 
1653
      declarative extension itself, using the
 
1654
      new DeferredReflection class.  This
 
1655
      class is now tested with both single
 
1656
      and joined table inheritance use cases.
 
1657
 
 
1658
    .. change::
 
1659
        :tags: orm, feature
 
1660
        :tickets: 2208
 
1661
 
 
1662
      Added new core function "inspect()",
 
1663
      which serves as a generic gateway to
 
1664
      introspection into mappers, objects,
 
1665
      others.   The Mapper and InstanceState
 
1666
      objects have been enhanced with a public
 
1667
      API that allows inspection of mapped
 
1668
      attributes, including filters for column-bound
 
1669
      or relationship-bound properties, inspection
 
1670
      of current object state, history of
 
1671
      attributes, etc.
 
1672
 
 
1673
    .. change::
 
1674
        :tags: orm, feature
 
1675
        :tickets: 2452
 
1676
 
 
1677
      Calling rollback() within a
 
1678
      session.begin_nested() will now only expire
 
1679
      those objects that had net changes within the
 
1680
      scope of that transaction, that is objects which
 
1681
      were dirty or were modified on a flush.  This
 
1682
      allows the typical use case for begin_nested(),
 
1683
      that of altering a small subset of objects, to
 
1684
      leave in place the data from the larger enclosing
 
1685
      set of objects that weren't modified in
 
1686
      that sub-transaction.
 
1687
 
 
1688
    .. change::
 
1689
        :tags: orm, feature
 
1690
        :tickets: 2372
 
1691
 
 
1692
      Added utility feature
 
1693
      Session.enable_relationship_loading(),
 
1694
      supersedes relationship.load_on_pending.
 
1695
      Both features should be avoided, however.
 
1696
 
 
1697
    .. change::
 
1698
        :tags: orm, feature
 
1699
        :tickets:
 
1700
 
 
1701
      Added support for .info dictionary argument to
 
1702
      column_property(), relationship(), composite().
 
1703
      All MapperProperty classes have an auto-creating .info
 
1704
      dict available overall.
 
1705
 
 
1706
    .. change::
 
1707
        :tags: orm, feature
 
1708
        :tickets: 2229
 
1709
 
 
1710
      Adding/removing None from a mapped collection
 
1711
      now generates attribute events.  Previously, a None
 
1712
      append would be ignored in some cases.  Related
 
1713
      to.
 
1714
 
 
1715
    .. change::
 
1716
        :tags: orm, feature
 
1717
        :tickets: 2229
 
1718
 
 
1719
      The presence of None in a mapped collection
 
1720
      now raises an error during flush.   Previously,
 
1721
      None values in collections would be silently ignored.
 
1722
 
 
1723
    .. change::
 
1724
        :tags: orm, feature
 
1725
        :tickets:
 
1726
 
 
1727
      The Query.update() method is now
 
1728
      more lenient as to the table
 
1729
      being updated.  Plain Table objects are better
 
1730
      supported now, and additional a joined-inheritance
 
1731
      subclass may be used with update(); the subclass
 
1732
      table will be the target of the update,
 
1733
      and if the parent table is referenced in the
 
1734
      WHERE clause, the compiler will call upon
 
1735
      UPDATE..FROM syntax as allowed by the dialect
 
1736
      to satisfy the WHERE clause.  MySQL's multi-table
 
1737
      update feature is also supported if columns
 
1738
      are specified by object in the "values" dicitionary.
 
1739
      PG's DELETE..USING is also not available
 
1740
      in Core yet.
 
1741
 
 
1742
    .. change::
 
1743
        :tags: orm, feature
 
1744
        :tickets:
 
1745
 
 
1746
      New session events after_transaction_create
 
1747
      and after_transaction_end
 
1748
      allows tracking of new SessionTransaction objects.
 
1749
      If the object is inspected, can be used to determine
 
1750
      when a session first becomes active and when
 
1751
      it deactivates.
 
1752
 
 
1753
    .. change::
 
1754
        :tags: orm, feature
 
1755
        :tickets: 2592
 
1756
 
 
1757
      The Query can now load entity/scalar-mixed
 
1758
      "tuple" rows that contain
 
1759
      types which aren't hashable, by setting the flag
 
1760
      "hashable=False" on the corresponding TypeEngine object
 
1761
      in use.  Custom types that return unhashable types
 
1762
      (typically lists) can set this flag to False.
 
1763
 
 
1764
    .. change::
 
1765
        :tags: orm, bug
 
1766
        :tickets: 2481
 
1767
 
 
1768
      Improvements to joined/subquery eager
 
1769
      loading dealing with chains of subclass entities
 
1770
      sharing a common base, with no specific "join depth"
 
1771
      provided.  Will chain out to
 
1772
      each subclass mapper individually before detecting
 
1773
      a "cycle", rather than considering the base class
 
1774
      to be the source of the "cycle".
 
1775
 
 
1776
    .. change::
 
1777
        :tags: orm, bug
 
1778
        :tickets: 2320
 
1779
 
 
1780
      The "passive" flag on Session.is_modified()
 
1781
      no longer has any effect. is_modified() in
 
1782
      all cases looks only at local in-memory
 
1783
      modified flags and will not emit any
 
1784
      SQL or invoke loader callables/initializers.
 
1785
 
 
1786
    .. change::
 
1787
        :tags: orm, bug
 
1788
        :tickets: 2405
 
1789
 
 
1790
      The warning emitted when using
 
1791
      delete-orphan cascade with one-to-many
 
1792
      or many-to-many without single-parent=True
 
1793
      is now an error.  The ORM
 
1794
      would fail to function subsequent to this
 
1795
      warning in any case.
 
1796
 
 
1797
    .. change::
 
1798
        :tags: orm, bug
 
1799
        :tickets: 2350
 
1800
 
 
1801
      Lazy loads emitted within flush events
 
1802
      such as before_flush(), before_update(),
 
1803
      etc. will now function as they would
 
1804
      within non-event code, regarding consideration
 
1805
      of the PK/FK values used in the lazy-emitted
 
1806
      query.   Previously,
 
1807
      special flags would be established that
 
1808
      would cause lazy loads to load related items
 
1809
      based on the "previous" value of the
 
1810
      parent PK/FK values specifically when called
 
1811
      upon within a flush; the signal to load
 
1812
      in this way is now localized to where the
 
1813
      unit of work actually needs to load that
 
1814
      way.  Note that the UOW does
 
1815
      sometimes load these collections before
 
1816
      the before_update() event is called,
 
1817
      so the usage of "passive_updates" or not
 
1818
      can affect whether or not a collection will
 
1819
      represent the "old" or "new" data, when
 
1820
      accessed within a flush event, based
 
1821
      on when the lazy load was emitted.
 
1822
      The change is backwards incompatible in
 
1823
      the exceedingly small chance that
 
1824
      user event code depended on the old
 
1825
      behavior.
 
1826
 
 
1827
    .. change::
 
1828
        :tags: orm, feature
 
1829
        :tickets: 2179
 
1830
 
 
1831
      Query now "auto correlates" by
 
1832
      default in the same way as select() does.
 
1833
      Previously, a Query used as a subquery
 
1834
      in another would require the correlate()
 
1835
      method be called explicitly in order to
 
1836
      correlate a table on the inside to the
 
1837
      outside.  As always, correlate(None)
 
1838
      disables correlation.
 
1839
 
 
1840
    .. change::
 
1841
        :tags: orm, feature
 
1842
        :tickets: 2464
 
1843
 
 
1844
      The after_attach event is now
 
1845
      emitted after the object is established
 
1846
      in Session.new or Session.identity_map
 
1847
      upon Session.add(), Session.merge(),
 
1848
      etc., so that the object is represented
 
1849
      in these collections when the event
 
1850
      is called.  Added before_attach
 
1851
      event to accommodate use cases that
 
1852
      need autoflush w pre-attached object.
 
1853
 
 
1854
    .. change::
 
1855
        :tags: orm, feature
 
1856
        :tickets:
 
1857
 
 
1858
      The Session will produce warnings
 
1859
      when unsupported methods are used inside the
 
1860
      "execute" portion of the flush.   These are
 
1861
      the familiar methods add(), delete(), etc.
 
1862
      as well as collection and related-object
 
1863
      manipulations, as called within mapper-level
 
1864
      flush events
 
1865
      like after_insert(), after_update(), etc.
 
1866
      It's been prominently documented for a long
 
1867
      time that  SQLAlchemy cannot guarantee
 
1868
      results when the Session is manipulated within
 
1869
      the execution of the flush plan,
 
1870
      however users are still doing it, so now
 
1871
      there's a warning.   Maybe someday the Session
 
1872
      will be enhanced to support these operations
 
1873
      inside of the flush, but for now, results
 
1874
      can't be guaranteed.
 
1875
 
 
1876
    .. change::
 
1877
        :tags: orm, bug
 
1878
        :tickets: 2582, 2566
 
1879
 
 
1880
      Continuing regarding extra
 
1881
      state post-flush due to event listeners;
 
1882
      any states that are marked as "dirty" from an
 
1883
      attribute perspective, usually via column-attribute
 
1884
      set events within after_insert(), after_update(),
 
1885
      etc., will get the "history" flag reset
 
1886
      in all cases, instead of only those instances
 
1887
      that were part of the flush.  This has the effect
 
1888
      that this "dirty" state doesn't carry over
 
1889
      after the flush and won't result in UPDATE
 
1890
      statements.   A warning is emitted to this
 
1891
      effect; the set_committed_state()
 
1892
      method can be used to assign attributes on objects
 
1893
      without producing history events.
 
1894
 
 
1895
    .. change::
 
1896
        :tags: orm, feature
 
1897
        :tickets: 2245
 
1898
 
 
1899
      ORM entities can be passed
 
1900
      to the core select() construct as well
 
1901
      as to the select_from(),
 
1902
      correlate(), and correlate_except()
 
1903
      methods of select(), where they will be unwrapped
 
1904
      into selectables.
 
1905
 
 
1906
    .. change::
 
1907
        :tags: orm, feature
 
1908
        :tickets: 2245
 
1909
 
 
1910
      Some support for auto-rendering of a
 
1911
      relationship join condition based on the mapped
 
1912
      attribute, with usage of core SQL constructs.
 
1913
      E.g. select([SomeClass]).where(SomeClass.somerelationship)
 
1914
      would render SELECT from "someclass" and use the
 
1915
      primaryjoin of "somerelationship" as the WHERE
 
1916
      clause.   This changes the previous meaning
 
1917
      of "SomeClass.somerelationship" when used in a
 
1918
      core SQL context; previously, it would "resolve"
 
1919
      to the parent selectable, which wasn't generally
 
1920
      useful.  Also works with query.filter().
 
1921
      Related to.
 
1922
 
 
1923
    .. change::
 
1924
        :tags: orm, feature
 
1925
        :tickets: 2526
 
1926
 
 
1927
      The registry of classes
 
1928
      in declarative_base() is now a
 
1929
      WeakValueDictionary.  So subclasses of
 
1930
      "Base" that are dereferenced will be
 
1931
      garbage collected, *if they are not
 
1932
      referred to by any other mappers/superclass
 
1933
      mappers*. See the next note for this ticket.
 
1934
 
 
1935
    .. change::
 
1936
        :tags: orm, feature
 
1937
        :tickets: 2472
 
1938
 
 
1939
      Conflicts between columns on
 
1940
      single-inheritance declarative subclasses,
 
1941
      with or without using a mixin, can be resolved
 
1942
      using a new @declared_attr usage described
 
1943
      in the documentation.
 
1944
 
 
1945
    .. change::
 
1946
        :tags: orm, feature
 
1947
        :tickets: 2472
 
1948
 
 
1949
      declared_attr can now be used
 
1950
      on non-mixin classes, even though this is generally
 
1951
      only useful for single-inheritance subclass
 
1952
      column conflict resolution.
 
1953
 
 
1954
    .. change::
 
1955
        :tags: orm, feature
 
1956
        :tickets: 2517
 
1957
 
 
1958
      declared_attr can now be used with
 
1959
      attributes that are not Column or MapperProperty;
 
1960
      including any user-defined value as well
 
1961
      as association proxy objects.
 
1962
 
 
1963
    .. change::
 
1964
        :tags: orm, bug
 
1965
        :tickets: 2565
 
1966
 
 
1967
      Fixed a disconnect that slowly evolved
 
1968
      between a @declared_attr Column and a
 
1969
      directly-defined Column on a mixin. In both
 
1970
      cases, the Column will be applied to the
 
1971
      declared class' table, but not to that of a
 
1972
      joined inheritance subclass.   Previously,
 
1973
      the directly-defined Column would be placed
 
1974
      on both the base and the sub table, which isn't
 
1975
      typically what's desired.
 
1976
 
 
1977
    .. change::
 
1978
        :tags: orm, feature
 
1979
        :tickets: 2526
 
1980
 
 
1981
      *Very limited* support for
 
1982
      inheriting mappers to be GC'ed when the
 
1983
      class itself is deferenced.  The mapper
 
1984
      must not have its own table (i.e.
 
1985
      single table inh only) without polymorphic
 
1986
      attributes in place.
 
1987
      This allows for the use case of
 
1988
      creating a temporary subclass of a declarative
 
1989
      mapped class, with no table or mapping
 
1990
      directives of its own, to be garbage collected
 
1991
      when dereferenced by a unit test.
 
1992
 
 
1993
    .. change::
 
1994
        :tags: orm, feature
 
1995
        :tickets: 2338
 
1996
 
 
1997
      Declarative now maintains a registry
 
1998
      of classes by string name as well as by full
 
1999
      module-qualified name.   Multiple classes with the
 
2000
      same name can now be looked up based on a module-qualified
 
2001
      string within relationship().   Simple class name
 
2002
      lookups where more than one class shares the same
 
2003
      name now raises an informative error message.
 
2004
 
 
2005
    .. change::
 
2006
        :tags: orm, feature
 
2007
        :tickets: 2535
 
2008
 
 
2009
      Can now provide class-bound attributes
 
2010
      that override columns which are of any
 
2011
      non-ORM type, not just descriptors.
 
2012
 
 
2013
    .. change::
 
2014
        :tags: orm, feature
 
2015
        :tickets: 1729
 
2016
 
 
2017
      Added with_labels and
 
2018
      reduce_columns keyword arguments to
 
2019
      Query.subquery(), to provide two alternate
 
2020
      strategies for producing queries with uniquely-
 
2021
      named columns. .
 
2022
 
 
2023
    .. change::
 
2024
        :tags: orm, feature
 
2025
        :tickets: 2476
 
2026
 
 
2027
      A warning is emitted when a reference
 
2028
      to an instrumented collection is no longer
 
2029
      associated with the parent class due to
 
2030
      expiration/attribute refresh/collection
 
2031
      replacement, but an append
 
2032
      or remove operation is received on the
 
2033
      now-detached collection.
 
2034
 
 
2035
    .. change::
 
2036
        :tags: orm, bug
 
2037
        :tickets: 2549
 
2038
 
 
2039
      Declarative can now propagate a column
 
2040
      declared on a single-table inheritance subclass
 
2041
      up to the parent class' table, when the parent
 
2042
      class is itself mapped to a join() or select()
 
2043
      statement, directly or via joined inheritance,
 
2044
      and not just a Table.
 
2045
 
 
2046
    .. change::
 
2047
        :tags: orm, bug
 
2048
        :tickets:
 
2049
 
 
2050
      An error is emitted when uselist=False
 
2051
      is combined with a "dynamic" loader.
 
2052
      This is a warning in 0.7.9.
 
2053
 
 
2054
    .. change::
 
2055
        :tags: removed, orm
 
2056
        :tickets:
 
2057
 
 
2058
      Deprecated identifiers removed:
 
2059
 
 
2060
      * allow_null_pks mapper() argument
 
2061
        (use allow_partial_pks)
 
2062
 
 
2063
      * _get_col_to_prop() mapper method
 
2064
        (use get_property_by_column())
 
2065
 
 
2066
      * dont_load argument to Session.merge()
 
2067
        (use load=True)
 
2068
 
 
2069
      * sqlalchemy.orm.shard module
 
2070
        (use sqlalchemy.ext.horizontal_shard)
 
2071
 
 
2072
    .. change::
 
2073
        :tags: engine, feature
 
2074
        :tickets: 2511
 
2075
 
 
2076
      Connection event listeners can
 
2077
      now be associated with individual
 
2078
      Connection objects, not just Engine
 
2079
      objects.
 
2080
 
 
2081
    .. change::
 
2082
        :tags: engine, feature
 
2083
        :tickets: 2459
 
2084
 
 
2085
      The before_cursor_execute event
 
2086
      fires off for so-called "_cursor_execute"
 
2087
      events, which are usually special-case
 
2088
      executions of primary-key bound sequences
 
2089
      and default-generation SQL
 
2090
      phrases that invoke separately when RETURNING
 
2091
      is not used with INSERT.
 
2092
 
 
2093
    .. change::
 
2094
        :tags: engine, feature
 
2095
        :tickets:
 
2096
 
 
2097
      The libraries used by the test suite
 
2098
      have been moved around a bit so that they are
 
2099
      part of the SQLAlchemy install again.  In addition,
 
2100
      a new suite of tests is present in the
 
2101
      new sqlalchemy.testing.suite package.  This is
 
2102
      an under-development system that hopes to provide
 
2103
      a universal testing suite for external dialects.
 
2104
      Dialects which are maintained outside of SQLAlchemy
 
2105
      can use the new test fixture as the framework
 
2106
      for their own tests, and will get for free a
 
2107
      "compliance" suite of dialect-focused tests,
 
2108
      including an improved "requirements" system
 
2109
      where specific capabilities and features can
 
2110
      be enabled or disabled for testing.
 
2111
 
 
2112
    .. change::
 
2113
        :tags: engine, bug
 
2114
        :tickets:
 
2115
 
 
2116
      The Inspector.get_table_names()
 
2117
      order_by="foreign_key" feature now sorts
 
2118
      tables by dependee first, to be consistent
 
2119
      with util.sort_tables and metadata.sorted_tables.
 
2120
 
 
2121
    .. change::
 
2122
        :tags: engine, bug
 
2123
        :tickets: 2522
 
2124
 
 
2125
      Fixed bug whereby if a database restart
 
2126
      affected multiple connections, each
 
2127
      connection would individually invoke a new
 
2128
      disposal of the pool, even though only
 
2129
      one disposal is needed.
 
2130
 
 
2131
    .. change::
 
2132
        :tags: engine, feature
 
2133
        :tickets: 2462
 
2134
 
 
2135
      Added a new system
 
2136
      for registration of new dialects in-process
 
2137
      without using an entrypoint.  See the
 
2138
      docs for "Registering New Dialects".
 
2139
 
 
2140
    .. change::
 
2141
        :tags: engine, feature
 
2142
        :tickets: 2556
 
2143
 
 
2144
      The "required" flag is set to
 
2145
      True by default, if not passed explicitly,
 
2146
      on bindparam() if the "value" or "callable"
 
2147
      parameters are not passed.
 
2148
      This will cause statement execution to check
 
2149
      for the parameter being present in the final
 
2150
      collection of bound parameters, rather than
 
2151
      implicitly assigning None.
 
2152
 
 
2153
    .. change::
 
2154
        :tags: engine, feature
 
2155
        :tickets:
 
2156
 
 
2157
      Various API tweaks to the "dialect"
 
2158
      API to better support highly specialized
 
2159
      systems such as the Akiban database, including
 
2160
      more hooks to allow an execution context to
 
2161
      access type processors.
 
2162
 
 
2163
    .. change::
 
2164
        :tags: engine, bug
 
2165
        :tickets: 2397
 
2166
 
 
2167
      The names of the columns on the
 
2168
      .c. attribute of a select().apply_labels()
 
2169
      is now based on <tablename>_<colkey> instead
 
2170
      of <tablename>_<colname>, for those columns
 
2171
      that have a distinctly named .key.
 
2172
 
 
2173
    .. change::
 
2174
        :tags: engine, feature
 
2175
        :tickets: 2422
 
2176
 
 
2177
      Inspector.get_primary_keys() is
 
2178
      deprecated; use Inspector.get_pk_constraint().
 
2179
      Courtesy Diana Clarke.
 
2180
 
 
2181
    .. change::
 
2182
        :tags: engine, bug
 
2183
        :tickets:
 
2184
 
 
2185
      The autoload_replace flag on Table,
 
2186
      when False, will cause any reflected foreign key
 
2187
      constraints which refer to already-declared
 
2188
      columns to be skipped, assuming that the
 
2189
      in-Python declared column will take over
 
2190
      the task of specifying in-Python ForeignKey
 
2191
      or ForeignKeyConstraint declarations.
 
2192
 
 
2193
    .. change::
 
2194
        :tags: engine, bug
 
2195
        :tickets: 2498
 
2196
 
 
2197
      The ResultProxy methods inserted_primary_key,
 
2198
      last_updated_params(), last_inserted_params(),
 
2199
      postfetch_cols(), prefetch_cols() all
 
2200
      assert that the given statement is a compiled
 
2201
      construct, and is an insert() or update()
 
2202
      statement as is appropriate, else
 
2203
      raise InvalidRequestError.
 
2204
 
 
2205
    .. change::
 
2206
        :tags: engine, feature
 
2207
        :tickets:
 
2208
 
 
2209
      New C extension module "utils" has
 
2210
      been added for additional function speedups
 
2211
      as we have time to implement.
 
2212
 
 
2213
    .. change::
 
2214
        :tags: engine
 
2215
        :tickets:
 
2216
 
 
2217
      ResultProxy.last_inserted_ids is removed,
 
2218
      replaced by inserted_primary_key.
 
2219
 
 
2220
    .. change::
 
2221
        :tags: feature, sql
 
2222
        :tickets: 2547
 
2223
 
 
2224
      Major rework of operator system
 
2225
      in Core, to allow redefinition of existing
 
2226
      operators as well as addition of new operators
 
2227
      at the type level.  New types can be created
 
2228
      from existing ones which add or redefine
 
2229
      operations that are exported out to column
 
2230
      expressions, in a similar manner to how the
 
2231
      ORM has allowed comparator_factory.   The new
 
2232
      architecture moves this capability into the
 
2233
      Core so that it is consistently usable in
 
2234
      all cases, propagating cleanly using existing
 
2235
      type propagation behavior.
 
2236
 
 
2237
    .. change::
 
2238
        :tags: feature, sql
 
2239
        :tickets: 1534, 2547
 
2240
 
 
2241
      To complement, types
 
2242
      can now provide "bind expressions" and
 
2243
      "column expressions" which allow compile-time
 
2244
      injection of SQL expressions into statements
 
2245
      on a per-column or per-bind level.   This is
 
2246
      to suit the use case of a type which needs
 
2247
      to augment bind- and result- behavior at the
 
2248
      SQL level, as opposed to in the Python level.
 
2249
      Allows for schemes like transparent encryption/
 
2250
      decryption, usage of Postgis functions, etc.
 
2251
 
 
2252
    .. change::
 
2253
        :tags: feature, sql
 
2254
        :tickets:
 
2255
 
 
2256
      The Core oeprator system now includes
 
2257
      the `getitem` operator, i.e. the bracket
 
2258
      operator in Python.  This is used at first
 
2259
      to provide index and slice behavior to the
 
2260
      Postgresql ARRAY type, and also provides a hook
 
2261
      for end-user definition of custom __getitem__
 
2262
      schemes which can be applied at the type
 
2263
      level as well as within ORM-level custom
 
2264
      operator schemes.   `lshift` (<<)
 
2265
      and `rshift` (>>) are also supported as
 
2266
      optional operators.
 
2267
 
 
2268
      Note that this change has the effect that
 
2269
      descriptor-based __getitem__ schemes used by
 
2270
      the ORM in conjunction with synonym() or other
 
2271
      "descriptor-wrapped" schemes will need
 
2272
      to start using a custom comparator in order
 
2273
      to maintain this behavior.
 
2274
 
 
2275
    .. change::
 
2276
        :tags: feature, sql
 
2277
        :tickets: 2537
 
2278
 
 
2279
      Revised the rules used to determine
 
2280
      the operator precedence for the user-defined
 
2281
      operator, i.e. that granted using the ``op()``
 
2282
      method.   Previously, the smallest precedence
 
2283
      was applied in all cases, now the default
 
2284
      precedence is zero, lower than all operators
 
2285
      except "comma" (such as, used in the argument
 
2286
      list of a ``func`` call) and "AS", and is
 
2287
      also customizable via the "precedence" argument
 
2288
      on the ``op()`` method.
 
2289
 
 
2290
    .. change::
 
2291
        :tags: feature, sql
 
2292
        :tickets: 2276
 
2293
 
 
2294
      Added "collation" parameter to all
 
2295
      String types.  When present, renders as
 
2296
      COLLATE <collation>.  This to support the
 
2297
      COLLATE keyword now supported by several
 
2298
      databases including MySQL, SQLite, and Postgresql.
 
2299
 
 
2300
    .. change::
 
2301
        :tags: change, sql
 
2302
        :tickets:
 
2303
 
 
2304
      The Text() type renders the length
 
2305
      given to it, if a length was specified.
 
2306
 
 
2307
    .. change::
 
2308
        :tags: feature, sql
 
2309
        :tickets:
 
2310
 
 
2311
      Custom unary operators can now be
 
2312
      used by combining operators.custom_op() with
 
2313
      UnaryExpression().
 
2314
 
 
2315
    .. change::
 
2316
        :tags: bug, sql
 
2317
        :tickets: 2564
 
2318
 
 
2319
      A tweak to column precedence which moves the
 
2320
      "concat" and "match" operators to be the same as
 
2321
      that of "is", "like", and others; this helps with
 
2322
      parenthesization rendering when used in conjunction
 
2323
      with "IS".
 
2324
 
 
2325
    .. change::
 
2326
        :tags: feature, sql
 
2327
        :tickets:
 
2328
 
 
2329
      Enhanced GenericFunction and func.*
 
2330
      to allow for user-defined GenericFunction
 
2331
      subclasses to be available via the func.*
 
2332
      namespace automatically by classname,
 
2333
      optionally using a package name, as well
 
2334
      as with the ability to have the rendered
 
2335
      name different from the identified name
 
2336
      in func.*.
 
2337
 
 
2338
    .. change::
 
2339
        :tags: feature, sql
 
2340
        :tickets: 2562
 
2341
 
 
2342
      The cast() and extract() constructs
 
2343
      will now be produced via the func.* accessor
 
2344
      as well, as users naturally try to access these
 
2345
      names from func.* they might as well do
 
2346
      what's expected, even though the returned
 
2347
      object is not a FunctionElement.
 
2348
 
 
2349
    .. change::
 
2350
        :tags: changed, sql
 
2351
        :tickets:
 
2352
 
 
2353
      Most classes in expression.sql
 
2354
      are no longer preceded with an underscore,
 
2355
      i.e. Label, SelectBase, Generative, CompareMixin.
 
2356
      _BindParamClause is also renamed to
 
2357
      BindParameter.   The old underscore names for
 
2358
      these classes will remain available as synonyms
 
2359
      for the foreseeable future.
 
2360
 
 
2361
    .. change::
 
2362
        :tags: feature, sql
 
2363
        :tickets: 2208
 
2364
 
 
2365
      The Inspector object can now be
 
2366
      acquired using the new inspect() service,
 
2367
      part of
 
2368
 
 
2369
    .. change::
 
2370
        :tags: feature, sql
 
2371
        :tickets: 2418
 
2372
 
 
2373
      The column_reflect event now
 
2374
      accepts the Inspector object as the first
 
2375
      argument, preceding "table".   Code which
 
2376
      uses the 0.7 version of this very new
 
2377
      event will need modification to add the
 
2378
      "inspector" object as the first argument.
 
2379
 
 
2380
    .. change::
 
2381
        :tags: feature, sql
 
2382
        :tickets: 2423
 
2383
 
 
2384
      The behavior of column targeting
 
2385
      in result sets is now case sensitive by
 
2386
      default.   SQLAlchemy for many years would
 
2387
      run a case-insensitive conversion on these values,
 
2388
      probably to alleviate early case sensitivity
 
2389
      issues with dialects like Oracle and
 
2390
      Firebird.   These issues have been more cleanly
 
2391
      solved in more modern versions so the performance
 
2392
      hit of calling lower() on identifiers is removed.
 
2393
      The case insensitive comparisons can be re-enabled
 
2394
      by setting "case_insensitive=False" on
 
2395
      create_engine().
 
2396
 
 
2397
    .. change::
 
2398
        :tags: bug, sql
 
2399
        :tickets: 2591
 
2400
 
 
2401
      Applying a column expression to a select
 
2402
      statement using a label with or without other
 
2403
      modifying constructs will no longer "target" that
 
2404
      expression to the underlying Column; this affects
 
2405
      ORM operations that rely upon Column targeting
 
2406
      in order to retrieve results.  That is, a query
 
2407
      like query(User.id, User.id.label('foo')) will now
 
2408
      track the value of each "User.id" expression separately
 
2409
      instead of munging them together.  It is not expected
 
2410
      that any users will be impacted by this; however,
 
2411
      a usage that uses select() in conjunction with
 
2412
      query.from_statement() and attempts to load fully
 
2413
      composed ORM entities may not function as expected
 
2414
      if the select() named Column objects with arbitrary
 
2415
      .label() names, as these will no longer target to
 
2416
      the Column objects mapped by that entity.
 
2417
 
 
2418
    .. change::
 
2419
        :tags: feature, sql
 
2420
        :tickets: 2415
 
2421
 
 
2422
      The "unconsumed column names" warning emitted
 
2423
      when keys are present in insert.values() or update.values()
 
2424
      that aren't in the target table is now an exception.
 
2425
 
 
2426
    .. change::
 
2427
        :tags: feature, sql
 
2428
        :tickets: 2502
 
2429
 
 
2430
      Added "MATCH" clause to ForeignKey,
 
2431
      ForeignKeyConstraint, courtesy Ryan Kelly.
 
2432
 
 
2433
    .. change::
 
2434
        :tags: feature, sql
 
2435
        :tickets: 2507
 
2436
 
 
2437
      Added support for DELETE and UPDATE from
 
2438
      an alias of a table, which would assumedly
 
2439
      be related to itself elsewhere in the query,
 
2440
      courtesy Ryan Kelly.
 
2441
 
 
2442
    .. change::
 
2443
        :tags: feature, sql
 
2444
        :tickets:
 
2445
 
 
2446
      select() features a correlate_except()
 
2447
      method, auto correlates all selectables except those
 
2448
      passed.
 
2449
 
 
2450
    .. change::
 
2451
        :tags: feature, sql
 
2452
        :tickets: 2431
 
2453
 
 
2454
      The prefix_with() method is now available
 
2455
      on each of select(), insert(), update(), delete(),
 
2456
      all with the same API, accepting multiple
 
2457
      prefix calls, as well as a "dialect name" so that
 
2458
      the prefix can be limited to one kind of dialect.
 
2459
 
 
2460
    .. change::
 
2461
        :tags: feature, sql
 
2462
        :tickets: 1729
 
2463
 
 
2464
      Added reduce_columns() method
 
2465
      to select() construct, replaces columns inline
 
2466
      using the util.reduce_columns utility function
 
2467
      to remove equivalent columns.  reduce_columns()
 
2468
      also adds "with_only_synonyms" to limit the
 
2469
      reduction just to those columns which have the same
 
2470
      name.  The deprecated fold_equivalents() feature is
 
2471
      removed.
 
2472
 
 
2473
    .. change::
 
2474
        :tags: feature, sql
 
2475
        :tickets: 2470
 
2476
 
 
2477
      Reworked the startswith(), endswith(),
 
2478
      contains() operators to do a better job with
 
2479
      negation (NOT LIKE), and also to assemble them
 
2480
      at compilation time so that their rendered SQL
 
2481
      can be altered, such as in the case for Firebird
 
2482
      STARTING WITH
 
2483
 
 
2484
    .. change::
 
2485
        :tags: feature, sql
 
2486
        :tickets: 2463
 
2487
 
 
2488
      Added a hook to the system of rendering
 
2489
      CREATE TABLE that provides access to the render for each
 
2490
      Column individually, by constructing a @compiles
 
2491
      function against the new schema.CreateColumn
 
2492
      construct.
 
2493
 
 
2494
    .. change::
 
2495
        :tags: feature, sql
 
2496
        :tickets:
 
2497
 
 
2498
      "scalar" selects now have a WHERE method
 
2499
      to help with generative building.  Also slight adjustment
 
2500
      regarding how SS "correlates" columns; the new methodology
 
2501
      no longer applies meaning to the underlying
 
2502
      Table column being selected.  This improves
 
2503
      some fairly esoteric situations, and the logic
 
2504
      that was there didn't seem to have any purpose.
 
2505
 
 
2506
    .. change::
 
2507
        :tags: bug, sql
 
2508
        :tickets: 2520
 
2509
 
 
2510
      Fixes to the interpretation of the
 
2511
      Column "default" parameter as a callable
 
2512
      to not pass ExecutionContext into a keyword
 
2513
      argument parameter.
 
2514
 
 
2515
    .. change::
 
2516
        :tags: bug, sql
 
2517
        :tickets: 2410
 
2518
 
 
2519
      All of UniqueConstraint, ForeignKeyConstraint,
 
2520
      CheckConstraint, and PrimaryKeyConstraint will
 
2521
      attach themselves to their parent table automatically
 
2522
      when they refer to a Table-bound Column object directly
 
2523
      (i.e. not just string column name), and refer to
 
2524
      one and only one Table.   Prior to 0.8 this behavior
 
2525
      occurred for UniqueConstraint and PrimaryKeyConstraint,
 
2526
      but not ForeignKeyConstraint or CheckConstraint.
 
2527
 
 
2528
    .. change::
 
2529
        :tags: bug, sql
 
2530
        :tickets: 2594
 
2531
 
 
2532
      TypeDecorator now includes a generic repr()
 
2533
      that works in terms of the "impl" type by default.
 
2534
      This is a behavioral change for those TypeDecorator
 
2535
      classes that specify a custom __init__ method; those
 
2536
      types will need to re-define __repr__() if they need
 
2537
      __repr__() to provide a faithful constructor representation.
 
2538
 
 
2539
    .. change::
 
2540
        :tags: bug, sql
 
2541
        :tickets: 2168
 
2542
 
 
2543
      column.label(None) now produces an
 
2544
      anonymous label, instead of returning the
 
2545
      column object itself, consistent with the behavior
 
2546
      of label(column, None).
 
2547
 
 
2548
    .. change::
 
2549
        :tags: feature, sql
 
2550
        :tickets: 2455
 
2551
 
 
2552
      An explicit error is raised when
 
2553
      a ForeignKeyConstraint() that was
 
2554
      constructed to refer to multiple remote tables
 
2555
      is first used.
 
2556
 
 
2557
    .. change::
 
2558
        :tags: access, feature
 
2559
        :tickets:
 
2560
 
 
2561
      the MS Access dialect has been
 
2562
      moved to its own project on Bitbucket,
 
2563
      taking advantage of the new SQLAlchemy
 
2564
      dialect compliance suite.   The dialect is
 
2565
      still in very rough shape and probably not
 
2566
      ready for general use yet, however
 
2567
      it does have *extremely* rudimental
 
2568
      functionality now.
 
2569
      https://bitbucket.org/zzzeek/sqlalchemy-access
 
2570
 
 
2571
    .. change::
 
2572
        :tags: maxdb, moved
 
2573
        :tickets:
 
2574
 
 
2575
      The MaxDB dialect, which hasn't been
 
2576
      functional for several years, is
 
2577
      moved out to a pending bitbucket project,
 
2578
      https://bitbucket.org/zzzeek/sqlalchemy-maxdb.
 
2579
 
 
2580
    .. change::
 
2581
        :tags: sqlite, feature
 
2582
        :tickets: 2363
 
2583
 
 
2584
      the SQLite date and time types
 
2585
      have been overhauled to support a more open
 
2586
      ended format for input and output, using
 
2587
      name based format strings and regexps.  A
 
2588
      new argument "microseconds" also provides
 
2589
      the option to omit the "microseconds"
 
2590
      portion of timestamps.  Thanks to
 
2591
      Nathan Wright for the work and tests on
 
2592
      this.
 
2593
 
 
2594
    .. change::
 
2595
        :tags: mssql, feature
 
2596
        :tickets:
 
2597
 
 
2598
      SQL Server dialect can be given
 
2599
      database-qualified schema names,
 
2600
      i.e. "schema='mydatabase.dbo'"; reflection
 
2601
      operations will detect this, split the schema
 
2602
      among the "." to get the owner separately,
 
2603
      and emit a "USE mydatabase" statement before
 
2604
      reflecting targets within the "dbo" owner;
 
2605
      the existing database returned from
 
2606
      DB_NAME() is then restored.
 
2607
 
 
2608
    .. change::
 
2609
        :tags: mssql, bug
 
2610
        :tickets: 2277
 
2611
 
 
2612
      removed legacy behavior whereby
 
2613
      a column comparison to a scalar SELECT via
 
2614
      == would coerce to an IN with the SQL server
 
2615
      dialect.  This is implicit
 
2616
      behavior which fails in other scenarios
 
2617
      so is removed.  Code which relies on this
 
2618
      needs to be modified to use column.in_(select)
 
2619
      explicitly.
 
2620
 
 
2621
    .. change::
 
2622
        :tags: mssql, feature
 
2623
        :tickets:
 
2624
 
 
2625
      updated support for the mxodbc
 
2626
      driver; mxodbc 3.2.1 is recommended for full
 
2627
      compatibility.
 
2628
 
 
2629
    .. change::
 
2630
        :tags: postgresql, feature
 
2631
        :tickets: 2441
 
2632
 
 
2633
      postgresql.ARRAY features an optional
 
2634
      "dimension" argument, will assign a specific
 
2635
      number of dimensions to the array which will
 
2636
      render in DDL as ARRAY[][]..., also improves
 
2637
      performance of bind/result processing.
 
2638
 
 
2639
    .. change::
 
2640
        :tags: postgresql, feature
 
2641
        :tickets:
 
2642
 
 
2643
      postgresql.ARRAY now supports
 
2644
      indexing and slicing.  The Python [] operator
 
2645
      is available on all SQL expressions that are
 
2646
      of type ARRAY; integer or simple slices can be
 
2647
      passed.  The slices can also be used on the
 
2648
      assignment side in the SET clause of an UPDATE
 
2649
      statement by passing them into Update.values();
 
2650
      see the docs for examples.
 
2651
 
 
2652
    .. change::
 
2653
        :tags: postgresql, feature
 
2654
        :tickets:
 
2655
 
 
2656
      Added new "array literal" construct
 
2657
      postgresql.array().  Basically a "tuple" that
 
2658
      renders as ARRAY[1,2,3].
 
2659
 
 
2660
    .. change::
 
2661
        :tags: postgresql, feature
 
2662
        :tickets: 2506
 
2663
 
 
2664
      Added support for the Postgresql ONLY
 
2665
      keyword, which can appear corresponding to a
 
2666
      table in a SELECT, UPDATE, or DELETE statement.
 
2667
      The phrase is established using with_hint().
 
2668
      Courtesy Ryan Kelly
 
2669
 
 
2670
    .. change::
 
2671
        :tags: postgresql, feature
 
2672
        :tickets:
 
2673
 
 
2674
      The "ischema_names" dictionary of the
 
2675
      Postgresql dialect is "unofficially" customizable.
 
2676
      Meaning, new types such as PostGIS types can
 
2677
      be added into this dictionary, and the PG type
 
2678
      reflection code should be able to handle simple
 
2679
      types with variable numbers of arguments.
 
2680
      The functionality here is "unofficial" for
 
2681
      three reasons:
 
2682
 
 
2683
      1. this is not an "official" API.  Ideally
 
2684
         an "official" API would allow custom type-handling
 
2685
         callables at the dialect or global level
 
2686
         in a generic way.
 
2687
      2. This is only implemented for the PG dialect,
 
2688
         in particular because PG has broad support
 
2689
         for custom types vs. other database backends.
 
2690
         A real API would be implemented at the
 
2691
         default dialect level.
 
2692
      3. The reflection code here is only tested against
 
2693
         simple types and probably has issues with more
 
2694
         compositional types.
 
2695
 
 
2696
      patch courtesy Éric Lemoine.
 
2697
 
 
2698
    .. change::
 
2699
        :tags: firebird, feature
 
2700
        :tickets: 2470
 
2701
 
 
2702
      The "startswith()" operator renders
 
2703
      as "STARTING WITH", "~startswith()" renders
 
2704
      as "NOT STARTING WITH", using FB's more efficient
 
2705
      operator.
 
2706
 
 
2707
    .. change::
 
2708
        :tags: firebird, bug
 
2709
        :tickets: 2505
 
2710
 
 
2711
      CompileError is raised when VARCHAR with
 
2712
      no length is attempted to be emitted, same
 
2713
      way as MySQL.
 
2714
 
 
2715
    .. change::
 
2716
        :tags: firebird, bug
 
2717
        :tickets:
 
2718
 
 
2719
      Firebird now uses strict "ansi bind rules"
 
2720
      so that bound parameters don't render in the
 
2721
      columns clause of a statement - they render
 
2722
      literally instead.
 
2723
 
 
2724
    .. change::
 
2725
        :tags: firebird, bug
 
2726
        :tickets:
 
2727
 
 
2728
      Support for passing datetime as date when
 
2729
      using the DateTime type with Firebird; other
 
2730
      dialects support this.
 
2731
 
 
2732
    .. change::
 
2733
        :tags: firebird, feature
 
2734
        :tickets: 2504
 
2735
 
 
2736
      An experimental dialect for the fdb
 
2737
      driver is added, but is untested as I cannot
 
2738
      get the fdb package to build.
 
2739
 
 
2740
    .. change::
 
2741
        :tags: bug, mysql
 
2742
        :tickets: 2404
 
2743
 
 
2744
      Dialect no longer emits expensive server
 
2745
      collations query, as well as server casing,
 
2746
      on first connect.  These functions are still
 
2747
      available as semi-private.
 
2748
 
 
2749
    .. change::
 
2750
        :tags: feature, mysql
 
2751
        :tickets: 2534
 
2752
 
 
2753
      Added TIME type to mysql dialect,
 
2754
      accepts "fst" argument which is the new
 
2755
      "fractional seconds" specifier for recent
 
2756
      MySQL versions.  The datatype will interpret
 
2757
      a microseconds portion received from the driver,
 
2758
      however note that at this time most/all MySQL
 
2759
      DBAPIs do not support returning this value.
 
2760
 
 
2761
    .. change::
 
2762
        :tags: oracle, bug
 
2763
        :tickets: 2437
 
2764
 
 
2765
      Quoting information is now passed along
 
2766
      from a Column with quote=True when generating
 
2767
      a same-named bound parameter to the bindparam()
 
2768
      object, as is the case in generated INSERT and UPDATE
 
2769
      statements, so that unknown reserved names can
 
2770
      be fully supported.
 
2771
 
 
2772
    .. change::
 
2773
        :tags: oracle, feature
 
2774
        :tickets: 2561
 
2775
 
 
2776
      The types of columns excluded from the
 
2777
      setinputsizes() set can be customized by sending
 
2778
      a list of string DBAPI type names to exclude,
 
2779
      using the exclude_setinputsizes dialect parameter.
 
2780
      This list was previously fixed.  The list also
 
2781
      now defaults to STRING, UNICODE, removing
 
2782
      CLOB, NCLOB from the list.
 
2783
 
 
2784
    .. change::
 
2785
        :tags: oracle, bug
 
2786
        :tickets:
 
2787
 
 
2788
      The CreateIndex construct in Oracle
 
2789
      will now schema-qualify the name of the index
 
2790
      to be that of the parent table.  Previously this
 
2791
      name was omitted which apparently creates the
 
2792
      index in the default schema, rather than that
 
2793
      of the table.
 
2794
 
 
2795
    .. change::
 
2796
        :tags: sql, feature
 
2797
        :tickets: 2580
 
2798
 
 
2799
        Added :meth:`.ColumnOperators.notin_`,
 
2800
        :meth:`.ColumnOperators.notlike`,
 
2801
        :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`.
 
2802
 
 
2803
    .. change::
 
2804
        :tags: sql, removed
 
2805
 
 
2806
        The long-deprecated and non-functional ``assert_unicode`` flag on
 
2807
        :func:`.create_engine` as well as :class:`.String` is removed.