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

« back to all changes in this revision

Viewing changes to CHANGES_PRE_06

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-01 23:18:16 UTC
  • mfrom: (1.4.15 upstream) (16.1.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20110801231816-6lx797pi3q1fpqst
Tags: 0.7.2-1
* New upstream release
* Bump minimum required python-mako version to 0.4.1 (closes: 635898)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-*- coding: utf-8; fill-column: 68 -*-
 
2
 
 
3
===============
 
4
CHANGES PRE-0.6
 
5
===============
 
6
 
 
7
0.5.9
 
8
=====
 
9
- sql
 
10
    - Fixed erroneous self_group() call in expression package.
 
11
      [ticket:1661]
 
12
 
 
13
0.5.8
 
14
=====
 
15
- sql
 
16
    - The copy() method on Column now supports uninitialized,
 
17
      unnamed Column objects. This allows easy creation of 
 
18
      declarative helpers which place common columns on multiple 
 
19
      subclasses.
 
20
 
 
21
    - Default generators like Sequence() translate correctly
 
22
      across a copy() operation.
 
23
 
 
24
    - Sequence() and other DefaultGenerator objects are accepted 
 
25
      as the value for the "default" and "onupdate" keyword
 
26
      arguments of Column, in addition to being accepted
 
27
      positionally.
 
28
 
 
29
    - Fixed a column arithmetic bug that affected column
 
30
      correspondence for cloned selectables which contain
 
31
      free-standing column expressions.   This bug is
 
32
      generally only noticeable when exercising newer 
 
33
      ORM behavior only availble in 0.6 via [ticket:1568], 
 
34
      but is more correct at the SQL expression level 
 
35
      as well. [ticket:1617]
 
36
 
 
37
- postgresql
 
38
    - The extract() function, which was slightly improved in
 
39
      0.5.7, needed a lot more work to generate the correct
 
40
      typecast (the typecasts appear to be necessary in PG's
 
41
      EXTRACT quite a lot of the time).  The typecast is 
 
42
      now generated using a rule dictionary based 
 
43
      on PG's documentation for date/time/interval arithmetic.
 
44
      It also accepts text() constructs again, which was broken
 
45
      in 0.5.7. [ticket:1647]
 
46
 
 
47
- firebird 
 
48
    - Recognize more errors as disconnections. [ticket:1646]
 
49
 
 
50
0.5.7
 
51
=====
 
52
- orm
 
53
    - contains_eager() now works with the automatically 
 
54
      generated subquery that results when you say 
 
55
      "query(Parent).join(Parent.somejoinedsubclass)", i.e. 
 
56
      when Parent joins to a joined-table-inheritance subclass.
 
57
      Previously contains_eager() would erroneously add the 
 
58
      subclass table to the query separately producing a 
 
59
      cartesian product.  An example is in the ticket
 
60
      description.  [ticket:1543]
 
61
 
 
62
    - query.options() now only propagate to loaded objects
 
63
      for potential further sub-loads only for options where
 
64
      such behavior is relevant, keeping
 
65
      various unserializable options like those generated
 
66
      by contains_eager() out of individual instance states.
 
67
      [ticket:1553]
 
68
 
 
69
    - Session.execute() now locates table- and 
 
70
      mapper-specific binds based on a passed
 
71
      in expression which is an insert()/update()/delete() 
 
72
      construct. [ticket:1054]
 
73
 
 
74
    - Session.merge() now properly overwrites a many-to-one or 
 
75
      uselist=False attribute to None if the attribute 
 
76
      is also None in the given object to be merged.
 
77
 
 
78
    - Fixed a needless select which would occur when merging
 
79
      transient objects that contained a null primary key
 
80
      identifier.  [ticket:1618]
 
81
 
 
82
    - Mutable collection passed to the "extension" attribute
 
83
      of relation(), column_property() etc. will not be mutated
 
84
      or shared among multiple instrumentation calls, preventing
 
85
      duplicate extensions, such as backref populators,
 
86
      from being inserted into the list.
 
87
      [ticket:1585]
 
88
 
 
89
    - Fixed the call to get_committed_value() on CompositeProperty.
 
90
      [ticket:1504]
 
91
 
 
92
    - Fixed bug where Query would crash if a join() with no clear
 
93
      "left" side were called when a non-mapped column entity
 
94
      appeared in the columns list. [ticket:1602]
 
95
 
 
96
    - Fixed bug whereby composite columns wouldn't load properly
 
97
      when configured on a joined-table subclass, introduced in
 
98
      version 0.5.6 as a result of the fix for [ticket:1480].
 
99
      [ticket:1616] thx to Scott Torborg.
 
100
 
 
101
    - The "use get" behavior of many-to-one relations, i.e. that a 
 
102
      lazy load will fallback to the possibly cached query.get() 
 
103
      value, now works across join conditions where the two compared 
 
104
      types are not exactly the same class, but share the same 
 
105
      "affinity" - i.e. Integer and SmallInteger.  Also allows
 
106
      combinations of reflected and non-reflected types to work
 
107
      with 0.5 style type reflection, such as PGText/Text (note 0.6 
 
108
      reflects types as their generic versions).   [ticket:1556]
 
109
 
 
110
    - Fixed bug in query.update() when passing Cls.attribute
 
111
      as keys in the value dict and using synchronize_session='expire'
 
112
      ('fetch' in 0.6). [ticket:1436]
 
113
 
 
114
- sql
 
115
    - Fixed bug in two-phase transaction whereby commit() method
 
116
      didn't set the full state which allows subsequent close()
 
117
      call to succeed. [ticket:1603]
 
118
 
 
119
    - Fixed the "numeric" paramstyle, which apparently is the
 
120
      default paramstyle used by Informixdb.
 
121
 
 
122
    - Repeat expressions in the columns clause of a select
 
123
      are deduped based on the identity of each clause element,
 
124
      not the actual string.  This allows positional 
 
125
      elements to render correctly even if they all render
 
126
      identically, such as "qmark" style bind parameters.
 
127
      [ticket:1574]
 
128
 
 
129
    - The cursor associated with connection pool connections
 
130
      (i.e. _CursorFairy) now proxies `__iter__()` to the 
 
131
      underlying cursor correctly. [ticket:1632]
 
132
 
 
133
    - types now support an "affinity comparison" operation, i.e.
 
134
      that an Integer/SmallInteger are "compatible", or 
 
135
      a Text/String, PickleType/Binary, etc.  Part of 
 
136
      [ticket:1556].
 
137
 
 
138
    - Fixed bug preventing alias() of an alias() from being
 
139
      cloned or adapted (occurs frequently in ORM operations).
 
140
      [ticket:1641]
 
141
 
 
142
- sqlite
 
143
    - sqlite dialect properly generates CREATE INDEX for a table
 
144
      that is in an alternate schema.  [ticket:1439]
 
145
 
 
146
- postgresql
 
147
    - Added support for reflecting the DOUBLE PRECISION type,
 
148
      via a new postgres.PGDoublePrecision object.
 
149
      This is postgresql.DOUBLE_PRECISION in 0.6.
 
150
      [ticket:1085]
 
151
 
 
152
    - Added support for reflecting the INTERVAL YEAR TO MONTH
 
153
      and INTERVAL DAY TO SECOND syntaxes of the INTERVAL 
 
154
      type.  [ticket:460]
 
155
 
 
156
    - Corrected the "has_sequence" query to take current schema,
 
157
      or explicit sequence-stated schema, into account.
 
158
      [ticket:1576]
 
159
 
 
160
    - Fixed the behavior of extract() to apply operator
 
161
      precedence rules to the "::" operator when applying
 
162
      the "timestamp" cast - ensures proper parenthesization.
 
163
      [ticket:1611]
 
164
 
 
165
- mssql
 
166
    - Changed the name of TrustedConnection to
 
167
      Trusted_Connection when constructing pyodbc connect
 
168
      arguments [ticket:1561]
 
169
 
 
170
- oracle
 
171
     - The "table_names" dialect function, used by MetaData
 
172
       .reflect(), omits "index overflow tables", a system
 
173
       table generated by Oracle when "index only tables"
 
174
       with overflow are used.  These tables aren't accessible
 
175
       via SQL and can't be reflected.  [ticket:1637]
 
176
 
 
177
- ext 
 
178
    - A column can be added to a joined-table declarative 
 
179
      superclass after the class has been constructed 
 
180
      (i.e. via class-level attribute assignment), and
 
181
      the column will be propagated down to 
 
182
      subclasses. [ticket:1570]  This is the reverse
 
183
      situation as that of [ticket:1523], fixed in 0.5.6.
 
184
 
 
185
    - Fixed a slight inaccuracy in the sharding example.
 
186
      Comparing equivalence of columns in the ORM is best 
 
187
      accomplished using col1.shares_lineage(col2).
 
188
      [ticket:1491]
 
189
 
 
190
    - Removed unused `load()` method from ShardedQuery.
 
191
      [ticket:1606]
 
192
 
 
193
0.5.6
 
194
=====
 
195
- orm
 
196
    - Fixed bug whereby inheritance discriminator part of a
 
197
      composite primary key would fail on updates.
 
198
      Continuation of [ticket:1300].
 
199
 
 
200
    - Fixed bug which disallowed one side of a many-to-many 
 
201
      bidirectional reference to declare itself as "viewonly"
 
202
      [ticket:1507]
 
203
 
 
204
    - Added an assertion that prevents a @validates function
 
205
      or other AttributeExtension from loading an unloaded
 
206
      collection such that internal state may be corrupted.
 
207
      [ticket:1526]
 
208
 
 
209
    - Fixed bug which prevented two entities from mutually
 
210
      replacing each other's primary key values within a single
 
211
      flush() for some orderings of operations.  [ticket:1519]
 
212
 
 
213
    - Fixed an obscure issue whereby a joined-table subclass
 
214
      with a self-referential eager load on the base class
 
215
      would populate the related object's "subclass" table with
 
216
      data from the "subclass" table of the parent.
 
217
      [ticket:1485]
 
218
 
 
219
    - relations() now have greater ability to be "overridden",
 
220
      meaning a subclass that explicitly specifies a relation()
 
221
      overriding that of the parent class will be honored
 
222
      during a flush.  This is currently to support 
 
223
      many-to-many relations from concrete inheritance setups.
 
224
      Outside of that use case, YMMV.  [ticket:1477]
 
225
 
 
226
    - Squeezed a few more unnecessary "lazy loads" out of 
 
227
      relation().  When a collection is mutated, many-to-one
 
228
      backrefs on the other side will not fire off to load
 
229
      the "old" value, unless "single_parent=True" is set.
 
230
      A direct assignment of a many-to-one still loads 
 
231
      the "old" value in order to update backref collections 
 
232
      on that value, which may be present in the session 
 
233
      already, thus maintaining the 0.5 behavioral contract.
 
234
      [ticket:1483]
 
235
 
 
236
    - Fixed bug whereby a load/refresh of joined table
 
237
      inheritance attributes which were based on 
 
238
      column_property() or similar would fail to evaluate.
 
239
      [ticket:1480]
 
240
 
 
241
    - Improved support for MapperProperty objects overriding
 
242
      that of an inherited mapper for non-concrete 
 
243
      inheritance setups - attribute extensions won't randomly
 
244
      collide with each other.  [ticket:1488]
 
245
 
 
246
    - UPDATE and DELETE do not support ORDER BY, LIMIT, OFFSET,
 
247
      etc. in standard SQL.  Query.update() and Query.delete()
 
248
      now raise an exception if any of limit(), offset(),
 
249
      order_by(), group_by(), or distinct() have been
 
250
      called. [ticket:1487]
 
251
 
 
252
    - Added AttributeExtension to sqlalchemy.orm.__all__
 
253
 
 
254
    - Improved error message when query() is called with
 
255
      a non-SQL /entity expression. [ticket:1476]
 
256
 
 
257
    - Using False or 0 as a polymorphic discriminator now
 
258
      works on the base class as well as a subclass.
 
259
      [ticket:1440]
 
260
 
 
261
    - Added enable_assertions(False) to Query which disables
 
262
      the usual assertions for expected state - used
 
263
      by Query subclasses to engineer custom state.
 
264
      [ticket:1424].  See
 
265
      http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery
 
266
      for an example.
 
267
 
 
268
    - Fixed recursion issue which occured if a mapped object's
 
269
      `__len__()` or `__nonzero__()` method resulted in state
 
270
      changes.  [ticket:1501]
 
271
 
 
272
    - Fixed incorrect exception raise in 
 
273
      Weak/StrongIdentityMap.add() 
 
274
      [ticket:1506]
 
275
 
 
276
    - Fixed the error message for "could not find a FROM clause"
 
277
      in query.join() which would fail to issue correctly
 
278
      if the query was against a pure SQL construct.
 
279
      [ticket:1522]
 
280
 
 
281
    - Fixed a somewhat hypothetical issue which would result
 
282
      in the wrong primary key being calculated for a mapper
 
283
      using the old polymorphic_union function - but this
 
284
      is old stuff.  [ticket:1486]
 
285
 
 
286
- sql
 
287
    - Fixed column.copy() to copy defaults and onupdates.
 
288
      [ticket:1373]
 
289
 
 
290
    - Fixed a bug in extract() introduced in 0.5.4 whereby
 
291
      the string "field" argument was getting treated as a 
 
292
      ClauseElement, causing various errors within more 
 
293
      complex SQL transformations.
 
294
 
 
295
    - Unary expressions such as DISTINCT propagate their 
 
296
      type handling to result sets, allowing conversions like
 
297
      unicode and such to take place.  [ticket:1420]
 
298
 
 
299
    - Fixed bug in Table and Column whereby passing empty
 
300
      dict for "info" argument would raise an exception.
 
301
      [ticket:1482]
 
302
 
 
303
- oracle
 
304
    - Backported 0.6 fix for Oracle alias names not getting
 
305
      truncated.  [ticket:1309]
 
306
 
 
307
- ext
 
308
   - The collection proxies produced by associationproxy are now
 
309
     pickleable.  A user-defined proxy_factory however
 
310
     is still not pickleable unless it defines __getstate__
 
311
     and __setstate__. [ticket:1446]
 
312
 
 
313
   - Declarative will raise an informative exception if 
 
314
     __table_args__ is passed as a tuple with no dict argument.
 
315
     Improved documentation.  [ticket:1468]
 
316
 
 
317
   - Table objects declared in the MetaData can now be used
 
318
     in string expressions sent to primaryjoin/secondaryjoin/
 
319
     secondary - the name is pulled from the MetaData of the
 
320
     declarative base.  [ticket:1527]
 
321
 
 
322
   - A column can be added to a joined-table subclass after
 
323
     the class has been constructed (i.e. via class-level
 
324
     attribute assignment).  The column is added to the underlying
 
325
     Table as always, but now the mapper will rebuild its
 
326
     "join" to include the new column, instead of raising
 
327
     an error about "no such column, use column_property()
 
328
     instead".  [ticket:1523]
 
329
 
 
330
- test
 
331
   - Added examples into the test suite so they get exercised
 
332
     regularly and cleaned up a couple deprecation warnings.
 
333
 
 
334
 
 
335
0.5.5
 
336
=======
 
337
- general
 
338
    - unit tests have been migrated from unittest to nose.  See
 
339
      README.unittests for information on how to run the tests.
 
340
      [ticket:970]
 
341
 
 
342
- orm
 
343
    - The "foreign_keys" argument of relation() will now propagate
 
344
      automatically to the backref in the same way that primaryjoin
 
345
      and secondaryjoin do.  For the extremely rare use case where
 
346
      the backref of a relation() has intentionally different
 
347
      "foreign_keys" configured, both sides now need to be
 
348
      configured explicity (if they do in fact require this setting,
 
349
      see the next note...).
 
350
 
 
351
    - ...the only known (and really, really rare) use case where a
 
352
      different foreign_keys setting was used on the
 
353
      forwards/backwards side, a composite foreign key that
 
354
      partially points to its own columns, has been enhanced such
 
355
      that the fk->itself aspect of the relation won't be used to
 
356
      determine relation direction.
 
357
 
 
358
    - Session.mapper is now *deprecated*.
 
359
 
 
360
      Call session.add() if you'd like a free-standing object to be
 
361
      part of your session.  Otherwise, a DIY version of
 
362
      Session.mapper is now documented at
 
363
      http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
 
364
      The method will remain deprecated throughout 0.6.
 
365
 
 
366
    - Fixed Query being able to join() from individual columns of a
 
367
      joined-table subclass entity, i.e.  query(SubClass.foo,
 
368
      SubcClass.bar).join(<anything>).  In most cases, an error
 
369
      "Could not find a FROM clause to join from" would be
 
370
      raised. In a few others, the result would be returned in terms
 
371
      of the base class rather than the subclass - so applications
 
372
      which relied on this erroneous result need to be
 
373
      adjusted. [ticket:1431]
 
374
 
 
375
    - Fixed a bug involving contains_eager(), which would apply
 
376
      itself to a secondary (i.e. lazy) load in a particular rare
 
377
      case, producing cartesian products.  improved the targeting of
 
378
      query.options() on secondary loads overall [ticket:1461].
 
379
 
 
380
    - Fixed bug introduced in 0.5.4 whereby Composite types fail
 
381
      when default-holding columns are flushed.
 
382
 
 
383
    - Fixed another 0.5.4 bug whereby mutable attributes
 
384
      (i.e. PickleType) wouldn't be deserialized correctly when the
 
385
      whole object was serialized.  [ticket:1426]
 
386
 
 
387
    - Fixed bug whereby session.is_modified() would raise an
 
388
      exception if any synonyms were in use.
 
389
 
 
390
    - Fixed potential memory leak whereby previously pickled objects
 
391
      placed back in a session would not be fully garbage collected
 
392
      unless the Session were explicitly closed out.
 
393
 
 
394
    - Fixed bug whereby list-based attributes, like pickletype and
 
395
      PGArray, failed to be merged() properly.
 
396
 
 
397
    - Repaired non-working attributes.set_committed_value function.
 
398
 
 
399
    - Trimmed the pickle format for InstanceState which should
 
400
      further reduce the memory footprint of pickled instances.  The
 
401
      format should be backwards compatible with that of 0.5.4 and
 
402
      previous.
 
403
 
 
404
    - sqlalchemy.orm.join and sqlalchemy.orm.outerjoin are now
 
405
      added to __all__ in sqlalchemy.orm.*. [ticket:1463]
 
406
 
 
407
    - Fixed bug where Query exception raise would fail when
 
408
      a too-short composite primary key value were passed to
 
409
      get().  [ticket:1458]
 
410
 
 
411
- sql
 
412
    - Removed an obscure feature of execute() (including connection,
 
413
      engine, Session) whereby a bindparam() construct can be sent
 
414
      as a key to the params dictionary.  This usage is undocumented
 
415
      and is at the core of an issue whereby the bindparam() object
 
416
      created implicitly by a text() construct may have the same
 
417
      hash value as a string placed in the params dictionary and may
 
418
      result in an inappropriate match when computing the final bind
 
419
      parameters.  Internal checks for this condition would add
 
420
      significant latency to the critical task of parameter
 
421
      rendering, so the behavior is removed.  This is a backwards
 
422
      incompatible change for any application that may have been
 
423
      using this feature, however the feature has never been
 
424
      documented.
 
425
 
 
426
- engine/pool
 
427
    - Implemented recreate() for StaticPool.
 
428
 
 
429
 
 
430
0.5.4p2
 
431
=======
 
432
 
 
433
- sql
 
434
    - Repaired the printing of SQL exceptions which are not 
 
435
      based on parameters or are not executemany() style.
 
436
 
 
437
- postgresql
 
438
    - Deprecated the hardcoded TIMESTAMP function, which when
 
439
      used as func.TIMESTAMP(value) would render "TIMESTAMP value".
 
440
      This breaks on some platforms as PostgreSQL doesn't allow
 
441
      bind parameters to be used in this context.  The hard-coded
 
442
      uppercase is also inappropriate and there's lots of other
 
443
      PG casts that we'd need to support.  So instead, use
 
444
      text constructs i.e. select(["timestamp '12/05/09'"]).
 
445
 
 
446
 
 
447
0.5.4p1
 
448
=======
 
449
 
 
450
- orm
 
451
    - Fixed an attribute error introduced in 0.5.4 which would 
 
452
      occur when merge() was used with an incomplete object.
 
453
 
 
454
0.5.4
 
455
=====
 
456
 
 
457
- orm
 
458
    - Significant performance enhancements regarding Sessions/flush()
 
459
      in conjunction with large mapper graphs, large numbers of 
 
460
      objects:
 
461
 
 
462
      - Removed all* O(N) scanning behavior from the flush() process,
 
463
        i.e. operations that were scanning the full session, 
 
464
        including an extremely expensive one that was erroneously
 
465
        assuming primary key values were changing when this 
 
466
        was not the case.
 
467
 
 
468
        * one edge case remains which may invoke a full scan,
 
469
          if an existing primary key attribute is modified
 
470
          to a new value.
 
471
 
 
472
      - The Session's "weak referencing" behavior is now *full* -
 
473
        no strong references whatsoever are made to a mapped object
 
474
        or related items/collections in its __dict__.  Backrefs and 
 
475
        other cycles in objects no longer affect the Session's ability 
 
476
        to lose all references to unmodified objects.  Objects with 
 
477
        pending changes still are maintained strongly until flush.
 
478
        [ticket:1398]
 
479
 
 
480
        The implementation also improves performance by moving
 
481
        the "resurrection" process of garbage collected items
 
482
        to only be relevant for mappings that map "mutable" 
 
483
        attributes (i.e. PickleType, composite attrs).  This removes
 
484
        overhead from the gc process and simplifies internal 
 
485
        behavior.
 
486
 
 
487
        If a "mutable" attribute change is the sole change on an object 
 
488
        which is then dereferenced, the mapper will not have access to 
 
489
        other attribute state when the UPDATE is issued.  This may present 
 
490
        itself differently to some MapperExtensions.
 
491
 
 
492
        The change also affects the internal attribute API, but not
 
493
        the AttributeExtension interface nor any of the publically
 
494
        documented attribute functions.
 
495
 
 
496
      - The unit of work no longer genererates a graph of "dependency"
 
497
        processors for the full graph of mappers during flush(), instead
 
498
        creating such processors only for those mappers which represent
 
499
        objects with pending changes.  This saves a tremendous number
 
500
        of method calls in the context of a large interconnected 
 
501
        graph of mappers.
 
502
 
 
503
      - Cached a wasteful "table sort" operation that previously
 
504
        occured multiple times per flush, also removing significant
 
505
        method call count from flush().
 
506
 
 
507
      - Other redundant behaviors have been simplified in 
 
508
        mapper._save_obj().
 
509
 
 
510
    - Modified query_cls on DynamicAttributeImpl to accept a full
 
511
      mixin version of the AppenderQuery, which allows subclassing
 
512
      the AppenderMixin.
 
513
 
 
514
    - The "polymorphic discriminator" column may be part of a 
 
515
      primary key, and it will be populated with the correct 
 
516
      discriminator value.  [ticket:1300]
 
517
 
 
518
    - Fixed the evaluator not being able to evaluate IS NULL clauses.
 
519
 
 
520
    - Fixed the "set collection" function on "dynamic" relations to
 
521
      initiate events correctly.  Previously a collection could only
 
522
      be assigned to a pending parent instance, otherwise modified
 
523
      events would not be fired correctly.  Set collection is now
 
524
      compatible with merge(), fixes [ticket:1352].
 
525
 
 
526
    - Allowed pickling of PropertyOption objects constructed with
 
527
      instrumented descriptors; previously, pickle errors would occur 
 
528
      when pickling an object which was loaded with a descriptor-based 
 
529
      option, such as query.options(eagerload(MyClass.foo)).
 
530
 
 
531
    - Lazy loader will not use get() if the "lazy load" SQL clause
 
532
      matches the clause used by get(), but contains some parameters
 
533
      hardcoded.  Previously the lazy strategy would fail with the
 
534
      get().  Ideally get() would be used with the hardcoded
 
535
      parameters but this would require further development.
 
536
      [ticket:1357]
 
537
 
 
538
    - MapperOptions and other state associated with query.options()
 
539
      is no longer bundled within callables associated with each 
 
540
      lazy/deferred-loading attribute during a load.
 
541
      The options are now associated with the instance's
 
542
      state object just once when it's populated.  This removes
 
543
      the need in most cases for per-instance/attribute loader 
 
544
      objects, improving load speed and memory overhead for
 
545
      individual instances. [ticket:1391]
 
546
 
 
547
    - Fixed another location where autoflush was interfering
 
548
      with session.merge().  autoflush is disabled completely
 
549
      for the duration of merge() now. [ticket:1360]
 
550
 
 
551
    - Fixed bug which prevented "mutable primary key" dependency
 
552
      logic from functioning properly on a one-to-one
 
553
      relation().  [ticket:1406]
 
554
 
 
555
    - Fixed bug in relation(), introduced in 0.5.3, 
 
556
      whereby a self referential relation
 
557
      from a base class to a joined-table subclass would 
 
558
      not configure correctly.
 
559
 
 
560
    - Fixed obscure mapper compilation issue when inheriting
 
561
      mappers are used which would result in un-initialized
 
562
      attributes.
 
563
 
 
564
    - Fixed documentation for session weak_identity_map - 
 
565
      the default value is True, indicating a weak
 
566
      referencing map in use.
 
567
 
 
568
    - Fixed a unit of work issue whereby the foreign
 
569
      key attribute on an item contained within a collection 
 
570
      owned by an object being deleted would not be set to
 
571
      None if the relation() was self-referential. [ticket:1376]
 
572
 
 
573
    - Fixed Query.update() and Query.delete() failures with eagerloaded
 
574
      relations. [ticket:1378]
 
575
 
 
576
    - It is now an error to specify both columns of a binary primaryjoin
 
577
      condition in the foreign_keys or remote_side collection.  Whereas
 
578
      previously it was just nonsensical, but would succeed in a 
 
579
      non-deterministic way.
 
580
 
 
581
- schema
 
582
    - Added a quote_schema() method to the IdentifierPreparer class
 
583
      so that dialects can override how schemas get handled. This
 
584
      enables the MSSQL dialect to treat schemas as multipart
 
585
      identifiers, such as 'database.owner'. [ticket: 594, 1341]
 
586
 
 
587
- sql
 
588
    - Back-ported the "compiler" extension from SQLA 0.6.  This
 
589
      is a standardized interface which allows the creation of custom
 
590
      ClauseElement subclasses and compilers.  In particular it's
 
591
      handy as an alternative to text() when you'd like to 
 
592
      build a construct that has database-specific compilations.
 
593
      See the extension docs for details.
 
594
 
 
595
    - Exception messages are truncated when the list of bound 
 
596
      parameters is larger than 10, preventing enormous
 
597
      multi-page exceptions from filling up screens and logfiles
 
598
      for large executemany() statements. [ticket:1413]
 
599
 
 
600
    - ``sqlalchemy.extract()`` is now dialect sensitive and can
 
601
      extract components of timestamps idiomatically across the
 
602
      supported databases, including SQLite.
 
603
 
 
604
    - Fixed __repr__() and other _get_colspec() methods on
 
605
      ForeignKey constructed from __clause_element__() style
 
606
      construct (i.e. declarative columns).  [ticket:1353]
 
607
 
 
608
- mysql
 
609
    - Reflecting a FOREIGN KEY construct will take into account
 
610
      a dotted schema.tablename combination, if the foreign key
 
611
      references a table in a remote schema. [ticket:1405]
 
612
 
 
613
- mssql
 
614
    - Modified how savepoint logic works to prevent it from
 
615
      stepping on non-savepoint oriented routines. Savepoint
 
616
      support is still very experimental.
 
617
 
 
618
    - Added in reserved words for MSSQL that covers version 2008
 
619
      and all prior versions. [ticket:1310]
 
620
 
 
621
    - Corrected problem with information schema not working with a
 
622
      binary collation based database. Cleaned up information schema
 
623
      since it is only used by mssql now. [ticket:1343]
 
624
 
 
625
- sqlite
 
626
    - Corrected the SLBoolean type so that it properly treats only 1
 
627
      as True. [ticket:1402]
 
628
 
 
629
    - Corrected the float type so that it correctly maps to a
 
630
      SLFloat type when being reflected. [ticket:1273]
 
631
 
 
632
- extensions
 
633
 
 
634
    - Fixed adding of deferred or other column properties to a
 
635
      declarative class. [ticket:1379]
 
636
 
 
637
0.5.3
 
638
=====
 
639
- orm
 
640
    - The "objects" argument to session.flush() is deprecated.
 
641
      State which represents the linkage between a parent and
 
642
      child object does not support "flushed" status on
 
643
      one side of the link and not the other, so supporting
 
644
      this operation leads to misleading results.
 
645
      [ticket:1315]
 
646
 
 
647
    - Query now implements __clause_element__() which produces
 
648
      its selectable, which means a Query instance can be accepted 
 
649
      in many SQL expressions, including col.in_(query), 
 
650
      union(query1, query2), select([foo]).select_from(query), 
 
651
      etc.
 
652
 
 
653
    - Query.join() can now construct multiple FROM clauses, if 
 
654
      needed.  Such as, query(A, B).join(A.x).join(B.y)
 
655
      might say SELECT A.*, B.* FROM A JOIN X, B JOIN Y.
 
656
      Eager loading can also tack its joins onto those 
 
657
      multiple FROM clauses.  [ticket:1337]
 
658
 
 
659
    - Fixed bug in dynamic_loader() where append/remove events
 
660
      after construction time were not being propagated to the 
 
661
      UOW to pick up on flush(). [ticket:1347]
 
662
 
 
663
    - Fixed bug where column_prefix wasn't being checked before
 
664
      not mapping an attribute that already had class-level 
 
665
      name present.
 
666
 
 
667
    - a session.expire() on a particular collection attribute
 
668
      will clear any pending backref additions as well, so that
 
669
      the next access correctly returns only what was present
 
670
      in the database.  Presents some degree of a workaround for 
 
671
      [ticket:1315], although we are considering removing the 
 
672
      flush([objects]) feature altogether.
 
673
 
 
674
    - Session.scalar() now converts raw SQL strings to text()
 
675
      the same way Session.execute() does and accepts same 
 
676
      alternative **kw args.
 
677
 
 
678
    - improvements to the "determine direction" logic of 
 
679
      relation() such that the direction of tricky situations 
 
680
      like mapper(A.join(B)) -> relation-> mapper(B) can be
 
681
      determined.
 
682
 
 
683
    - When flushing partial sets of objects using session.flush([somelist]),
 
684
      pending objects which remain pending after the operation won't
 
685
      inadvertently be added as persistent. [ticket:1306]
 
686
 
 
687
    - Added "post_configure_attribute" method to InstrumentationManager,
 
688
      so that the "listen_for_events.py" example works again.
 
689
      [ticket:1314]
 
690
 
 
691
    - a forward and complementing backwards reference which are both
 
692
      of the same direction, i.e. ONETOMANY or MANYTOONE, 
 
693
      is now detected, and an error message is raised.
 
694
      Saves crazy CircularDependencyErrors later on.
 
695
 
 
696
    - Fixed bugs in Query regarding simultaneous selection of 
 
697
      multiple joined-table inheritance entities with common base 
 
698
      classes:
 
699
 
 
700
      - previously the adaption applied to "B" on 
 
701
        "A JOIN B" would be erroneously partially applied 
 
702
        to "A".
 
703
 
 
704
      - comparisons on relations (i.e. A.related==someb)
 
705
        were not getting adapted when they should.
 
706
 
 
707
      - Other filterings, like 
 
708
        query(A).join(A.bs).filter(B.foo=='bar'), were erroneously
 
709
        adapting "B.foo" as though it were an "A".
 
710
 
 
711
     - Fixed adaptation of EXISTS clauses via any(), has(), etc.
 
712
       in conjunction with an aliased object on the left and 
 
713
       of_type() on the right.  [ticket:1325]
 
714
 
 
715
     - Added an attribute helper method ``set_committed_value`` in 
 
716
       sqlalchemy.orm.attributes.  Given an object, attribute name,
 
717
       and value, will set the value on the object as part of its
 
718
       "committed" state, i.e. state that is understood to have 
 
719
       been loaded from the database.   Helps with the creation of 
 
720
       homegrown collection loaders and such.
 
721
 
 
722
     - Query won't fail with weakref error when a non-mapper/class
 
723
       instrumented descriptor is passed, raises 
 
724
       "Invalid column expession".
 
725
 
 
726
     - Query.group_by() properly takes into account aliasing applied
 
727
       to the FROM clause, such as with select_from(), using
 
728
       with_polymorphic(), or using from_self().
 
729
 
 
730
- sql
 
731
    - An alias() of a select() will convert to a "scalar subquery"
 
732
      when used in an unambiguously scalar context, i.e. it's used 
 
733
      in a comparison operation.  This applies to
 
734
      the ORM when using query.subquery() as well.
 
735
 
 
736
    - Fixed missing _label attribute on Function object, others
 
737
      when used in a select() with use_labels (such as when used
 
738
      in an ORM column_property()).  [ticket:1302]
 
739
 
 
740
    - anonymous alias names now truncate down to the max length
 
741
      allowed by the dialect.  More significant on DBs like
 
742
      Oracle with very small character limits. [ticket:1309]
 
743
 
 
744
    - the __selectable__() interface has been replaced entirely
 
745
      by __clause_element__().
 
746
 
 
747
    - The per-dialect cache used by TypeEngine to cache
 
748
      dialect-specific types is now a WeakKeyDictionary.
 
749
      This to prevent dialect objects from 
 
750
      being referenced forever for an application that 
 
751
      creates an arbitrarily large number of engines
 
752
      or dialects.   There is a small performance penalty
 
753
      which will be resolved in 0.6.  [ticket:1299]
 
754
 
 
755
- sqlite
 
756
    - Fixed SQLite reflection methods so that non-present
 
757
      cursor.description, which triggers an auto-cursor
 
758
      close, will be detected so that no results doesn't
 
759
      fail on recent versions of pysqlite which raise 
 
760
      an error when fetchone() called with no rows present.
 
761
 
 
762
- postgresql
 
763
    - Index reflection won't fail when an index with 
 
764
      multiple expressions is encountered.
 
765
 
 
766
    - Added PGUuid and PGBit types to 
 
767
      sqlalchemy.databases.postgres. [ticket:1327]
 
768
 
 
769
    - Refection of unknown PG types won't crash when those
 
770
      types are specified within a domain.  [ticket:1327]
 
771
 
 
772
- mssql
 
773
    - Preliminary support for pymssql 1.0.1
 
774
 
 
775
    - Corrected issue on mssql where max_identifier_length was
 
776
      not being respected.
 
777
 
 
778
- extensions
 
779
 
 
780
    - Fixed a recursive pickling issue in serializer, triggered
 
781
      by an EXISTS or other embedded FROM construct.
 
782
 
 
783
    - Declarative locates the "inherits" class using a search
 
784
      through __bases__, to skip over mixins that are local
 
785
      to subclasses.
 
786
 
 
787
    - Declarative figures out joined-table inheritance primary join
 
788
      condition even if "inherits" mapper argument is given 
 
789
      explicitly. 
 
790
 
 
791
    - Declarative will properly interpret the "foreign_keys" argument
 
792
      on a backref() if it's a string.
 
793
 
 
794
    - Declarative will accept a table-bound column as a property
 
795
      when used in conjunction with __table__, if the column is already
 
796
      present in __table__.  The column will be remapped to the given 
 
797
      key the same way as when added to the mapper() properties dict.
 
798
 
 
799
0.5.2
 
800
======
 
801
 
 
802
- orm
 
803
    - Further refined 0.5.1's warning about delete-orphan cascade
 
804
      placed on a many-to-many relation.   First, the bad news:
 
805
      the warning will apply to both many-to-many as well as
 
806
      many-to-one relations.  This is necessary since in both 
 
807
      cases, SQLA does not scan the full set of potential parents
 
808
      when determining "orphan" status - for a persistent object
 
809
      it only detects an in-python de-association event to establish
 
810
      the object as an "orphan".  Next, the good news: to support 
 
811
      one-to-one via a foreign key or assocation table, or to 
 
812
      support one-to-many via an association table, a new flag 
 
813
      single_parent=True may be set which indicates objects 
 
814
      linked to the relation are only meant to have a single parent.
 
815
      The relation will raise an error if multiple parent-association
 
816
      events occur within Python.
 
817
 
 
818
    - Adjusted the attribute instrumentation change from 0.5.1 to 
 
819
      fully establish instrumentation for subclasses where the mapper
 
820
      was created after the superclass had already been fully
 
821
      instrumented. [ticket:1292]
 
822
 
 
823
    - Fixed bug in delete-orphan cascade whereby two one-to-one
 
824
      relations from two different parent classes to the same target 
 
825
      class would prematurely expunge the instance.
 
826
 
 
827
    - Fixed an eager loading bug whereby self-referential eager 
 
828
      loading would prevent other eager loads, self referential or not,
 
829
      from joining to the parent JOIN properly.  Thanks to Alex K
 
830
      for creating a great test case.
 
831
 
 
832
    - session.expire() and related methods will not expire() unloaded
 
833
      deferred attributes.  This prevents them from being needlessly
 
834
      loaded when the instance is refreshed.
 
835
 
 
836
    - query.join()/outerjoin() will now properly join an aliased()
 
837
      construct to the existing left side, even if query.from_self()
 
838
      or query.select_from(someselectable) has been called.
 
839
      [ticket:1293]
 
840
 
 
841
- sql
 
842
    - Further fixes to the "percent signs and spaces in column/table
 
843
       names" functionality. [ticket:1284]
 
844
 
 
845
- mssql
 
846
    - Restored convert_unicode handling. Results were being passed
 
847
      on through without conversion. [ticket:1291]
 
848
 
 
849
    - Really fixing the decimal handling this time. [ticket:1282].
 
850
 
 
851
    - Modified table reflection code to use only kwargs when 
 
852
      constructing tables. [Ticket:1289]
 
853
 
 
854
0.5.1
 
855
========
 
856
 
 
857
- orm
 
858
    - Removed an internal join cache which could potentially leak 
 
859
      memory when issuing query.join() repeatedly to ad-hoc 
 
860
      selectables.
 
861
 
 
862
    - The "clear()", "save()", "update()", "save_or_update()"
 
863
      Session methods have been deprecated, replaced by 
 
864
      "expunge_all()" and "add()".  "expunge_all()" has also
 
865
      been added to ScopedSession.
 
866
 
 
867
    - Modernized the "no mapped table" exception and added a more
 
868
      explicit __table__/__tablename__ exception to declarative.
 
869
 
 
870
    - Concrete inheriting mappers now instrument attributes which
 
871
      are inherited from the superclass, but are not defined for
 
872
      the concrete mapper itself, with an InstrumentedAttribute that
 
873
      issues a descriptive error when accessed. [ticket:1237]
 
874
 
 
875
    - Added a new `relation()` keyword `back_populates`. This
 
876
      allows configuation of backreferences using explicit
 
877
      relations. [ticket:781] This is required when creating
 
878
      bidirectional relations between a hierarchy of concrete
 
879
      mappers and another class. [ticket:1237]
 
880
 
 
881
    - Test coverage added for `relation()` objects specified on
 
882
      concrete mappers. [ticket:1237]
 
883
 
 
884
    - Query.from_self() as well as query.subquery() both disable 
 
885
      the rendering of eager joins inside the subquery produced.
 
886
      The "disable all eager joins" feature is available publically
 
887
      via a new query.enable_eagerloads() generative. [ticket:1276]
 
888
 
 
889
    - Added a rudimental series of set operations to Query that
 
890
      receive Query objects as arguments, including union(),
 
891
      union_all(), intersect(), except_(), insertsect_all(),
 
892
      except_all().  See the API documentation for
 
893
      Query.union() for examples. 
 
894
 
 
895
    - Fixed bug that prevented Query.join() and eagerloads from 
 
896
      attaching to a query that selected from a union or aliased union.
 
897
 
 
898
    - A short documentation example added for bidirectional
 
899
      relations specified on concrete mappers. [ticket:1237]
 
900
 
 
901
    - Mappers now instrument class attributes upon construction
 
902
      with the final InstrumentedAttribute object which remains
 
903
      persistent. The `_CompileOnAttr`/`__getattribute__()`
 
904
      methodology has been removed. The net effect is that
 
905
      Column-based mapped class attributes can now be used fully
 
906
      at the class level without invoking a mapper compilation
 
907
      operation, greatly simplifying typical usage patterns
 
908
      within declarative. [ticket:1269]
 
909
 
 
910
    - ColumnProperty (and front-end helpers such as ``deferred``) no
 
911
      longer ignores unknown **keyword arguments.
 
912
 
 
913
    - Fixed a bug with the unitofwork's "row switch" mechanism,
 
914
      i.e. the conversion of INSERT/DELETE into an UPDATE, when
 
915
      combined with joined-table inheritance and an object
 
916
      which contained no defined values for the child table where
 
917
      an UPDATE with no SET clause would be rendered.
 
918
 
 
919
    - Using delete-orphan on a many-to-many relation is deprecated.
 
920
      This produces misleading or erroneous results since SQLA does 
 
921
      not retrieve the full list of "parents" for m2m.  To get delete-orphan
 
922
      behavior with an m2m table, use an explcit association class
 
923
      so that the individual association row is treated as a parent.
 
924
      [ticket:1281]
 
925
 
 
926
    - delete-orphan cascade always requires delete cascade.  Specifying
 
927
      delete-orphan without delete now raises a deprecation warning.
 
928
      [ticket:1281]
 
929
 
 
930
- sql
 
931
    - Improved the methodology to handling percent signs in column
 
932
      names from [ticket:1256].  Added more tests.  MySQL and
 
933
      PostgreSQL dialects still do not issue correct CREATE TABLE
 
934
      statements for identifiers with percent signs in them.
 
935
 
 
936
- schema
 
937
    - Index now accepts column-oriented InstrumentedAttributes
 
938
      (i.e. column-based mapped class attributes) as column
 
939
      arguments. [ticket:1214]
 
940
 
 
941
    - Column with no name (as in declarative) won't raise a 
 
942
      NoneType error when it's string output is requsted
 
943
      (such as in a stack trace).
 
944
 
 
945
    - Fixed bug when overriding a Column with a ForeignKey
 
946
      on a reflected table, where derived columns (i.e. the 
 
947
      "virtual" columns of a select, etc.) would inadvertently
 
948
      call upon schema-level cleanup logic intended only
 
949
      for the original column. [ticket:1278]
 
950
 
 
951
- declarative
 
952
    - Can now specify Column objects on subclasses which have no
 
953
      table of their own (i.e. use single table inheritance).
 
954
      The columns will be appended to the base table, but only
 
955
      mapped by the subclass.
 
956
 
 
957
    - For both joined and single inheriting subclasses, the subclass
 
958
      will only map those columns which are already mapped on the 
 
959
      superclass and those explicit on the subclass.  Other 
 
960
      columns that are present on the `Table` will be excluded
 
961
      from the mapping by default, which can be disabled
 
962
      by passing a blank `exclude_properties` collection to the
 
963
      `__mapper_args__`.  This is so that single-inheriting
 
964
      classes which define their own columns are the only classes
 
965
      to map those columns.   The effect is actually a more organized
 
966
      mapping than you'd normally get with explicit `mapper()`
 
967
      calls unless you set up the `exclude_properties` arguments
 
968
      explicitly.
 
969
 
 
970
    - It's an error to add new Column objects to a declarative class
 
971
      that specified an existing table using __table__.
 
972
 
 
973
- mysql
 
974
    - Added the missing keywords from MySQL 4.1 so they get escaped
 
975
      properly.
 
976
 
 
977
- mssql
 
978
    - Corrected handling of large decimal values with more robust
 
979
      tests. Removed string manipulation on floats. [ticket:1280]
 
980
 
 
981
    - Modified the do_begin handling in mssql to use the Cursor not
 
982
      the Connection so it is DBAPI compatible.
 
983
 
 
984
    - Corrected SAVEPOINT support on adodbapi by changing the
 
985
      handling of savepoint_release, which is unsupported on mssql.
 
986
 
 
987
0.5.0
 
988
========
 
989
 
 
990
- new features
 
991
- general
 
992
    - Documentation has been converted to Sphinx.  In particular,
 
993
      the generated API documentation has been constructed into a
 
994
      full blown "API Reference" section which organizes editorial
 
995
      documentation combined with generated docstrings.  Cross
 
996
      linking between sections and API docs are vastly improved, a
 
997
      javascript-powered search feature is provided, and a full
 
998
      index of all classes, functions and members is provided.
 
999
 
 
1000
    - setup.py now imports setuptools only optionally.  If not
 
1001
      present, distutils is used.  The new "pip" installer is
 
1002
      recommended over easy_install as it installs in a more
 
1003
      simplified way.
 
1004
 
 
1005
    - added an extremely basic illustration of a PostGIS integration
 
1006
      to the examples folder.
 
1007
 
 
1008
- orm
 
1009
    - Query.with_polymorphic() now accepts a third argument
 
1010
      "discriminator" which will replace the value of
 
1011
      mapper.polymorphic_on for that query.  Mappers themselves no
 
1012
      longer require polymorphic_on to be set, even if the mapper
 
1013
      has a polymorphic_identity.  When not set, the mapper will
 
1014
      load non-polymorphically by default. Together, these two
 
1015
      features allow a non-polymorphic concrete inheritance setup to
 
1016
      use polymorphic loading on a per-query basis, since concrete
 
1017
      setups are prone to many issues when used polymorphically in
 
1018
      all cases.
 
1019
 
 
1020
    - dynamic_loader accepts a query_class= to customize the Query
 
1021
      classes used for both the dynamic collection and the queries
 
1022
      built from it.
 
1023
 
 
1024
    - query.order_by() accepts None which will remove any pending
 
1025
      order_by state from the query, as well as cancel out any
 
1026
      mapper/relation configured ordering. This is primarily useful
 
1027
      for overriding the ordering specified on a dynamic_loader().
 
1028
      [ticket:1079]
 
1029
 
 
1030
- sql
 
1031
    - RowProxy objects can be used in place of dictionary arguments
 
1032
      sent to connection.execute() and friends.  [ticket:935]
 
1033
 
 
1034
- dialect
 
1035
    - Added a new description_encoding attribute on the dialect that
 
1036
      is used for encoding the column name when processing the
 
1037
      metadata. This usually defaults to utf-8.
 
1038
 
 
1039
- mssql
 
1040
    - Added in a new MSGenericBinary type. This maps to the Binary
 
1041
      type so it can implement the specialized behavior of treating
 
1042
      length specified types as fixed-width Binary types and
 
1043
      non-length types as an unbound variable length Binary type.
 
1044
 
 
1045
    - Added in new types: MSVarBinary and MSImage. [ticket:1249]
 
1046
 
 
1047
    - Added in the MSReal, MSNText, MSSmallDateTime, MSTime,
 
1048
      MSDateTimeOffset, and MSDateTime2 types
 
1049
 
 
1050
- sqlite
 
1051
    - Table reflection now stores the actual DefaultClause value for
 
1052
      the column. [ticket:1266]
 
1053
 
 
1054
- bugfixes, behavioral changes
 
1055
- general
 
1056
- orm
 
1057
    - Exceptions raised during compile_mappers() are now preserved
 
1058
      to provide "sticky behavior" - if a hasattr() call on a
 
1059
      pre-compiled mapped attribute triggers a failing compile and
 
1060
      suppresses the exception, subsequent compilation is blocked
 
1061
      and the exception will be reiterated on the next compile()
 
1062
      call.  This issue occurs frequently when using declarative.
 
1063
 
 
1064
    - property.of_type() is now recognized on a single-table
 
1065
      inheriting target, when used in the context of
 
1066
      prop.of_type(..).any()/has(), as well as
 
1067
      query.join(prop.of_type(...)).
 
1068
 
 
1069
    - query.join() raises an error when the target of the join
 
1070
      doesn't match the property-based attribute - while it's
 
1071
      unlikely anyone is doing this, the SQLAlchemy author was
 
1072
      guilty of this particular loosey-goosey behavior.
 
1073
 
 
1074
    - Fixed bug when using weak_instance_map=False where modified
 
1075
      events would not be intercepted for a flush(). [ticket:1272]
 
1076
 
 
1077
    - Fixed some deep "column correspondence" issues which could
 
1078
      impact a Query made against a selectable containing multiple
 
1079
      versions of the same table, as well as unions and similar
 
1080
      which contained the same table columns in different column
 
1081
      positions at different levels.  [ticket:1268]
 
1082
 
 
1083
    - Custom comparator classes used in conjunction with
 
1084
      column_property(), relation() etc. can define new comparison
 
1085
      methods on the Comparator, which will become available via
 
1086
      __getattr__() on the InstrumentedAttribute.  In the case of
 
1087
      synonym() or comparable_property(), attributes are resolved
 
1088
      first on the user-defined descriptor, then on the user-defined
 
1089
      comparator.
 
1090
 
 
1091
    - Added ScopedSession.is_active accessor. [ticket:976]
 
1092
 
 
1093
    - Can pass mapped attributes and column objects as keys to
 
1094
      query.update({}).  [ticket:1262]
 
1095
 
 
1096
    - Mapped attributes passed to the values() of an expression
 
1097
      level insert() or update() will use the keys of the mapped
 
1098
      columns, not that of the mapped attribute.
 
1099
 
 
1100
    - Corrected problem with Query.delete() and Query.update() not
 
1101
      working properly with bind parameters. [ticket:1242]
 
1102
 
 
1103
    - Query.select_from(), from_statement() ensure that the given
 
1104
      argument is a FromClause, or Text/Select/Union, respectively.
 
1105
 
 
1106
    - Query() can be passed a "composite" attribute as a column
 
1107
      expression and it will be expanded.  Somewhat related to
 
1108
      [ticket:1253].
 
1109
 
 
1110
    - Query() is a little more robust when passed various column
 
1111
      expressions such as strings, clauselists, text() constructs
 
1112
      (which may mean it just raises an error more nicely).
 
1113
 
 
1114
    - first() works as expected with Query.from_statement().
 
1115
 
 
1116
    - Fixed bug introduced in 0.5rc4 involving eager loading not
 
1117
      functioning for properties which were added to a mapper
 
1118
      post-compile using add_property() or equivalent.
 
1119
 
 
1120
    - Fixed bug where many-to-many relation() with viewonly=True
 
1121
      would not correctly reference the link between
 
1122
      secondary->remote.
 
1123
 
 
1124
    - Duplicate items in a list-based collection will be maintained
 
1125
      when issuing INSERTs to a "secondary" table in a many-to-many
 
1126
      relation.  Assuming the m2m table has a unique or primary key
 
1127
      constraint on it, this will raise the expected constraint
 
1128
      violation instead of silently dropping the duplicate
 
1129
      entries. Note that the old behavior remains for a one-to-many
 
1130
      relation since collection entries in that case don't result in
 
1131
      INSERT statements and SQLA doesn't manually police
 
1132
      collections. [ticket:1232]
 
1133
 
 
1134
    - Query.add_column() can accept FromClause objects in the same
 
1135
      manner as session.query() can.
 
1136
 
 
1137
    - Comparison of many-to-one relation to NULL is properly
 
1138
      converted to IS NOT NULL based on not_().
 
1139
 
 
1140
    - Extra checks added to ensure explicit
 
1141
      primaryjoin/secondaryjoin are ClauseElement instances, to
 
1142
      prevent more confusing errors later on. [ticket:1087]
 
1143
 
 
1144
    - Improved mapper() check for non-class classes.  [ticket:1236]
 
1145
 
 
1146
    - comparator_factory argument is now documented and supported by
 
1147
      all MapperProperty types, including column_property(),
 
1148
      relation(), backref(), and synonym() [ticket:5051].
 
1149
 
 
1150
    - Changed the name of PropertyLoader to RelationProperty, to be
 
1151
      consistent with all the other names.  PropertyLoader is still
 
1152
      present as a synonym.
 
1153
 
 
1154
    - fixed "double iter()" call causing bus errors in shard API,
 
1155
      removed errant result.close() left over from the 0.4
 
1156
      version. [ticket:1099] [ticket:1228]
 
1157
 
 
1158
    - made Session.merge cascades not trigger autoflush.  Fixes
 
1159
      merged instances getting prematurely inserted with missing
 
1160
      values.
 
1161
 
 
1162
    - Two fixes to help prevent out-of-band columns from being
 
1163
      rendered in polymorphic_union inheritance scenarios (which
 
1164
      then causes extra tables to be rendered in the FROM clause
 
1165
      causing cartesian products):
 
1166
 
 
1167
        - improvements to "column adaption" for a->b->c inheritance
 
1168
          situations to better locate columns that are related to
 
1169
          one another via multiple levels of indirection, rather
 
1170
          than rendering the non-adapted column.
 
1171
 
 
1172
        - the "polymorphic discriminator" column is only rendered
 
1173
          for the actual mapper being queried against. The column
 
1174
          won't be "pulled in" from a subclass or superclass mapper
 
1175
          since it's not needed.
 
1176
 
 
1177
    - Fixed shard_id argument on ShardedSession.execute().
 
1178
      [ticket:1072]
 
1179
 
 
1180
- sql
 
1181
    - Columns can again contain percent signs within their
 
1182
      names. [ticket:1256]
 
1183
 
 
1184
    - sqlalchemy.sql.expression.Function is now a public class.  It
 
1185
      can be subclassed to provide user-defined SQL functions in an
 
1186
      imperative style, including with pre-established behaviors.
 
1187
      The postgis.py example illustrates one usage of this.
 
1188
 
 
1189
    - PickleType now favors == comparison by default, if the
 
1190
      incoming object (such as a dict) implements __eq__().  If the
 
1191
      object does not implement __eq__() and mutable=True, a
 
1192
      deprecation warning is raised.
 
1193
 
 
1194
    - Fixed the import weirdness in sqlalchemy.sql to not export
 
1195
      __names__ [ticket:1215].
 
1196
 
 
1197
    - Using the same ForeignKey object repeatedly raises an error
 
1198
      instead of silently failing later. [ticket:1238]
 
1199
 
 
1200
    - Added NotImplementedError for params() method on
 
1201
      Insert/Update/Delete constructs.  These items currently don't
 
1202
      support this functionality, which also would be a little
 
1203
      misleading compared to values().
 
1204
 
 
1205
    - Reflected foreign keys will properly locate their referenced
 
1206
      column, even if the column was given a "key" attribute
 
1207
      different from the reflected name.  This is achieved via a new
 
1208
      flag on ForeignKey/ForeignKeyConstraint called "link_to_name",
 
1209
      if True means the given name is the referred-to column's name,
 
1210
      not its assigned key.  [ticket:650]
 
1211
 
 
1212
    - select() can accept a ClauseList as a column in the same way
 
1213
      as a Table or other selectable and the interior expressions
 
1214
      will be used as column elements. [ticket:1253]
 
1215
 
 
1216
    - the "passive" flag on session.is_modified() is correctly
 
1217
      propagated to the attribute manager.
 
1218
 
 
1219
    - union() and union_all() will not whack any order_by() that has
 
1220
      been applied to the select()s inside.  If you union() a
 
1221
      select() with order_by() (presumably to support LIMIT/OFFSET),
 
1222
      you should also call self_group() on it to apply parenthesis.
 
1223
 
 
1224
- engine/pool
 
1225
 
 
1226
    - Connection.invalidate() checks for closed status to avoid
 
1227
      attribute errors. [ticket:1246]
 
1228
 
 
1229
    - NullPool supports reconnect on failure behavior.
 
1230
      [ticket:1094]
 
1231
 
 
1232
    - Added a mutex for the initial pool creation when using
 
1233
      pool.manage(dbapi).  This prevents a minor case of "dogpile"
 
1234
      behavior which would otherwise occur upon a heavy load
 
1235
      startup.  [ticket:799]
 
1236
 
 
1237
    - _execute_clauseelement() goes back to being a private method.
 
1238
      Subclassing Connection is not needed now that ConnectionProxy
 
1239
      is available.
 
1240
 
 
1241
- documentation
 
1242
    - Tickets [ticket:1200] [ticket:1149].
 
1243
 
 
1244
    - Added note about create_session() defaults.
 
1245
 
 
1246
    - Added section about metadata.reflect().
 
1247
 
 
1248
    - Updated `TypeDecorator` section.
 
1249
 
 
1250
    - Rewrote the "threadlocal" strategy section of the docs due to
 
1251
      recent confusion over this feature.
 
1252
 
 
1253
    - Removed badly out of date 'polymorphic_fetch' and
 
1254
      'select_table' docs from inheritance, reworked the second half
 
1255
      of "joined table inheritance".
 
1256
 
 
1257
    - Documented `comparator_factory` kwarg, added new doc section
 
1258
      "Custom Comparators".
 
1259
 
 
1260
- mssql
 
1261
    - Refactored the Date/Time types. The ``smalldatetime`` data
 
1262
      type no longer truncates to a date only, and will now be
 
1263
      mapped to the MSSmallDateTime type. [ticket:1254]
 
1264
 
 
1265
    - Corrected an issue with Numerics to accept an int.
 
1266
 
 
1267
    - Mapped ``char_length`` to the ``LEN()`` function.
 
1268
 
 
1269
    - If an ``INSERT`` includes a subselect the ``INSERT`` is
 
1270
      converted from an ``INSERT INTO VALUES`` construct to a
 
1271
      ``INSERT INTO SELECT`` construct.
 
1272
 
 
1273
    - If the column is part of a ``primary_key`` it will be ``NOT
 
1274
      NULL`` since MSSQL doesn't allow ``NULL`` in primary_key
 
1275
      columns.
 
1276
 
 
1277
    - ``MSBinary`` now returns a ``BINARY`` instead of an
 
1278
      ``IMAGE``. This is a backwards incompatible change in that
 
1279
      ``BINARY`` is a fixed length data type whereas ``IMAGE`` is a
 
1280
      variable length data type. [ticket:1249]
 
1281
 
 
1282
    - ``get_default_schema_name`` is now reflected from the database
 
1283
      based on the user's default schema. This only works with MSSQL
 
1284
      2005 and later. [ticket:1258]
 
1285
 
 
1286
    - Added collation support through the use of a new collation
 
1287
      argument. This is supported on the following types: char,
 
1288
      nchar, varchar, nvarchar, text, ntext. [ticket:1248]
 
1289
 
 
1290
    - Changes to the connection string parameters favor DSN as the
 
1291
      default specification for pyodbc. See the mssql.py docstring
 
1292
      for detailed usage instructions.
 
1293
 
 
1294
    - Added experimental support of savepoints. It currently does
 
1295
      not work fully with sessions.
 
1296
 
 
1297
    - Support for three levels of column nullability: NULL, NOT
 
1298
      NULL, and the database's configured default.  The default
 
1299
      Column configuration (nullable=True) will now generate NULL in
 
1300
      the DDL. Previously no specification was emitted and the
 
1301
      database default would take effect (usually NULL, but not
 
1302
      always).  To explicitly request the database default,
 
1303
      configure columns with nullable=None and no specification will
 
1304
      be emitted in DDL. This is backwards incompatible
 
1305
      behavior. [ticket:1243]
 
1306
 
 
1307
- postgres
 
1308
    - "%" signs in text() constructs are automatically escaped to
 
1309
      "%%".  Because of the backwards incompatible nature of this
 
1310
      change, a warning is emitted if '%%' is detected in the
 
1311
      string.  [ticket:1267]
 
1312
 
 
1313
    - Calling alias.execute() in conjunction with
 
1314
      server_side_cursors won't raise AttributeError.
 
1315
 
 
1316
    - Added Index reflection support to PostgreSQL, using a great
 
1317
      patch we long neglected, submitted by Ken
 
1318
      Kuhlman. [ticket:714]
 
1319
 
 
1320
- oracle
 
1321
    - Adjusted the format of create_xid() to repair two-phase
 
1322
      commit.  We now have field reports of Oracle two-phase commit
 
1323
      working properly with this change.
 
1324
 
 
1325
    - Added OracleNVarchar type, produces NVARCHAR2, and also
 
1326
      subclasses Unicode so that convert_unicode=True by default.
 
1327
      NVARCHAR2 reflects into this type automatically so these
 
1328
      columns pass unicode on a reflected table with no explicit
 
1329
      convert_unicode=True flags.  [ticket:1233]
 
1330
 
 
1331
    - Fixed bug which was preventing out params of certain types
 
1332
      from being received; thanks a ton to huddlej at wwu.edu !
 
1333
      [ticket:1265]
 
1334
 
 
1335
- mysql
 
1336
    - "%" signs in text() constructs are automatically escaped to
 
1337
      "%%".  Because of the backwards incompatible nature of this
 
1338
      change, a warning is emitted if '%%' is detected in the
 
1339
      string.
 
1340
 
 
1341
    - Fixed bug in exception raise when FK columns not present
 
1342
      during reflection. [ticket:1241]
 
1343
 
 
1344
    - Fixed bug involving reflection of a remote-schema table with a
 
1345
      foreign key ref to another table in that schema.
 
1346
 
 
1347
- associationproxy
 
1348
    - The association proxy properties are make themselves available
 
1349
      at the class level, e.g. MyClass.aproxy.  Previously this
 
1350
      evaluated to None.
 
1351
 
 
1352
- declarative
 
1353
    - The full list of arguments accepted as string by backref()
 
1354
      includes 'primaryjoin', 'secondaryjoin', 'secondary',
 
1355
      'foreign_keys', 'remote_side', 'order_by'.
 
1356
 
 
1357
0.5.0rc4
 
1358
========
 
1359
- features
 
1360
- orm
 
1361
    - Query.count() has been enhanced to do the "right thing" in a
 
1362
      wider variety of cases. It can now count multiple-entity
 
1363
      queries, as well as column-based queries. Note that this means
 
1364
      if you say query(A, B).count() without any joining criterion,
 
1365
      it's going to count the cartesian product of A*B. Any query
 
1366
      which is against column-based entities will automatically
 
1367
      issue "SELECT count(1) FROM (SELECT...)" so that the real
 
1368
      rowcount is returned, meaning a query such as
 
1369
      query(func.count(A.name)).count() will return a value of one,
 
1370
      since that query would return one row.
 
1371
 
 
1372
    - Lots of performance tuning.  A rough guesstimate over various
 
1373
      ORM operations places it 10% faster over 0.5.0rc3, 25-30% over
 
1374
      0.4.8.
 
1375
 
 
1376
- bugfixes and behavioral changes
 
1377
- general:
 
1378
    - global "propigate"->"propagate" change.
 
1379
 
 
1380
- orm
 
1381
    - Adjustments to the enhanced garbage collection on
 
1382
      InstanceState to better guard against errors due to lost
 
1383
      state.
 
1384
 
 
1385
    - Query.get() returns a more informative error message when
 
1386
      executed against multiple entities.  [ticket:1220]
 
1387
 
 
1388
    - Restored NotImplementedError on Cls.relation.in_()
 
1389
      [ticket:1140] [ticket:1221]
 
1390
 
 
1391
    - Fixed PendingDeprecationWarning involving order_by parameter
 
1392
      on relation(). [ticket:1226]
 
1393
 
 
1394
- sql
 
1395
    - Removed the 'properties' attribute of the Connection object,
 
1396
      Connection.info should be used.
 
1397
 
 
1398
    - Restored "active rowcount" fetch before ResultProxy autocloses
 
1399
      the cursor.  This was removed in 0.5rc3.
 
1400
 
 
1401
    - Rearranged the `load_dialect_impl()` method in `TypeDecorator`
 
1402
      such that it will take effect even if the user-defined
 
1403
      `TypeDecorator` uses another `TypeDecorator` as its impl.
 
1404
 
 
1405
- access
 
1406
    - Added support for Currency type.
 
1407
 
 
1408
    - Functions were not return their result. [ticket:1017]
 
1409
 
 
1410
    - Corrected problem with joins. Access only support LEFT OUTER
 
1411
      or INNER not just JOIN by itself.  [ticket:1017]
 
1412
 
 
1413
- mssql
 
1414
    - Lots of cleanup and fixes to correct problems with limit and
 
1415
      offset.
 
1416
 
 
1417
    - Correct situation where subqueries as part of a binary
 
1418
      expression need to be translated to use the IN and NOT IN
 
1419
      syntax.
 
1420
 
 
1421
    - Fixed E Notation issue that prevented the ability to insert
 
1422
      decimal values less than 1E-6. [ticket:1216]
 
1423
 
 
1424
    - Corrected problems with reflection when dealing with schemas,
 
1425
      particularly when those schemas are the default
 
1426
      schema. [ticket:1217]
 
1427
 
 
1428
    - Corrected problem with casting a zero length item to a
 
1429
      varchar. It now correctly adjusts the CAST.
 
1430
 
 
1431
- ext
 
1432
    - Can now use a custom "inherit_condition" in __mapper_args__
 
1433
      when using declarative.
 
1434
 
 
1435
    - fixed string-based "remote_side", "order_by" and others not
 
1436
      propagating correctly when used in backref().
 
1437
 
 
1438
0.5.0rc3
 
1439
========
 
1440
- features
 
1441
- orm
 
1442
    - Added two new hooks to SessionExtension: after_bulk_delete()
 
1443
      and after_bulk_update().  after_bulk_delete() is called after
 
1444
      a bulk delete() operation on a query. after_bulk_update() is
 
1445
      called after a bulk update() operation on a query.
 
1446
 
 
1447
- sql
 
1448
    - SQL compiler optimizations and complexity reduction. The call
 
1449
      count for compiling a typical select() construct is 20% less
 
1450
      versus 0.5.0rc2.
 
1451
 
 
1452
    - Dialects can now generate label names of adjustable
 
1453
      length. Pass in the argument "label_length=<value>" to
 
1454
      create_engine() to adjust how many characters max will be
 
1455
      present in dynamically generated column labels, i.e.
 
1456
      "somecolumn AS somelabel". Any value less than 6 will result
 
1457
      in a label of minimal size, consisting of an underscore and a
 
1458
      numeric counter. The compiler uses the value of
 
1459
      dialect.max_identifier_length as a default.  [ticket:1211]
 
1460
 
 
1461
- ext
 
1462
    - Added a new extension sqlalchemy.ext.serializer.  Provides
 
1463
      Serializer/Deserializer "classes" which mirror
 
1464
      Pickle/Unpickle, as well as dumps() and loads(). This
 
1465
      serializer implements an "external object" pickler which keeps
 
1466
      key context-sensitive objects, including engines, sessions,
 
1467
      metadata, Tables/Columns, and mappers, outside of the pickle
 
1468
      stream, and can later restore the pickle using any
 
1469
      engine/metadata/session provider. This is used not for
 
1470
      pickling regular object instances, which are pickleable
 
1471
      without any special logic, but for pickling expression objects
 
1472
      and full Query objects, such that all mapper/engine/session
 
1473
      dependencies can be restored at unpickle time.
 
1474
 
 
1475
- oracle
 
1476
    - Wrote a docstring for Oracle dialect. Apparently that Ohloh
 
1477
      "few source code comments" label is starting to sting :).
 
1478
 
 
1479
    - Removed FIRST_ROWS() optimize flag when using LIMIT/OFFSET,
 
1480
      can be reenabled with optimize_limits=True create_engine()
 
1481
      flag.  [ticket:536]
 
1482
 
 
1483
- bugfixes and behavioral changes
 
1484
- orm
 
1485
    - "not equals" comparisons of simple many-to-one relation to an
 
1486
      instance will not drop into an EXISTS clause and will compare
 
1487
      foreign key columns instead.
 
1488
 
 
1489
    - Removed not-really-working use cases of comparing a collection
 
1490
      to an iterable. Use contains() to test for collection
 
1491
      membership.
 
1492
 
 
1493
    - Improved the behavior of aliased() objects such that they more
 
1494
      accurately adapt the expressions generated, which helps
 
1495
      particularly with self-referential comparisons. [ticket:1171]
 
1496
 
 
1497
    - Fixed bug involving primaryjoin/secondaryjoin conditions
 
1498
      constructed from class-bound attributes (as often occurs when
 
1499
      using declarative), which later would be inappropriately
 
1500
      aliased by Query, particularly with the various EXISTS based
 
1501
      comparators.
 
1502
 
 
1503
    - Fixed bug when using multiple query.join() with an
 
1504
      aliased-bound descriptor which would lose the left alias.
 
1505
 
 
1506
    - Improved weakref identity map memory management to no longer
 
1507
      require mutexing, resurrects garbage collected instance on a
 
1508
      lazy basis for an InstanceState with pending changes.
 
1509
 
 
1510
    - InstanceState object now removes circular references to itself
 
1511
      upon disposal to keep it outside of cyclic garbage collection.
 
1512
 
 
1513
    - relation() won't hide unrelated ForeignKey errors inside of
 
1514
      the "please specify primaryjoin" message when determining join
 
1515
      condition.
 
1516
 
 
1517
    - Fixed bug in Query involving order_by() in conjunction with
 
1518
      multiple aliases of the same class (will add tests in
 
1519
      [ticket:1218])
 
1520
 
 
1521
    - When using Query.join() with an explicit clause for the ON
 
1522
      clause, the clause will be aliased in terms of the left side
 
1523
      of the join, allowing scenarios like query(Source).
 
1524
      from_self().join((Dest, Source.id==Dest.source_id)) to work
 
1525
      properly.
 
1526
 
 
1527
    - polymorphic_union() function respects the "key" of each Column
 
1528
      if they differ from the column's name.
 
1529
 
 
1530
    - Repaired support for "passive-deletes" on a many-to-one
 
1531
      relation() with "delete" cascade.  [ticket:1183]
 
1532
 
 
1533
    - Fixed bug in composite types which prevented a primary-key
 
1534
      composite type from being mutated [ticket:1213].
 
1535
 
 
1536
    - Added more granularity to internal attribute access, such that
 
1537
      cascade and flush operations will not initialize unloaded
 
1538
      attributes and collections, leaving them intact for a
 
1539
      lazy-load later on. Backref events still initialize attrbutes
 
1540
      and collections for pending instances.  [ticket:1202]
 
1541
 
 
1542
- sql
 
1543
    - Simplified the check for ResultProxy "autoclose without
 
1544
      results" to be based solely on presence of
 
1545
      cursor.description. All the regexp-based guessing about
 
1546
      statements returning rows has been removed [ticket:1212].
 
1547
 
 
1548
    - Direct execution of a union() construct will properly set up
 
1549
      result-row processing.  [ticket:1194]
 
1550
 
 
1551
    - The internal notion of an "OID" or "ROWID" column has been
 
1552
      removed. It's basically not used by any dialect, and the
 
1553
      possibility of its usage with psycopg2's cursor.lastrowid is
 
1554
      basically gone now that INSERT..RETURNING is available.
 
1555
 
 
1556
    - Removed "default_order_by()" method on all FromClause objects.
 
1557
 
 
1558
    - Repaired the table.tometadata() method so that a passed-in
 
1559
      schema argument is propagated to ForeignKey constructs.
 
1560
 
 
1561
    - Slightly changed behavior of IN operator for comparing to
 
1562
      empty collections. Now results in inequality comparison
 
1563
      against self. More portable, but breaks with stored procedures
 
1564
      that aren't pure functions.
 
1565
 
 
1566
- oracle
 
1567
    - Setting the auto_convert_lobs to False on create_engine() will
 
1568
      also instruct the OracleBinary type to return the cx_oracle
 
1569
      LOB object unchanged.
 
1570
 
 
1571
- mysql
 
1572
    - Fixed foreign key reflection in the edge case where a Table's
 
1573
      explicit schema= is the same as the schema (database) the
 
1574
      connection is attached to.
 
1575
 
 
1576
    - No longer expects include_columns in table reflection to be
 
1577
      lower case.
 
1578
 
 
1579
- ext
 
1580
    - Fixed bug preventing declarative-bound "column" objects from
 
1581
      being used in column_mapped_collection(). [ticket:1174]
 
1582
 
 
1583
- misc
 
1584
    - util.flatten_iterator() func doesn't interpret strings with
 
1585
      __iter__() methods as iterators, such as in pypy
 
1586
      [ticket:1077].
 
1587
 
 
1588
0.5.0rc2
 
1589
========
 
1590
- orm
 
1591
    - Fixed bug involving read/write relation()s that contain
 
1592
      literal or other non-column expressions within their
 
1593
      primaryjoin condition equated to a foreign key column.
 
1594
 
 
1595
    - "non-batch" mode in mapper(), a feature which allows mapper
 
1596
      extension methods to be called as each instance is
 
1597
      updated/inserted, now honors the insert order of the objects
 
1598
      given.
 
1599
 
 
1600
    - Fixed RLock-related bug in mapper which could deadlock upon
 
1601
      reentrant mapper compile() calls, something that occurs when
 
1602
      using declarative constructs inside of ForeignKey objects.
 
1603
 
 
1604
    - ScopedSession.query_property now accepts a query_cls factory,
 
1605
      overriding the session's configured query_cls.
 
1606
 
 
1607
    - Fixed shared state bug interfering with ScopedSession.mapper's
 
1608
      ability to apply default __init__ implementations on object
 
1609
      subclasses.
 
1610
 
 
1611
    - Fixed up slices on Query (i.e. query[x:y]) to work properly
 
1612
      for zero length slices, slices with None on either end.
 
1613
      [ticket:1177]
 
1614
 
 
1615
    - Added an example illustrating Celko's "nested sets" as a 
 
1616
      SQLA mapping.
 
1617
 
 
1618
    - contains_eager() with an alias argument works even when 
 
1619
      the alias is embedded in a SELECT, as when sent to the
 
1620
      Query via query.select_from().
 
1621
 
 
1622
    - contains_eager() usage is now compatible with a Query that
 
1623
      also contains a regular eager load and limit/offset, in that
 
1624
      the columns are added to the Query-generated subquery.
 
1625
      [ticket:1180]
 
1626
 
 
1627
    - session.execute() will execute a Sequence object passed to
 
1628
      it (regression from 0.4).
 
1629
 
 
1630
    - Removed the "raiseerror" keyword argument from object_mapper()
 
1631
      and class_mapper().  These functions raise in all cases
 
1632
      if the given class/instance is not mapped.
 
1633
 
 
1634
    - Fixed session.transaction.commit() on a autocommit=False
 
1635
      session not starting a new transaction.
 
1636
 
 
1637
    - Some adjustments to Session.identity_map's weak referencing
 
1638
      behavior to reduce asynchronous GC side effects.
 
1639
 
 
1640
    - Adjustment to Session's post-flush accounting of newly
 
1641
      "clean" objects to better protect against operating on
 
1642
      objects as they're asynchronously gc'ed. [ticket:1182]
 
1643
 
 
1644
- sql
 
1645
    - column.in_(someselect) can now be used as a columns-clause
 
1646
      expression without the subquery bleeding into the FROM clause
 
1647
      [ticket:1074]
 
1648
 
 
1649
- sqlite
 
1650
    - Overhauled SQLite date/time bind/result processing to use
 
1651
      regular expressions and format strings, rather than
 
1652
      strptime/strftime, to generically support pre-1900 dates,
 
1653
      dates with microseconds.  [ticket:968]
 
1654
 
 
1655
    - String's (and Unicode's, UnicodeText's, etc.) convert_unicode 
 
1656
      logic disabled in the sqlite dialect, to adjust for pysqlite 
 
1657
      2.5.0's new requirement that only Python unicode objects are 
 
1658
      accepted;
 
1659
      http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
 
1660
 
 
1661
- mysql
 
1662
    - Temporary tables are now reflectable.
 
1663
 
 
1664
- oracle
 
1665
    - Oracle will detect string-based statements which contain 
 
1666
      comments at the front before a SELECT as SELECT statements.
 
1667
      [ticket:1187]
 
1668
 
 
1669
0.5.0rc1
 
1670
========
 
1671
 
 
1672
- orm
 
1673
    - Query now has delete() and update(values) methods. This allows
 
1674
      to perform bulk deletes/updates with the Query object.
 
1675
 
 
1676
    - The RowTuple object returned by Query(*cols) now features
 
1677
      keynames which prefer mapped attribute names over column keys,
 
1678
      column keys over column names, i.e.  Query(Class.foo,
 
1679
      Class.bar) will have names "foo" and "bar" even if those are
 
1680
      not the names of the underlying Column objects.  Direct Column
 
1681
      objects such as Query(table.c.col) will return the "key"
 
1682
      attribute of the Column.
 
1683
 
 
1684
    - Added scalar() and value() methods to Query, each return a
 
1685
      single scalar value.  scalar() takes no arguments and is
 
1686
      roughly equivalent to first()[0], value()
 
1687
      takes a single column expression and is roughly equivalent to
 
1688
      values(expr).next()[0].
 
1689
 
 
1690
    - Improved the determination of the FROM clause when placing SQL
 
1691
      expressions in the query() list of entities.  In particular
 
1692
      scalar subqueries should not "leak" their inner FROM objects
 
1693
      out into the enclosing query.
 
1694
 
 
1695
    - Joins along a relation() from a mapped class to a mapped
 
1696
      subclass, where the mapped subclass is configured with single
 
1697
      table inheritance, will include an IN clause which limits the
 
1698
      subtypes of the joined class to those requested, within the ON
 
1699
      clause of the join.  This takes effect for eager load joins as
 
1700
      well as query.join().  Note that in some scenarios the IN
 
1701
      clause will appear in the WHERE clause of the query as well
 
1702
      since this discrimination has multiple trigger points.
 
1703
 
 
1704
    - AttributeExtension has been refined such that the event
 
1705
      is fired before the mutation actually occurs.  Additionally,
 
1706
      the append() and set() methods must now return the given value,
 
1707
      which is used as the value to be used in the mutation operation.
 
1708
      This allows creation of validating AttributeListeners which
 
1709
      raise before the action actually occurs, and which can change
 
1710
      the given value into something else before its used.
 
1711
 
 
1712
    - column_property(), composite_property(), and relation() now 
 
1713
      accept a single or list of AttributeExtensions using the 
 
1714
      "extension" keyword argument.
 
1715
 
 
1716
    - query.order_by().get() silently drops the "ORDER BY" from 
 
1717
      the query issued by GET but does not raise an exception.
 
1718
 
 
1719
    - Added a Validator AttributeExtension, as well as a 
 
1720
      @validates decorator which is used in a similar fashion
 
1721
      as @reconstructor, and marks a method as validating
 
1722
      one or more mapped attributes.
 
1723
 
 
1724
    - class.someprop.in_() raises NotImplementedError pending the
 
1725
      implementation of "in_" for relation [ticket:1140]
 
1726
 
 
1727
    - Fixed primary key update for many-to-many collections where
 
1728
      the collection had not been loaded yet [ticket:1127]
 
1729
 
 
1730
    - Fixed bug whereby deferred() columns with a group in conjunction
 
1731
      with an otherwise unrelated synonym() would produce 
 
1732
      an AttributeError during deferred load.
 
1733
 
 
1734
    - The before_flush() hook on SessionExtension takes place before
 
1735
      the list of new/dirty/deleted is calculated for the final
 
1736
      time, allowing routines within before_flush() to further
 
1737
      change the state of the Session before the flush proceeds.
 
1738
      [ticket:1128]
 
1739
 
 
1740
    - The "extension" argument to Session and others can now
 
1741
      optionally be a list, supporting events sent to multiple
 
1742
      SessionExtension instances.  Session places SessionExtensions
 
1743
      in Session.extensions.
 
1744
 
 
1745
    - Reentrant calls to flush() raise an error.  This also serves
 
1746
      as a rudimentary, but not foolproof, check against concurrent
 
1747
      calls to Session.flush().
 
1748
 
 
1749
    - Improved the behavior of query.join() when joining to
 
1750
      joined-table inheritance subclasses, using explicit join
 
1751
      criteria (i.e. not on a relation).
 
1752
 
 
1753
    - @orm.attributes.reconstitute and
 
1754
      MapperExtension.reconstitute have been renamed to
 
1755
      @orm.reconstructor and MapperExtension.reconstruct_instance
 
1756
 
 
1757
    - Fixed @reconstructor hook for subclasses which inherit from a
 
1758
      base class.  [ticket:1129]
 
1759
 
 
1760
    - The composite() property type now supports a
 
1761
      __set_composite_values__() method on the composite class which
 
1762
      is required if the class represents state using attribute
 
1763
      names other than the column's keynames; default-generated
 
1764
      values now get populated properly upon flush.  Also,
 
1765
      composites with attributes set to None compare correctly.
 
1766
      [ticket:1132]
 
1767
 
 
1768
    - The 3-tuple of iterables returned by attributes.get_history()
 
1769
      may now be a mix of lists and tuples.  (Previously members
 
1770
      were always lists.)
 
1771
 
 
1772
    - Fixed bug whereby changing a primary key attribute on an 
 
1773
      entity where the attribute's previous value had been expired 
 
1774
      would produce an error upon flush(). [ticket:1151]
 
1775
 
 
1776
    - Fixed custom instrumentation bug whereby get_instance_dict()
 
1777
      was not called for newly constructed instances not loaded
 
1778
      by the ORM.
 
1779
 
 
1780
    - Session.delete() adds the given object to the session if 
 
1781
      not already present.  This was a regression bug from 0.4.
 
1782
      [ticket:1150]
 
1783
 
 
1784
    - The `echo_uow` flag on `Session` is deprecated, and unit-of-work
 
1785
      logging is now application-level only, not per-session level.
 
1786
 
 
1787
    - Removed conflicting `contains()` operator from 
 
1788
      `InstrumentedAttribute` which didn't accept `escape` kwaarg
 
1789
      [ticket:1153].
 
1790
 
 
1791
- declarative
 
1792
    - Fixed bug whereby mapper couldn't initialize if a composite
 
1793
      primary key referenced another table that was not defined
 
1794
      yet. [ticket:1161]
 
1795
 
 
1796
    - Fixed exception throw which would occur when string-based
 
1797
      primaryjoin condition was used in conjunction with backref.
 
1798
 
 
1799
- schema
 
1800
    - Added "sorted_tables" accessor to MetaData, which returns
 
1801
      Table objects sorted in order of dependency as a list.
 
1802
      This deprecates the MetaData.table_iterator() method.
 
1803
      The "reverse=False" keyword argument has also been
 
1804
      removed from util.sort_tables(); use the Python
 
1805
      'reversed' function to reverse the results.
 
1806
      [ticket:1033]
 
1807
 
 
1808
    - The 'length' argument to all Numeric types has been renamed
 
1809
      to 'scale'.  'length' is deprecated and is still accepted
 
1810
      with a warning.
 
1811
 
 
1812
    - Dropped 0.3-compatibility for user defined types
 
1813
      (convert_result_value, convert_bind_param).
 
1814
 
 
1815
- sql
 
1816
    - Temporarily rolled back the "ORDER BY" enhancement from
 
1817
      [ticket:1068].  This feature is on hold pending further
 
1818
      development.
 
1819
 
 
1820
    - The exists() construct won't "export" its contained list 
 
1821
      of elements as FROM clauses, allowing them to be used more
 
1822
      effectively in the columns clause of a SELECT.
 
1823
 
 
1824
    - and_() and or_() now generate a ColumnElement, allowing
 
1825
      boolean expressions as result columns, i.e.
 
1826
      select([and_(1, 0)]).  [ticket:798]
 
1827
 
 
1828
    - Bind params now subclass ColumnElement which allows them to be
 
1829
      selectable by orm.query (they already had most ColumnElement
 
1830
      semantics).
 
1831
 
 
1832
    - Added select_from() method to exists() construct, which becomes
 
1833
      more and more compatible with a regular select().
 
1834
 
 
1835
    - Added func.min(), func.max(), func.sum() as "generic functions",
 
1836
      which basically allows for their return type to be determined
 
1837
      automatically.  Helps with dates on SQLite, decimal types, 
 
1838
      others. [ticket:1160]
 
1839
 
 
1840
    - added decimal.Decimal as an "auto-detect" type; bind parameters
 
1841
      and generic functions will set their type to Numeric when a 
 
1842
      Decimal is used.
 
1843
 
 
1844
- mysql
 
1845
    - The 'length' argument to MSInteger, MSBigInteger, MSTinyInteger,
 
1846
      MSSmallInteger and MSYear has been renamed to 'display_width'.
 
1847
 
 
1848
    - Added MSMediumInteger type [ticket:1146].
 
1849
 
 
1850
    - the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
 
1851
      the parenthesis, which seem to get in the way when using in 
 
1852
      conjunction with executemany().
 
1853
 
 
1854
- oracle
 
1855
    - limit/offset no longer uses ROW NUMBER OVER to limit rows,
 
1856
      and instead uses subqueries in conjunction with a special
 
1857
      Oracle optimization comment.  Allows LIMIT/OFFSET to work
 
1858
      in conjunction with DISTINCT. [ticket:536]
 
1859
    - has_sequence() now takes the current "schema" argument into
 
1860
      account [ticket:1155]
 
1861
    - added BFILE to reflected type names [ticket:1121]
 
1862
 
 
1863
0.5beta3
 
1864
========
 
1865
 
 
1866
0.5beta3 includes all bugfixes listed under release "0.4.7".
 
1867
 
 
1868
- orm
 
1869
    - The "entity_name" feature of SQLAlchemy mappers has been
 
1870
      removed.  For rationale, see http://tinyurl.com/6nm2ne
 
1871
 
 
1872
    - the "autoexpire" flag on Session, sessionmaker(), and
 
1873
      scoped_session() has been renamed to "expire_on_commit".  It
 
1874
      does not affect the expiration behavior of rollback().
 
1875
 
 
1876
    - fixed endless loop bug which could occur within a mapper's
 
1877
      deferred load of inherited attributes.
 
1878
 
 
1879
    - a legacy-support flag "_enable_transaction_accounting" flag
 
1880
      added to Session which when False, disables all
 
1881
      transaction-level object accounting, including expire on
 
1882
      rollback, expire on commit, new/deleted list maintenance, and
 
1883
      autoflush on begin.
 
1884
 
 
1885
    - The 'cascade' parameter to relation() accepts None as a value,
 
1886
      which is equivalent to no cascades.
 
1887
 
 
1888
    - A critical fix to dynamic relations allows the "modified"
 
1889
      history to be properly cleared after a flush().
 
1890
 
 
1891
    - user-defined @properties on a class are detected and left in
 
1892
      place during mapper initialization.  This means that a
 
1893
      table-bound column of the same name will not be mapped at all
 
1894
      if a @property is in the way (and the column is not remapped
 
1895
      to a different name), nor will an instrumented attribute from
 
1896
      an inherited class be applied.  The same rules apply for names
 
1897
      excluded using the include_properties/exclude_properties
 
1898
      collections.
 
1899
 
 
1900
    - Added a new SessionExtension hook called after_attach().  This
 
1901
      is called at the point of attachment for objects via add(),
 
1902
      add_all(), delete(), and merge().
 
1903
 
 
1904
    - A mapper which inherits from another, when inheriting the
 
1905
      columns of its inherited mapper, will use any reassigned
 
1906
      property names specified in that inheriting mapper.
 
1907
      Previously, if "Base" had reassigned "base_id" to the name
 
1908
      "id", "SubBase(Base)" would still get an attribute called
 
1909
      "base_id".  This could be worked around by explicitly stating
 
1910
      the column in each submapper as well but this is fairly
 
1911
      unworkable and also impossible when using declarative
 
1912
      [ticket:1111].
 
1913
 
 
1914
    - Fixed a series of potential race conditions in Session whereby
 
1915
      asynchronous GC could remove unmodified, no longer referenced
 
1916
      items from the session as they were present in a list of items
 
1917
      to be processed, typically during session.expunge_all() and
 
1918
      dependent methods.
 
1919
 
 
1920
    - Some improvements to the _CompileOnAttr mechanism which should
 
1921
      reduce the probability of "Attribute x was not replaced during
 
1922
      compile" warnings. (this generally applies to SQLA hackers,
 
1923
      like Elixir devs).
 
1924
 
 
1925
    - Fixed bug whereby the "unsaved, pending instance" FlushError
 
1926
      raised for a pending orphan would not take superclass mappers
 
1927
      into account when generating the list of relations responsible
 
1928
      for the error.
 
1929
 
 
1930
- sql
 
1931
    - func.count() with no arguments renders as COUNT(*), equivalent
 
1932
      to func.count(text('*')).
 
1933
 
 
1934
    - simple label names in ORDER BY expressions render as
 
1935
      themselves, and not as a re-statement of their corresponding
 
1936
      expression.  This feature is currently enabled only for
 
1937
      SQLite, MySQL, and PostgreSQL.  It can be enabled on other
 
1938
      dialects as each is shown to support this
 
1939
      behavior. [ticket:1068]
 
1940
 
 
1941
- ext
 
1942
    - Class-bound attributes sent as arguments to relation()'s
 
1943
      remote_side and foreign_keys parameters are now accepted,
 
1944
      allowing them to be used with declarative.  Additionally fixed
 
1945
      bugs involving order_by being specified as a class-bound
 
1946
      attribute in conjunction with eager loading.
 
1947
 
 
1948
    - declarative initialization of Columns adjusted so that
 
1949
      non-renamed columns initialize in the same way as a non
 
1950
      declarative mapper.  This allows an inheriting mapper to set
 
1951
      up its same-named "id" columns in particular such that the
 
1952
      parent "id" column is favored over the child column, reducing
 
1953
      database round trips when this value is requested.
 
1954
 
 
1955
- mysql
 
1956
    - Quoting of MSEnum values for use in CREATE TABLE is now
 
1957
      optional & will be quoted on demand as required.  (Quoting was
 
1958
      always optional for use with existing tables.) [ticket:1110]
 
1959
 
 
1960
0.5beta2
 
1961
========
 
1962
 
 
1963
0.5beta2 includes some of the bugfixes listed under release "0.4.7".
 
1964
 
 
1965
- orm
 
1966
    - In addition to expired attributes, deferred attributes also
 
1967
      load if their data is present in the result set.  [ticket:870]
 
1968
 
 
1969
    - session.refresh() raises an informative error message if the
 
1970
      list of attributes does not include any column-based
 
1971
      attributes.
 
1972
 
 
1973
    - query() raises an informative error message if no columns or
 
1974
      mappers are specified.
 
1975
 
 
1976
    - lazy loaders now trigger autoflush before proceeding.  This
 
1977
      allows expire() of a collection or scalar relation to function
 
1978
      properly in the context of autoflush.
 
1979
 
 
1980
    - column_property() attributes which represent SQL expressions
 
1981
      or columns that are not present in the mapped tables (such as
 
1982
      those from views) are automatically expired after an INSERT or
 
1983
      UPDATE, assuming they have not been locally modified, so that
 
1984
      they are refreshed with the most recent data upon access.
 
1985
      [ticket:887]
 
1986
 
 
1987
    - Fixed explicit, self-referential joins between two
 
1988
      joined-table inheritance mappers when using query.join(cls,
 
1989
      aliased=True).  [ticket:1082]
 
1990
 
 
1991
    - Fixed query.join() when used in conjunction with a
 
1992
      columns-only clause and an SQL-expression ON clause in the
 
1993
      join.
 
1994
 
 
1995
    - The "allow_column_override" flag from mapper() has been
 
1996
      removed.  This flag is virtually always misunderstood.  Its
 
1997
      specific functionality is available via the
 
1998
      include_properties/exclude_properties mapper arguments.
 
1999
 
 
2000
    - Repaired `__str__()` method on Query. [ticket:1066]
 
2001
 
 
2002
    - Session.bind gets used as a default even when table/mapper
 
2003
      specific binds are defined.
 
2004
 
 
2005
- schema
 
2006
    - Added prefixes option to `Table` that accepts a list of
 
2007
      strings to insert after CREATE in the CREATE TABLE statement.
 
2008
      [ticket:1075]
 
2009
 
 
2010
    - Unicode, UnicodeText types now set "assert_unicode" and
 
2011
      "convert_unicode" by default, but accept overriding
 
2012
      **kwargs for these values.
 
2013
 
 
2014
- sql
 
2015
    - Added new match() operator that performs a full-text search.
 
2016
      Supported on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle
 
2017
      backends.
 
2018
 
 
2019
- sqlite
 
2020
    - Modified SQLite's representation of "microseconds" to match
 
2021
      the output of str(somedatetime), i.e. in that the microseconds
 
2022
      are represented as fractional seconds in string format.  This
 
2023
      makes SQLA's SQLite date type compatible with datetimes that
 
2024
      were saved directly using Pysqlite (which just calls str()).
 
2025
      Note that this is incompatible with the existing microseconds
 
2026
      values in a SQLA 0.4 generated SQLite database file.
 
2027
 
 
2028
      To get the old behavior globally:
 
2029
 
 
2030
           from sqlalchemy.databases.sqlite import DateTimeMixin
 
2031
           DateTimeMixin.__legacy_microseconds__ = True
 
2032
 
 
2033
      To get the behavior on individual DateTime types:
 
2034
 
 
2035
            t = sqlite.SLDateTime()
 
2036
            t.__legacy_microseconds__ = True
 
2037
 
 
2038
      Then use "t" as the type on the Column.
 
2039
 
 
2040
      [ticket:1090]
 
2041
 
 
2042
    - SQLite Date, DateTime, and Time types only accept Python
 
2043
      datetime objects now, not strings.  If you'd like to format
 
2044
      dates as strings yourself with SQLite, use a String type.  If
 
2045
      you'd like them to return datetime objects anyway despite
 
2046
      their accepting strings as input, make a TypeDecorator around
 
2047
      String - SQLA doesn't encourage this pattern.
 
2048
 
 
2049
- extensions
 
2050
    - Declarative supports a __table_args__ class variable, which is
 
2051
      either a dictionary, or tuple of the form (arg1, arg2, ...,
 
2052
      {kwarg1:value, ...}) which contains positional + kw arguments
 
2053
      to be passed to the Table constructor. [ticket:1096]
 
2054
 
 
2055
0.5beta1
 
2056
========
 
2057
 
 
2058
An ongoing document describing the changes from 0.4 to 0.5 is at:
 
2059
http://www.sqlalchemy.org/trac/wiki/05Migration
 
2060
 
 
2061
For this section, the list below primarily lists changes within the
 
2062
attribute instrumentation API and is only a small fraction of the
 
2063
full changes between 0.4/0.5.
 
2064
 
 
2065
-orm
 
2066
    - The "__init__" trigger/decorator added by mapper now attempts
 
2067
      to exactly mirror the argument signature of the original
 
2068
      __init__.  The pass-through for '_sa_session' is no longer
 
2069
      implicit- you must allow for this keyword argument in your
 
2070
      constructor.
 
2071
 
 
2072
    - ClassState is renamed to ClassManager.
 
2073
 
 
2074
    - Classes may supply their own InstrumentationManager by
 
2075
      providing a __sa_instrumentation_manager__ property.
 
2076
 
 
2077
    - Custom instrumentation may use any mechanism to associate a
 
2078
      ClassManager with a class and an InstanceState with an
 
2079
      instance.  Attributes on those objects are still the default
 
2080
      association mechanism used by SQLAlchemy's native
 
2081
      instrumentation.
 
2082
 
 
2083
    - Moved entity_name, _sa_session_id, and _instance_key from the
 
2084
      instance object to the instance state.  These values are still
 
2085
      available in the old way, which is now deprecated, using
 
2086
      descriptors attached to the class.  A deprecation warning will
 
2087
      be issued when accessed.
 
2088
 
 
2089
    - The _prepare_instrumentation alias for prepare_instrumentation
 
2090
      has been removed.
 
2091
 
 
2092
    - sqlalchemy.exceptions has been renamed to sqlalchemy.exc.  The
 
2093
      module may be imported under either name.
 
2094
 
 
2095
    - ORM-related exceptions are now defined in sqlalchemy.orm.exc.
 
2096
      ConcurrentModificationError, FlushError, and
 
2097
      UnmappedColumnError compatibility aliases are installed in
 
2098
      sqlalchemy.exc during the import of sqlalchemy.orm.
 
2099
 
 
2100
    - sqlalchemy.logging has been renamed to sqlalchemy.log.
 
2101
 
 
2102
    - The transitional sqlalchemy.log.SADeprecationWarning alias for
 
2103
      the warning's definition in sqlalchemy.exc has been removed.
 
2104
 
 
2105
    - exc.AssertionError has been removed and usage replaced with
 
2106
      Python's built-in AssertionError.
 
2107
 
 
2108
    - The behavior of MapperExtensions attached to multiple,
 
2109
      entity_name= primary mappers for a single class has been
 
2110
      altered.  The first mapper() defined for a class is the only
 
2111
      mapper eligible for the MapperExtension 'instrument_class',
 
2112
      'init_instance' and 'init_failed' events.  This is backwards
 
2113
      incompatible; previously the extensions of last mapper defined
 
2114
      would receive these events.
 
2115
 
 
2116
- firebird
 
2117
    - Added support for returning values from inserts (2.0+ only),
 
2118
      updates and deletes (2.1+ only).
 
2119
 
 
2120
0.4.7
 
2121
=====
 
2122
- orm
 
2123
    - The contains() operator when used with many-to-many
 
2124
      will alias() the secondary (association) table so
 
2125
      that multiple contains() calls will not conflict
 
2126
      with each other [ticket:1058]
 
2127
 
 
2128
    - fixed bug preventing merge() from functioning in
 
2129
      conjunction with a comparable_property()
 
2130
 
 
2131
    - the enable_typechecks=False setting on relation()
 
2132
      now only allows subtypes with inheriting mappers.
 
2133
      Totally unrelated types, or subtypes not set up with
 
2134
      mapper inheritance against the target mapper are
 
2135
      still not allowed.
 
2136
 
 
2137
    - Added is_active flag to Sessions to detect when
 
2138
      a transaction is in progress [ticket:976].  This
 
2139
      flag is always True with a "transactional"
 
2140
      (in 0.5 a non-"autocommit") Session.
 
2141
 
 
2142
- sql
 
2143
    - Fixed bug when calling select([literal('foo')])
 
2144
      or select([bindparam('foo')]).
 
2145
 
 
2146
- schema
 
2147
    - create_all(), drop_all(), create(), drop() all raise
 
2148
      an error if the table name or schema name contains
 
2149
      more characters than that dialect's configured
 
2150
      character limit.  Some DB's can handle too-long
 
2151
      table names during usage, and SQLA can handle this
 
2152
      as well. But various reflection/
 
2153
      checkfirst-during-create scenarios fail since we are
 
2154
      looking for the name within the DB's catalog tables.
 
2155
      [ticket:571]
 
2156
 
 
2157
    - The index name generated when you say "index=True"
 
2158
      on a Column is truncated to the length appropriate
 
2159
      for the dialect. Additionally, an Index with a too-
 
2160
      long name cannot be explicitly dropped with
 
2161
      Index.drop(), similar to [ticket:571].
 
2162
      [ticket:820]
 
2163
 
 
2164
- postgres
 
2165
    - Repaired server_side_cursors to properly detect
 
2166
      text() clauses.
 
2167
 
 
2168
    - Added PGCidr type. [ticket:1092]
 
2169
 
 
2170
- mysql
 
2171
    - Added 'CALL' to the list of SQL keywords which return
 
2172
      result rows.
 
2173
 
 
2174
- oracle
 
2175
    - Oracle get_default_schema_name() "normalizes" the name
 
2176
      before returning, meaning it returns a lower-case name
 
2177
      when the identifier is detected as case insensitive.
 
2178
 
 
2179
    - creating/dropping tables takes schema name into account
 
2180
      when searching for the existing table, so that tables
 
2181
      in other owner namespaces with the same name do not
 
2182
      conflict [ticket:709]
 
2183
 
 
2184
    - Cursors now have "arraysize" set to 50 by default on
 
2185
      them, the value of which is configurable using the
 
2186
      "arraysize" argument to create_engine() with the
 
2187
      Oracle dialect.  This to account for cx_oracle's default
 
2188
      setting of "1", which has the effect of many round trips
 
2189
      being sent to Oracle.  This actually works well in
 
2190
      conjunction with BLOB/CLOB-bound cursors, of which
 
2191
      there are any number available but only for the life of
 
2192
      that row request (so BufferedColumnRow is still needed,
 
2193
      but less so). [ticket:1062]
 
2194
 
 
2195
- sqlite
 
2196
      - add SLFloat type, which matches the SQLite REAL
 
2197
        type affinity.  Previously, only SLNumeric was provided
 
2198
        which fulfills NUMERIC affinity, but that's not the
 
2199
        same as REAL.
 
2200
 
 
2201
0.4.6
 
2202
=====
 
2203
- orm
 
2204
    - Fix to the recent relation() refactoring which fixes
 
2205
      exotic viewonly relations which join between local and
 
2206
      remote table multiple times, with a common column shared
 
2207
      between the joins.
 
2208
 
 
2209
    - Also re-established viewonly relation() configurations
 
2210
      that join across multiple tables.
 
2211
 
 
2212
    - Added experimental relation() flag to help with
 
2213
      primaryjoins across functions, etc.,
 
2214
      _local_remote_pairs=[tuples].  This complements a complex
 
2215
      primaryjoin condition allowing you to provide the
 
2216
      individual column pairs which comprise the relation's
 
2217
      local and remote sides.  Also improved lazy load SQL
 
2218
      generation to handle placing bind params inside of
 
2219
      functions and other expressions.  (partial progress
 
2220
      towards [ticket:610])
 
2221
 
 
2222
    - repaired single table inheritance such that you
 
2223
      can single-table inherit from a joined-table inherting
 
2224
      mapper without issue [ticket:1036].
 
2225
 
 
2226
    - Fixed "concatenate tuple" bug which could occur with
 
2227
      Query.order_by() if clause adaption had taken place.
 
2228
      [ticket:1027]
 
2229
 
 
2230
    - Removed ancient assertion that mapped selectables require
 
2231
      "alias names" - the mapper creates its own alias now if
 
2232
      none is present.  Though in this case you need to use the
 
2233
      class, not the mapped selectable, as the source of column
 
2234
      attributes - so a warning is still issued.
 
2235
 
 
2236
    - fixes to the "exists" function involving inheritance (any(),
 
2237
      has(), ~contains()); the full target join will be rendered
 
2238
      into the EXISTS clause for relations that link to subclasses.
 
2239
 
 
2240
    - restored usage of append_result() extension method for primary
 
2241
      query rows, when the extension is present and only a single-
 
2242
      entity result is being returned.
 
2243
 
 
2244
    - Also re-established viewonly relation() configurations that
 
2245
      join across multiple tables.
 
2246
 
 
2247
    - removed ancient assertion that mapped selectables require
 
2248
      "alias names" - the mapper creates its own alias now if
 
2249
      none is present.  Though in this case you need to use
 
2250
      the class, not the mapped selectable, as the source of
 
2251
      column attributes - so a warning is still issued.
 
2252
 
 
2253
    - refined mapper._save_obj() which was unnecessarily calling
 
2254
      __ne__() on scalar values during flush [ticket:1015]
 
2255
 
 
2256
    - added a feature to eager loading whereby subqueries set
 
2257
      as column_property() with explicit label names (which is not
 
2258
      necessary, btw) will have the label anonymized when
 
2259
      the instance is part of the eager join, to prevent
 
2260
      conflicts with a subquery or column of the same name
 
2261
      on the parent object.  [ticket:1019]
 
2262
 
 
2263
    - set-based collections |=, -=, ^= and &= are stricter about
 
2264
      their operands and only operate on sets, frozensets or
 
2265
      subclasses of the collection type. Previously, they would
 
2266
      accept any duck-typed set.
 
2267
 
 
2268
    - added an example dynamic_dict/dynamic_dict.py, illustrating
 
2269
      a simple way to place dictionary behavior on top of
 
2270
      a dynamic_loader.
 
2271
 
 
2272
- declarative extension
 
2273
    - Joined table inheritance mappers use a slightly relaxed
 
2274
      function to create the "inherit condition" to the parent
 
2275
      table, so that other foreign keys to not-yet-declared
 
2276
      Table objects don't trigger an error.
 
2277
 
 
2278
    - fixed reentrant mapper compile hang when
 
2279
      a declared attribute is used within ForeignKey,
 
2280
      ie. ForeignKey(MyOtherClass.someattribute)
 
2281
 
 
2282
- sql
 
2283
    - Added COLLATE support via the .collate(<collation>)
 
2284
      expression operator and collate(<expr>, <collation>) sql
 
2285
      function.
 
2286
 
 
2287
    - Fixed bug with union() when applied to non-Table connected
 
2288
      select statements
 
2289
 
 
2290
    - improved behavior of text() expressions when used as
 
2291
      FROM clauses, such as select().select_from(text("sometext"))
 
2292
      [ticket:1014]
 
2293
 
 
2294
    - Column.copy() respects the value of "autoincrement",
 
2295
      fixes usage with Migrate [ticket:1021]
 
2296
 
 
2297
- engines
 
2298
    - Pool listeners can now be provided as a dictionary of
 
2299
      callables or a (possibly partial) duck-type of
 
2300
      PoolListener, your choice.
 
2301
 
 
2302
    - added "rollback_returned" option to Pool which will
 
2303
      disable the rollback() issued when connections are
 
2304
      returned.  This flag is only safe to use with a database
 
2305
      which does not support transactions (i.e. MySQL/MyISAM).
 
2306
 
 
2307
- ext
 
2308
    - set-based association proxies |=, -=, ^= and &= are
 
2309
      stricter about their operands and only operate on sets,
 
2310
      frozensets or other association proxies. Previously, they
 
2311
      would accept any duck-typed set.
 
2312
 
 
2313
- mssql
 
2314
    - Added "odbc_autotranslate" parameter to engine / dburi
 
2315
      parameters. Any given string will be passed through to the
 
2316
      ODBC connection string as:
 
2317
 
 
2318
            "AutoTranslate=%s" % odbc_autotranslate
 
2319
 
 
2320
      [ticket:1005]
 
2321
 
 
2322
    - Added "odbc_options" parameter to engine / dburi
 
2323
      parameters. The given string is simply appended to the
 
2324
      SQLAlchemy-generated odbc connection string.
 
2325
 
 
2326
      This should obviate the need of adding a myriad of ODBC
 
2327
      options in the future.
 
2328
 
 
2329
- firebird
 
2330
    - Handle the "SUBSTRING(:string FROM :start FOR :length)"
 
2331
      builtin.
 
2332
 
 
2333
0.4.5
 
2334
=====
 
2335
- orm
 
2336
    - A small change in behavior to session.merge() - existing
 
2337
      objects are checked for based on primary key attributes, not
 
2338
      necessarily _instance_key.  So the widely requested
 
2339
      capability, that:
 
2340
 
 
2341
            x = MyObject(id=1)
 
2342
            x = sess.merge(x)
 
2343
 
 
2344
      will in fact load MyObject with id #1 from the database if
 
2345
      present, is now available.  merge() still copies the state
 
2346
      of the given object to the persistent one, so an example
 
2347
      like the above would typically have copied "None" from all
 
2348
      attributes of "x" onto the persistent copy.  These can be
 
2349
      reverted using session.expire(x).
 
2350
 
 
2351
    - Also fixed behavior in merge() whereby collection elements
 
2352
      present on the destination but not the merged collection
 
2353
      were not being removed from the destination.
 
2354
 
 
2355
    - Added a more aggressive check for "uncompiled mappers",
 
2356
      helps particularly with declarative layer [ticket:995]
 
2357
 
 
2358
    - The methodology behind "primaryjoin"/"secondaryjoin" has
 
2359
      been refactored.  Behavior should be slightly more
 
2360
      intelligent, primarily in terms of error messages which
 
2361
      have been pared down to be more readable.  In a slight
 
2362
      number of scenarios it can better resolve the correct
 
2363
      foreign key than before.
 
2364
 
 
2365
    - Added comparable_property(), adds query Comparator
 
2366
      behavior to regular, unmanaged Python properties
 
2367
 
 
2368
    - the functionality of query.with_polymorphic() has
 
2369
      been added to mapper() as a configuration option.
 
2370
 
 
2371
      It's set via several forms:
 
2372
            with_polymorphic='*'
 
2373
            with_polymorphic=[mappers]
 
2374
            with_polymorphic=('*', selectable)
 
2375
            with_polymorphic=([mappers], selectable)
 
2376
 
 
2377
      This controls the default polymorphic loading strategy
 
2378
      for inherited mappers. When a selectable is not given,
 
2379
      outer joins are created for all joined-table inheriting
 
2380
      mappers requested. Note that the auto-create of joins
 
2381
      is not compatible with concrete table inheritance.
 
2382
 
 
2383
      The existing select_table flag on mapper() is now
 
2384
      deprecated and is synonymous with
 
2385
      with_polymorphic('*', select_table).  Note that the
 
2386
      underlying "guts" of select_table have been
 
2387
      completely removed and replaced with the newer,
 
2388
      more flexible approach.
 
2389
 
 
2390
      The new approach also automatically allows eager loads
 
2391
      to work for subclasses, if they are present, for
 
2392
      example
 
2393
        sess.query(Company).options(
 
2394
         eagerload_all(
 
2395
          [Company.employees.of_type(Engineer), 'machines']
 
2396
        ))
 
2397
      to load Company objects, their employees, and the
 
2398
      'machines' collection of employees who happen to be
 
2399
      Engineers. A "with_polymorphic" Query option should be
 
2400
      introduced soon as well which would allow per-Query
 
2401
      control of with_polymorphic() on relations.
 
2402
 
 
2403
    - added two "experimental" features to Query,
 
2404
      "experimental" in that their specific name/behavior
 
2405
      is not carved in stone just yet:  _values() and
 
2406
      _from_self().  We'd like feedback on these.
 
2407
 
 
2408
      - _values(*columns) is given a list of column
 
2409
        expressions, and returns a new Query that only
 
2410
        returns those columns. When evaluated, the return
 
2411
        value is a list of tuples just like when using
 
2412
        add_column() or add_entity(), the only difference is
 
2413
        that "entity zero", i.e. the mapped class, is not
 
2414
        included in the results. This means it finally makes
 
2415
        sense to use group_by() and having() on Query, which
 
2416
        have been sitting around uselessly until now.
 
2417
 
 
2418
        A future change to this method may include that its
 
2419
        ability to join, filter and allow other options not
 
2420
        related to a "resultset" are removed, so the feedback
 
2421
        we're looking for is how people want to use
 
2422
        _values()...i.e. at the very end, or do people prefer
 
2423
        to continue generating after it's called.
 
2424
 
 
2425
      - _from_self() compiles the SELECT statement for the
 
2426
        Query (minus any eager loaders), and returns a new
 
2427
        Query that selects from that SELECT. So basically you
 
2428
        can query from a Query without needing to extract the
 
2429
        SELECT statement manually. This gives meaning to
 
2430
        operations like query[3:5]._from_self().filter(some
 
2431
        criterion). There's not much controversial here
 
2432
        except that you can quickly create highly nested
 
2433
        queries that are less efficient, and we want feedback
 
2434
        on the naming choice.
 
2435
 
 
2436
    - query.order_by() and query.group_by() will accept
 
2437
      multiple arguments using *args (like select()
 
2438
      already does).
 
2439
 
 
2440
    - Added some convenience descriptors to Query:
 
2441
      query.statement returns the full SELECT construct,
 
2442
      query.whereclause returns just the WHERE part of the
 
2443
      SELECT construct.
 
2444
 
 
2445
    - Fixed/covered case when using a False/0 value as a
 
2446
      polymorphic discriminator.
 
2447
 
 
2448
    - Fixed bug which was preventing synonym() attributes from
 
2449
      being used with inheritance
 
2450
 
 
2451
    - Fixed SQL function truncation of trailing underscores
 
2452
      [ticket:996]
 
2453
 
 
2454
    - When attributes are expired on a pending instance, an
 
2455
      error will not be raised when the "refresh" action is
 
2456
      triggered and no result is found.
 
2457
 
 
2458
    - Session.execute can now find binds from metadata
 
2459
 
 
2460
    - Adjusted the definition of "self-referential" to be any
 
2461
      two mappers with a common parent (this affects whether or
 
2462
      not aliased=True is required when joining with Query).
 
2463
 
 
2464
    - Made some fixes to the "from_joinpoint" argument to
 
2465
      query.join() so that if the previous join was aliased and
 
2466
      this one isn't, the join still happens successfully.
 
2467
 
 
2468
    - Assorted "cascade deletes" fixes:
 
2469
        - Fixed "cascade delete" operation of dynamic relations,
 
2470
          which had only been implemented for foreign-key
 
2471
          nulling behavior in 0.4.2 and not actual cascading
 
2472
          deletes [ticket:895]
 
2473
 
 
2474
        - Delete cascade without delete-orphan cascade on a
 
2475
          many-to-one will not delete orphans which were
 
2476
          disconnected from the parent before session.delete()
 
2477
          is called on the parent (one-to-many already had
 
2478
          this).
 
2479
 
 
2480
        - Delete cascade with delete-orphan will delete orphans
 
2481
          whether or not it remains attached to its also-deleted
 
2482
          parent.
 
2483
 
 
2484
        - delete-orphan casacde is properly detected on relations
 
2485
          that are present on superclasses when using inheritance.
 
2486
 
 
2487
    - Fixed order_by calculation in Query to properly alias
 
2488
      mapper-config'ed order_by when using select_from()
 
2489
 
 
2490
    - Refactored the diffing logic that kicks in when replacing
 
2491
      one collection with another into collections.bulk_replace,
 
2492
      useful to anyone building multi-level collections.
 
2493
 
 
2494
    - Cascade traversal algorithm converted from recursive to
 
2495
      iterative to support deep object graphs.
 
2496
 
 
2497
- sql
 
2498
    - schema-qualified tables now will place the schemaname
 
2499
      ahead of the tablename in all column expressions as well
 
2500
      as when generating column labels.  This prevents cross-
 
2501
      schema name collisions in all cases [ticket:999]
 
2502
 
 
2503
    - can now allow selects which correlate all FROM clauses
 
2504
      and have no FROM themselves.  These are typically
 
2505
      used in a scalar context, i.e. SELECT x, (SELECT x WHERE y)
 
2506
      FROM table.  Requires explicit correlate() call.
 
2507
 
 
2508
    - 'name' is no longer a required constructor argument for
 
2509
      Column().  It (and .key) may now be deferred until the
 
2510
      column is added to a Table.
 
2511
 
 
2512
    - like(), ilike(), contains(), startswith(), endswith() take
 
2513
      an optional keyword argument "escape=<somestring>", which
 
2514
      is set as the escape character using the syntax "x LIKE y
 
2515
      ESCAPE '<somestring>'" [ticket:993], [ticket:791]
 
2516
 
 
2517
    - random() is now a generic sql function and will compile to
 
2518
      the database's random implementation, if any.
 
2519
 
 
2520
    - update().values() and insert().values() take keyword
 
2521
      arguments.
 
2522
 
 
2523
    - Fixed an issue in select() regarding its generation of
 
2524
      FROM clauses, in rare circumstances two clauses could be
 
2525
      produced when one was intended to cancel out the other.
 
2526
      Some ORM queries with lots of eager loads might have seen
 
2527
      this symptom.
 
2528
 
 
2529
    - The case() function now also takes a dictionary as its
 
2530
      whens parameter.  It also interprets the "THEN"
 
2531
      expressions as values by default, meaning case([(x==y,
 
2532
      "foo")]) will interpret "foo" as a bound value, not a SQL
 
2533
      expression.  use text(expr) for literal SQL expressions in
 
2534
      this case.  For the criterion itself, these may be literal
 
2535
      strings only if the "value" keyword is present, otherwise
 
2536
      SA will force explicit usage of either text() or
 
2537
      literal().
 
2538
 
 
2539
- oracle
 
2540
    - The "owner" keyword on Table is now deprecated, and is
 
2541
      exactly synonymous with the "schema" keyword.  Tables can
 
2542
      now be reflected with alternate "owner" attributes,
 
2543
      explicitly stated on the Table object or not using
 
2544
      "schema".
 
2545
 
 
2546
    - All of the "magic" searching for synonyms, DBLINKs etc.
 
2547
      during table reflection are disabled by default unless you
 
2548
      specify "oracle_resolve_synonyms=True" on the Table
 
2549
      object.  Resolving synonyms necessarily leads to some
 
2550
      messy guessing which we'd rather leave off by default.
 
2551
      When the flag is set, tables and related tables will be
 
2552
      resolved against synonyms in all cases, meaning if a
 
2553
      synonym exists for a particular table, reflection will use
 
2554
      it when reflecting related tables.  This is stickier
 
2555
      behavior than before which is why it's off by default.
 
2556
 
 
2557
- declarative extension
 
2558
    - The "synonym" function is now directly usable with
 
2559
      "declarative".  Pass in the decorated property using the
 
2560
      "descriptor" keyword argument, e.g.: somekey =
 
2561
      synonym('_somekey', descriptor=property(g, s))
 
2562
 
 
2563
    - The "deferred" function is usable with "declarative".
 
2564
      Simplest usage is to declare deferred and Column together,
 
2565
      e.g.: data = deferred(Column(Text))
 
2566
 
 
2567
    - Declarative also gained @synonym_for(...) and
 
2568
      @comparable_using(...), front-ends for synonym and
 
2569
      comparable_property.
 
2570
 
 
2571
    - Improvements to mapper compilation when using declarative;
 
2572
      already-compiled mappers will still trigger compiles of
 
2573
      other uncompiled mappers when used [ticket:995]
 
2574
 
 
2575
    - Declarative will complete setup for Columns lacking names,
 
2576
      allows a more DRY syntax.
 
2577
 
 
2578
        class Foo(Base):
 
2579
            __tablename__ = 'foos'
 
2580
            id = Column(Integer, primary_key=True)
 
2581
 
 
2582
     - inheritance in declarative can be disabled when sending
 
2583
       "inherits=None" to __mapper_args__.
 
2584
 
 
2585
     - declarative_base() takes optional kwarg "mapper", which
 
2586
       is any callable/class/method that produces a mapper,
 
2587
       such as declarative_base(mapper=scopedsession.mapper).
 
2588
       This property can also be set on individual declarative
 
2589
       classes using the "__mapper_cls__" property.
 
2590
 
 
2591
- postgres
 
2592
    - Got PG server side cursors back into shape, added fixed
 
2593
      unit tests as part of the default test suite.  Added
 
2594
      better uniqueness to the cursor ID [ticket:1001]
 
2595
 
 
2596
- oracle
 
2597
    - The "owner" keyword on Table is now deprecated, and is
 
2598
      exactly synonymous with the "schema" keyword.  Tables can
 
2599
      now be reflected with alternate "owner" attributes,
 
2600
      explicitly stated on the Table object or not using
 
2601
      "schema".
 
2602
 
 
2603
    - All of the "magic" searching for synonyms, DBLINKs etc.
 
2604
      during table reflection are disabled by default unless you
 
2605
      specify "oracle_resolve_synonyms=True" on the Table
 
2606
      object.  Resolving synonyms necessarily leads to some
 
2607
      messy guessing which we'd rather leave off by default.
 
2608
      When the flag is set, tables and related tables will be
 
2609
      resolved against synonyms in all cases, meaning if a
 
2610
      synonym exists for a particular table, reflection will use
 
2611
      it when reflecting related tables.  This is stickier
 
2612
      behavior than before which is why it's off by default.
 
2613
 
 
2614
- mssql
 
2615
     - Reflected tables will now automatically load other tables
 
2616
       which are referenced by Foreign keys in the auto-loaded
 
2617
       table, [ticket:979].
 
2618
 
 
2619
     - Added executemany check to skip identity fetch, [ticket:916].
 
2620
 
 
2621
     - Added stubs for small date type, [ticket:884]
 
2622
 
 
2623
     - Added a new 'driver' keyword parameter for the pyodbc dialect.
 
2624
       Will substitute into the ODBC connection string if given,
 
2625
       defaults to 'SQL Server'.
 
2626
 
 
2627
     - Added a new 'max_identifier_length' keyword parameter for
 
2628
       the pyodbc dialect.
 
2629
 
 
2630
     - Improvements to pyodbc + Unix. If you couldn't get that
 
2631
       combination to work before, please try again.
 
2632
 
 
2633
- mysql
 
2634
     - The connection.info keys the dialect uses to cache server
 
2635
       settings have changed and are now namespaced.
 
2636
 
 
2637
0.4.4
 
2638
------
 
2639
- sql
 
2640
    - Can again create aliases of selects against textual FROM
 
2641
      clauses, [ticket:975]
 
2642
 
 
2643
    - The value of a bindparam() can be a callable, in which
 
2644
      case it's evaluated at statement execution time to get the
 
2645
      value.
 
2646
 
 
2647
    - Added exception wrapping/reconnect support to result set
 
2648
      fetching.  Reconnect works for those databases that raise
 
2649
      a catchable data error during results (i.e. doesn't work
 
2650
      on MySQL) [ticket:978]
 
2651
 
 
2652
    - Implemented two-phase API for "threadlocal" engine, via
 
2653
      engine.begin_twophase(), engine.prepare() [ticket:936]
 
2654
 
 
2655
    - Fixed bug which was preventing UNIONS from being
 
2656
      cloneable, [ticket:986]
 
2657
 
 
2658
    - Added "bind" keyword argument to insert(), update(),
 
2659
      delete() and DDL(). The .bind property is now assignable
 
2660
      on those statements as well as on select().
 
2661
 
 
2662
    - Insert statements can now be compiled with extra "prefix"
 
2663
      words between INSERT and INTO, for vendor extensions like
 
2664
      MySQL's INSERT IGNORE INTO table.
 
2665
 
 
2666
- orm
 
2667
    - any(), has(), contains(), ~contains(), attribute level ==
 
2668
      and != now work properly with self-referential relations -
 
2669
      the clause inside the EXISTS is aliased on the "remote"
 
2670
      side to distinguish it from the parent table.  This
 
2671
      applies to single table self-referential as well as
 
2672
      inheritance-based self-referential.
 
2673
 
 
2674
    - Repaired behavior of == and != operators at the relation()
 
2675
      level when compared against NULL for one-to-one relations
 
2676
      [ticket:985]
 
2677
 
 
2678
    - Fixed bug whereby session.expire() attributes were not
 
2679
      loading on an polymorphically-mapped instance mapped by a
 
2680
      select_table mapper.
 
2681
 
 
2682
    - Added query.with_polymorphic() - specifies a list of
 
2683
      classes which descend from the base class, which will be
 
2684
      added to the FROM clause of the query.  Allows subclasses
 
2685
      to be used within filter() criterion as well as eagerly
 
2686
      loads the attributes of those subclasses.
 
2687
 
 
2688
    - Your cries have been heard: removing a pending item from
 
2689
      an attribute or collection with delete-orphan expunges the
 
2690
      item from the session; no FlushError is raised.  Note that
 
2691
      if you session.save()'ed the pending item explicitly, the
 
2692
      attribute/collection removal still knocks it out.
 
2693
 
 
2694
    - session.refresh() and session.expire() raise an error when
 
2695
      called on instances which are not persistent within the
 
2696
      session
 
2697
 
 
2698
    - Fixed potential generative bug when the same Query was
 
2699
      used to generate multiple Query objects using join().
 
2700
 
 
2701
    - Fixed bug which was introduced in 0.4.3, whereby loading
 
2702
      an already-persistent instance mapped with joined table
 
2703
      inheritance would trigger a useless "secondary" load from
 
2704
      its joined table, when using the default "select"
 
2705
      polymorphic_fetch.  This was due to attributes being
 
2706
      marked as expired during its first load and not getting
 
2707
      unmarked from the previous "secondary" load.  Attributes
 
2708
      are now unexpired based on presence in __dict__ after any
 
2709
      load or commit operation succeeds.
 
2710
 
 
2711
    - Deprecated Query methods apply_sum(), apply_max(),
 
2712
      apply_min(), apply_avg().  Better methodologies are
 
2713
      coming....
 
2714
 
 
2715
    - relation() can accept a callable for its first argument,
 
2716
      which returns the class to be related.  This is in place
 
2717
      to assist declarative packages to define relations without
 
2718
      classes yet being in place.
 
2719
 
 
2720
    - Added a new "higher level" operator called "of_type()":
 
2721
      used in join() as well as with any() and has(), qualifies
 
2722
      the subclass which will be used in filter criterion, e.g.:
 
2723
 
 
2724
        query.filter(Company.employees.of_type(Engineer).
 
2725
          any(Engineer.name=='foo'))
 
2726
 
 
2727
        or
 
2728
 
 
2729
        query.join(Company.employees.of_type(Engineer)).
 
2730
          filter(Engineer.name=='foo')
 
2731
 
 
2732
    - Preventive code against a potential lost-reference bug in
 
2733
      flush().
 
2734
 
 
2735
    - Expressions used in filter(), filter_by() and others, when
 
2736
      they make usage of a clause generated from a relation
 
2737
      using the identity of a child object (e.g.,
 
2738
      filter(Parent.child==<somechild>)), evaluate the actual
 
2739
      primary key value of <somechild> at execution time so that
 
2740
      the autoflush step of the Query can complete, thereby
 
2741
      populating the PK value of <somechild> in the case that
 
2742
      <somechild> was pending.
 
2743
 
 
2744
    - setting the relation()-level order by to a column in the
 
2745
      many-to-many "secondary" table will now work with eager
 
2746
      loading, previously the "order by" wasn't aliased against
 
2747
      the secondary table's alias.
 
2748
 
 
2749
    - Synonyms riding on top of existing descriptors are now
 
2750
      full proxies to those descriptors.
 
2751
 
 
2752
- dialects
 
2753
    - Invalid SQLite connection URLs now raise an error.
 
2754
 
 
2755
    - postgres TIMESTAMP renders correctly [ticket:981]
 
2756
 
 
2757
    - postgres PGArray is a "mutable" type by default; when used
 
2758
      with the ORM, mutable-style equality/ copy-on-write
 
2759
      techniques are used to test for changes.
 
2760
 
 
2761
- extensions
 
2762
    - a new super-small "declarative" extension has been added,
 
2763
      which allows Table and mapper() configuration to take
 
2764
      place inline underneath a class declaration.  This
 
2765
      extension differs from ActiveMapper and Elixir in that it
 
2766
      does not redefine any SQLAlchemy semantics at all; literal
 
2767
      Column, Table and relation() constructs are used to define
 
2768
      the class behavior and table definition.
 
2769
 
 
2770
0.4.3
 
2771
------
 
2772
- sql
 
2773
    - Added "schema.DDL", an executable free-form DDL statement.
 
2774
      DDLs can be executed in isolation or attached to Table or
 
2775
      MetaData instances and executed automatically when those
 
2776
      objects are created and/or dropped.
 
2777
 
 
2778
    - Table columns and constraints can be overridden on a an
 
2779
      existing table (such as a table that was already reflected)
 
2780
      using the 'useexisting=True' flag, which now takes into
 
2781
      account the arguments passed along with it.
 
2782
 
 
2783
    - Added a callable-based DDL events interface, adds hooks
 
2784
      before and after Tables and MetaData create and drop.
 
2785
 
 
2786
    - Added generative where(<criterion>) method to delete() and
 
2787
      update() constructs which return a new object with criterion
 
2788
      joined to existing criterion via AND, just like
 
2789
      select().where().
 
2790
 
 
2791
    - Added "ilike()" operator to column operations.  Compiles to
 
2792
      ILIKE on postgres, lower(x) LIKE lower(y) on all
 
2793
      others. [ticket:727]
 
2794
 
 
2795
    - Added "now()" as a generic function; on SQLite, Oracle
 
2796
      and MSSQL compiles as "CURRENT_TIMESTAMP"; "now()" on
 
2797
      all others. [ticket:943]
 
2798
 
 
2799
    - The startswith(), endswith(), and contains() operators now
 
2800
      concatenate the wildcard operator with the given operand in
 
2801
      SQL, i.e. "'%' || <bindparam>" in all cases, accept
 
2802
      text('something') operands properly [ticket:962]
 
2803
 
 
2804
    - cast() accepts text('something') and other non-literal
 
2805
      operands properly [ticket:962]
 
2806
 
 
2807
    - fixed bug in result proxy where anonymously generated
 
2808
      column labels would not be accessible using their straight
 
2809
      string name
 
2810
 
 
2811
    - Deferrable constraints can now be defined.
 
2812
 
 
2813
    - Added "autocommit=True" keyword argument to select() and
 
2814
      text(), as well as generative autocommit() method on
 
2815
      select(); for statements which modify the database through
 
2816
      some user-defined means other than the usual INSERT/UPDATE/
 
2817
      DELETE etc.  This flag will enable "autocommit" behavior
 
2818
      during execution if no transaction is in progress.
 
2819
      [ticket:915]
 
2820
 
 
2821
    - The '.c.' attribute on a selectable now gets an entry for
 
2822
      every column expression in its columns clause.  Previously,
 
2823
      "unnamed" columns like functions and CASE statements weren't
 
2824
      getting put there.  Now they will, using their full string
 
2825
      representation if no 'name' is available.
 
2826
 
 
2827
    - a CompositeSelect, i.e. any union(), union_all(),
 
2828
      intersect(), etc. now asserts that each selectable contains
 
2829
      the same number of columns.  This conforms to the
 
2830
      corresponding SQL requirement.
 
2831
 
 
2832
    - The anonymous 'label' generated for otherwise unlabeled
 
2833
      functions and expressions now propagates outwards at compile
 
2834
      time for expressions like select([select([func.foo()])]).
 
2835
 
 
2836
    - Building on the above ideas, CompositeSelects now build up
 
2837
      their ".c." collection based on the names present in the
 
2838
      first selectable only; corresponding_column() now works
 
2839
      fully for all embedded selectables.
 
2840
 
 
2841
    - Oracle and others properly encode SQL used for defaults like
 
2842
      sequences, etc., even if no unicode idents are used since
 
2843
      identifier preparer may return a cached unicode identifier.
 
2844
 
 
2845
    - Column and clause comparisons to datetime objects on the
 
2846
      left hand side of the expression now work (d < table.c.col).
 
2847
      (datetimes on the RHS have always worked, the LHS exception
 
2848
      is a quirk of the datetime implementation.)
 
2849
 
 
2850
- orm
 
2851
    - Every Session.begin() must now be accompanied by a
 
2852
      corresponding commit() or rollback() unless the session is
 
2853
      closed with Session.close().  This also includes the begin()
 
2854
      which is implicit to a session created with
 
2855
      transactional=True.  The biggest change introduced here is
 
2856
      that when a Session created with transactional=True raises
 
2857
      an exception during flush(), you must call
 
2858
      Session.rollback() or Session.close() in order for that
 
2859
      Session to continue after an exception.
 
2860
 
 
2861
    - Fixed merge() collection-doubling bug when merging transient
 
2862
      entities with backref'ed collections.  [ticket:961]
 
2863
 
 
2864
    - merge(dont_load=True) does not accept transient entities,
 
2865
      this is in continuation with the fact that
 
2866
      merge(dont_load=True) does not accept any "dirty" objects
 
2867
      either.
 
2868
 
 
2869
    - Added standalone "query" class attribute generated by a
 
2870
      scoped_session.  This provides MyClass.query without using
 
2871
      Session.mapper.  Use via:
 
2872
 
 
2873
        MyClass.query = Session.query_property()
 
2874
 
 
2875
    - The proper error message is raised when trying to access
 
2876
      expired instance attributes with no session present
 
2877
 
 
2878
    - dynamic_loader() / lazy="dynamic" now accepts and uses
 
2879
      the order_by parameter in the same way in which it works
 
2880
      with relation().
 
2881
 
 
2882
    - Added expire_all() method to Session.  Calls expire() for
 
2883
      all persistent instances.  This is handy in conjunction
 
2884
      with...
 
2885
 
 
2886
    - Instances which have been partially or fully expired will
 
2887
      have their expired attributes populated during a regular
 
2888
      Query operation which affects those objects, preventing a
 
2889
      needless second SQL statement for each instance.
 
2890
 
 
2891
    - Dynamic relations, when referenced, create a strong
 
2892
      reference to the parent object so that the query still has a
 
2893
      parent to call against even if the parent is only created
 
2894
      (and otherwise dereferenced) within the scope of a single
 
2895
      expression. [ticket:938]
 
2896
 
 
2897
    - Added a mapper() flag "eager_defaults". When set to True,
 
2898
      defaults that are generated during an INSERT or UPDATE
 
2899
      operation are post-fetched immediately, instead of being
 
2900
      deferred until later.  This mimics the old 0.3 behavior.
 
2901
 
 
2902
    - query.join() can now accept class-mapped attributes as
 
2903
      arguments. These can be used in place or in any combination
 
2904
      with strings.  In particular this allows construction of
 
2905
      joins to subclasses on a polymorphic relation, i.e.:
 
2906
 
 
2907
        query(Company).join(['employees', Engineer.name])
 
2908
 
 
2909
    - query.join() can also accept tuples of attribute name/some
 
2910
      selectable as arguments.  This allows construction of joins
 
2911
      *from* subclasses of a polymorphic relation, i.e.:
 
2912
 
 
2913
        query(Company).\
 
2914
        join(
 
2915
          [('employees', people.join(engineer)), Engineer.name]
 
2916
        )
 
2917
 
 
2918
    - General improvements to the behavior of join() in
 
2919
      conjunction with polymorphic mappers, i.e. joining from/to
 
2920
      polymorphic mappers and properly applying aliases.
 
2921
 
 
2922
    - Fixed/improved behavior when a mapper determines the natural
 
2923
      "primary key" of a mapped join, it will more effectively
 
2924
      reduce columns which are equivalent via foreign key
 
2925
      relation.  This affects how many arguments need to be sent
 
2926
      to query.get(), among other things.  [ticket:933]
 
2927
 
 
2928
    - The lazy loader can now handle a join condition where the
 
2929
      "bound" column (i.e. the one that gets the parent id sent as
 
2930
      a bind parameter) appears more than once in the join
 
2931
      condition.  Specifically this allows the common task of a
 
2932
      relation() which contains a parent-correlated subquery, such
 
2933
      as "select only the most recent child item". [ticket:946]
 
2934
 
 
2935
    - Fixed bug in polymorphic inheritance where an incorrect
 
2936
      exception is raised when base polymorphic_on column does not
 
2937
      correspond to any columns within the local selectable of an
 
2938
      inheriting mapper more than one level deep
 
2939
 
 
2940
    - Fixed bug in polymorphic inheritance which made it difficult
 
2941
      to set a working "order_by" on a polymorphic mapper.
 
2942
 
 
2943
    - Fixed a rather expensive call in Query that was slowing down
 
2944
      polymorphic queries.
 
2945
 
 
2946
    - "Passive defaults" and other "inline" defaults can now be
 
2947
      loaded during a flush() call if needed; in particular, this
 
2948
      allows constructing relations() where a foreign key column
 
2949
      references a server-side-generated, non-primary-key
 
2950
      column. [ticket:954]
 
2951
 
 
2952
    - Additional Session transaction fixes/changes:
 
2953
        - Fixed bug with session transaction management: parent
 
2954
          transactions weren't started on the connection when
 
2955
          adding a connection to a nested transaction.
 
2956
 
 
2957
        - session.transaction now always refers to the innermost
 
2958
          active transaction, even when commit/rollback are called
 
2959
          directly on the session transaction object.
 
2960
 
 
2961
        - Two-phase transactions can now be prepared.
 
2962
 
 
2963
        - When preparing a two-phase transaction fails on one
 
2964
          connection, all the connections are rolled back.
 
2965
 
 
2966
        - session.close() didn't close all transactions when
 
2967
          nested transactions were used.
 
2968
 
 
2969
        - rollback() previously erroneously set the current
 
2970
          transaction directly to the parent of the transaction
 
2971
          that could be rolled back to. Now it rolls back the next
 
2972
          transaction up that can handle it, but sets the current
 
2973
          transaction to it's parent and inactivates the
 
2974
          transactions in between. Inactive transactions can only
 
2975
          be rolled back or closed, any other call results in an
 
2976
          error.
 
2977
 
 
2978
        - autoflush for commit() wasn't flushing for simple
 
2979
          subtransactions.
 
2980
 
 
2981
        - unitofwork flush didn't close the failed transaction
 
2982
          when the session was not in a transaction and commiting
 
2983
          the transaction failed.
 
2984
 
 
2985
    - Miscellaneous tickets: [ticket:940] [ticket:964]
 
2986
 
 
2987
- general
 
2988
    - Fixed a variety of hidden and some not-so-hidden
 
2989
      compatibility issues for Python 2.3, thanks to new support
 
2990
      for running the full test suite on 2.3.
 
2991
 
 
2992
    - Warnings are now issued as type exceptions.SAWarning.
 
2993
 
 
2994
- dialects
 
2995
    - Better support for schemas in SQLite (linked in by ATTACH
 
2996
      DATABASE ... AS name).  In some cases in the past, schema
 
2997
      names were ommitted from generated SQL for SQLite.  This is
 
2998
      no longer the case.
 
2999
 
 
3000
    - table_names on SQLite now picks up temporary tables as well.
 
3001
 
 
3002
    - Auto-detect an unspecified MySQL ANSI_QUOTES mode during
 
3003
      reflection operations, support for changing the mode
 
3004
      midstream.  Manual mode setting is still required if no
 
3005
      reflection is used.
 
3006
 
 
3007
    - Fixed reflection of TIME columns on SQLite.
 
3008
 
 
3009
    - Finally added PGMacAddr type to postgres [ticket:580]
 
3010
 
 
3011
    - Reflect the sequence associated to a PK field (typically
 
3012
      with a BEFORE INSERT trigger) under Firebird
 
3013
 
 
3014
    - Oracle assembles the correct columns in the result set
 
3015
      column mapping when generating a LIMIT/OFFSET subquery,
 
3016
      allows columns to map properly to result sets even if
 
3017
      long-name truncation kicks in [ticket:941]
 
3018
 
 
3019
    - MSSQL now includes EXEC in the _is_select regexp, which
 
3020
      should allow row-returning stored procedures to be used.
 
3021
 
 
3022
    - MSSQL now includes an experimental implementation of
 
3023
      LIMIT/OFFSET using the ANSI SQL row_number() function, so it
 
3024
      requires MSSQL-2005 or higher. To enable the feature, add
 
3025
      "has_window_funcs" to the keyword arguments for connect, or
 
3026
      add "?has_window_funcs=1" to your dburi query arguments.
 
3027
 
 
3028
- ext
 
3029
    - Changed ext.activemapper to use a non-transactional session
 
3030
      for the objectstore.
 
3031
 
 
3032
    - Fixed output order of "['a'] + obj.proxied" binary operation
 
3033
      on association-proxied lists.
 
3034
 
 
3035
0.4.2p3
 
3036
------
 
3037
- general
 
3038
    - sub version numbering scheme changed to suite
 
3039
      setuptools version number rules; easy_install -u
 
3040
      should now get this version over 0.4.2.
 
3041
 
 
3042
- sql
 
3043
    - Text type is properly exported now and does not
 
3044
      raise a warning on DDL create; String types with no
 
3045
      length only raise warnings during CREATE TABLE
 
3046
      [ticket:912]
 
3047
 
 
3048
    - new UnicodeText type is added, to specify an
 
3049
      encoded, unlengthed Text type
 
3050
 
 
3051
    - fixed bug in union() so that select() statements
 
3052
      which don't derive from FromClause objects can be
 
3053
      unioned
 
3054
 
 
3055
- orm
 
3056
    - fixed bug with session.dirty when using "mutable
 
3057
      scalars" (such as PickleTypes)
 
3058
 
 
3059
    - added a more descriptive error message when flushing
 
3060
      on a relation() that has non-locally-mapped columns
 
3061
      in its primary or secondary join condition
 
3062
 
 
3063
- dialects
 
3064
    - Fixed reflection of mysql empty string column
 
3065
      defaults.
 
3066
 
 
3067
0.4.2b  (0.4.2p2)
 
3068
------
 
3069
- sql
 
3070
    - changed name of TEXT to Text since its a "generic"
 
3071
      type; TEXT name is deprecated until 0.5. The
 
3072
      "upgrading" behavior of String to Text when no
 
3073
      length is present is also deprecated until 0.5; will
 
3074
      issue a warning when used for CREATE TABLE
 
3075
      statements (String with no length for SQL expression
 
3076
      purposes is still fine) [ticket:912]
 
3077
 
 
3078
    - generative select.order_by(None) / group_by(None)
 
3079
      was not managing to reset order by/group by
 
3080
      criterion, fixed [ticket:924]
 
3081
 
 
3082
- orm
 
3083
    - suppressing *all* errors in
 
3084
      InstanceState.__cleanup() now.
 
3085
 
 
3086
    - fixed an attribute history bug whereby assigning a
 
3087
      new collection to a collection-based attribute which
 
3088
      already had pending changes would generate incorrect
 
3089
      history [ticket:922]
 
3090
 
 
3091
    - fixed delete-orphan cascade bug whereby setting the
 
3092
      same object twice to a scalar attribute could log it
 
3093
      as an orphan [ticket:925]
 
3094
 
 
3095
    - Fixed cascades on a += assignment to a list-based
 
3096
      relation.
 
3097
 
 
3098
    - synonyms can now be created against props that don't
 
3099
      exist yet, which are later added via add_property().
 
3100
      This commonly includes backrefs. (i.e. you can make
 
3101
      synonyms for backrefs without worrying about the
 
3102
      order of operations) [ticket:919]
 
3103
 
 
3104
    - fixed bug which could occur with polymorphic "union"
 
3105
      mapper which falls back to "deferred" loading of
 
3106
      inheriting tables
 
3107
 
 
3108
    - the "columns" collection on a mapper/mapped class
 
3109
      (i.e. 'c') is against the mapped table, not the
 
3110
      select_table in the case of polymorphic "union"
 
3111
      loading (this shouldn't be noticeable).
 
3112
 
 
3113
- ext
 
3114
    - '+', '*', '+=' and '*=' support for association
 
3115
      proxied lists.
 
3116
 
 
3117
- dialects
 
3118
    - mssql - narrowed down the test for "date"/"datetime"
 
3119
      in MSDate/ MSDateTime subclasses so that incoming
 
3120
      "datetime" objects don't get mis-interpreted as
 
3121
      "date" objects and vice versa, [ticket:923]
 
3122
 
 
3123
0.4.2a   (0.4.2p1)
 
3124
------
 
3125
 
 
3126
- orm
 
3127
    - fixed fairly critical bug whereby the same instance could be listed
 
3128
      more than once in the unitofwork.new collection; most typically
 
3129
      reproduced when using a combination of inheriting mappers and
 
3130
      ScopedSession.mapper, as the multiple __init__ calls per instance
 
3131
      could save() the object with distinct _state objects
 
3132
 
 
3133
    - added very rudimentary yielding iterator behavior to Query.  Call
 
3134
      query.yield_per(<number of rows>) and evaluate the Query in an
 
3135
      iterative context; every collection of N rows will be packaged up
 
3136
      and yielded.  Use this method with extreme caution since it does
 
3137
      not attempt to reconcile eagerly loaded collections across
 
3138
      result batch boundaries, nor will it behave nicely if the same
 
3139
      instance occurs in more than one batch.  This means that an eagerly
 
3140
      loaded collection will get cleared out if it's referenced in more than
 
3141
      one batch, and in all cases attributes will be overwritten on instances
 
3142
      that occur in more than one batch.
 
3143
 
 
3144
   - Fixed in-place set mutation operators for set collections and association
 
3145
     proxied sets. [ticket:920]
 
3146
 
 
3147
- dialects
 
3148
    - Fixed the missing call to subtype result processor for the PGArray
 
3149
      type. [ticket:913]
 
3150
 
 
3151
0.4.2
 
3152
-----
 
3153
- sql
 
3154
    - generic functions ! we introduce a database of known SQL functions, such
 
3155
      as current_timestamp, coalesce, and create explicit function objects
 
3156
      representing them. These objects have constrained argument lists, are
 
3157
      type aware, and can compile in a dialect-specific fashion. So saying
 
3158
      func.char_length("foo", "bar") raises an error (too many args),
 
3159
      func.coalesce(datetime.date(2007, 10, 5), datetime.date(2005, 10, 15))
 
3160
      knows that its return type is a Date. We only have a few functions
 
3161
      represented so far but will continue to add to the system [ticket:615]
 
3162
 
 
3163
    - auto-reconnect support improved; a Connection can now automatically
 
3164
      reconnect after its underlying connection is invalidated, without
 
3165
      needing to connect() again from the engine.  This allows an ORM session
 
3166
      bound to a single Connection to not need a reconnect.
 
3167
      Open transactions on the Connection must be rolled back after an invalidation
 
3168
      of the underlying connection else an error is raised.  Also fixed
 
3169
      bug where disconnect detect was not being called for cursor(), rollback(),
 
3170
      or commit().
 
3171
 
 
3172
    - added new flag to String and create_engine(),
 
3173
      assert_unicode=(True|False|'warn'|None). Defaults to `False` or `None` on
 
3174
      create_engine() and String, `'warn'` on the Unicode type. When `True`,
 
3175
      results in all unicode conversion operations raising an exception when a
 
3176
      non-unicode bytestring is passed as a bind parameter. 'warn' results
 
3177
      in a warning. It is strongly advised that all unicode-aware applications
 
3178
      make proper use of Python unicode objects (i.e. u'hello' and not 'hello')
 
3179
      so that data round trips accurately.
 
3180
 
 
3181
    - generation of "unique" bind parameters has been simplified to use the same
 
3182
      "unique identifier" mechanisms as everything else.  This doesn't affect
 
3183
      user code, except any code that might have been hardcoded against the generated
 
3184
      names.  Generated bind params now have the form "<paramname>_<num>",
 
3185
      whereas before only the second bind of the same name would have this form.
 
3186
 
 
3187
    - select().as_scalar() will raise an exception if the select does not have
 
3188
      exactly one expression in its columns clause.
 
3189
 
 
3190
    - bindparam() objects themselves can be used as keys for execute(), i.e.
 
3191
      statement.execute({bind1:'foo', bind2:'bar'})
 
3192
 
 
3193
    - added new methods to TypeDecorator, process_bind_param() and
 
3194
      process_result_value(), which automatically take advantage of the processing
 
3195
      of the underlying type.  Ideal for using with Unicode or Pickletype.
 
3196
      TypeDecorator should now be the primary way to augment the behavior of any
 
3197
      existing type including other TypeDecorator subclasses such as PickleType.
 
3198
 
 
3199
    - selectables (and others) will issue a warning when two columns in
 
3200
      their exported columns collection conflict based on name.
 
3201
 
 
3202
    - tables with schemas can still be used in sqlite, firebird,
 
3203
      schema name just gets dropped [ticket:890]
 
3204
 
 
3205
    - changed the various "literal" generation functions to use an anonymous
 
3206
      bind parameter.  not much changes here except their labels now look
 
3207
      like ":param_1", ":param_2" instead of ":literal"
 
3208
 
 
3209
    - column labels in the form "tablename.columname", i.e. with a dot, are now
 
3210
      supported.
 
3211
 
 
3212
    - from_obj keyword argument to select() can be a scalar or a list.
 
3213
 
 
3214
- orm
 
3215
   - a major behavioral change to collection-based backrefs: they no
 
3216
     longer trigger lazy loads !  "reverse" adds and removes
 
3217
     are queued up and are merged with the collection when it is
 
3218
     actually read from and loaded; but do not trigger a load beforehand.
 
3219
     For users who have noticed this behavior, this should be much more
 
3220
     convenient than using dynamic relations in some cases; for those who
 
3221
     have not, you might notice your apps using a lot fewer queries than
 
3222
     before in some situations. [ticket:871]
 
3223
 
 
3224
   - mutable primary key support is added. primary key columns can be
 
3225
     changed freely, and the identity of the instance will change upon
 
3226
     flush. In addition, update cascades of foreign key referents (primary
 
3227
     key or not) along relations are supported, either in tandem with the
 
3228
     database's ON UPDATE CASCADE (required for DB's like Postgres) or
 
3229
     issued directly by the ORM in the form of UPDATE statements, by setting
 
3230
     the flag "passive_cascades=False".
 
3231
 
 
3232
   - inheriting mappers now inherit the MapperExtensions of their parent
 
3233
     mapper directly, so that all methods for a particular MapperExtension
 
3234
     are called for subclasses as well.  As always, any MapperExtension
 
3235
     can return either EXT_CONTINUE to continue extension processing
 
3236
     or EXT_STOP to stop processing.  The order of mapper resolution is:
 
3237
     <extensions declared on the classes mapper> <extensions declared on the
 
3238
     classes' parent mapper> <globally declared extensions>.
 
3239
 
 
3240
     Note that if you instantiate the same extension class separately
 
3241
     and then apply it individually for two mappers in the same inheritance
 
3242
     chain, the extension will be applied twice to the inheriting class,
 
3243
     and each method will be called twice.
 
3244
 
 
3245
     To apply a mapper extension explicitly to each inheriting class but
 
3246
     have each method called only once per operation, use the same
 
3247
     instance of the extension for both mappers.
 
3248
     [ticket:490]
 
3249
 
 
3250
   - MapperExtension.before_update() and after_update() are now called
 
3251
     symmetrically; previously, an instance that had no modified column
 
3252
     attributes (but had a relation() modification) could be called with
 
3253
     before_update() but not after_update() [ticket:907]
 
3254
 
 
3255
   - columns which are missing from a Query's select statement
 
3256
     now get automatically deferred during load.
 
3257
 
 
3258
   - mapped classes which extend "object" and do not provide an
 
3259
     __init__() method will now raise TypeError if non-empty *args
 
3260
     or **kwargs are present at instance construction time (and are
 
3261
     not consumed by any extensions such as the scoped_session mapper),
 
3262
     consistent with the behavior of normal Python classes [ticket:908]
 
3263
 
 
3264
   - fixed Query bug when filter_by() compares a relation against None
 
3265
     [ticket:899]
 
3266
 
 
3267
   - improved support for pickling of mapped entities.  Per-instance
 
3268
     lazy/deferred/expired callables are now serializable so that
 
3269
     they serialize and deserialize with _state.
 
3270
 
 
3271
   - new synonym() behavior: an attribute will be placed on the mapped
 
3272
     class, if one does not exist already, in all cases. if a property
 
3273
     already exists on the class, the synonym will decorate the property
 
3274
     with the appropriate comparison operators so that it can be used in in
 
3275
     column expressions just like any other mapped attribute (i.e. usable in
 
3276
     filter(), etc.) the "proxy=True" flag is deprecated and no longer means
 
3277
     anything. Additionally, the flag "map_column=True" will automatically
 
3278
     generate a ColumnProperty corresponding to the name of the synonym,
 
3279
     i.e.: 'somename':synonym('_somename', map_column=True) will map the
 
3280
     column named 'somename' to the attribute '_somename'. See the example
 
3281
     in the mapper docs. [ticket:801]
 
3282
 
 
3283
   - Query.select_from() now replaces all existing FROM criterion with
 
3284
     the given argument; the previous behavior of constructing a list
 
3285
     of FROM clauses was generally not useful as is required
 
3286
     filter() calls to create join criterion, and new tables introduced
 
3287
     within filter() already add themselves to the FROM clause.  The
 
3288
     new behavior allows not just joins from the main table, but select
 
3289
     statements as well.  Filter criterion, order bys, eager load
 
3290
     clauses will be "aliased" against the given statement.
 
3291
 
 
3292
   - this month's refactoring of attribute instrumentation changes
 
3293
     the "copy-on-load" behavior we've had since midway through 0.3
 
3294
     with "copy-on-modify" in most cases.  This takes a sizable chunk
 
3295
     of latency out of load operations and overall does less work
 
3296
     as only attributes which are actually modified get their
 
3297
     "committed state" copied.  Only "mutable scalar" attributes
 
3298
     (i.e. a pickled object or other mutable item), the reason for
 
3299
     the copy-on-load change in the first place, retain the old
 
3300
     behavior.
 
3301
 
 
3302
   - a slight behavioral change to attributes is, del'ing an attribute
 
3303
     does *not* cause the lazyloader of that attribute to fire off again;
 
3304
     the "del" makes the effective value of the attribute "None".  To
 
3305
     re-trigger the "loader" for an attribute, use
 
3306
     session.expire(instance, [attrname]).
 
3307
 
 
3308
   - query.filter(SomeClass.somechild == None), when comparing
 
3309
     a many-to-one property to None, properly generates "id IS NULL"
 
3310
     including that the NULL is on the right side.
 
3311
 
 
3312
   - query.order_by() takes into account aliased joins, i.e.
 
3313
     query.join('orders', aliased=True).order_by(Order.id)
 
3314
 
 
3315
   - eagerload(), lazyload(), eagerload_all() take an optional
 
3316
     second class-or-mapper argument, which will select the mapper
 
3317
     to apply the option towards.  This can select among other
 
3318
     mappers which were added using add_entity().
 
3319
 
 
3320
   - eagerloading will work with mappers added via add_entity().
 
3321
 
 
3322
   - added "cascade delete" behavior to "dynamic" relations just like
 
3323
     that of regular relations.  if passive_deletes flag (also just added)
 
3324
     is not set, a delete of the parent item will trigger a full load of
 
3325
     the child items so that they can be deleted or updated accordingly.
 
3326
 
 
3327
   - also with dynamic, implemented correct count() behavior as well
 
3328
     as other helper methods.
 
3329
 
 
3330
   - fix to cascades on polymorphic relations, such that cascades
 
3331
     from an object to a polymorphic collection continue cascading
 
3332
     along the set of attributes specific to each element in the collection.
 
3333
 
 
3334
   - query.get() and query.load() do not take existing filter or other
 
3335
     criterion into account; these methods *always* look up the given id
 
3336
     in the database or return the current instance from the identity map,
 
3337
     disregarding any existing filter, join, group_by or other criterion
 
3338
     which has been configured. [ticket:893]
 
3339
 
 
3340
   - added support for version_id_col in conjunction with inheriting mappers.
 
3341
     version_id_col is typically set on the base mapper in an inheritance
 
3342
     relationship where it takes effect for all inheriting mappers.
 
3343
     [ticket:883]
 
3344
 
 
3345
   - relaxed rules on column_property() expressions having labels; any
 
3346
     ColumnElement is accepted now, as the compiler auto-labels non-labeled
 
3347
     ColumnElements now.  a selectable, like a select() statement, still
 
3348
     requires conversion to ColumnElement via as_scalar() or label().
 
3349
 
 
3350
   - fixed backref bug where you could not del instance.attr if attr
 
3351
     was None
 
3352
 
 
3353
   - several ORM attributes have been removed or made private:
 
3354
     mapper.get_attr_by_column(), mapper.set_attr_by_column(),
 
3355
     mapper.pks_by_table, mapper.cascade_callable(),
 
3356
     MapperProperty.cascade_callable(), mapper.canload(),
 
3357
     mapper.save_obj(), mapper.delete_obj(), mapper._mapper_registry,
 
3358
     attributes.AttributeManager
 
3359
 
 
3360
   - Assigning an incompatible collection type to a relation attribute now
 
3361
     raises TypeError instead of sqlalchemy's ArgumentError.
 
3362
 
 
3363
   - Bulk assignment of a MappedCollection now raises an error if a key in the
 
3364
     incoming dictionary does not match the key that the collection's keyfunc
 
3365
     would use for that value. [ticket:886]
 
3366
 
 
3367
   - Custom collections can now specify a @converter method to translate
 
3368
     objects used in "bulk" assignment into a stream of values, as in::
 
3369
 
 
3370
        obj.col = [newval1, newval2]
 
3371
        # or
 
3372
        obj.dictcol = {'foo': newval1, 'bar': newval2}
 
3373
 
 
3374
     The MappedCollection uses this hook to ensure that incoming key/value
 
3375
     pairs are sane from the collection's perspective.
 
3376
 
 
3377
   - fixed endless loop issue when using lazy="dynamic" on both
 
3378
     sides of a bi-directional relationship [ticket:872]
 
3379
 
 
3380
   - more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,
 
3381
     in this case when mapped against a select statement [ticket:904]
 
3382
 
 
3383
   - fix to self-referential eager loading such that if the same mapped
 
3384
     instance appears in two or more distinct sets of columns in the same
 
3385
     result set, its eagerly loaded collection will be populated regardless
 
3386
     of whether or not all of the rows contain a set of "eager" columns for
 
3387
     that collection.  this would also show up as a KeyError when fetching
 
3388
     results with join_depth turned on.
 
3389
 
 
3390
   - fixed bug where Query would not apply a subquery to the SQL when LIMIT
 
3391
     was used in conjunction with an inheriting mapper where the eager
 
3392
     loader was only in the parent mapper.
 
3393
 
 
3394
   - clarified the error message which occurs when you try to update()
 
3395
     an instance with the same identity key as an instance already present
 
3396
     in the session.
 
3397
 
 
3398
   - some clarifications and fixes to merge(instance, dont_load=True).
 
3399
     fixed bug where lazy loaders were getting disabled on returned instances.
 
3400
     Also, we currently do not support merging an instance which has uncommitted
 
3401
     changes on it, in the case that dont_load=True is used....this will
 
3402
     now raise an error.  This is due to complexities in merging the
 
3403
     "committed state" of the given instance to correctly correspond to the
 
3404
     newly copied instance, as well as other modified state.
 
3405
     Since the use case for dont_load=True is caching, the given instances
 
3406
     shouldn't have any uncommitted changes on them anyway.
 
3407
     We also copy the instances over without using any events now, so that
 
3408
     the 'dirty' list on the new session remains unaffected.
 
3409
 
 
3410
   - fixed bug which could arise when using session.begin_nested() in conjunction
 
3411
     with more than one level deep of enclosing session.begin() statements
 
3412
 
 
3413
   - fixed session.refresh() with instance that has custom entity_name
 
3414
     [ticket:914]
 
3415
 
 
3416
- dialects
 
3417
 
 
3418
   - sqlite SLDate type will not erroneously render "microseconds" portion
 
3419
     of a datetime or time object.
 
3420
 
 
3421
   - oracle
 
3422
      - added disconnect detection support for Oracle
 
3423
      - some cleanup to binary/raw types so that cx_oracle.LOB is detected
 
3424
        on an ad-hoc basis [ticket:902]
 
3425
 
 
3426
   - MSSQL
 
3427
      - PyODBC no longer has a global "set nocount on".
 
3428
      - Fix non-identity integer PKs on autload [ticket:824]
 
3429
      - Better support for convert_unicode [ticket:839]
 
3430
      - Less strict date conversion for pyodbc/adodbapi [ticket:842]
 
3431
      - Schema-qualified tables / autoload [ticket:901]
 
3432
 
 
3433
   - Firebird backend
 
3434
 
 
3435
     - does properly reflect domains (partially fixing [ticket:410]) and
 
3436
       PassiveDefaults
 
3437
 
 
3438
     - reverted to use default poolclass (was set to SingletonThreadPool in
 
3439
       0.4.0 [3562] for test purposes)
 
3440
 
 
3441
     - map func.length() to 'char_length' (easily overridable with the UDF
 
3442
       'strlen' on old versions of Firebird)
 
3443
 
 
3444
 
 
3445
0.4.1
 
3446
-----
 
3447
 
 
3448
- sql
 
3449
 
 
3450
  - the "shortname" keyword parameter on bindparam() has been
 
3451
    deprecated.
 
3452
 
 
3453
  - Added contains operator (generates a "LIKE %<other>%" clause).
 
3454
 
 
3455
  - anonymous column expressions are automatically labeled.
 
3456
    e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1".
 
3457
    This allows the labelname to be present in the cursor.description
 
3458
    which can then be appropriately matched to result-column processing
 
3459
    rules. (we can't reliably use positional tracking for result-column
 
3460
    matches since text() expressions may represent multiple columns).
 
3461
 
 
3462
  - operator overloading is now controlled by TypeEngine objects - the
 
3463
    one built-in operator overload so far is String types overloading
 
3464
    '+' to be the string concatenation operator.
 
3465
    User-defined types can also define their own operator overloading
 
3466
    by overriding the adapt_operator(self, op) method.
 
3467
 
 
3468
  - untyped bind parameters on the right side of a binary expression
 
3469
    will be assigned the type of the left side of the operation, to better
 
3470
    enable the appropriate bind parameter processing to take effect
 
3471
    [ticket:819]
 
3472
 
 
3473
  - Removed regular expression step from most statement compilations.
 
3474
    Also fixes [ticket:833]
 
3475
 
 
3476
  - Fixed empty (zero column) sqlite inserts, allowing inserts on
 
3477
    autoincrementing single column tables.
 
3478
 
 
3479
  - Fixed expression translation of text() clauses; this repairs various
 
3480
    ORM scenarios where literal text is used for SQL expressions
 
3481
 
 
3482
  - Removed ClauseParameters object; compiled.params returns a regular
 
3483
    dictionary now, as well as result.last_inserted_params() /
 
3484
    last_updated_params().
 
3485
 
 
3486
  - Fixed INSERT statements w.r.t. primary key columns that have
 
3487
    SQL-expression based default generators on them; SQL expression
 
3488
    executes inline as normal but will not trigger a "postfetch" condition
 
3489
    for the column, for those DB's who provide it via cursor.lastrowid
 
3490
 
 
3491
  - func. objects can be pickled/unpickled [ticket:844]
 
3492
 
 
3493
  - rewrote and simplified the system used to "target" columns across
 
3494
    selectable expressions.  On the SQL side this is represented by the
 
3495
    "corresponding_column()" method. This method is used heavily by the ORM
 
3496
    to "adapt" elements of an expression to similar, aliased expressions,
 
3497
    as well as to target result set columns originally bound to a
 
3498
    table or selectable to an aliased, "corresponding" expression.  The new
 
3499
    rewrite features completely consistent and accurate behavior.
 
3500
 
 
3501
  - Added a field ("info") for storing arbitrary data on schema items
 
3502
    [ticket:573]
 
3503
 
 
3504
  - The "properties" collection on Connections has been renamed "info" to
 
3505
    match schema's writable collections.  Access is still available via
 
3506
    the "properties" name until 0.5.
 
3507
 
 
3508
  - fixed the close() method on Transaction when using strategy='threadlocal'
 
3509
 
 
3510
  - fix to compiled bind parameters to not mistakenly populate None
 
3511
    [ticket:853]
 
3512
 
 
3513
  - <Engine|Connection>._execute_clauseelement becomes a public method
 
3514
    Connectable.execute_clauseelement
 
3515
 
 
3516
- orm
 
3517
  - eager loading with LIMIT/OFFSET applied no longer adds the primary
 
3518
    table joined to a limited subquery of itself; the eager loads now
 
3519
    join directly to the subquery which also provides the primary table's
 
3520
    columns to the result set.  This eliminates a JOIN from all eager loads
 
3521
    with LIMIT/OFFSET.  [ticket:843]
 
3522
 
 
3523
  - session.refresh() and session.expire() now support an additional argument
 
3524
    "attribute_names", a list of individual attribute keynames to be refreshed
 
3525
    or expired, allowing partial reloads of attributes on an already-loaded
 
3526
    instance. [ticket:802]
 
3527
 
 
3528
  - added op() operator to instrumented attributes; i.e.
 
3529
    User.name.op('ilike')('%somename%') [ticket:767]
 
3530
 
 
3531
  - Mapped classes may now define __eq__, __hash__, and __nonzero__ methods
 
3532
    with arbitrary semantics.  The orm now handles all mapped instances on
 
3533
    an identity-only basis. (e.g. 'is' vs '==') [ticket:676]
 
3534
 
 
3535
  - the "properties" accessor on Mapper is removed; it now throws an informative
 
3536
    exception explaining the usage of mapper.get_property() and
 
3537
    mapper.iterate_properties
 
3538
 
 
3539
  - added having() method to Query, applies HAVING to the generated statement
 
3540
    in the same way as filter() appends to the WHERE clause.
 
3541
 
 
3542
  - The behavior of query.options() is now fully based on paths, i.e. an
 
3543
    option such as eagerload_all('x.y.z.y.x') will apply eagerloading to
 
3544
    only those paths, i.e. and not 'x.y.x'; eagerload('children.children')
 
3545
    applies only to exactly two-levels deep, etc. [ticket:777]
 
3546
 
 
3547
  - PickleType will compare using `==` when set up with mutable=False,
 
3548
    and not the `is` operator.  To use `is` or any other comparator, send
 
3549
    in a custom comparison function using PickleType(comparator=my_custom_comparator).
 
3550
 
 
3551
  - query doesn't throw an error if you use distinct() and an order_by()
 
3552
    containing UnaryExpressions (or other) together [ticket:848]
 
3553
 
 
3554
  - order_by() expressions from joined tables are properly added to columns
 
3555
    clause when using distinct() [ticket:786]
 
3556
 
 
3557
  - fixed error where Query.add_column() would not accept a class-bound
 
3558
    attribute as an argument; Query also raises an error if an invalid
 
3559
    argument was sent to add_column() (at instances() time) [ticket:858]
 
3560
 
 
3561
  - added a little more checking for garbage-collection dereferences in
 
3562
    InstanceState.__cleanup() to reduce "gc ignored" errors on app
 
3563
    shutdown
 
3564
 
 
3565
  - The session API has been solidified:
 
3566
 
 
3567
    - It's an error to session.save() an object which is already
 
3568
      persistent [ticket:840]
 
3569
 
 
3570
    - It's an error to session.delete() an object which is *not*
 
3571
      persistent.
 
3572
 
 
3573
    - session.update() and session.delete() raise an error when updating
 
3574
      or deleting an instance that is already in the session with a
 
3575
      different identity.
 
3576
 
 
3577
    - The session checks more carefully when determining "object X already
 
3578
      in another session"; e.g. if you pickle a series of objects and
 
3579
      unpickle (i.e. as in a Pylons HTTP session or similar), they can go
 
3580
      into a new session without any conflict
 
3581
 
 
3582
    - merge() includes a keyword argument "dont_load=True".  setting this
 
3583
      flag will cause the merge operation to not load any data from the
 
3584
      database in response to incoming detached objects, and will accept
 
3585
      the incoming detached object as though it were already present in
 
3586
      that session.  Use this to merge detached objects from external
 
3587
      caching systems into the session.
 
3588
 
 
3589
  - Deferred column attributes no longer trigger a load operation when the
 
3590
    attribute is assigned to.  In those cases, the newly assigned value
 
3591
    will be present in the flushes' UPDATE statement unconditionally.
 
3592
 
 
3593
  - Fixed a truncation error when re-assigning a subset of a collection
 
3594
    (obj.relation = obj.relation[1:]) [ticket:834]
 
3595
 
 
3596
  - De-cruftified backref configuration code, backrefs which step on
 
3597
    existing properties now raise an error [ticket:832]
 
3598
 
 
3599
  - Improved behavior of add_property() etc., fixed [ticket:831] involving
 
3600
    synonym/deferred.
 
3601
 
 
3602
  - Fixed clear_mappers() behavior to better clean up after itself.
 
3603
 
 
3604
  - Fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined
 
3605
    into a single UPDATE; many-to-many relations on the parent object
 
3606
    update properly.  [ticket:841]
 
3607
 
 
3608
  - Fixed __hash__ for association proxy- these collections are unhashable,
 
3609
    just like their mutable Python counterparts.
 
3610
 
 
3611
  - Added proxying of save_or_update, __contains__ and __iter__ methods for
 
3612
    scoped sessions.
 
3613
 
 
3614
  - fixed very hard-to-reproduce issue where by the FROM clause of Query
 
3615
    could get polluted by certain generative calls [ticket:852]
 
3616
 
 
3617
- dialects
 
3618
 
 
3619
  - Added experimental support for MaxDB (versions >= 7.6.03.007 only).
 
3620
 
 
3621
  - oracle will now reflect "DATE" as an OracleDateTime column, not
 
3622
    OracleDate
 
3623
 
 
3624
  - added awareness of schema name in oracle table_names() function,
 
3625
    fixes metadata.reflect(schema='someschema') [ticket:847]
 
3626
 
 
3627
  - MSSQL anonymous labels for selection of functions made deterministic
 
3628
 
 
3629
  - sqlite will reflect "DECIMAL" as a numeric column.
 
3630
 
 
3631
  - Made access dao detection more reliable [ticket:828]
 
3632
 
 
3633
  - Renamed the Dialect attribute 'preexecute_sequences' to
 
3634
    'preexecute_pk_sequences'.  An attribute porxy is in place for
 
3635
    out-of-tree dialects using the old name.
 
3636
 
 
3637
  - Added test coverage for unknown type reflection. Fixed sqlite/mysql
 
3638
    handling of type reflection for unknown types.
 
3639
 
 
3640
  - Added REAL for mysql dialect (for folks exploiting the
 
3641
    REAL_AS_FLOAT sql mode).
 
3642
 
 
3643
  - mysql Float, MSFloat and MSDouble constructed without arguments
 
3644
    now produce no-argument DDL, e.g.'FLOAT'.
 
3645
 
 
3646
- misc
 
3647
 
 
3648
  - Removed unused util.hash().
 
3649
 
 
3650
 
 
3651
0.4.0
 
3652
-----
 
3653
 
 
3654
- (see 0.4.0beta1 for the start of major changes against 0.3,
 
3655
  as well as http://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 )
 
3656
 
 
3657
- Added initial Sybase support (mxODBC so far) [ticket:785]
 
3658
 
 
3659
- Added partial index support for PostgreSQL. Use the postgres_where keyword
 
3660
  on the Index.
 
3661
 
 
3662
- string-based query param parsing/config file parser understands
 
3663
  wider range of string values for booleans [ticket:817]
 
3664
 
 
3665
- backref remove object operation doesn't fail if the other-side
 
3666
  collection doesn't contain the item, supports noload collections
 
3667
  [ticket:813]
 
3668
 
 
3669
- removed __len__ from "dynamic" collection as it would require issuing
 
3670
  a SQL "count()" operation, thus forcing all list evaluations to issue
 
3671
  redundant SQL [ticket:818]
 
3672
 
 
3673
- inline optimizations added to locate_dirty() which can greatly speed up
 
3674
  repeated calls to flush(), as occurs with autoflush=True [ticket:816]
 
3675
 
 
3676
- The IdentifierPreprarer's _requires_quotes test is now regex based.  Any
 
3677
  out-of-tree dialects that provide custom sets of legal_characters or
 
3678
  illegal_initial_characters will need to move to regexes or override
 
3679
  _requires_quotes.
 
3680
 
 
3681
- Firebird has supports_sane_rowcount and supports_sane_multi_rowcount set
 
3682
  to False due to ticket #370 (right way).
 
3683
 
 
3684
- Improvements and fixes on Firebird reflection:
 
3685
  . FBDialect now mimics OracleDialect, regarding case-sensitivity of TABLE and
 
3686
    COLUMN names (see 'case_sensitive remotion' topic on this current file).
 
3687
  . FBDialect.table_names() doesn't bring system tables (ticket:796).
 
3688
  . FB now reflects Column's nullable property correctly.
 
3689
 
 
3690
- Fixed SQL compiler's awareness of top-level column labels as used
 
3691
  in result-set processing; nested selects which contain the same column
 
3692
  names don't affect the result or conflict with result-column metadata.
 
3693
 
 
3694
- query.get() and related functions (like many-to-one lazyloading)
 
3695
  use compile-time-aliased bind parameter names, to prevent
 
3696
  name conflicts with bind parameters that already exist in the
 
3697
  mapped selectable.
 
3698
 
 
3699
- Fixed three- and multi-level select and deferred inheritance loading
 
3700
  (i.e. abc inheritance with no select_table), [ticket:795]
 
3701
 
 
3702
- Ident passed to id_chooser in shard.py always a list.
 
3703
 
 
3704
- The no-arg ResultProxy._row_processor() is now the class attribute
 
3705
  `_process_row`.
 
3706
 
 
3707
- Added support for returning values from inserts and updates for
 
3708
  PostgreSQL 8.2+. [ticket:797]
 
3709
 
 
3710
- PG reflection, upon seeing the default schema name being used explicitly
 
3711
  as the "schema" argument in a Table, will assume that this is the the
 
3712
  user's desired convention, and will explicitly set the "schema" argument
 
3713
  in foreign-key-related reflected tables, thus making them match only
 
3714
  with Table constructors that also use the explicit "schema" argument
 
3715
  (even though its the default schema).
 
3716
  In other words, SA assumes the user is being consistent in this usage.
 
3717
 
 
3718
- fixed sqlite reflection of BOOL/BOOLEAN [ticket:808]
 
3719
 
 
3720
- Added support for UPDATE with LIMIT on mysql.
 
3721
 
 
3722
- null foreign key on a m2o doesn't trigger a lazyload [ticket:803]
 
3723
 
 
3724
- oracle does not implicitly convert to unicode for non-typed result
 
3725
  sets (i.e. when no TypeEngine/String/Unicode type is even being used;
 
3726
  previously it was detecting DBAPI types and converting regardless).
 
3727
  should fix [ticket:800]
 
3728
 
 
3729
- fix to anonymous label generation of long table/column names [ticket:806]
 
3730
 
 
3731
- Firebird dialect now uses SingletonThreadPool as poolclass.
 
3732
 
 
3733
- Firebird now uses dialect.preparer to format sequences names
 
3734
 
 
3735
- Fixed breakage with postgres and multiple two-phase transactions. Two-phase
 
3736
  commits and and rollbacks didn't automatically end up with a new transaction
 
3737
  as the usual dbapi commits/rollbacks do. [ticket:810]
 
3738
 
 
3739
- Added an option to the _ScopedExt mapper extension to not automatically
 
3740
  save new objects to session on object initialization.
 
3741
 
 
3742
- fixed Oracle non-ansi join syntax
 
3743
 
 
3744
- PickleType and Interval types (on db not supporting it natively) are now
 
3745
  slightly faster.
 
3746
 
 
3747
- Added Float and Time types to Firebird (FBFloat and FBTime). Fixed
 
3748
  BLOB SUB_TYPE for TEXT and Binary types.
 
3749
 
 
3750
- Changed the API for the in_ operator. in_() now accepts a single argument
 
3751
  that is a sequence of values or a selectable. The old API of passing in
 
3752
  values as varargs still works but is deprecated.
 
3753
 
 
3754
 
 
3755
0.4.0beta6
 
3756
----------
 
3757
 
 
3758
- The Session identity map is now *weak referencing* by default, use
 
3759
  weak_identity_map=False to use a regular dict.  The weak dict we are using
 
3760
  is customized to detect instances which are "dirty" and maintain a
 
3761
  temporary strong reference to those instances until changes are flushed.
 
3762
 
 
3763
- Mapper compilation has been reorganized such that most compilation occurs
 
3764
  upon mapper construction.  This allows us to have fewer calls to
 
3765
  mapper.compile() and also to allow class-based properties to force a
 
3766
  compilation (i.e. User.addresses == 7 will compile all mappers; this is
 
3767
  [ticket:758]).  The only caveat here is that an inheriting mapper now
 
3768
  looks for its inherited mapper upon construction; so mappers within
 
3769
  inheritance relationships need to be constructed in inheritance order
 
3770
  (which should be the normal case anyway).
 
3771
 
 
3772
- added "FETCH" to the keywords detected by Postgres to indicate a
 
3773
  result-row holding statement (i.e. in addition to "SELECT").
 
3774
 
 
3775
- Added full list of SQLite reserved keywords so that they get escaped
 
3776
  properly.
 
3777
 
 
3778
- Tightened up the relationship between the Query's generation of "eager
 
3779
  load" aliases, and Query.instances() which actually grabs the eagerly
 
3780
  loaded rows.  If the aliases were not specifically generated for that
 
3781
  statement by EagerLoader, the EagerLoader will not take effect when the
 
3782
  rows are fetched.  This prevents columns from being grabbed accidentally
 
3783
  as being part of an eager load when they were not meant for such, which
 
3784
  can happen with textual SQL as well as some inheritance situations.  It's
 
3785
  particularly important since the "anonymous aliasing" of columns uses
 
3786
  simple integer counts now to generate labels.
 
3787
 
 
3788
- Removed "parameters" argument from clauseelement.compile(), replaced with
 
3789
  "column_keys".  The parameters sent to execute() only interact with the
 
3790
  insert/update statement compilation process in terms of the column names
 
3791
  present but not the values for those columns.  Produces more consistent
 
3792
  execute/executemany behavior, simplifies things a bit internally.
 
3793
 
 
3794
- Added 'comparator' keyword argument to PickleType.  By default, "mutable"
 
3795
  PickleType does a "deep compare" of objects using their dumps()
 
3796
  representation.  But this doesn't work for dictionaries.  Pickled objects
 
3797
  which provide an adequate __eq__() implementation can be set up with
 
3798
  "PickleType(comparator=operator.eq)" [ticket:560]
 
3799
 
 
3800
- Added session.is_modified(obj) method; performs the same "history"
 
3801
  comparison operation as occurs within a flush operation; setting
 
3802
  include_collections=False gives the same result as is used when the flush
 
3803
  determines whether or not to issue an UPDATE for the instance's row.
 
3804
 
 
3805
- Added "schema" argument to Sequence; use this with Postgres /Oracle when
 
3806
  the sequence is located in an alternate schema.  Implements part of
 
3807
  [ticket:584], should fix [ticket:761].
 
3808
 
 
3809
- Fixed reflection of the empty string for mysql enums.
 
3810
 
 
3811
- Changed MySQL dialect to use the older LIMIT <offset>, <limit> syntax
 
3812
  instead of LIMIT <l> OFFSET <o> for folks using 3.23. [ticket:794]
 
3813
 
 
3814
- Added 'passive_deletes="all"' flag to relation(), disables all nulling-out
 
3815
  of foreign key attributes during a flush where the parent object is
 
3816
  deleted.
 
3817
 
 
3818
- Column defaults and onupdates, executing inline, will add parenthesis for
 
3819
  subqueries and other parenthesis-requiring expressions
 
3820
 
 
3821
- The behavior of String/Unicode types regarding that they auto-convert to
 
3822
  TEXT/CLOB when no length is present now occurs *only* for an exact type of
 
3823
  String or Unicode with no arguments.  If you use VARCHAR or NCHAR
 
3824
  (subclasses of String/Unicode) with no length, they will be interpreted by
 
3825
  the dialect as VARCHAR/NCHAR; no "magic" conversion happens there.  This
 
3826
  is less surprising behavior and in particular this helps Oracle keep
 
3827
  string-based bind parameters as VARCHARs and not CLOBs [ticket:793].
 
3828
 
 
3829
- Fixes to ShardedSession to work with deferred columns [ticket:771].
 
3830
 
 
3831
- User-defined shard_chooser() function must accept "clause=None" argument;
 
3832
  this is the ClauseElement passed to session.execute(statement) and can be
 
3833
  used to determine correct shard id (since execute() doesn't take an
 
3834
  instance.)
 
3835
 
 
3836
- Adjusted operator precedence of NOT to match '==' and others, so that
 
3837
  ~(x <operator> y) produces NOT (x <op> y), which is better compatible
 
3838
  with older MySQL versions. [ticket:764].  This doesn't apply to "~(x==y)"
 
3839
  as it does in 0.3 since ~(x==y) compiles to "x != y", but still applies
 
3840
  to operators like BETWEEN.
 
3841
 
 
3842
- Other tickets: [ticket:768], [ticket:728], [ticket:779], [ticket:757]
 
3843
 
 
3844
0.4.0beta5
 
3845
----------
 
3846
 
 
3847
- Connection pool fixes; the better performance of beta4 remains but fixes
 
3848
  "connection overflow" and other bugs which were present (like
 
3849
  [ticket:754]).
 
3850
 
 
3851
- Fixed bugs in determining proper sync clauses from custom inherit
 
3852
  conditions. [ticket:769]
 
3853
 
 
3854
- Extended 'engine_from_config' coercion for QueuePool size / overflow.
 
3855
  [ticket:763]
 
3856
 
 
3857
- mysql views can be reflected again. [ticket:748]
 
3858
 
 
3859
- AssociationProxy can now take custom getters and setters.
 
3860
 
 
3861
- Fixed malfunctioning BETWEEN in orm queries.
 
3862
 
 
3863
- Fixed OrderedProperties pickling [ticket:762]
 
3864
 
 
3865
- SQL-expression defaults and sequences now execute "inline" for all
 
3866
  non-primary key columns during an INSERT or UPDATE, and for all columns
 
3867
  during an executemany()-style call. inline=True flag on any insert/update
 
3868
  statement also forces the same behavior with a single execute().
 
3869
  result.postfetch_cols() is a collection of columns for which the previous
 
3870
  single insert or update statement contained a SQL-side default expression.
 
3871
 
 
3872
- Fixed PG executemany() behavior, [ticket:759]
 
3873
 
 
3874
- postgres reflects tables with autoincrement=False for primary key columns
 
3875
  which have no defaults.
 
3876
 
 
3877
- postgres no longer wraps executemany() with individual execute() calls,
 
3878
  instead favoring performance.  "rowcount"/"concurrency" checks with
 
3879
  deleted items (which use executemany) are disabled with PG since psycopg2
 
3880
  does not report proper rowcount for executemany().
 
3881
 
 
3882
- Tickets fixed:
 
3883
 
 
3884
  - [ticket:742]
 
3885
  - [ticket:748]
 
3886
  - [ticket:760]
 
3887
  - [ticket:762]
 
3888
  - [ticket:763]
 
3889
 
 
3890
0.4.0beta4
 
3891
----------
 
3892
 
 
3893
- Tidied up what ends up in your namespace when you 'from sqlalchemy import *':
 
3894
 
 
3895
  - 'table' and 'column' are no longer imported.  They remain available by
 
3896
    direct reference (as in 'sql.table' and 'sql.column') or a glob import
 
3897
    from the sql package.  It was too easy to accidentally use a
 
3898
    sql.expressions.table instead of schema.Table when just starting out
 
3899
    with SQLAlchemy, likewise column.
 
3900
 
 
3901
  - Internal-ish classes like ClauseElement, FromClause, NullTypeEngine,
 
3902
    etc., are also no longer imported into your namespace
 
3903
 
 
3904
  - The 'Smallinteger' compatiblity name (small i!) is no longer imported,
 
3905
    but remains in schema.py for now.  SmallInteger (big I!) is still
 
3906
    imported.
 
3907
 
 
3908
- The connection pool uses a "threadlocal" strategy internally to return
 
3909
  the same connection already bound to a thread, for "contextual" connections;
 
3910
  these are the connections used when you do a "connectionless" execution
 
3911
  like insert().execute().  This is like a "partial" version of the
 
3912
  "threadlocal" engine strategy but without the thread-local transaction part
 
3913
  of it.  We're hoping it reduces connection pool overhead as well as
 
3914
  database usage.  However, if it proves to impact stability in a negative way,
 
3915
  we'll roll it right back.
 
3916
 
 
3917
- Fix to bind param processing such that "False" values (like blank strings)
 
3918
  still get processed/encoded.
 
3919
 
 
3920
- Fix to select() "generative" behavior, such that calling column(),
 
3921
  select_from(), correlate(), and with_prefix() does not modify the
 
3922
  original select object [ticket:752]
 
3923
 
 
3924
- Added a "legacy" adapter to types, such that user-defined TypeEngine
 
3925
  and TypeDecorator classes which define convert_bind_param() and/or
 
3926
  convert_result_value() will continue to function.  Also supports
 
3927
  calling the super() version of those methods.
 
3928
 
 
3929
- Added session.prune(), trims away instances cached in a session that
 
3930
  are no longer referenced elsewhere. (A utility for strong-ref
 
3931
  identity maps).
 
3932
 
 
3933
- Added close() method to Transaction.  Closes out a transaction using
 
3934
  rollback if it's the outermost transaction, otherwise just ends
 
3935
  without affecting the outer transaction.
 
3936
 
 
3937
- Transactional and non-transactional Session integrates better with
 
3938
  bound connection; a close() will ensure that connection
 
3939
  transactional state is the same as that which existed on it before
 
3940
  being bound to the Session.
 
3941
 
 
3942
- Modified SQL operator functions to be module-level operators,
 
3943
  allowing SQL expressions to be pickleable. [ticket:735]
 
3944
 
 
3945
- Small adjustment to mapper class.__init__ to allow for Py2.6
 
3946
  object.__init__() behavior.
 
3947
 
 
3948
- Fixed 'prefix' argument for select()
 
3949
 
 
3950
- Connection.begin() no longer accepts nested=True, this logic is now
 
3951
  all in begin_nested().
 
3952
 
 
3953
- Fixes to new "dynamic" relation loader involving cascades
 
3954
 
 
3955
- Tickets fixed:
 
3956
 
 
3957
  - [ticket:735]
 
3958
  - [ticket:752]
 
3959
 
 
3960
0.4.0beta3
 
3961
----------
 
3962
 
 
3963
- SQL types optimization:
 
3964
 
 
3965
  - New performance tests show a combined mass-insert/mass-select test as
 
3966
    having 68% fewer function calls than the same test run against 0.3.
 
3967
 
 
3968
  - General performance improvement of result set iteration is around 10-20%.
 
3969
 
 
3970
  - In types.AbstractType, convert_bind_param() and convert_result_value()
 
3971
    have migrated to callable-returning bind_processor() and
 
3972
    result_processor() methods.  If no callable is returned, no pre/post
 
3973
    processing function is called.
 
3974
 
 
3975
  - Hooks added throughout base/sql/defaults to optimize the calling of bind
 
3976
    aram/result processors so that method call overhead is minimized.
 
3977
 
 
3978
  - Support added for executemany() scenarios such that unneeded "last row id"
 
3979
    logic doesn't kick in, parameters aren't excessively traversed.
 
3980
 
 
3981
- Added 'inherit_foreign_keys' arg to mapper().
 
3982
 
 
3983
- Added support for string date passthrough in sqlite.
 
3984
 
 
3985
- Tickets fixed:
 
3986
 
 
3987
  - [ticket:738]
 
3988
  - [ticket:739]
 
3989
  - [ticket:743]
 
3990
  - [ticket:744]
 
3991
 
 
3992
0.4.0beta2
 
3993
----------
 
3994
 
 
3995
- mssql improvements.
 
3996
 
 
3997
- oracle improvements.
 
3998
 
 
3999
- Auto-commit after LOAD DATA INFILE for mysql.
 
4000
 
 
4001
- A rudimental SessionExtension class has been added, allowing user-defined
 
4002
  functionality to take place at flush(), commit(), and rollback() boundaries.
 
4003
 
 
4004
- Added engine_from_config() function for helping to create_engine() from an
 
4005
  .ini style config.
 
4006
 
 
4007
- base_mapper() becomes a plain attribute.
 
4008
 
 
4009
- session.execute() and scalar() can search for a Table with which to bind from
 
4010
  using the given ClauseElement.
 
4011
 
 
4012
- Session automatically extrapolates tables from mappers with binds, also uses
 
4013
  base_mapper so that inheritance hierarchies bind automatically.
 
4014
 
 
4015
- Moved ClauseVisitor traversal back to inlined non-recursive.
 
4016
 
 
4017
- Tickets fixed:
 
4018
 
 
4019
  - [ticket:730]
 
4020
  - [ticket:732]
 
4021
  - [ticket:733]
 
4022
  - [ticket:734]
 
4023
 
 
4024
0.4.0beta1
 
4025
----------
 
4026
 
 
4027
- orm
 
4028
 
 
4029
  - Speed! Along with recent speedups to ResultProxy, total number of function
 
4030
    calls significantly reduced for large loads.
 
4031
 
 
4032
  - test/perf/masseagerload.py reports 0.4 as having the fewest number of
 
4033
    function calls across all SA versions (0.1, 0.2, and 0.3).
 
4034
 
 
4035
  - New collection_class api and implementation [ticket:213]. Collections are
 
4036
    now instrumented via decorations rather than proxying.  You can now have
 
4037
    collections that manage their own membership, and your class instance will
 
4038
    be directly exposed on the relation property.  The changes are transparent
 
4039
    for most users.
 
4040
 
 
4041
    - InstrumentedList (as it was) is removed, and relation properties no
 
4042
      longer have 'clear()', '.data', or any other added methods beyond those
 
4043
      provided by the collection type. You are free, of course, to add them to
 
4044
      a custom class.
 
4045
 
 
4046
    - __setitem__-like assignments now fire remove events for the existing
 
4047
      value, if any.
 
4048
 
 
4049
    - dict-likes used as collection classes no longer need to change __iter__
 
4050
      semantics- itervalues() is used by default instead. This is a backwards
 
4051
      incompatible change.
 
4052
 
 
4053
    - Subclassing dict for a mapped collection is no longer needed in most
 
4054
      cases. orm.collections provides canned implementations that key objects
 
4055
      by a specified column or a custom function of your choice.
 
4056
 
 
4057
    - Collection assignment now requires a compatible type- assigning None to
 
4058
      clear a collection or assigning a list to a dict collection will now
 
4059
      raise an argument error.
 
4060
 
 
4061
    - AttributeExtension moved to interfaces, and .delete is now .remove The
 
4062
      event method signature has also been swapped around.
 
4063
 
 
4064
  - Major overhaul for Query:
 
4065
 
 
4066
    - All selectXXX methods are deprecated.  Generative methods are now the
 
4067
      standard way to do things, i.e. filter(), filter_by(), all(), one(),
 
4068
      etc.  Deprecated methods are docstring'ed with their new replacements.
 
4069
 
 
4070
    - Class-level properties are now usable as query elements... no more
 
4071
      '.c.'!  "Class.c.propname" is now superceded by "Class.propname".  All
 
4072
      clause operators are supported, as well as higher level operators such
 
4073
      as Class.prop==<some instance> for scalar attributes,
 
4074
      Class.prop.contains(<some instance>) and Class.prop.any(<some
 
4075
      expression>) for collection-based attributes (all are also
 
4076
      negatable).  Table-based column expressions as well as columns mounted
 
4077
      on mapped classes via 'c' are of course still fully available and can be
 
4078
      freely mixed with the new attributes.  [ticket:643]
 
4079
 
 
4080
    - Removed ancient query.select_by_attributename() capability.
 
4081
 
 
4082
    - The aliasing logic used by eager loading has been generalized, so that
 
4083
      it also adds full automatic aliasing support to Query.  It's no longer
 
4084
      necessary to create an explicit Alias to join to the same tables
 
4085
      multiple times; *even for self-referential relationships*.
 
4086
 
 
4087
      - join() and outerjoin() take arguments "aliased=True".  Yhis causes
 
4088
        their joins to be built on aliased tables; subsequent calls to
 
4089
        filter() and filter_by() will translate all table expressions (yes,
 
4090
        real expressions using the original mapped Table) to be that of the
 
4091
        Alias for the duration of that join() (i.e. until reset_joinpoint() or
 
4092
        another join() is called).
 
4093
 
 
4094
      - join() and outerjoin() take arguments "id=<somestring>".  When used
 
4095
        with "aliased=True", the id can be referenced by add_entity(cls,
 
4096
        id=<somestring>) so that you can select the joined instances even if
 
4097
        they're from an alias.
 
4098
 
 
4099
      - join() and outerjoin() now work with self-referential relationships!
 
4100
        Using "aliased=True", you can join as many levels deep as desired,
 
4101
        i.e. query.join(['children', 'children'], aliased=True); filter
 
4102
        criterion will be against the rightmost joined table
 
4103
 
 
4104
    - Added query.populate_existing(), marks the query to reload all
 
4105
      attributes and collections of all instances touched in the query,
 
4106
      including eagerly-loaded entities.  [ticket:660]
 
4107
 
 
4108
    - Added eagerload_all(), allows eagerload_all('x.y.z') to specify eager
 
4109
      loading of all properties in the given path.
 
4110
 
 
4111
  - Major overhaul for Session:
 
4112
 
 
4113
    - New function which "configures" a session called "sessionmaker()".  Send
 
4114
      various keyword arguments to this function once, returns a new class
 
4115
      which creates a Session against that stereotype.
 
4116
 
 
4117
    - SessionTransaction removed from "public" API.  You now can call begin()/
 
4118
      commit()/rollback() on the Session itself.
 
4119
 
 
4120
    - Session also supports SAVEPOINT transactions; call begin_nested().
 
4121
 
 
4122
    - Session supports two-phase commit behavior when vertically or
 
4123
      horizontally partitioning (i.e., using more than one engine).  Use
 
4124
      twophase=True.
 
4125
 
 
4126
    - Session flag "transactional=True" produces a session which always places
 
4127
      itself into a transaction when first used.  Upon commit(), rollback() or
 
4128
      close(), the transaction ends; but begins again on the next usage.
 
4129
 
 
4130
    - Session supports "autoflush=True".  This issues a flush() before each
 
4131
      query.  Use in conjunction with transactional, and you can just
 
4132
      save()/update() and then query, the new objects will be there.  Use
 
4133
      commit() at the end (or flush() if non-transactional) to flush remaining
 
4134
      changes.
 
4135
 
 
4136
    - New scoped_session() function replaces SessionContext and assignmapper.
 
4137
      Builds onto "sessionmaker()" concept to produce a class whos Session()
 
4138
      construction returns the thread-local session.  Or, call all Session
 
4139
      methods as class methods, i.e. Session.save(foo); Session.commit().
 
4140
      just like the old "objectstore" days.
 
4141
 
 
4142
    - Added new "binds" argument to Session to support configuration of
 
4143
      multiple binds with sessionmaker() function.
 
4144
 
 
4145
    - A rudimental SessionExtension class has been added, allowing
 
4146
      user-defined functionality to take place at flush(), commit(), and
 
4147
      rollback() boundaries.
 
4148
 
 
4149
  - Query-based relation()s available with dynamic_loader().  This is a
 
4150
    *writable* collection (supporting append() and remove()) which is also a
 
4151
    live Query object when accessed for reads.  Ideal for dealing with very
 
4152
    large collections where only partial loading is desired.
 
4153
 
 
4154
  - flush()-embedded inline INSERT/UPDATE expressions.  Assign any SQL
 
4155
    expression, like "sometable.c.column + 1", to an instance's attribute.
 
4156
    Upon flush(), the mapper detects the expression and embeds it directly in
 
4157
    the INSERT or UPDATE statement; the attribute gets deferred on the
 
4158
    instance so it loads the new value the next time you access it.
 
4159
 
 
4160
  - A rudimental sharding (horizontal scaling) system is introduced.  This
 
4161
    system uses a modified Session which can distribute read and write
 
4162
    operations among multiple databases, based on user-defined functions
 
4163
    defining the "sharding strategy".  Instances and their dependents can be
 
4164
    distributed and queried among multiple databases based on attribute
 
4165
    values, round-robin approaches or any other user-defined
 
4166
    system. [ticket:618]
 
4167
 
 
4168
  - Eager loading has been enhanced to allow even more joins in more places.
 
4169
    It now functions at any arbitrary depth along self-referential and
 
4170
    cyclical structures.  When loading cyclical structures, specify
 
4171
    "join_depth" on relation() indicating how many times you'd like the table
 
4172
    to join to itself; each level gets a distinct table alias.  The alias
 
4173
    names themselves are generated at compile time using a simple counting
 
4174
    scheme now and are a lot easier on the eyes, as well as of course
 
4175
    completely deterministic. [ticket:659]
 
4176
 
 
4177
  - Added composite column properties.  This allows you to create a type which
 
4178
    is represented by more than one column, when using the ORM.  Objects of
 
4179
    the new type are fully functional in query expressions, comparisons,
 
4180
    query.get() clauses, etc. and act as though they are regular single-column
 
4181
    scalars... except they're not!  Use the function composite(cls, *columns)
 
4182
    inside of the mapper's "properties" dict, and instances of cls will be
 
4183
    created/mapped to a single attribute, comprised of the values correponding
 
4184
    to *columns. [ticket:211]
 
4185
 
 
4186
  - Improved support for custom column_property() attributes which feature
 
4187
    correlated subqueries, works better with eager loading now.
 
4188
 
 
4189
  - Primary key "collapse" behavior; the mapper will analyze all columns in
 
4190
    its given selectable for primary key "equivalence", that is, columns which
 
4191
    are equivalent via foreign key relationship or via an explicit
 
4192
    inherit_condition. primarily for joined-table inheritance scenarios where
 
4193
    different named PK columns in inheriting tables should "collapse" into a
 
4194
    single-valued (or fewer-valued) primary key.  Fixes things like
 
4195
    [ticket:611].
 
4196
 
 
4197
  - Joined-table inheritance will now generate the primary key columns of all
 
4198
    inherited classes against the root table of the join only.  This implies
 
4199
    that each row in the root table is distinct to a single instance.  If for
 
4200
    some rare reason this is not desireable, explicit primary_key settings on
 
4201
    individual mappers will override it.
 
4202
 
 
4203
  - When "polymorphic" flags are used with joined-table or single-table
 
4204
    inheritance, all identity keys are generated against the root class of the
 
4205
    inheritance hierarchy; this allows query.get() to work polymorphically
 
4206
    using the same caching semantics as a non-polymorphic get.  Note that this
 
4207
    currently does not work with concrete inheritance.
 
4208
 
 
4209
  - Secondary inheritance loading: polymorphic mappers can be constructed
 
4210
    *without* a select_table argument. inheriting mappers whose tables were
 
4211
    not represented in the initial load will issue a second SQL query
 
4212
    immediately, once per instance (i.e. not very efficient for large lists),
 
4213
    in order to load the remaining columns.
 
4214
 
 
4215
  - Secondary inheritance loading can also move its second query into a
 
4216
    column-level "deferred" load, via the "polymorphic_fetch" argument, which
 
4217
    can be set to 'select' or 'deferred'
 
4218
 
 
4219
  - It's now possible to map only a subset of available selectable columns
 
4220
    onto mapper properties, using include_columns/exclude_columns.
 
4221
    [ticket:696].
 
4222
 
 
4223
  - Added undefer_group() MapperOption, sets a set of "deferred" columns
 
4224
    joined by a "group" to load as "undeferred".
 
4225
 
 
4226
  - Rewrite of the "deterministic alias name" logic to be part of the SQL
 
4227
    layer, produces much simpler alias and label names more in the style of
 
4228
    Hibernate
 
4229
 
 
4230
- sql
 
4231
 
 
4232
  - Speed!  Clause compilation as well as the mechanics of SQL constructs have
 
4233
    been streamlined and simplified to a signficant degree, for a 20-30%
 
4234
    improvement of the statement construction/compilation overhead of 0.3.
 
4235
 
 
4236
  - All "type" keyword arguments, such as those to bindparam(), column(),
 
4237
    Column(), and func.<something>(), renamed to "type_".  Those objects still
 
4238
    name their "type" attribute as "type".
 
4239
 
 
4240
  - case_sensitive=(True|False) setting removed from schema items, since
 
4241
    checking this state added a lot of method call overhead and there was no
 
4242
    decent reason to ever set it to False.  Table and column names which are
 
4243
    all lower case will be treated as case-insenstive (yes we adjust for
 
4244
    Oracle's UPPERCASE style too).
 
4245
 
 
4246
  - Transactions:
 
4247
 
 
4248
    - Added context manager (with statement) support for transactions.
 
4249
    - Added support for two phase commit, works with mysql and postgres so far.
 
4250
    - Added a subtransaction implementation that uses savepoints.
 
4251
    - Added support for savepoints.
 
4252
 
 
4253
  - MetaData:
 
4254
 
 
4255
    - Tables can be reflected from the database en-masse without declaring
 
4256
      them in advance.  MetaData(engine, reflect=True) will load all tables
 
4257
      present in the database, or use metadata.reflect() for finer control.
 
4258
    - DynamicMetaData has been renamed to ThreadLocalMetaData
 
4259
    - The ThreadLocalMetaData constructor now takes no arguments.
 
4260
    - BoundMetaData has been removed- regular MetaData is equivalent
 
4261
 
 
4262
  - Numeric and Float types now have an "asdecimal" flag; defaults to True for
 
4263
    Numeric, False for Float.  When True, values are returned as
 
4264
    decimal.Decimal objects; when False, values are returned as float().  The
 
4265
    defaults of True/False are already the behavior for PG and MySQL's DBAPI
 
4266
    modules. [ticket:646]
 
4267
 
 
4268
  - New SQL operator implementation which removes all hardcoded operators from
 
4269
    expression structures and moves them into compilation; allows greater
 
4270
    flexibility of operator compilation; for example, "+" compiles to "||"
 
4271
    when used in a string context, or "concat(a,b)" on MySQL; whereas in a
 
4272
    numeric context it compiles to "+".  Fixes [ticket:475].
 
4273
 
 
4274
  - "Anonymous" alias and label names are now generated at SQL compilation
 
4275
    time in a completely deterministic fashion... no more random hex IDs
 
4276
 
 
4277
  - Significant architectural overhaul to SQL elements (ClauseElement).  All
 
4278
    elements share a common "mutability" framework which allows a consistent
 
4279
    approach to in-place modifications of elements as well as generative
 
4280
    behavior.  Improves stability of the ORM which makes heavy usage of
 
4281
    mutations to SQL expressions.
 
4282
 
 
4283
  - select() and union()'s now have "generative" behavior.  Methods like
 
4284
    order_by() and group_by() return a *new* instance - the original instance
 
4285
    is left unchanged.  Non-generative methods remain as well.
 
4286
 
 
4287
  - The internals of select/union vastly simplified- all decision making
 
4288
    regarding "is subquery" and "correlation" pushed to SQL generation phase.
 
4289
    select() elements are now *never* mutated by their enclosing containers or
 
4290
    by any dialect's compilation process [ticket:52] [ticket:569]
 
4291
 
 
4292
  - select(scalar=True) argument is deprecated; use select(..).as_scalar().
 
4293
    The resulting object obeys the full "column" interface and plays better
 
4294
    within expressions.
 
4295
 
 
4296
  - Added select().with_prefix('foo') allowing any set of keywords to be
 
4297
    placed before the columns clause of the SELECT [ticket:504]
 
4298
 
 
4299
  - Added array slice support to row[<index>] [ticket:686]
 
4300
 
 
4301
  - Result sets make a better attempt at matching the DBAPI types present in
 
4302
    cursor.description to the TypeEngine objects defined by the dialect, which
 
4303
    are then used for result-processing. Note this only takes effect for
 
4304
    textual SQL; constructed SQL statements always have an explicit type map.
 
4305
 
 
4306
  - Result sets from CRUD operations close their underlying cursor immediately
 
4307
    and will also autoclose the connection if defined for the operation; this
 
4308
    allows more efficient usage of connections for successive CRUD operations
 
4309
    with less chance of "dangling connections".
 
4310
 
 
4311
  - Column defaults and onupdate Python functions (i.e. passed to
 
4312
    ColumnDefault) may take zero or one arguments; the one argument is the
 
4313
    ExecutionContext, from which you can call "context.parameters[someparam]"
 
4314
    to access the other bind parameter values affixed to the statement
 
4315
    [ticket:559].  The connection used for the execution is available as well
 
4316
    so that you can pre-execute statements.
 
4317
 
 
4318
  - Added "explcit" create/drop/execute support for sequences (i.e. you can
 
4319
    pass a "connectable" to each of those methods on Sequence).
 
4320
 
 
4321
  - Better quoting of identifiers when manipulating schemas.
 
4322
 
 
4323
  - Standardized the behavior for table reflection where types can't be
 
4324
    located; NullType is substituted instead, warning is raised.
 
4325
 
 
4326
  - ColumnCollection (i.e. the 'c' attribute on tables) follows dictionary
 
4327
    semantics for "__contains__" [ticket:606]
 
4328
 
 
4329
- engines
 
4330
 
 
4331
  - Speed! The mechanics of result processing and bind parameter processing
 
4332
    have been overhauled, streamlined and optimized to issue as little method
 
4333
    calls as possible.  Bench tests for mass INSERT and mass rowset iteration
 
4334
    both show 0.4 to be over twice as fast as 0.3, using 68% fewer function
 
4335
    calls.
 
4336
 
 
4337
  - You can now hook into the pool lifecycle and run SQL statements or other
 
4338
    logic at new each DBAPI connection, pool check-out and check-in.
 
4339
 
 
4340
  - Connections gain a .properties collection, with contents scoped to the
 
4341
    lifetime of the underlying DBAPI connection
 
4342
 
 
4343
  - Removed auto_close_cursors and disallow_open_cursors arguments from Pool;
 
4344
    reduces overhead as cursors are normally closed by ResultProxy and
 
4345
    Connection.
 
4346
 
 
4347
- extensions
 
4348
 
 
4349
  - proxyengine is temporarily removed, pending an actually working
 
4350
    replacement.
 
4351
 
 
4352
  - SelectResults has been replaced by Query.  SelectResults /
 
4353
    SelectResultsExt still exist but just return a slightly modified Query
 
4354
    object for backwards-compatibility.  join_to() method from SelectResults
 
4355
    isn't present anymore, need to use join().
 
4356
 
 
4357
- mysql
 
4358
 
 
4359
  - Table and column names loaded via reflection are now Unicode.
 
4360
 
 
4361
  - All standard column types are now supported, including SET.
 
4362
 
 
4363
  - Table reflection can now be performed in as little as one round-trip.
 
4364
 
 
4365
  - ANSI and ANSI_QUOTES sql modes are now supported.
 
4366
 
 
4367
  - Indexes are now reflected.
 
4368
 
 
4369
- postgres
 
4370
 
 
4371
  - Added PGArray datatype for using postgres array datatypes.
 
4372
 
 
4373
- oracle
 
4374
 
 
4375
  - Very rudimental support for OUT parameters added; use sql.outparam(name,
 
4376
    type) to set up an OUT parameter, just like bindparam(); after execution,
 
4377
    values are avaiable via result.out_parameters dictionary. [ticket:507]
 
4378
 
 
4379
0.3.11
 
4380
------
 
4381
 
 
4382
- sql
 
4383
 
 
4384
    - tweak DISTINCT precedence for clauses like
 
4385
      `func.count(t.c.col.distinct())`
 
4386
 
 
4387
    - Fixed detection of internal '$' characters in :bind$params [ticket:719]
 
4388
 
 
4389
    - [ticket:768] dont assume join criterion consists only of column objects
 
4390
 
 
4391
    - adjusted operator precedence of NOT to match '==' and others, so that
 
4392
      ~(x==y) produces NOT (x=y), which is compatible with MySQL < 5.0
 
4393
      (doesn't like "NOT x=y") [ticket:764]
 
4394
 
 
4395
- orm
 
4396
 
 
4397
    - added a check for joining from A->B using join(), along two
 
4398
      different m2m tables.  this raises an error in 0.3 but is
 
4399
      possible in 0.4 when aliases are used. [ticket:687]
 
4400
 
 
4401
    - fixed small exception throw bug in Session.merge()
 
4402
 
 
4403
    - fixed bug where mapper, being linked to a join where one table had
 
4404
      no PK columns, would not detect that the joined table had no PK.
 
4405
 
 
4406
    - fixed bugs in determining proper sync clauses from custom inherit
 
4407
      conditions [ticket:769]
 
4408
 
 
4409
    - backref remove object operation doesn't fail if the other-side
 
4410
      collection doesn't contain the item, supports noload collections
 
4411
      [ticket:813]
 
4412
 
 
4413
- engine
 
4414
 
 
4415
    - fixed another occasional race condition which could occur
 
4416
      when using pool with threadlocal setting
 
4417
 
 
4418
- mysql
 
4419
    - fixed specification of YEAR columns when generating schema
 
4420
 
 
4421
- mssql
 
4422
 
 
4423
    - added support for TIME columns (simulated using DATETIME) [ticket:679]
 
4424
 
 
4425
    - added support for BIGINT, MONEY, SMALLMONEY, UNIQUEIDENTIFIER and
 
4426
      SQL_VARIANT [ticket:721]
 
4427
 
 
4428
    - index names are now quoted when dropping from reflected tables
 
4429
      [ticket:684]
 
4430
 
 
4431
    - can now specify a DSN for PyODBC, using a URI like mssql:///?dsn=bob
 
4432
 
 
4433
- postgres
 
4434
 
 
4435
    - when reflecting tables from alternate schemas, the "default" placed upon
 
4436
      the primary key, i.e. usually a sequence name, has the "schema" name
 
4437
      unconditionally quoted, so that schema names which need quoting are fine.
 
4438
      its slightly unnecessary for schema names which don't need quoting
 
4439
      but not harmful.
 
4440
 
 
4441
- sqlite
 
4442
   - passthrough for stringified dates
 
4443
 
 
4444
- firebird
 
4445
    - supports_sane_rowcount() set to False due to ticket #370 (right way).
 
4446
    - fixed reflection of Column's nullable property.
 
4447
 
 
4448
- oracle
 
4449
    - removed LONG_STRING, LONG_BINARY from "binary" types, so type objects
 
4450
      don't try to read their values as LOB [ticket:622], [ticket:751]
 
4451
 
 
4452
0.3.10
 
4453
- general
 
4454
    - a new mutex that was added in 0.3.9 causes the pool_timeout
 
4455
      feature to fail during a race condition; threads would
 
4456
      raise TimeoutError immediately with no delay if many threads
 
4457
      push the pool into overflow at the same time.  this issue has been
 
4458
      fixed.
 
4459
- sql
 
4460
  - got connection-bound metadata to work with implicit execution
 
4461
  - foreign key specs can have any chararcter in their identifiers
 
4462
   [ticket:667]
 
4463
  - added commutativity-awareness to binary clause comparisons to
 
4464
    each other, improves ORM lazy load optimization [ticket:664]
 
4465
- orm
 
4466
  - cleanup to connection-bound sessions, SessionTransaction
 
4467
- postgres
 
4468
  - fixed max identifier length (63) [ticket:571]
 
4469
 
 
4470
 
 
4471
0.3.9
 
4472
- general
 
4473
    - better error message for NoSuchColumnError [ticket:607]
 
4474
    - finally figured out how to get setuptools version in, available
 
4475
      as sqlalchemy.__version__ [ticket:428]
 
4476
    - the various "engine" arguments, such as "engine", "connectable",
 
4477
      "engine_or_url", "bind_to", etc. are all present, but deprecated.
 
4478
      they all get replaced by the single term "bind".  you also
 
4479
      set the "bind" of MetaData using
 
4480
      metadata.bind = <engine or connection>
 
4481
- ext
 
4482
    - iteration over dict association proxies is now dict-like, not
 
4483
      InstrumentedList-like (e.g. over keys instead of values)
 
4484
    - association proxies no longer bind tightly to source collections
 
4485
      [ticket:597], and are constructed with a thunk instead
 
4486
    - added selectone_by() to assignmapper
 
4487
- orm
 
4488
    - forwards-compatibility with 0.4: added one(), first(), and
 
4489
      all() to Query.  almost all Query functionality from 0.4 is
 
4490
      present in 0.3.9 for forwards-compat purposes.
 
4491
    - reset_joinpoint() really really works this time, promise ! lets
 
4492
      you re-join from the root:
 
4493
      query.join(['a', 'b']).filter(<crit>).reset_joinpoint().\
 
4494
      join(['a', 'c']).filter(<some other crit>).all()
 
4495
      in 0.4 all join() calls start from the "root"
 
4496
    - added synchronization to the mapper() construction step, to avoid
 
4497
      thread collisions when pre-existing mappers are compiling in a
 
4498
      different thread [ticket:613]
 
4499
    - a warning is issued by Mapper when two primary key columns of the
 
4500
      same name are munged into a single attribute.  this happens frequently
 
4501
      when mapping to joins (or inheritance).
 
4502
    - synonym() properties are fully supported by all Query joining/
 
4503
      with_parent operations [ticket:598]
 
4504
    - fixed very stupid bug when deleting items with many-to-many
 
4505
      uselist=False relations
 
4506
    - remember all that stuff about polymorphic_union ?  for
 
4507
      joined table inheritance ?  Funny thing...
 
4508
      You sort of don't need it for joined table inheritance, you
 
4509
      can just string all the tables together via outerjoin().
 
4510
      The UNION still applies if concrete tables are involved,
 
4511
      though (since nothing to join them on).
 
4512
    - small fix to eager loading to better work with eager loads
 
4513
      to polymorphic mappers that are using a straight "outerjoin"
 
4514
      clause
 
4515
- sql
 
4516
    - ForeignKey to a table in a schema thats not the default schema
 
4517
      requires the schema to be explicit; i.e. ForeignKey('alt_schema.users.id')
 
4518
    - MetaData can now be constructed with an engine or url as the first
 
4519
      argument, just like BoundMetaData
 
4520
    - BoundMetaData is now deprecated, and MetaData is a direct substitute.
 
4521
    - DynamicMetaData has been renamed to ThreadLocalMetaData.  the
 
4522
      DynamicMetaData name is deprecated and is an alias for ThreadLocalMetaData
 
4523
      or a regular MetaData if threadlocal=False
 
4524
    - composite primary key is represented as a non-keyed set to allow for
 
4525
      composite keys consisting of cols with the same name; occurs within a
 
4526
      Join.  helps inheritance scenarios formulate correct PK.
 
4527
    - improved ability to get the "correct" and most minimal set of primary key
 
4528
      columns from a join, equating foreign keys and otherwise equated columns.
 
4529
      this is also mostly to help inheritance scenarios formulate the best
 
4530
      choice of primary key columns.  [ticket:185]
 
4531
    - added 'bind' argument to Sequence.create()/drop(), ColumnDefault.execute()
 
4532
    - columns can be overridden in a reflected table with a "key"
 
4533
      attribute different than the column's name, including for primary key
 
4534
      columns [ticket:650]
 
4535
    - fixed "ambiguous column" result detection, when dupe col names exist
 
4536
      in a result [ticket:657]
 
4537
    - some enhancements to "column targeting", the ability to match a column
 
4538
      to a "corresponding" column in another selectable.  this affects mostly
 
4539
      ORM ability to map to complex joins
 
4540
    - MetaData and all SchemaItems are safe to use with pickle.  slow
 
4541
      table reflections can be dumped into a pickled file to be reused later.
 
4542
      Just reconnect the engine to the metadata after unpickling. [ticket:619]
 
4543
    - added a mutex to QueuePool's "overflow" calculation to prevent a race
 
4544
      condition that can bypass max_overflow
 
4545
    - fixed grouping of compound selects to give correct results. will break
 
4546
      on sqlite in some cases, but those cases were producing incorrect
 
4547
      results anyway, sqlite doesn't support grouped compound selects
 
4548
      [ticket:623]
 
4549
    - fixed precedence of operators so that parenthesis are correctly applied
 
4550
      [ticket:620]
 
4551
    - calling <column>.in_() (i.e. with no arguments) will return
 
4552
      "CASE WHEN (<column> IS NULL) THEN NULL ELSE 0 END = 1)", so that
 
4553
      NULL or False is returned in all cases, rather than throwing an error
 
4554
      [ticket:545]
 
4555
    - fixed "where"/"from" criterion of select() to accept a unicode string
 
4556
      in addition to regular string - both convert to text()
 
4557
    - added standalone distinct() function in addition to column.distinct()
 
4558
      [ticket:558]
 
4559
    - result.last_inserted_ids() should return a list that is identically
 
4560
      sized to the primary key constraint of the table.  values that were
 
4561
      "passively" created and not available via cursor.lastrowid will be None.
 
4562
    - long-identifier detection fixed to use > rather than >= for
 
4563
      max ident length [ticket:589]
 
4564
    - fixed bug where selectable.corresponding_column(selectable.c.col)
 
4565
      would not return selectable.c.col, if the selectable is a join
 
4566
      of a table and another join involving the same table.  messed
 
4567
      up ORM decision making [ticket:593]
 
4568
    - added Interval type to types.py [ticket:595]
 
4569
- mysql
 
4570
    - fixed catching of some errors that imply a dropped connection [ticket:625]
 
4571
    - fixed escaping of the modulo operator [ticket:624]
 
4572
    - added 'fields' to reserved words [ticket:590]
 
4573
    - various reflection enhancement/fixes
 
4574
- oracle
 
4575
    - datetime fixes: got subsecond TIMESTAMP to work [ticket:604],
 
4576
      added OracleDate which supports types.Date with only year/month/day
 
4577
    - added dialect flag "auto_convert_lobs", defaults to True; will cause any
 
4578
      LOB objects detected in a result set to be forced into OracleBinary
 
4579
      so that the LOB is read() automatically, if no typemap was present
 
4580
      (i.e., if a textual execute() was issued).
 
4581
    - mod operator '%' produces MOD [ticket:624]
 
4582
    - converts cx_oracle datetime objects to Python datetime.datetime when
 
4583
      Python 2.3 used [ticket:542]
 
4584
    - fixed unicode conversion in Oracle TEXT type
 
4585
- postgres
 
4586
    - fixed escaping of the modulo operator [ticket:624]
 
4587
    - added support for reflection of domains [ticket:570]
 
4588
    - types which are missing during reflection resolve to Null type
 
4589
      instead of raising an error
 
4590
    - the fix in "schema" above fixes reflection of foreign keys from an
 
4591
      alt-schema table to a public schema table
 
4592
- sqlite
 
4593
    - rearranged dialect initialization so it has time to warn about pysqlite1
 
4594
      being too old.
 
4595
    - sqlite better handles datetime/date/time objects mixed and matched
 
4596
      with various Date/Time/DateTime columns
 
4597
    - string PK column inserts dont get overwritten with OID [ticket:603]
 
4598
- mssql
 
4599
    - fix port option handling for pyodbc [ticket:634]
 
4600
    - now able to reflect start and increment values for identity columns
 
4601
    - preliminary support for using scope_identity() with pyodbc
 
4602
 
 
4603
0.3.8
 
4604
- engines
 
4605
  - added detach() to Connection, allows underlying DBAPI connection
 
4606
    to be detached from its pool, closing on dereference/close()
 
4607
    instead of being reused by the pool.
 
4608
  - added invalidate() to Connection, immediately invalidates the
 
4609
    Connection and its underlying DBAPI connection.
 
4610
- sql
 
4611
  - _Label class overrides compare_self to return its ultimate
 
4612
    object. meaning, if you say someexpr.label('foo') == 5, it
 
4613
    produces the correct "someexpr == 5".
 
4614
  - _Label propagates "_hide_froms()" so that scalar selects
 
4615
    behave more properly with regards to FROM clause #574
 
4616
  - fix to long name generation when using oid_column as an order by
 
4617
    (oids used heavily in mapper queries)
 
4618
  - significant speed improvement to ResultProxy, pre-caches
 
4619
    TypeEngine dialect implementations and saves on function calls
 
4620
    per column
 
4621
  - parenthesis are applied to clauses via a new _Grouping
 
4622
    construct. uses operator precedence to more intelligently apply
 
4623
    parenthesis to clauses, provides cleaner nesting of clauses
 
4624
    (doesnt mutate clauses placed in other clauses, i.e. no 'parens'
 
4625
    flag)
 
4626
  - added 'modifier' keyword, works like func.<foo> except does not
 
4627
    add parenthesis.  e.g. select([modifier.DISTINCT(...)]) etc.
 
4628
  - removed "no group by's in a select thats part of a UNION"
 
4629
    restriction [ticket:578]
 
4630
- orm
 
4631
  - added reset_joinpoint() method to Query, moves the "join point"
 
4632
    back to the starting mapper. 0.4 will change the behavior of
 
4633
    join() to reset the "join point" in all cases so this is an
 
4634
    interim method. for forwards compatibility, ensure joins across
 
4635
    multiple relations are specified using a single join(), i.e.
 
4636
    join(['a', 'b', 'c']).
 
4637
  - fixed bug in query.instances() that wouldnt handle more than
 
4638
    on additional mapper or one additional column.
 
4639
  - "delete-orphan" no longer implies "delete". ongoing effort to
 
4640
    separate the behavior of these two operations.
 
4641
  - many-to-many relationships properly set the type of bind params
 
4642
    for delete operations on the association table
 
4643
  - many-to-many relationships check that the number of rows deleted
 
4644
    from the association table by a delete operation matches the
 
4645
    expected results
 
4646
  - session.get() and session.load() propagate **kwargs through to
 
4647
    query
 
4648
  - fix to polymorphic query which allows the original
 
4649
    polymorphic_union to be embedded into a correlated subquery
 
4650
    [ticket:577]
 
4651
  - fix to select_by(<propname>=<object instance>) -style joins in
 
4652
    conjunction with many-to-many relationships, bug introduced in
 
4653
    r2556
 
4654
  - the "primary_key" argument to mapper() is propagated to the
 
4655
    "polymorphic" mapper. primary key columns in this list get
 
4656
    normalized to that of the mapper's local table.
 
4657
  - restored logging of "lazy loading clause" under
 
4658
    sa.orm.strategies logger, got removed in 0.3.7
 
4659
  - improved support for eagerloading of properties off of mappers
 
4660
    that are mapped to select() statements; i.e. eagerloader is
 
4661
    better at locating the correct selectable with which to attach
 
4662
    its LEFT OUTER JOIN.
 
4663
- mysql
 
4664
  - Nearly all MySQL column types are now supported for declaration
 
4665
    and reflection. Added NCHAR, NVARCHAR, VARBINARY, TINYBLOB,
 
4666
    LONGBLOB, YEAR
 
4667
  - The sqltypes.Binary passthrough now always builds a BLOB,
 
4668
    avoiding problems with very old database versions
 
4669
  - support for column-level CHARACTER SET and COLLATE declarations,
 
4670
    as well as ASCII, UNICODE, NATIONAL and BINARY shorthand.
 
4671
- firebird
 
4672
  - set max identifier length to 31
 
4673
  - supports_sane_rowcount() set to False due to ticket #370.
 
4674
    versioned_id_col feature wont work in FB.
 
4675
  - some execution fixes
 
4676
-extensions
 
4677
  - new association proxy implementation, implementing complete
 
4678
    proxies to list, dict and set-based relation collections
 
4679
  - added orderinglist, a custom list class that synchronizes an
 
4680
    object attribute with that object's position in the list
 
4681
  - small fix to SelectResultsExt to not bypass itself during
 
4682
    select().
 
4683
  - added filter(), filter_by() to assignmapper
 
4684
 
 
4685
0.3.7
 
4686
- engines
 
4687
    - warnings module used for issuing warnings (instead of logging)
 
4688
    - cleanup of DBAPI import strategies across all engines
 
4689
      [ticket:480]
 
4690
    - refactoring of engine internals which reduces complexity,
 
4691
      number of codepaths; places more state inside of ExecutionContext
 
4692
      to allow more dialect control of cursor handling, result sets.
 
4693
      ResultProxy totally refactored and also has two versions of
 
4694
      "buffered" result sets used for different purposes.
 
4695
    - server side cursor support fully functional in postgres
 
4696
      [ticket:514].
 
4697
    - improved framework for auto-invalidation of connections that have
 
4698
      lost their underlying database, via dialect-specific detection
 
4699
      of exceptions corresponding to that database's disconnect
 
4700
      related error messages.  Additionally, when a "connection no
 
4701
      longer open" condition is detected, the entire connection pool
 
4702
      is discarded and replaced with a new instance.  #516
 
4703
    - the dialects within sqlalchemy.databases become a setuptools
 
4704
      entry points. loading the built-in database dialects works the
 
4705
      same as always, but if none found will fall back to trying
 
4706
      pkg_resources to load an external module [ticket:521]
 
4707
    - Engine contains a "url" attribute referencing the url.URL object
 
4708
      used by create_engine().
 
4709
- sql:
 
4710
    - keys() of result set columns are not lowercased, come back
 
4711
      exactly as they're expressed in cursor.description.  note this
 
4712
      causes colnames to be all caps in oracle.
 
4713
    - preliminary support for unicode table names, column names and
 
4714
      SQL statements added, for databases which can support them.
 
4715
      Works with sqlite and postgres so far.  Mysql *mostly* works
 
4716
      except the has_table() function does not work.  Reflection
 
4717
      works too.
 
4718
    - the Unicode type is now a direct subclass of String, which now
 
4719
      contains all the "convert_unicode" logic.  This helps the variety
 
4720
      of unicode situations that occur in db's such as MS-SQL to be
 
4721
      better handled and allows subclassing of the Unicode datatype.
 
4722
      [ticket:522]
 
4723
    - ClauseElements can be used in in_() clauses now, such as bind
 
4724
      parameters, etc. #476
 
4725
    - reverse operators implemented for `CompareMixin` elements,
 
4726
      allows expressions like "5 + somecolumn" etc. #474
 
4727
    - the "where" criterion of an update() and delete() now correlates
 
4728
      embedded select() statements against the table being updated or
 
4729
      deleted.  this works the same as nested select() statement
 
4730
      correlation, and can be disabled via the correlate=False flag on
 
4731
      the embedded select().
 
4732
    - column labels are now generated in the compilation phase, which
 
4733
      means their lengths are dialect-dependent.  So on oracle a label
 
4734
      that gets truncated to 30 chars will go out to 63 characters
 
4735
      on postgres.  Also, the true labelname is always attached as the
 
4736
      accessor on the parent Selectable so theres no need to be aware
 
4737
      of the "truncated" label names [ticket:512].
 
4738
    - column label and bind param "truncation" also generate
 
4739
      deterministic names now, based on their ordering within the
 
4740
      full statement being compiled.  this means the same statement
 
4741
      will produce the same string across application restarts and
 
4742
      allowing DB query plan caching to work better.
 
4743
    - the "mini" column labels generated when using subqueries, which
 
4744
      are to work around glitchy SQLite behavior that doesnt understand
 
4745
      "foo.id" as equivalent to "id", are now only generated in the case
 
4746
      that those named columns are selected from (part of [ticket:513])
 
4747
    - the label() method on ColumnElement will properly propagate the
 
4748
      TypeEngine of the base element out to the label, including a label()
 
4749
      created from a scalar=True select() statement.
 
4750
    - MS-SQL better detects when a query is a subquery and knows not to
 
4751
      generate ORDER BY phrases for those [ticket:513]
 
4752
    - fix for fetchmany() "size" argument being positional in most
 
4753
      dbapis [ticket:505]
 
4754
    - sending None as an argument to func.<something> will produce
 
4755
      an argument of NULL
 
4756
    - query strings in unicode URLs get keys encoded to ascii
 
4757
      for **kwargs compat
 
4758
    - slight tweak to raw execute() change to also support tuples
 
4759
      for positional parameters, not just lists [ticket:523]
 
4760
    - fix to case() construct to propagate the type of the first
 
4761
      WHEN condition as the return type of the case statement
 
4762
- orm:
 
4763
    - fixed critical issue when, after options(eagerload()) is used,
 
4764
      the mapper would then always apply query "wrapping" behavior
 
4765
      for all subsequent LIMIT/OFFSET/DISTINCT queries, even if no
 
4766
      eager loading was applied on those subsequent queries.
 
4767
    - added query.with_parent(someinstance) method.  searches for
 
4768
      target instance using lazy join criterion from parent instance.
 
4769
      takes optional string "property" to isolate the desired relation.
 
4770
      also adds static Query.query_from_parent(instance, property)
 
4771
      version. [ticket:541]
 
4772
    - improved query.XXX_by(someprop=someinstance) querying to use
 
4773
      similar methodology to with_parent, i.e. using the "lazy" clause
 
4774
      which prevents adding the remote instance's table to the SQL,
 
4775
      thereby making more complex conditions possible [ticket:554]
 
4776
    - added generative versions of aggregates, i.e. sum(), avg(), etc.
 
4777
      to query. used via query.apply_max(), apply_sum(), etc.
 
4778
      #552
 
4779
    - fix to using distinct() or distinct=True in combination with
 
4780
      join() and similar
 
4781
    - corresponding to label/bindparam name generation, eager loaders
 
4782
      generate deterministic names for the aliases they create using
 
4783
      md5 hashes.
 
4784
    - improved/fixed custom collection classes when giving it "set"/
 
4785
      "sets.Set" classes or subclasses (was still looking for append()
 
4786
      methods on them during lazy loads)
 
4787
    - restored old "column_property()" ORM function (used to be called
 
4788
      "column()") to force any column expression to be added as a property
 
4789
      on a mapper, particularly those that aren't present in the mapped
 
4790
      selectable.  this allows "scalar expressions" of any kind to be
 
4791
      added as relations (though they have issues with eager loads).
 
4792
    - fix to many-to-many relationships targeting polymorphic mappers
 
4793
      [ticket:533]
 
4794
    - making progress with session.merge() as well as combining its
 
4795
      usage with entity_name [ticket:543]
 
4796
    - the usual adjustments to relationships between inheriting mappers,
 
4797
      in this case establishing relation()s to subclass mappers where
 
4798
      the join conditions come from the superclass' table
 
4799
- informix:
 
4800
    - informix support added !  courtesy James Zhang, who put a ton
 
4801
      of effort in.
 
4802
- sqlite:
 
4803
    - removed silly behavior where sqlite would reflect UNIQUE indexes
 
4804
      as part of the primary key (?!)
 
4805
- oracle:
 
4806
    - small fix to allow successive compiles of the same SELECT object
 
4807
      which features LIMIT/OFFSET.  oracle dialect needs to modify
 
4808
      the object to have ROW_NUMBER OVER and wasn't performing
 
4809
      the full series of steps on successive compiles.
 
4810
- mysql
 
4811
    - support for SSL arguments given as inline within URL query string,
 
4812
      prefixed with "ssl_", courtesy terjeros@gmail.com.
 
4813
    - mysql uses "DESCRIBE [<schemaname>].<tablename>", catching exceptions
 
4814
      if table doesnt exist, in order to determine if a table exists.
 
4815
      this supports unicode table names as well as schema names. tested
 
4816
      with MySQL5 but should work with 4.1 series as well. (#557)
 
4817
- extensions
 
4818
    - big fix to AssociationProxy so that multiple AssociationProxy
 
4819
      objects can be associated with a single association collection.
 
4820
    - assign_mapper names methods according to their keys (i.e. __name__)
 
4821
      #551
 
4822
- mssql
 
4823
    - pyodbc is now the preferred DB-API for MSSQL, and if no module is
 
4824
      specifically requested, will be loaded first on a module probe.
 
4825
 
 
4826
    - The @@SCOPE_IDENTITY is now used instead of @@IDENTITY. This
 
4827
      behavior may be overridden with the engine_connect
 
4828
      "use_scope_identity" keyword parameter, which may also be specified
 
4829
      in the dburi.
 
4830
 
 
4831
 
 
4832
 
 
4833
0.3.6
 
4834
- sql:
 
4835
    - bindparam() names are now repeatable!  specify two
 
4836
      distinct bindparam()s with the same name in a single statement,
 
4837
      and the key will be shared.  proper positional/named args translate
 
4838
      at compile time.  for the old behavior of "aliasing" bind parameters
 
4839
      with conflicting names, specify "unique=True" - this option is
 
4840
      still used internally for all the auto-genererated (value-based)
 
4841
      bind parameters.
 
4842
 
 
4843
    - slightly better support for bind params as column clauses, either
 
4844
      via bindparam() or via literal(), i.e. select([literal('foo')])
 
4845
 
 
4846
    - MetaData can bind to an engine either via "url" or "engine" kwargs
 
4847
      to constructor, or by using connect() method. BoundMetaData is
 
4848
      identical to MetaData except engine_or_url param is required.
 
4849
      DynamicMetaData is the same and provides thread-local connections be
 
4850
      default.
 
4851
 
 
4852
    - exists() becomes useable as a standalone selectable, not just in a
 
4853
      WHERE clause, i.e. exists([columns], criterion).select()
 
4854
 
 
4855
    - correlated subqueries work inside of ORDER BY, GROUP BY
 
4856
 
 
4857
    - fixed function execution with explicit connections, i.e.
 
4858
      conn.execute(func.dosomething())
 
4859
 
 
4860
    - use_labels flag on select() wont auto-create labels for literal text
 
4861
      column elements, since we can make no assumptions about the text. to
 
4862
      create labels for literal columns, you can say "somecol AS
 
4863
      somelabel", or use literal_column("somecol").label("somelabel")
 
4864
 
 
4865
    - quoting wont occur for literal columns when they are "proxied" into
 
4866
      the column collection for their selectable (is_literal flag is
 
4867
      propagated). literal columns are specified via
 
4868
      literal_column("somestring").
 
4869
 
 
4870
    - added "fold_equivalents" boolean argument to Join.select(), which
 
4871
      removes 'duplicate' columns from the resulting column clause that
 
4872
      are known to be equivalent based on the join condition. this is of
 
4873
      great usage when constructing subqueries of joins which Postgres
 
4874
      complains about if duplicate column names are present.
 
4875
 
 
4876
    - fixed use_alter flag on ForeignKeyConstraint [ticket:503]
 
4877
 
 
4878
    - fixed usage of 2.4-only "reversed" in topological.py [ticket:506]
 
4879
 
 
4880
    - for hackers, refactored the "visitor" system of ClauseElement and
 
4881
      SchemaItem so that the traversal of items is controlled by the
 
4882
      ClauseVisitor itself, using the method visitor.traverse(item).
 
4883
      accept_visitor() methods can still be called directly but will not
 
4884
      do any traversal of child items. ClauseElement/SchemaItem now have a
 
4885
      configurable get_children() method to return the collection of child
 
4886
      elements for each parent object. This allows the full traversal of
 
4887
      items to be clear and unambiguous (as well as loggable), with an
 
4888
      easy method of limiting a traversal (just pass flags which are
 
4889
      picked up by appropriate get_children() methods). [ticket:501]
 
4890
 
 
4891
    - the "else_" parameter to the case statement now properly works when
 
4892
      set to zero.
 
4893
 
 
4894
- orm:
 
4895
    - the full featureset of the SelectResults extension has been merged
 
4896
      into a new set of methods available off of Query.  These methods
 
4897
      all provide "generative" behavior, whereby the Query is copied
 
4898
      and a new one returned with additional criterion added.
 
4899
      The new methods include:
 
4900
 
 
4901
          filter() - applies select criterion to the query
 
4902
          filter_by() - applies "by"-style criterion to the query
 
4903
          avg() - return the avg() function on the given column
 
4904
          join() - join to a property (or across a list of properties)
 
4905
          outerjoin() - like join() but uses LEFT OUTER JOIN
 
4906
          limit()/offset() - apply LIMIT/OFFSET
 
4907
          range-based access which applies limit/offset:
 
4908
             session.query(Foo)[3:5]
 
4909
          distinct() - apply DISTINCT
 
4910
          list() - evaluate the criterion and return results
 
4911
 
 
4912
      no incompatible changes have been made to Query's API and no methods
 
4913
      have been deprecated.  Existing methods like select(), select_by(),
 
4914
      get(), get_by() all execute the query at once and return results
 
4915
      like they always did.  join_to()/join_via() are still there although
 
4916
      the generative join()/outerjoin() methods are easier to use.
 
4917
 
 
4918
    - the return value for multiple mappers used with instances() now
 
4919
      returns a cartesian product of the requested list of mappers,
 
4920
      represented as a list of tuples. this corresponds to the documented
 
4921
      behavior. So that instances match up properly, the "uniquing" is
 
4922
      disabled when this feature is used.
 
4923
 
 
4924
    - Query has add_entity() and add_column() generative methods. these
 
4925
      will add the given mapper/class or ColumnElement to the query at
 
4926
      compile time, and apply them to the instances() method. the user is
 
4927
      responsible for constructing reasonable join conditions (otherwise
 
4928
      you can get full cartesian products). result set is the list of
 
4929
      tuples, non-uniqued.
 
4930
 
 
4931
    - strings and columns can also be sent to the *args of instances()
 
4932
      where those exact result columns will be part of the result tuples.
 
4933
 
 
4934
    - a full select() construct can be passed to query.select() (which
 
4935
      worked anyway), but also query.selectfirst(), query.selectone()
 
4936
      which will be used as is (i.e. no query is compiled). works
 
4937
      similarly to sending the results to instances().
 
4938
 
 
4939
    - eager loading will not "aliasize" "order by" clauses that were
 
4940
      placed in the select statement by something other than the eager
 
4941
      loader itself, to fix possibility of dupe columns as illustrated in
 
4942
      [ticket:495]. however, this means you have to be more careful with
 
4943
      the columns placed in the "order by" of Query.select(), that you
 
4944
      have explicitly named them in your criterion (i.e. you cant rely on
 
4945
      the eager loader adding them in for you)
 
4946
 
 
4947
    - added a handy multi-use "identity_key()" method to Session, allowing
 
4948
      the generation of identity keys for primary key values, instances,
 
4949
      and rows, courtesy Daniel Miller
 
4950
 
 
4951
    - many-to-many table will be properly handled even for operations that
 
4952
      occur on the "backref" side of the operation [ticket:249]
 
4953
 
 
4954
    - added "refresh-expire" cascade [ticket:492].  allows refresh() and
 
4955
      expire() calls to propagate along relationships.
 
4956
 
 
4957
    - more fixes to polymorphic relations, involving proper lazy-clause
 
4958
      generation on many-to-one relationships to polymorphic mappers
 
4959
      [ticket:493]. also fixes to detection of "direction", more specific
 
4960
      targeting of columns that belong to the polymorphic union vs. those
 
4961
      that dont.
 
4962
 
 
4963
    - some fixes to relationship calcs when using "viewonly=True" to pull
 
4964
      in other tables into the join condition which arent parent of the
 
4965
      relationship's parent/child mappings
 
4966
 
 
4967
    - flush fixes on cyclical-referential relationships that contain
 
4968
      references to other instances outside of the cyclical chain, when
 
4969
      some of the objects in the cycle are not actually part of the flush
 
4970
 
 
4971
    - put an aggressive check for "flushing object A with a collection of
 
4972
      B's, but you put a C in the collection" error condition - **even if
 
4973
      C is a subclass of B**, unless B's mapper loads polymorphically.
 
4974
      Otherwise, the collection will later load a "B" which should be a
 
4975
      "C" (since its not polymorphic) which breaks in bi-directional
 
4976
      relationships (i.e. C has its A, but A's backref will lazyload it as
 
4977
      a different instance of type "B") [ticket:500] This check is going
 
4978
      to bite some of you who do this without issues, so the error message
 
4979
      will also document a flag "enable_typechecks=False" to disable this
 
4980
      checking. But be aware that bi-directional relationships in
 
4981
      particular become fragile without this check.
 
4982
 
 
4983
- extensions:
 
4984
    - options() method on SelectResults now implemented "generatively"
 
4985
      like the rest of the SelectResults methods [ticket:472].  But
 
4986
      you're going to just use Query now anyway.
 
4987
 
 
4988
    - query() method is added by assignmapper.  this helps with
 
4989
      navigating to all the new generative methods on Query.
 
4990
 
 
4991
- ms-sql:
 
4992
    - removed seconds input on DATE column types (probably
 
4993
        should remove the time altogether)
 
4994
 
 
4995
    - null values in float fields no longer raise errors
 
4996
 
 
4997
    - LIMIT with OFFSET now raises an error (MS-SQL has no OFFSET support)
 
4998
 
 
4999
    - added an facility to use the MSSQL type VARCHAR(max) instead of TEXT
 
5000
      for large unsized string fields. Use the new "text_as_varchar" to
 
5001
      turn it on. [ticket:509]
 
5002
 
 
5003
    - ORDER BY clauses without a LIMIT are now stripped in subqueries, as
 
5004
      MS-SQL forbids this usage
 
5005
 
 
5006
    - cleanup of module importing code; specifiable DB-API module; more
 
5007
      explicit ordering of module preferences. [ticket:480]
 
5008
 
 
5009
- oracle:
 
5010
    - got binary working for any size input !  cx_oracle works fine,
 
5011
      it was my fault as BINARY was being passed and not BLOB for
 
5012
      setinputsizes (also unit tests werent even setting input sizes).
 
5013
 
 
5014
    - also fixed CLOB read/write on a separate changeset.
 
5015
 
 
5016
    - auto_setinputsizes defaults to True for Oracle, fixed cases where
 
5017
      it improperly propagated bad types.
 
5018
 
 
5019
- mysql:
 
5020
    - added a catchall **kwargs to MSString, to help reflection of
 
5021
      obscure types (like "varchar() binary" in MS 4.0)
 
5022
 
 
5023
    - added explicit MSTimeStamp type which takes effect when using
 
5024
      types.TIMESTAMP.
 
5025
 
 
5026
 
 
5027
0.3.5
 
5028
- sql:
 
5029
    - the value of "case_sensitive" defaults to True now, regardless of the
 
5030
      casing of the identifier, unless specifically set to False. this is
 
5031
      because the object might be label'ed as something else which does
 
5032
      contain mixed case, and propigating "case_sensitive=False" breaks that.
 
5033
      Other fixes to quoting when using labels and "fake" column objects
 
5034
    - added a "supports_execution()" method to ClauseElement, so that
 
5035
      individual kinds of clauses can express if they are appropriate for
 
5036
      executing...such as, you can execute a "select", but not a "Table" or a
 
5037
      "Join".
 
5038
    - fixed argument passing to straight textual execute() on engine,
 
5039
      connection. can handle *args or a list instance for positional, **kwargs
 
5040
      or a dict instance for named args, or a list of list or dicts to invoke
 
5041
      executemany()
 
5042
    - small fix to BoundMetaData to accept unicode or string URLs
 
5043
    - fixed named PrimaryKeyConstraint generation [ticket:466] courtesy
 
5044
      andrija at gmail
 
5045
    - fixed generation of CHECK constraints on columns [ticket:464]
 
5046
    - fixes to tometadata() operation to propagate Constraints at column and
 
5047
      table level
 
5048
- oracle:
 
5049
    - when returning "rowid" as the ORDER BY column or in use with ROW_NUMBER
 
5050
      OVER, oracle dialect checks the selectable its being applied to and will
 
5051
      switch to table PK if not applicable, i.e. for a UNION. checking for
 
5052
      DISTINCT, GROUP BY (other places that rowid is invalid) still a TODO.
 
5053
      allows polymorphic mappings to function, [ticket:436]
 
5054
    - sequences on a non-pk column will properly fire off on INSERT
 
5055
    - added PrefetchingResultProxy support to pre-fetch LOB columns when they
 
5056
      are known to be present, fixes [ticket:435]
 
5057
    - implemented reflection of tables based on synonyms, including across
 
5058
      dblinks [ticket:379]
 
5059
    - issues a log warning when a related table cant be reflected due to
 
5060
      certain permission errors [ticket:363]
 
5061
- mysql:
 
5062
    - fix to reflection on older DB's that might return array() type for
 
5063
    "show variables like" statements
 
5064
- postgres:
 
5065
    - better reflection of sequences for alternate-schema Tables [ticket:442]
 
5066
    - sequences on a non-pk column will properly fire off on INSERT
 
5067
    - added PGInterval type [ticket:460], PGInet type [ticket:444]
 
5068
- mssql:
 
5069
    - preliminary support for pyodbc (Yay!) [ticket:419]
 
5070
    - better support for NVARCHAR types added [ticket:298]
 
5071
    - fix for commit logic on pymssql
 
5072
    - fix for query.get() with schema [ticket:456]
 
5073
    - fix for non-integer relationships [ticket:473]
 
5074
    - DB-API module now selectable at run-time [ticket:419]
 
5075
    - now passes many more unit tests [tickets:422, 481, 415]
 
5076
    - better unittest compatibility with ANSI functions [ticket:479]
 
5077
    - improved support for implicit sequence PK columns with auto-insert
 
5078
      [ticket:415]
 
5079
    - fix for blank password in adodbapi [ticket:371]
 
5080
    - fixes to get unit tests working with pyodbc [ticket:481]
 
5081
    - fix to auto_identity_insert on db-url query
 
5082
    - added query_timeout to db-url query parms. currently works only for
 
5083
      pymssql
 
5084
    - tested with pymssql 0.8.0 (which is now LGPL)
 
5085
- orm bugs:
 
5086
    - another refactoring to relationship calculation. Allows more accurate
 
5087
      ORM behavior with relationships from/to/between mappers, particularly
 
5088
      polymorphic mappers, also their usage with Query, SelectResults. tickets
 
5089
      include [ticket:439], [ticket:441], [ticket:448].
 
5090
    - removed deprecated method of specifying custom collections on classes;
 
5091
      you must now use the "collection_class" option. the old way was
 
5092
      beginning to produce conflicts when people used assign_mapper(), which
 
5093
      now patches an "options" method, in conjunction with a relationship
 
5094
      named "options". (relationships take precedence over monkeypatched
 
5095
      assign_mapper methods).
 
5096
    - extension() query option propagates to Mapper._instance() method so that
 
5097
      all loading-related methods get called [ticket:454]
 
5098
    - eager relation to an inheriting mapper wont fail if no rows returned for
 
5099
      the relationship.
 
5100
    - eager relation loading bug fixed for eager relation on multiple
 
5101
      descendant classes [ticket:486]
 
5102
    - fix for very large topological sorts, courtesy ants.aasma at gmail
 
5103
      [ticket:423]
 
5104
    - eager loading is slightly more strict about detecting "self-referential"
 
5105
      relationships, specifically between polymorphic mappers. this results in
 
5106
      an "eager degrade" to lazy loading.
 
5107
    - improved support for complex queries embedded into "where" criterion for
 
5108
      query.select() [ticket:449]
 
5109
    - mapper options like eagerload(), lazyload(), deferred(), will work for
 
5110
      "synonym()" relationships [ticket:485]
 
5111
    - fixed bug where cascade operations incorrectly included deleted
 
5112
      collection items in the cascade [ticket:445]
 
5113
    - fixed relationship deletion error when one-to-many child item is moved
 
5114
      to a new parent in a single unit of work [ticket:478]
 
5115
    - fixed relationship deletion error where parent/child with a single
 
5116
      column as PK/FK on the child would raise a "blank out the primary key"
 
5117
      error, if manually deleted or "delete" cascade without "delete-orphan"
 
5118
      was used
 
5119
    - fix to deferred so that load operation doesnt mistakenly occur when only
 
5120
      PK col attributes are set
 
5121
- orm enhancements:
 
5122
    - implemented foreign_keys argument to mapper [ticket:385]. use in
 
5123
      conjunction with primaryjoin/secondaryjoin arguments to specify/override
 
5124
      foreign keys defined on the Table instance.
 
5125
    - contains_eager('foo') automatically implies eagerload('foo')
 
5126
    - added "alias" argument to contains_eager(). use it to specify the string
 
5127
      name or Alias instance of an alias used in the query for the eagerly
 
5128
      loaded child items. easier to use than "decorator"
 
5129
    - added "contains_alias()" option for result set mapping to an alias of
 
5130
      the mapped table
 
5131
    - added support for py2.5 "with" statement with SessionTransaction
 
5132
      [ticket:468]
 
5133
- extensions:
 
5134
    - added distinct() method to SelectResults. generally should only make a
 
5135
      difference when using count().
 
5136
    - added options() method to SelectResults, equivalent to query.options()
 
5137
      [ticket:472]
 
5138
    - added optional __table_opts__ dictionary to ActiveMapper, will send kw
 
5139
      options to Table objects [ticket:462]
 
5140
    - added selectfirst(), selectfirst_by() to assign_mapper [ticket:467]
 
5141
 
 
5142
0.3.4
 
5143
- general:
 
5144
  - global "insure"->"ensure" change. in US english "insure" is actually
 
5145
    largely interchangeable with "ensure" (so says the dictionary), so I'm not
 
5146
    completely illiterate, but its definitely sub-optimal to "ensure" which is
 
5147
    non-ambiguous.
 
5148
- sql:
 
5149
  - added "fetchmany()" support to ResultProxy
 
5150
  - added support for column "key" attribute to be useable in
 
5151
    row[<key>]/row.<key>
 
5152
  - changed "BooleanExpression" to subclass from "BinaryExpression", so that
 
5153
    boolean expressions can also follow column-clause behaviors (i.e. label(),
 
5154
    etc).
 
5155
  - trailing underscores are trimmed from func.<xxx> calls, such as func.if_()
 
5156
  - fix to correlation of subqueries when the column list of the select
 
5157
    statement is constructed with individual calls to append_column(); this
 
5158
    fixes an ORM bug whereby nested select statements were not getting
 
5159
    correlated with the main select generated by the Query object.
 
5160
  - another fix to subquery correlation so that a subquery which has only one
 
5161
    FROM element will *not* correlate that single element, since at least one
 
5162
    FROM element is required in a query.
 
5163
  - default "timezone" setting is now False. this corresponds to Python's
 
5164
    datetime behavior as well as Postgres' timestamp/time types (which is the
 
5165
    only timezone-sensitive dialect at the moment) [ticket:414]
 
5166
  - the "op()" function is now treated as an "operation", rather than a
 
5167
    "comparison". the difference is, an operation produces a BinaryExpression
 
5168
    from which further operations can occur whereas comparison produces the
 
5169
    more restrictive BooleanExpression
 
5170
  - trying to redefine a reflected primary key column as non-primary key raises
 
5171
    an error
 
5172
  - type system slightly modified to support TypeDecorators that can be
 
5173
    overridden by the dialect (ok, thats not very clear, it allows the mssql
 
5174
    tweak below to be possible)
 
5175
- mssql:
 
5176
  - added an NVarchar type (produces NVARCHAR), also MSUnicode which provides
 
5177
    Unicode-translation for the NVarchar regardless of dialect convert_unicode
 
5178
    setting.
 
5179
- postgres:
 
5180
  - fix to the initial checkfirst for tables to take current schema into
 
5181
    account [ticket:424]
 
5182
  - postgres has an optional "server_side_cursors=True" flag which will utilize
 
5183
    server side cursors. these are appropriate for fetching only partial
 
5184
    results and are necessary for working with very large unbounded result
 
5185
    sets. While we'd like this to be the default behavior, different
 
5186
    environments seem to have different results and the causes have not been
 
5187
    isolated so we are leaving the feature off by default for now. Uses an
 
5188
    apparently undocumented psycopg2 behavior recently discovered on the
 
5189
    psycopg mailing list.
 
5190
  - added "BIGSERIAL" support for postgres table with
 
5191
    PGBigInteger/autoincrement
 
5192
  - fixes to postgres reflection to better handle when schema names are
 
5193
    present; thanks to jason (at) ncsmags.com [ticket:402]
 
5194
- mysql:
 
5195
  - mysql is inconsistent with what kinds of quotes it uses in foreign keys
 
5196
    during a SHOW CREATE TABLE, reflection updated to accomodate for all three
 
5197
    styles [ticket:420]
 
5198
  - mysql table create options work on a generic passthru now, i.e. Table(...,
 
5199
    mysql_engine='InnoDB', mysql_collate="latin1_german2_ci",
 
5200
    mysql_auto_increment="5", mysql_<somearg>...), helps [ticket:418]
 
5201
- firebird:
 
5202
  - order of constraint creation puts primary key first before all other
 
5203
    constraints; required for firebird, not a bad idea for others [ticket:408]
 
5204
  - Firebird fix to autoload multifield foreign keys [ticket:409]
 
5205
  - Firebird NUMERIC type properly handles a type without precision
 
5206
    [ticket:409]
 
5207
- oracle:
 
5208
  - *slight* support for binary, but still need to figure out how to insert
 
5209
    reasonably large values (over 4K). requires auto_setinputsizes=True sent to
 
5210
    create_engine(), rows must be fully fetched individually, etc.
 
5211
- orm:
 
5212
  - poked the first hole in the can of worms: saying
 
5213
    query.select_by(somerelationname=someinstance) will create the join of the
 
5214
    primary key columns represented by "somerelationname"'s mapper to the
 
5215
    actual primary key in "someinstance".
 
5216
  - reworked how relations interact with "polymorphic" mappers, i.e. mappers
 
5217
    that have a select_table as well as polymorphic flags. better determination
 
5218
    of proper join conditions, interaction with user- defined join conditions,
 
5219
    and support for self-referential polymorphic mappers.
 
5220
  - related to polymorphic mapping relations, some deeper error checking when
 
5221
    compiling relations, to detect an ambiguous "primaryjoin" in the case that
 
5222
    both sides of the relationship have foreign key references in the primary
 
5223
    join condition. also tightened down conditions used to locate "relation
 
5224
    direction", associating the "foreignkey" of the relationship with the
 
5225
    "primaryjoin"
 
5226
  - a little bit of improvement to the concept of a "concrete" inheritance
 
5227
    mapping, though that concept is not well fleshed out yet (added test case
 
5228
    to support concrete mappers on top of a polymorphic base).
 
5229
  - fix to "proxy=True" behavior on synonym()
 
5230
  - fixed bug where delete-orphan basically didn't work with many-to-many
 
5231
    relationships [ticket:427], backref presence generally hid the symptom
 
5232
  - added a mutex to the mapper compilation step. ive been reluctant to add any
 
5233
    kind of threading anything to SA but this is one spot that its its really
 
5234
    needed since mappers are typically "global", and while their state does not
 
5235
    change during normal operation, the initial compilation step does modify
 
5236
    internal state significantly, and this step usually occurs not at
 
5237
    module-level initialization time (unless you call compile()) but at
 
5238
    first-request time
 
5239
  - basic idea of "session.merge()" actually implemented.  needs more testing.
 
5240
  - added "compile_mappers()" function as a shortcut to compiling all mappers
 
5241
  - fix to MapperExtension create_instance so that entity_name properly
 
5242
    associated with new instance
 
5243
  - speed enhancements to ORM object instantiation, eager loading of rows
 
5244
  - invalid options sent to 'cascade' string will raise an exception
 
5245
    [ticket:406]
 
5246
  - fixed bug in mapper refresh/expire whereby eager loaders didnt properly
 
5247
    re-populate item lists [ticket:407]
 
5248
  - fix to post_update to ensure rows are updated even for non insert/delete
 
5249
    scenarios [ticket:413]
 
5250
  - added an error message if you actually try to modify primary key values on
 
5251
    an entity and then flush it [ticket:412]
 
5252
- extensions
 
5253
  - added "validate=False" argument to assign_mapper, if True will ensure that
 
5254
    only mapped attributes are named [ticket:426]
 
5255
  - assign_mapper gets "options", "instances" functions added (i.e.
 
5256
    MyClass.instances())
 
5257
 
 
5258
0.3.3
 
5259
- string-based FROM clauses fixed, i.e. select(..., from_obj=["sometext"])
 
5260
- fixes to passive_deletes flag, lazy=None (noload) flag
 
5261
- added example/docs for dealing with large collections
 
5262
- added object_session() method to sqlalchemy namespace
 
5263
- fixed QueuePool bug whereby its better able to reconnect to a database
 
5264
that was not reachable (thanks to Sébastien Lelong), also fixed dispose()
 
5265
method
 
5266
- patch that makes MySQL rowcount work correctly! [ticket:396]
 
5267
- fix to MySQL catch of 2006/2014 errors to properly re-raise OperationalError
 
5268
exception
 
5269
 
 
5270
0.3.2
 
5271
- major connection pool bug fixed.  fixes MySQL out of sync
 
5272
errors, will also prevent transactions getting rolled back
 
5273
accidentally in all DBs [ticket:387]
 
5274
- major speed enhancements vs. 0.3.1, to bring speed
 
5275
back to 0.2.8 levels
 
5276
  - made conditional dozens of debug log calls that were
 
5277
  time-intensive to generate log messages
 
5278
  - fixed bug in cascade rules whereby the entire object graph
 
5279
  could be unnecessarily cascaded on the save/update cascade
 
5280
  - various speedups in attributes module
 
5281
- identity map in Session is by default *no longer weak referencing*.
 
5282
to have it be weak referencing, use create_session(weak_identity_map=True)
 
5283
fixes [ticket:388]
 
5284
- MySQL detects errors 2006 (server has gone away) and 2014
 
5285
(commands out of sync) and invalidates the connection on which it occured.
 
5286
- MySQL bool type fix: [ticket:307]
 
5287
- postgres reflection fixes: [ticket:349] [ticket:382]
 
5288
- added keywords for EXCEPT, INTERSECT, EXCEPT ALL, INTERSECT ALL
 
5289
[ticket:247]
 
5290
- assign_mapper in assignmapper extension returns the created mapper
 
5291
[changeset:2110]
 
5292
- added label() function to Select class, when scalar=True is used
 
5293
to create a scalar subquery
 
5294
i.e. "select x, y, (select max(foo) from table) AS foomax from table"
 
5295
- added onupdate and ondelete keyword arguments to ForeignKey; propagate
 
5296
to underlying ForeignKeyConstraint if present.  (dont propagate in the
 
5297
other direction, however)
 
5298
- fix to session.update() to preserve "dirty" status of incoming object
 
5299
- sending a selectable to an IN via the in_() function no longer creates
 
5300
a "union" out of multiple selects; only one selectable to a the in_() function
 
5301
is allowed now (make a union yourself if union is needed)
 
5302
- improved support for disabling save-update cascade via cascade="none" etc.
 
5303
- added "remote_side" argument to relation(), used only with self-referential
 
5304
mappers to force the direction of the parent/child relationship.  replaces
 
5305
the usage of the "foreignkey" parameter for "switching" the direction.
 
5306
"foreignkey" argument is deprecated for all uses and will eventually
 
5307
be replaced by an argument dedicated to ForeignKey specification on mappers.
 
5308
 
 
5309
0.3.1
 
5310
- Engine/Pool:
 
5311
  - some new Pool utility classes, updated docs
 
5312
  - "use_threadlocal" on Pool defaults to False (same as create_engine)
 
5313
  - fixed direct execution of Compiled objects
 
5314
  - create_engine() reworked to be strict about incoming **kwargs.  all keyword
 
5315
arguments must be consumed by one of the dialect, connection pool, and engine
 
5316
constructors, else a TypeError is thrown which describes the full set of
 
5317
invalid kwargs in relation to the selected dialect/pool/engine configuration.
 
5318
- Databases/Types:
 
5319
  - MySQL catches exception on "describe" and reports as NoSuchTableError
 
5320
  - further fixes to sqlite booleans, weren't working as defaults
 
5321
  - fix to postgres sequence quoting when using schemas
 
5322
- ORM:
 
5323
  - the "delete" cascade will load in all child objects, if they were not
 
5324
loaded already.  this can be turned off (i.e. the old behavior) by setting
 
5325
passive_deletes=True on a relation().
 
5326
  - adjustments to reworked eager query generation to not fail on circular
 
5327
eager-loaded relationships (like backrefs)
 
5328
  - fixed bug where eagerload() (nor lazyload()) option didn't properly
 
5329
instruct the Query whether or not to use "nesting" when producing a
 
5330
LIMIT query.
 
5331
  - fixed bug in circular dependency sorting at flush time; if object A
 
5332
contained a cyclical many-to-one relationship to object B, and object B
 
5333
was just attached to object A, *but* object B itself wasnt changed,
 
5334
the many-to-one synchronize of B's primary key attribute to A's foreign key
 
5335
attribute wouldnt occur.  [ticket:360]
 
5336
  - implemented from_obj argument for query.count, improves count function
 
5337
on selectresults [ticket:325]
 
5338
  - added an assertion within the "cascade" step of ORM relationships to check
 
5339
that the class of object attached to a parent object is appropriate
 
5340
(i.e. if A.items stores B objects, raise an error if a C is appended to A.items)
 
5341
  - new extension sqlalchemy.ext.associationproxy, provides transparent
 
5342
"association object" mappings.  new example
 
5343
examples/association/proxied_association.py illustrates.
 
5344
  - improvement to single table inheritance to load full hierarchies beneath
 
5345
the target class
 
5346
  - fix to subtle condition in topological sort where a node could appear twice,
 
5347
for [ticket:362]
 
5348
  - additional rework to topological sort, refactoring, for [ticket:365]
 
5349
  - "delete-orphan" for a certain type can be set on more than one parent class;
 
5350
the instance is an "orphan" only if its not attached to *any* of those parents
 
5351
 
 
5352
0.3.0
 
5353
- General:
 
5354
    - logging is now implemented via standard python "logging" module.
 
5355
    "echo" keyword parameters are still functional but set/unset
 
5356
    log levels for their respective classes/instances.  all logging
 
5357
    can be controlled directly through the Python API by setting
 
5358
    INFO and DEBUG levels for loggers in the "sqlalchemy" namespace.
 
5359
    class-level logging is under "sqlalchemy.<module>.<classname>",
 
5360
    instance-level logging under "sqlalchemy.<module>.<classname>.0x..<00-FF>".
 
5361
    Test suite includes "--log-info" and "--log-debug" arguments
 
5362
    which work independently of --verbose/--quiet.  Logging added
 
5363
    to orm to allow tracking of mapper configurations, row iteration.
 
5364
    - the documentation-generation system has been overhauled to be
 
5365
    much simpler in design and more integrated with Markdown
 
5366
- Specific Databases:
 
5367
    - SQLite:
 
5368
    - sqlite boolean datatype converts False/True to 0/1 by default
 
5369
    - fixes to Date/Time (SLDate/SLTime) types; works as good as postgres
 
5370
    now [ticket:335]
 
5371
    - MS-SQL:
 
5372
    - fixes bug 261 (table reflection broken for MS-SQL case-sensitive
 
5373
    databases)
 
5374
    - can now specify port for pymssql
 
5375
    - introduces new "auto_identity_insert" option for auto-switching
 
5376
    between "SET IDENTITY_INSERT" mode when values specified for IDENTITY columns
 
5377
    - now supports multi-column foreign keys
 
5378
    - fix to reflecting date/datetime columns
 
5379
    - NCHAR and NVARCHAR type support added
 
5380
    - Oracle:
 
5381
    - Oracle has experimental support for cx_Oracle.TIMESTAMP, which requires
 
5382
    a setinputsizes() call on the cursor that is now enabled via the
 
5383
    'auto_setinputsizes' flag to the oracle dialect.
 
5384
    - Firebird:
 
5385
    - aliases do not use "AS"
 
5386
    - correctly raises NoSuchTableError when reflecting non-existent table
 
5387
- Schema:
 
5388
    - a fair amount of cleanup to the schema package, removal of ambiguous
 
5389
    methods, methods that are no longer needed.  slightly more constrained
 
5390
    useage, greater emphasis on explicitness
 
5391
    - the "primary_key" attribute of Table and other selectables becomes
 
5392
    a setlike ColumnCollection object; is ordered but not numerically
 
5393
    indexed.  a comparison clause between two pks that are derived from the
 
5394
    same underlying tables (i.e. such as two Alias objects) can be generated
 
5395
    via table1.primary_key==table2.primary_key
 
5396
    - ForeignKey(Constraint) supports "use_alter=True", to create/drop a foreign key
 
5397
    via ALTER.  this allows circular foreign key relationships to be set up.
 
5398
    - append_item() methods removed from Table and Column; preferably
 
5399
    construct Table/Column/related objects inline, but if needed use
 
5400
    append_column(), append_foreign_key(), append_constraint(), etc.
 
5401
    - table.create() no longer returns the Table object, instead has no
 
5402
    return value.  the usual case is that tables are created via metadata,
 
5403
    which is preferable since it will handle table dependencies.
 
5404
    - added UniqueConstraint (goes at Table level), CheckConstraint
 
5405
    (goes at Table or Column level).
 
5406
    - index=False/unique=True on Column now creates a UniqueConstraint,
 
5407
    index=True/unique=False creates a plain Index,
 
5408
    index=True/unique=True on Column creates a unique Index.  'index'
 
5409
    and 'unique' keyword arguments to column are now boolean only; for
 
5410
    explcit names and groupings of indexes or unique constraints, use the
 
5411
    UniqueConstraint/Index constructs explicitly.
 
5412
    - added autoincrement=True to Column; will disable schema generation
 
5413
    of SERIAL/AUTO_INCREMENT/identity seq for postgres/mysql/mssql if
 
5414
    explicitly set to False
 
5415
    - TypeEngine objects now have methods to deal with copying and comparing
 
5416
    values of their specific type.  Currently used by the ORM, see below.
 
5417
    - fixed condition that occurred during reflection when a primary key
 
5418
    column was explciitly overridden, where the PrimaryKeyConstraint would
 
5419
    get both the reflected and the programmatic column doubled up
 
5420
    - the "foreign_key" attribute on Column and ColumnElement in general
 
5421
    is deprecated, in favor of the "foreign_keys" list/set-based attribute,
 
5422
    which takes into account multiple foreign keys on one column.
 
5423
    "foreign_key" will return the first element in the "foreign_keys" list/set
 
5424
    or None if the list is empty.
 
5425
- Connections/Pooling/Execution:
 
5426
    - connection pool tracks open cursors and automatically closes them
 
5427
    if connection is returned to pool with cursors still opened.  Can be
 
5428
    affected by options which cause it to raise an error instead, or to
 
5429
    do nothing.  fixes issues with MySQL, others
 
5430
    - fixed bug where Connection wouldnt lose its Transaction
 
5431
    after commit/rollback
 
5432
    - added scalar() method to ComposedSQLEngine, ResultProxy
 
5433
    - ResultProxy will close() the underlying cursor when the ResultProxy
 
5434
    itself is closed.  this will auto-close cursors for ResultProxy objects
 
5435
    that have had all their rows fetched (or had scalar() called).
 
5436
    - ResultProxy.fetchall() internally uses DBAPI fetchall() for better efficiency,
 
5437
    added to mapper iteration as well (courtesy Michael Twomey)
 
5438
- SQL Construction:
 
5439
    - changed "for_update" parameter to accept False/True/"nowait"
 
5440
    and "read", the latter two of which are interpreted only by
 
5441
    Oracle and Mysql [ticket:292]
 
5442
    - added extract() function to sql dialect
 
5443
    (SELECT extract(field FROM expr))
 
5444
    - BooleanExpression includes new "negate" argument to specify
 
5445
    the appropriate negation operator if one is available.
 
5446
    - calling a negation on an "IN" or "IS" clause will result in
 
5447
    "NOT IN", "IS NOT" (as opposed to NOT (x IN y)).
 
5448
    - Function objects know what to do in a FROM clause now.  their
 
5449
    behavior should be the same, except now you can also do things like
 
5450
    select(['*'], from_obj=[func.my_function()]) to get multiple
 
5451
    columns from the result, or even use sql.column() constructs to name the
 
5452
    return columns [ticket:172]
 
5453
- ORM:
 
5454
    - attribute tracking modified to be more intelligent about detecting
 
5455
    changes, particularly with mutable types.  TypeEngine objects now
 
5456
    take a greater role in defining how to compare two scalar instances,
 
5457
    including the addition of a MutableType mixin which is implemented by
 
5458
    PickleType.  unit-of-work now tracks the "dirty" list as an expression
 
5459
    of all persistent objects where the attribute manager detects changes.
 
5460
    The basic issue thats fixed is detecting changes on PickleType
 
5461
    objects, but also generalizes type handling and "modified" object
 
5462
    checking to be more complete and extensible.
 
5463
    - a wide refactoring to "attribute loader" and "options" architectures.
 
5464
    ColumnProperty and PropertyLoader define their loading behaivor via switchable
 
5465
    "strategies", and MapperOptions no longer use mapper/property copying
 
5466
    in order to function; they are instead propagated via QueryContext
 
5467
    and SelectionContext objects at query/instances time.
 
5468
    All of the internal copying of mappers and properties that was used to handle
 
5469
    inheritance as well as options() has been removed; the structure
 
5470
    of mappers and properties is much simpler than before and is clearly laid out
 
5471
    in the new 'interfaces' module.
 
5472
    - related to the mapper/property overhaul, internal refactoring to
 
5473
    mapper instances() method to use a SelectionContext object to track
 
5474
    state during the operation.
 
5475
    SLIGHT API BREAKAGE: the append_result() and populate_instances()
 
5476
    methods on MapperExtension have a slightly different method signature
 
5477
    now as a result of the change; hoping that these methods are not
 
5478
    in widespread use as of yet.
 
5479
    - instances() method moved to Query now, backwards-compatible
 
5480
    version remains on Mapper.
 
5481
    - added contains_eager() MapperOption, used in conjunction with
 
5482
    instances() to specify properties that should be eagerly loaded
 
5483
    from the result set, using their plain column names by default, or translated
 
5484
    given an custom row-translation function.
 
5485
    - more rearrangements of unit-of-work commit scheme to better allow
 
5486
    dependencies within circular flushes to work properly...updated
 
5487
    task traversal/logging implementation
 
5488
    - polymorphic mappers (i.e. using inheritance) now produces INSERT
 
5489
    statements in order of tables across all inherited classes
 
5490
    [ticket:321]
 
5491
    - added an automatic "row switch" feature to mapping, which will
 
5492
    detect a pending instance/deleted instance pair with the same
 
5493
    identity key and convert the INSERT/DELETE to a single UPDATE
 
5494
    - "association" mappings simplified to take advantage of
 
5495
    automatic "row switch" feature
 
5496
    - "custom list classes" is now implemented via the "collection_class"
 
5497
    keyword argument to relation().  the old way still works but is
 
5498
    deprecated [ticket:212]
 
5499
    - added "viewonly" flag to relation(), allows construction of
 
5500
    relations that have no effect on the flush() process.
 
5501
    - added "lockmode" argument to base Query select/get functions,
 
5502
    including "with_lockmode" function to get a Query copy that has
 
5503
    a default locking mode.  Will translate "read"/"update"
 
5504
    arguments into a for_update argument on the select side.
 
5505
    [ticket:292]
 
5506
    - implemented "version check" logic in Query/Mapper, used
 
5507
    when version_id_col is in effect and query.with_lockmode()
 
5508
    is used to get() an instance thats already loaded
 
5509
    - post_update behavior improved; does a better job at not
 
5510
    updating too many rows, updates only required columns
 
5511
    [ticket:208]
 
5512
    - adjustments to eager loading so that its "eager chain" is
 
5513
    kept separate from the normal mapper setup, thereby
 
5514
    preventing conflicts with lazy loader operation, fixes
 
5515
    [ticket:308]
 
5516
    - fix to deferred group loading
 
5517
    - session.flush() wont close a connection it opened [ticket:346]
 
5518
    - added "batch=True" flag to mapper; if False, save_obj
 
5519
    will fully save one object at a time including calls
 
5520
    to before_XXXX and after_XXXX
 
5521
    - added "column_prefix=None" argument to mapper; prepends the
 
5522
    given string (typically '_') to column-based attributes automatically
 
5523
    set up from the mapper's Table
 
5524
    - specifying joins in the from_obj argument of query.select() will
 
5525
    replace the main table of the query, if the table is somewhere within
 
5526
    the given from_obj.  this makes it possible to produce custom joins and
 
5527
    outerjoins in queries without the main table getting added twice.
 
5528
    [ticket:315]
 
5529
    - eagerloading is adjusted to more thoughtfully attach its LEFT OUTER JOINs
 
5530
    to the given query, looking for custom "FROM" clauses that may have
 
5531
    already been set up.
 
5532
    - added join_to and outerjoin_to transformative methods to SelectResults,
 
5533
    to build up join/outerjoin conditions based on property names. also
 
5534
    added select_from to explicitly set from_obj parameter.
 
5535
    - removed "is_primary" flag from mapper.
 
5536
 
 
5537
0.2.8
 
5538
- cleanup on connection methods + documentation.  custom DBAPI
 
5539
arguments specified in query string, 'connect_args' argument
 
5540
to 'create_engine', or custom creation function via 'creator'
 
5541
function to 'create_engine'.
 
5542
- added "recycle" argument to Pool, is "pool_recycle" on create_engine,
 
5543
defaults to 3600 seconds; connections after this age will be closed and
 
5544
replaced with a new one, to handle db's that automatically close
 
5545
stale connections [ticket:274]
 
5546
- changed "invalidate" semantics with pooled connection; will
 
5547
instruct the underlying connection record to reconnect the next
 
5548
time its called.  "invalidate" will also automatically be called
 
5549
if any error is thrown in the underlying call to connection.cursor().
 
5550
this will hopefully allow the connection pool to reconnect to a
 
5551
database that had been stopped and started without restarting
 
5552
the connecting application [ticket:121]
 
5553
- eesh !  the tutorial doctest was broken for quite some time.
 
5554
- add_property() method on mapper does a "compile all mappers"
 
5555
step in case the given property references a non-compiled mapper
 
5556
(as it did in the case of the tutorial !)
 
5557
- [ticket:277] check for pg sequence already existing before create
 
5558
- if a contextual session is established via MapperExtension.get_session
 
5559
(as it is using the sessioncontext plugin, etc), a lazy load operation
 
5560
will use that session by default if the parent object is not
 
5561
persistent with a session already.
 
5562
- lazy loads will not fire off for an object that does not have a
 
5563
database identity (why?
 
5564
see http://www.sqlalchemy.org/trac/wiki/WhyDontForeignKeysLoadData)
 
5565
- unit-of-work does a better check for "orphaned" objects that are
 
5566
part of a "delete-orphan" cascade, for certain conditions where the
 
5567
parent isnt available to cascade from.
 
5568
- mappers can tell if one of their objects is an "orphan" based
 
5569
on interactions with the attribute package. this check is based
 
5570
on a status flag maintained for each relationship
 
5571
when objects are attached and detached from each other.
 
5572
- it is now invalid to declare a self-referential relationship with
 
5573
"delete-orphan" (as the abovementioned check would make them impossible
 
5574
to save)
 
5575
- improved the check for objects being part of a session when the
 
5576
unit of work seeks to flush() them as part of a relationship..
 
5577
- [ticket:280] statement execution supports using the same BindParam
 
5578
object more than once in an expression; simplified handling of positional
 
5579
parameters.  nice job by Bill Noon figuring out the basic idea.
 
5580
- postgres reflection moved to use pg_schema tables, can be overridden
 
5581
with use_information_schema=True argument to create_engine
 
5582
[ticket:60], [ticket:71]
 
5583
- added case_sensitive argument to MetaData, Table, Column, determines
 
5584
itself automatically based on if a parent schemaitem has a non-None
 
5585
setting for the flag, or if not, then whether the identifier name is all lower
 
5586
case or not.  when set to True, quoting is applied to identifiers with mixed or
 
5587
uppercase identifiers.  quoting is also applied automatically in all cases to
 
5588
identifiers that are known to be reserved words or contain other non-standard
 
5589
characters. various database dialects can override all of this behavior, but
 
5590
currently they are all using the default behavior.  tested with postgres, mysql,
 
5591
sqlite, oracle.  needs more testing with firebird, ms-sql. part of the ongoing
 
5592
work with [ticket:155]
 
5593
- unit tests updated to run without any pysqlite installed; pool
 
5594
test uses a mock DBAPI
 
5595
- urls support escaped characters in passwords [ticket:281]
 
5596
- added limit/offset to UNION queries (though not yet in oracle)
 
5597
- added "timezone=True" flag to DateTime and Time types.  postgres
 
5598
so far will convert this to "TIME[STAMP] (WITH|WITHOUT) TIME ZONE",
 
5599
so that control over timezone presence is more controllable (psycopg2
 
5600
returns datetimes with tzinfo's if available, which can create confusion
 
5601
against datetimes that dont).
 
5602
- fix to using query.count() with distinct, **kwargs with SelectResults
 
5603
count() [ticket:287]
 
5604
- deregister Table from MetaData when autoload fails; [ticket:289]
 
5605
- import of py2.5s sqlite3 [ticket:293]
 
5606
- unicode fix for startswith()/endswith() [ticket:296]
 
5607
 
 
5608
0.2.7
 
5609
- quoting facilities set up so that database-specific quoting can be
 
5610
turned on for individual table, schema, and column identifiers when
 
5611
used in all queries/creates/drops.  Enabled via "quote=True" in
 
5612
Table or Column, as well as "quote_schema=True" in Table.  Thanks to
 
5613
Aaron Spike for his excellent efforts.
 
5614
- assignmapper was setting is_primary=True, causing all sorts of mayhem
 
5615
by not raising an error when redundant mappers were set up, fixed
 
5616
- added allow_null_pks option to Mapper, allows rows where some
 
5617
primary key columns are null (i.e. when mapping to outer joins etc)
 
5618
- modifcation to unitofwork to not maintain ordering within the
 
5619
"new" list or within the UOWTask "objects" list; instead, new objects
 
5620
are tagged with an ordering identifier as they are registered as new
 
5621
with the session, and the INSERT statements are then sorted within the
 
5622
mapper save_obj.  the INSERT ordering has basically been pushed all
 
5623
the way to the end of the flush cycle. that way the various sorts and
 
5624
organizations occuring within UOWTask (particularly the circular task
 
5625
sort) dont have to worry about maintaining order (which they werent anyway)
 
5626
- fixed reflection of foreign keys to autoload the referenced table
 
5627
if it was not loaded already
 
5628
- [ticket:256] - pass URL query string arguments to connect() function
 
5629
- [ticket:257] - oracle boolean type
 
5630
- custom primary/secondary join conditions in a relation *will* be propagated
 
5631
to backrefs by default.  specifying a backref() will override this behavior.
 
5632
- better check for ambiguous join conditions in sql.Join; propagates to a
 
5633
better error message in PropertyLoader (i.e. relation()/backref()) for when
 
5634
the join condition can't be reasonably determined.
 
5635
- sqlite creates ForeignKeyConstraint objects properly upon table
 
5636
reflection.
 
5637
- adjustments to pool stemming from changes made for [ticket:224].
 
5638
overflow counter should only be decremented if the connection actually
 
5639
succeeded.  added a test script to attempt testing this.
 
5640
- fixed mysql reflection of default values to be PassiveDefault
 
5641
- added reflected 'tinyint', 'mediumint' type to MS-SQL [ticket:263],
 
5642
[ticket:264]
 
5643
- SingletonThreadPool has a size and does a cleanup pass, so that
 
5644
only a given number of thread-local connections stay around (needed
 
5645
for sqlite applications that dispose of threads en masse)
 
5646
- fixed small pickle bug(s) with lazy loaders [ticket:265] [ticket:267]
 
5647
- fixed possible error in mysql reflection where certain versions
 
5648
return an array instead of string for SHOW CREATE TABLE call
 
5649
- fix to lazy loads when mapping to joins [changeset:1770]
 
5650
- all create()/drop() calls have a keyword argument of "connectable".
 
5651
"engine" is deprecated.
 
5652
- fixed ms-sql connect() to work with adodbapi
 
5653
- added "nowait" flag to Select()
 
5654
- inheritance check uses issubclass() instead of direct __mro__ check
 
5655
to make sure class A inherits from B, allowing mapper inheritance to more
 
5656
flexibly correspond to class inheritance [ticket:271]
 
5657
- SelectResults will use a subselect, when calling an aggregate (i.e.
 
5658
max, min, etc.) on a SelectResults that has an ORDER BY clause
 
5659
[ticket:252]
 
5660
- fixes to types so that database-specific types more easily used;
 
5661
fixes to mysql text types to work with this methodology
 
5662
[ticket:269]
 
5663
- some fixes to sqlite date type organization
 
5664
- added MSTinyInteger to MS-SQL [ticket:263]
 
5665
 
 
5666
0.2.6
 
5667
- big overhaul to schema to allow truly composite primary and foreign
 
5668
key constraints, via new ForeignKeyConstraint and PrimaryKeyConstraint
 
5669
objects.
 
5670
Existing methods of primary/foreign key creation have not been changed
 
5671
but use these new objects behind the scenes.  table creation
 
5672
and reflection is now more table oriented rather than column oriented.
 
5673
[ticket:76]
 
5674
- overhaul to MapperExtension calling scheme, wasnt working very well
 
5675
previously
 
5676
- tweaks to ActiveMapper, supports self-referential relationships
 
5677
- slight rearrangement to objectstore (in activemapper/threadlocal)
 
5678
so that the SessionContext is referenced by '.context' instead
 
5679
of subclassed directly.
 
5680
- activemapper will use threadlocal's objectstore if the mod is
 
5681
activated when activemapper is imported
 
5682
- small fix to URL regexp to allow filenames with '@' in them
 
5683
- fixes to Session expunge/update/etc...needs more cleanup.
 
5684
- select_table mappers *still* werent always compiling
 
5685
- fixed up Boolean datatype
 
5686
- added count()/count_by() to list of methods proxied by assignmapper;
 
5687
this also adds them to activemapper
 
5688
- connection exceptions wrapped in DBAPIError
 
5689
- ActiveMapper now supports autoloading column definitions from the
 
5690
database if you supply a __autoload__ = True attribute in your
 
5691
mapping inner-class.  Currently this does not support reflecting
 
5692
any relationships.
 
5693
- deferred column load could screw up the connection status in
 
5694
a flush() under some circumstances, this was fixed
 
5695
- expunge() was not working with cascade, fixed.
 
5696
- potential endless loop in cascading operations fixed.
 
5697
- added "synonym()" function, applied to properties to have a
 
5698
propname the same as another, for the purposes of overriding props
 
5699
and allowing the original propname to be accessible in select_by().
 
5700
- fix to typing in clause construction which specifically helps
 
5701
type issues with polymorphic_union (CAST/ColumnClause propagates
 
5702
its type to proxy columns)
 
5703
- mapper compilation work ongoing, someday it'll work....moved
 
5704
around the initialization of MapperProperty objects to be after
 
5705
all mappers are created to better handle circular compilations.
 
5706
do_init() method is called on all properties now which are more
 
5707
aware of their "inherited" status if so.
 
5708
- eager loads explicitly disallowed on self-referential relationships, or
 
5709
relationships to an inheriting mapper (which is also self-referential)
 
5710
- reduced bind param size in query._get to appease the picky oracle
 
5711
[ticket:244]
 
5712
- added 'checkfirst' argument to table.create()/table.drop(), as
 
5713
well as table.exists() [ticket:234]
 
5714
- some other ongoing fixes to inheritance [ticket:245]
 
5715
- attribute/backref/orphan/history-tracking tweaks as usual...
 
5716
 
 
5717
0.2.5
 
5718
- fixed endless loop bug in select_by(), if the traversal hit
 
5719
two mappers that referenced each other
 
5720
- upgraded all unittests to insert './lib/' into sys.path,
 
5721
working around new setuptools PYTHONPATH-killing behavior
 
5722
- further fixes with attributes/dependencies/etc....
 
5723
- improved error handling for when DynamicMetaData is not connected
 
5724
- MS-SQL support largely working (tested with pymssql)
 
5725
- ordering of UPDATE and DELETE statements within groups is now
 
5726
in order of primary key values, for more deterministic ordering
 
5727
- after_insert/delete/update mapper extensions now called per object,
 
5728
not per-object-per-table
 
5729
- further fixes/refactorings to mapper compilation
 
5730
 
 
5731
0.2.4
 
5732
- try/except when the mapper sets init.__name__ on a mapped class,
 
5733
supports python 2.3
 
5734
- fixed bug where threadlocal engine would still autocommit
 
5735
despite a transaction in progress
 
5736
- lazy load and deferred load operations require the parent object
 
5737
to be in a Session to do the operation; whereas before the operation
 
5738
would just return a blank list or None, it now raises an exception.
 
5739
- Session.update() is slightly more lenient if the session to which
 
5740
the given object was formerly attached to was garbage collected;
 
5741
otherwise still requires you explicitly remove the instance from
 
5742
the previous Session.
 
5743
- fixes to mapper compilation, checking for more error conditions
 
5744
- small fix to eager loading combined with ordering/limit/offset
 
5745
- utterly remarkable:  added a single space between 'CREATE TABLE'
 
5746
and '(<the rest of it>' since *thats how MySQL indicates a non-
 
5747
reserved word tablename.....* [ticket:206]
 
5748
- more fixes to inheritance, related to many-to-many relations
 
5749
properly saving
 
5750
- fixed bug when specifying explicit module to mysql dialect
 
5751
- when QueuePool times out it raises a TimeoutError instead of
 
5752
erroneously making another connection
 
5753
- Queue.Queue usage in pool has been replaced with a locally
 
5754
modified version (works in py2.3/2.4!) that uses a threading.RLock
 
5755
for a mutex.  this is to fix a reported case where a ConnectionFairy's
 
5756
__del__() method got called within the Queue's get() method, which
 
5757
then returns its connection to the Queue via the the put() method,
 
5758
causing a reentrant hang unless threading.RLock is used.
 
5759
- postgres will not place SERIAL keyword on a primary key column
 
5760
if it has a foreign key constraint
 
5761
- cursor() method on ConnectionFairy allows db-specific extension
 
5762
arguments to be propagated [ticket:221]
 
5763
- lazy load bind params properly propagate column type [ticket:225]
 
5764
- new MySQL types: MSEnum, MSTinyText, MSMediumText, MSLongText, etc.
 
5765
more support for MS-specific length/precision params in numeric types
 
5766
patch courtesy Mike Bernson
 
5767
- some fixes to connection pool invalidate() [ticket:224]
 
5768
 
 
5769
0.2.3
 
5770
- overhaul to mapper compilation to be deferred.  this allows mappers
 
5771
to be constructed in any order, and their relationships to each
 
5772
other are compiled when the mappers are first used.
 
5773
- fixed a pretty big speed bottleneck in cascading behavior particularly
 
5774
when backrefs were in use
 
5775
- the attribute instrumentation module has been completely rewritten; its
 
5776
now a large degree simpler and clearer, slightly faster.  the "history"
 
5777
of an attribute is no longer micromanaged with each change and is
 
5778
instead part of a "CommittedState" object created when the
 
5779
instance is first loaded.  HistoryArraySet is gone, the behavior of
 
5780
list attributes is now more open ended (i.e. theyre not sets anymore).
 
5781
- py2.4 "set" construct used internally, falls back to sets.Set when
 
5782
"set" not available/ordering is needed.
 
5783
- fix to transaction control, so that repeated rollback() calls
 
5784
dont fail (was failing pretty badly when flush() would raise
 
5785
an exception in a larger try/except transaction block)
 
5786
- "foreignkey" argument to relation() can also be a list.  fixed
 
5787
auto-foreignkey detection [ticket:151]
 
5788
- fixed bug where tables with schema names werent getting indexed in
 
5789
the MetaData object properly
 
5790
- fixed bug where Column with redefined "key" property wasnt getting
 
5791
type conversion happening in the ResultProxy [ticket:207]
 
5792
- fixed 'port' attribute of URL to be an integer if present
 
5793
- fixed old bug where if a many-to-many table mapped as "secondary"
 
5794
had extra columns, delete operations didnt work
 
5795
- bugfixes for mapping against UNION queries
 
5796
- fixed incorrect exception class thrown when no DB driver present
 
5797
- added NonExistentTable exception thrown when reflecting a table
 
5798
that doesnt exist [ticket:138]
 
5799
- small fix to ActiveMapper regarding one-to-one backrefs, other
 
5800
refactorings
 
5801
- overridden constructor in mapped classes gets __name__ and
 
5802
__doc__ from the original class
 
5803
- fixed small bug in selectresult.py regarding mapper extension
 
5804
[ticket:200]
 
5805
- small tweak to cascade_mappers, not very strongly supported
 
5806
function at the moment
 
5807
- some fixes to between(), column.between() to propagate typing
 
5808
information better [ticket:202]
 
5809
- if an object fails to be constructed, is not added to the
 
5810
session [ticket:203]
 
5811
- CAST function has been made into its own clause object with
 
5812
its own compilation function in ansicompiler; allows MySQL
 
5813
to silently ignore most CAST calls since MySQL
 
5814
seems to only support the standard CAST syntax with Date types.
 
5815
MySQL-compatible CAST support for strings, ints, etc. a TODO
 
5816
 
 
5817
0.2.2
 
5818
- big improvements to polymorphic inheritance behavior, enabling it
 
5819
to work with adjacency list table structures [ticket:190]
 
5820
- major fixes and refactorings to inheritance relationships overall,
 
5821
more unit tests
 
5822
- fixed "echo_pool" flag on create_engine()
 
5823
- fix to docs, removed incorrect info that close() is unsafe to use
 
5824
with threadlocal strategy (its totally safe !)
 
5825
- create_engine() can take URLs as string or unicode [ticket:188]
 
5826
- firebird support partially completed;
 
5827
thanks to James Ralston and Brad Clements for their efforts.
 
5828
- Oracle url translation was broken, fixed, will feed host/port/sid
 
5829
into cx_oracle makedsn() if 'database' field is present, else uses
 
5830
straight TNS name from the 'host' field
 
5831
- fix to using unicode criterion for query.get()/query.load()
 
5832
- count() function on selectables now uses table primary key or
 
5833
first column instead of "1" for criterion, also uses label "rowcount"
 
5834
instead of "count".
 
5835
- got rudimental "mapping to multiple tables" functionality cleaned up,
 
5836
more correctly documented
 
5837
- restored global_connect() function, attaches to a DynamicMetaData
 
5838
instance called "default_metadata".  leaving MetaData arg to Table
 
5839
out will use the default metadata.
 
5840
- fixes to session cascade behavior, entity_name propigation
 
5841
- reorganized unittests into subdirectories
 
5842
- more fixes to threadlocal connection nesting patterns
 
5843
 
 
5844
0.2.1
 
5845
- "pool" argument to create_engine() properly propagates
 
5846
- fixes to URL, raises exception if not parsed, does not pass blank
 
5847
fields along to the DB connect string (a string such as
 
5848
user:host@/db was breaking on postgres)
 
5849
- small fixes to Mapper when it inserts and tries to get
 
5850
new primary key values back
 
5851
- rewrote half of TLEngine, the ComposedSQLEngine used with
 
5852
'strategy="threadlocal"'.  it now properly implements engine.begin()/
 
5853
engine.commit(), which nest fully with connection.begin()/trans.commit().
 
5854
added about six unittests.
 
5855
- major "duh" in pool.Pool, forgot to put back the WeakValueDictionary.
 
5856
unittest which was supposed to check for this was also silently missing
 
5857
it.  fixed unittest to ensure that ConnectionFairy properly falls out
 
5858
of scope.
 
5859
- placeholder dispose() method added to SingletonThreadPool, doesnt
 
5860
do anything yet
 
5861
- rollback() is automatically called when an exception is raised,
 
5862
but only if theres no transaction in process (i.e. works more like
 
5863
autocommit).
 
5864
- fixed exception raise in sqlite if no sqlite module present
 
5865
- added extra example detail for association object doc
 
5866
- Connection adds checks for already being closed
 
5867
 
 
5868
0.2.0
 
5869
- overhaul to Engine system so that what was formerly the SQLEngine
 
5870
is now a ComposedSQLEngine which consists of a variety of components,
 
5871
including a Dialect, ConnectionProvider, etc. This impacted all the
 
5872
db modules as well as Session and Mapper.
 
5873
- create_engine now takes only RFC-1738-style strings:
 
5874
driver://user:password@host:port/database
 
5875
- total rewrite of connection-scoping methodology, Connection objects
 
5876
can now execute clause elements directly, added explicit "close" as
 
5877
well as support throughout Engine/ORM to handle closing properly,
 
5878
no longer relying upon __del__ internally to return connections
 
5879
to the pool [ticket:152].
 
5880
- overhaul to Session interface and scoping.  uses hibernate-style
 
5881
methods, including query(class), save(), save_or_update(), etc.
 
5882
no threadlocal scope is installed by default.  Provides a binding
 
5883
interface to specific Engines and/or Connections so that underlying
 
5884
Schema objects do not need to be bound to an Engine.  Added a basic
 
5885
SessionTransaction object that can simplistically aggregate transactions
 
5886
across multiple engines.
 
5887
- overhaul to mapper's dependency and "cascade" behavior; dependency logic
 
5888
factored out of properties.py into a separate module "dependency.py".
 
5889
"cascade" behavior is now explicitly controllable, proper implementation
 
5890
of "delete", "delete-orphan", etc.  dependency system can now determine at
 
5891
flush time if a child object has a parent or not so that it makes better
 
5892
decisions on how that child should be updated in the DB with regards to deletes.
 
5893
- overhaul to Schema to build upon MetaData object instead of an Engine.
 
5894
Entire SQL/Schema system can be used with no Engines whatsoever, executed
 
5895
solely by an explicit Connection object.  the "bound" methodlogy exists via the
 
5896
BoundMetaData for schema objects.  ProxyEngine is generally not needed
 
5897
anymore and is replaced by DynamicMetaData.
 
5898
- true polymorphic behavior implemented, fixes [ticket:167]
 
5899
- "oid" system has been totally moved into compile-time behavior;
 
5900
if they are used in an order_by where they are not available, the order_by
 
5901
doesnt get compiled, fixes [ticket:147]
 
5902
- overhaul to packaging; "mapping" is now "orm", "objectstore" is now
 
5903
"session", the old "objectstore" namespace gets loaded in via the
 
5904
"threadlocal" mod if used
 
5905
- mods now called in via "import <modname>".  extensions favored over
 
5906
mods as mods are globally-monkeypatching
 
5907
- fix to add_property so that it propagates properties to inheriting
 
5908
mappers [ticket:154]
 
5909
- backrefs create themselves against primary mapper of its originating
 
5910
property, priamry/secondary join arguments can be specified to override.
 
5911
helps their usage with polymorphic mappers
 
5912
- "table exists" function has been implemented [ticket:31]
 
5913
- "create_all/drop_all" added to MetaData object [ticket:98]
 
5914
- improvements and fixes to topological sort algorithm, as well as more
 
5915
unit tests
 
5916
- tutorial page added to docs which also can be run with a custom doctest
 
5917
runner to ensure its properly working.  docs generally overhauled to
 
5918
deal with new code patterns
 
5919
- many more fixes, refactorings.
 
5920
- migration guide is available on the Wiki at
 
5921
http://www.sqlalchemy.org/trac/wiki/02Migration
 
5922
 
 
5923
0.1.7
 
5924
- some fixes to topological sort algorithm
 
5925
- added DISTINCT ON support to Postgres (just supply distinct=[col1,col2..])
 
5926
- added __mod__ (% operator) to sql expressions
 
5927
- "order_by" mapper property inherited from inheriting mapper
 
5928
- fix to column type used when mapper UPDATES/DELETEs
 
5929
- with convert_unicode=True, reflection was failing, has been fixed
 
5930
- types types types!  still werent working....have to use TypeDecorator again :(
 
5931
- mysql binary type converts array output to buffer, fixes PickleType
 
5932
- fixed the attributes.py memory leak once and for all
 
5933
- unittests are qualified based on the databases that support each one
 
5934
- fixed bug where column defaults would clobber VALUES clause of insert objects
 
5935
- fixed bug where table def w/ schema name would force engine connection
 
5936
- fix for parenthesis to work correctly with subqueries in INSERT/UPDATE
 
5937
- HistoryArraySet gets extend() method
 
5938
- fixed lazyload support for other comparison operators besides =
 
5939
- lazyload fix where two comparisons in the join condition point to the
 
5940
samem column
 
5941
- added "construct_new" flag to mapper, will use __new__ to create instances
 
5942
instead of __init__ (standard in 0.2)
 
5943
- added selectresults.py to SVN, missed it last time
 
5944
- tweak to allow a many-to-many relationship from a table to itself via
 
5945
an association table
 
5946
- small fix to "translate_row" function used by polymorphic example
 
5947
- create_engine uses cgi.parse_qsl to read query string (out the window in 0.2)
 
5948
- tweaks to CAST operator
 
5949
- fixed function names LOCAL_TIME/LOCAL_TIMESTAMP -> LOCALTIME/LOCALTIMESTAMP
 
5950
- fixed order of ORDER BY/HAVING in compile
 
5951
 
 
5952
0.1.6
 
5953
- support for MS-SQL added courtesy Rick Morrison, Runar Petursson
 
5954
- the latest SQLSoup from J. Ellis
 
5955
- ActiveMapper has preliminary support for inheritance (Jeff Watkins)
 
5956
- added a "mods" system which allows pluggable modules that modify/augment
 
5957
core functionality, using the function "install_mods(*modnames)".
 
5958
- added the first "mod", SelectResults, which modifies mapper selects to
 
5959
return generators that turn ranges into LIMIT/OFFSET queries 
 
5960
(Jonas Borgstr?
 
5961
- factored out querying capabilities of Mapper into a separate Query object
 
5962
which is Session-centric.  this improves the performance of mapper.using(session)
 
5963
and makes other things possible.
 
5964
- objectstore/Session refactored, the official way to save objects is now
 
5965
via the flush() method.  The begin/commit functionality of Session is factored
 
5966
into LegacySession which is still established as the default behavior, until
 
5967
the 0.2 series.
 
5968
- types system is bound to an engine at query compile time, not schema
 
5969
construction time.  this simplifies the types system as well as the ProxyEngine.
 
5970
- added 'version_id' keyword argument to mapper. this keyword should reference a
 
5971
Column object with type Integer, preferably non-nullable, which will be used on
 
5972
the mapped table to track version numbers. this number is incremented on each
 
5973
save operation and is specifed in the UPDATE/DELETE conditions so that it
 
5974
factors into the returned row count, which results in a ConcurrencyError if the
 
5975
value received is not the expected count.
 
5976
- added 'entity_name' keyword argument to mapper. a mapper is now associated
 
5977
with a class via the class object as well as an optional entity_name parameter,
 
5978
which is a string defaulting to None. any number of primary mappers can be
 
5979
created for a class, qualified by the entity name. instances of those classes
 
5980
will issue all of their load and save operations through their
 
5981
entity_name-qualified mapper, and maintain separate a identity in the identity
 
5982
map for an otherwise equilvalent object.
 
5983
- overhaul to the attributes system. code has been clarified, and also fixed to
 
5984
support proper polymorphic behavior on object attributes.
 
5985
- added "for_update" flag to Select objects
 
5986
- some fixes for backrefs
 
5987
- fix for postgres1 DateTime type
 
5988
- documentation pages mostly switched over to Markdown syntax
 
5989
 
 
5990
0.1.5
 
5991
- added SQLSession concept to SQLEngine. this object keeps track of retrieving a
 
5992
connection from the connection pool as well as an in-progress transaction.
 
5993
methods push_session() and pop_session() added to SQLEngine which push/pop a new
 
5994
SQLSession onto the engine, allowing operation upon a second connection "nested"
 
5995
within the previous one, allowing nested transactions. Other tricks are sure to
 
5996
come later regarding SQLSession.
 
5997
- added nest_on argument to objectstore.Session. This is a single SQLEngine or
 
5998
list of engines for which push_session()/pop_session() will be called each time
 
5999
this Session becomes the active session (via objectstore.push_session() or
 
6000
equivalent). This allows a unit of work Session to take advantage of the nested
 
6001
transaction feature without explicitly calling push_session/pop_session on the
 
6002
engine.
 
6003
- factored apart objectstore/unitofwork to separate "Session scoping" from
 
6004
"uow commit heavy lifting"
 
6005
- added populate_instance() method to MapperExtension. allows an extension to
 
6006
modify the population of object attributes. this method can call the
 
6007
populate_instance() method on another mapper to proxy the attribute population
 
6008
from one mapper to another; some row translation logic is also built in to help
 
6009
with this.
 
6010
- fixed Oracle8-compatibility "use_ansi" flag which converts JOINs to
 
6011
comparisons with the = and (+) operators, passes basic unittests
 
6012
- tweaks to Oracle LIMIT/OFFSET support
 
6013
- Oracle reflection uses ALL_** views instead of USER_** to get larger
 
6014
list of stuff to reflect from
 
6015
- fixes to Oracle foreign key reflection [ticket:105]
 
6016
- objectstore.commit(obj1, obj2,...) adds an extra step to seek out private
 
6017
relations on properties and delete child objects, even though its not a global
 
6018
commit
 
6019
- lots and lots of fixes to mappers which use inheritance, strengthened the
 
6020
concept of relations on a mapper being made towards the "local" table for that
 
6021
mapper, not the tables it inherits.  allows more complex compositional patterns
 
6022
to work with lazy/eager loading.
 
6023
- added support for mappers to inherit from others based on the same table,
 
6024
just specify the same table as that of both parent/child mapper.
 
6025
- some minor speed improvements to the attributes system with regards to
 
6026
instantiating and populating new objects.
 
6027
- fixed MySQL binary unit test
 
6028
- INSERTs can receive clause elements as VALUES arguments, not just literal
 
6029
values
 
6030
- support for calling multi-tokened functions, i.e. schema.mypkg.func()
 
6031
- added J. Ellis' SQLSoup module to extensions package
 
6032
- added "polymorphic" examples illustrating methods to load multiple object types
 
6033
from one mapper, the second of which uses the new populate_instance() method.
 
6034
small improvements to mapper, UNION construct to help the examples along
 
6035
- improvements/fixes to session.refresh()/session.expire() (which may have
 
6036
been called "invalidate" earlier..)
 
6037
- added session.expunge() which totally removes an object from the current
 
6038
session
 
6039
- added *args, **kwargs pass-thru to engine.transaction(func) allowing easier
 
6040
creation of transactionalizing decorator functions
 
6041
- added iterator interface to ResultProxy:  "for row in result:..."
 
6042
- added assertion to tx = session.begin(); tx.rollback(); tx.begin(), i.e. cant
 
6043
use it after a rollback()
 
6044
- added date conversion on bind parameter fix to SQLite enabling dates to
 
6045
work with pysqlite1
 
6046
- improvements to subqueries to more intelligently construct their FROM
 
6047
clauses [ticket:116]
 
6048
- added PickleType to types.
 
6049
- fixed two bugs with column labels with regards to bind parameters: bind param
 
6050
keynames they are now generated from a column "label" in all relevant cases to
 
6051
take advantage of excess-name-length rules, and checks for a peculiar collision
 
6052
against a column named the same as "tablename_colname" added
 
6053
- major overhaul to unit of work documentation, other documentation sections.
 
6054
- fixed attributes bug where if an object is committed, its lazy-loaded list got
 
6055
blown away if it hadnt been loaded
 
6056
- added unique_connection() method to engine, connection pool to return a
 
6057
connection that is not part of the thread-local context or any current
 
6058
transaction
 
6059
- added invalidate() function to pooled connection.  will remove the connection
 
6060
from the pool.  still need work for engines to auto-reconnect to a stale DB
 
6061
though.
 
6062
- added distinct() function to column elements so you can do
 
6063
func.count(mycol.distinct())
 
6064
- added "always_refresh" flag to Mapper, creates a mapper that will always
 
6065
refresh the attributes of objects it gets/selects from the DB, overwriting any
 
6066
changes made.
 
6067
 
 
6068
0.1.4
 
6069
- create_engine() now uses genericized parameters; host/hostname,
 
6070
db/dbname/database, password/passwd, etc. for all engine connections. makes
 
6071
 engine URIs much more "universal"
 
6072
- added support for SELECT statements embedded into a column clause, using the
 
6073
flag "scalar=True"
 
6074
- another overhaul to EagerLoading when used in conjunction with mappers that
 
6075
inherit; improvements to eager loads figuring out their aliased queries
 
6076
correctly, also relations set up against a mapper with inherited mappers will
 
6077
create joins against the table that is specific to the mapper itself (i.e. and
 
6078
not any tables that are inherited/are further down the inheritance chain),
 
6079
this can be overridden by using custom primary/secondary joins.
 
6080
- added J.Ellis patch to mapper.py so that selectone() throws an exception
 
6081
if query returns more than one object row, selectfirst() to not throw the
 
6082
exception. also adds selectfirst_by (synonymous with get_by) and selectone_by
 
6083
- added onupdate parameter to Column, will exec SQL/python upon an update
 
6084
statement.Also adds "for_update=True" to all DefaultGenerator subclasses
 
6085
- added support for Oracle table reflection contributed by Andrija Zaric;
 
6086
still some bugs to work out regarding composite primary keys/dictionary selection
 
6087
- checked in an initial Firebird module, awaiting testing.
 
6088
- added sql.ClauseParameters dictionary object as the result for
 
6089
compiled.get_params(), does late-typeprocessing of bind parameters so
 
6090
that the original values are easier to access
 
6091
- more docs for indexes, column defaults, connection pooling, engine construction
 
6092
- overhaul to the construction of the types system. uses a simpler inheritance
 
6093
pattern so that any of the generic types can be easily subclassed, with no need
 
6094
for TypeDecorator.
 
6095
- added "convert_unicode=False" parameter to SQLEngine, will cause all String
 
6096
types to perform unicode encoding/decoding (makes Strings act like Unicodes)
 
6097
- added 'encoding="utf8"' parameter to engine.  the given encoding will be
 
6098
used for all encode/decode calls within Unicode types as well as Strings
 
6099
when convert_unicode=True.
 
6100
- improved support for mapping against UNIONs, added polymorph.py example
 
6101
to illustrate multi-class mapping against a UNION
 
6102
- fix to SQLite LIMIT/OFFSET syntax
 
6103
- fix to Oracle LIMIT syntax
 
6104
- added backref() function, allows backreferences to have keyword arguments
 
6105
that will be passed to the backref.
 
6106
- Sequences and ColumnDefault objects can do execute()/scalar() standalone
 
6107
- SQL functions (i.e. func.foo()) can do execute()/scalar() standalone
 
6108
- fix to SQL functions so that the ANSI-standard functions, i.e. current_timestamp
 
6109
etc., do not specify parenthesis.  all other functions do.
 
6110
- added settattr_clean and append_clean to SmartProperty, which set
 
6111
attributes without triggering a "dirty" event or any history. used as:
 
6112
myclass.prop1.setattr_clean(myobject, 'hi')
 
6113
- improved support to column defaults when used by mappers; mappers will pull
 
6114
pre-executed defaults from statement's executed bind parameters
 
6115
(pre-conversion) to populate them into a saved object's attributes; if any
 
6116
PassiveDefaults have fired off, will instead post-fetch the row from the DB to
 
6117
populate the object.
 
6118
- added 'get_session().invalidate(*obj)' method to objectstore, instances will
 
6119
refresh() themselves upon the next attribute access.
 
6120
- improvements to SQL func calls including an "engine" keyword argument so
 
6121
they can be execute()d or scalar()ed standalone, also added func accessor to
 
6122
SQLEngine
 
6123
- fix to MySQL4 custom table engines, i.e. TYPE instead of ENGINE
 
6124
- slightly enhanced logging, includes timestamps and a somewhat configurable
 
6125
formatting system, in lieu of a full-blown logging system
 
6126
- improvements to the ActiveMapper class from the TG gang, including
 
6127
many-to-many relationships
 
6128
- added Double and TinyInt support to mysql
 
6129
 
 
6130
0.1.3
 
6131
- completed "post_update" feature, will add a second update statement before
 
6132
inserts and after deletes in order to reconcile a relationship without any
 
6133
dependencies being created; used when persisting two rows that are dependent
 
6134
on each other
 
6135
- completed mapper.using(session) function, localized per-object Session
 
6136
functionality; objects can be declared and manipulated as local to any
 
6137
user-defined Session
 
6138
- fix to Oracle "row_number over" clause with multiple tables
 
6139
- mapper.get() was not selecting multiple-keyed objects if the mapper's table was a join,
 
6140
such as in an inheritance relationship, this is fixed.
 
6141
- overhaul to sql/schema packages so that the sql package can run all on its own,
 
6142
producing selects, inserts, etc. without any engine dependencies.  builds upon
 
6143
new TableClause/ColumnClause lexical objects.  Schema's Table/Column objects
 
6144
are the "physical" subclasses of them.  simplifies schema/sql relationship,
 
6145
extensions (like proxyengine), and speeds overall performance by a large margin.
 
6146
removes the entire getattr() behavior that plagued 0.1.1.
 
6147
- refactoring of how the mapper "synchronizes" data between two objects into a
 
6148
separate module, works better with properties attached to a mapper that has an
 
6149
additional inheritance relationship to one of the related tables, also the same
 
6150
methodology used to synchronize parent/child objects now used by mapper to
 
6151
synchronize between inherited and inheriting mappers.
 
6152
- made objectstore "check for out-of-identitymap" more aggressive, will perform the
 
6153
check when object attributes are modified or the object is deleted
 
6154
- Index object fully implemented, can be constructed standalone, or via
 
6155
"index" and "unique" arguments on Columns.
 
6156
- added "convert_unicode" flag to SQLEngine, will treat all String/CHAR types
 
6157
as Unicode types, with raw-byte/utf-8 translation on the bind parameter and
 
6158
result set side.
 
6159
- postgres maintains a list of ANSI functions that must have no parenthesis so
 
6160
function calls with no arguments work consistently
 
6161
- tables can be created with no engine specified.  this will default their engine
 
6162
to a module-scoped "default engine" which is a ProxyEngine.  this engine can
 
6163
be connected via the function "global_connect".
 
6164
- added "refresh(*obj)" method to objectstore / Session to reload the attributes of
 
6165
any set of objects from the database unconditionally
 
6166
 
 
6167
0.1.2
 
6168
- fixed a recursive call in schema that was somehow running 994 times then returning
 
6169
normally.  broke nothing, slowed down everything.  thanks to jpellerin for finding this.
 
6170
 
 
6171
0.1.1
 
6172
- small fix to Function class so that expressions with a func.foo() use the type of the
 
6173
Function object (i.e. the left side) as the type of the boolean expression, not the
 
6174
other side which is more of a moving target (changeset 1020).
 
6175
- creating self-referring mappers with backrefs slightly easier (but still not that easy -
 
6176
changeset 1019)
 
6177
- fixes to one-to-one mappings (changeset 1015)
 
6178
- psycopg1 date/time issue with None fixed (changeset 1005)
 
6179
- two issues related to postgres, which doesnt want to give you the "lastrowid"
 
6180
since oids are deprecated:
 
6181
   * postgres database-side defaults that are on primary key cols *do* execute
 
6182
explicitly beforehand, even though thats not the idea of a PassiveDefault.  this is
 
6183
because sequences on columns get reflected as PassiveDefaults, but need to be explicitly
 
6184
executed on a primary key col so we know what we just inserted.
 
6185
   * if you did add a row that has a bunch of database-side defaults on it,
 
6186
and the PassiveDefault thing was working the old way, i.e. they just execute on
 
6187
the DB side, the "cant get the row back without an OID" exception that occurred
 
6188
also will not happen unless someone (usually the ORM) explicitly asks for it.
 
6189
- fixed a glitch with engine.execute_compiled where it was making a second
 
6190
ResultProxy that just got thrown away.
 
6191
- began to implement newer logic in object properities.  you can now say
 
6192
myclass.attr.property, which will give you the PropertyLoader corresponding to that
 
6193
attribute, i.e. myclass.mapper.props['attr']
 
6194
- eager loading has been internally overhauled to use aliases at all times.  more
 
6195
complicated chains of eager loads can now be created without any need for explicit
 
6196
"use aliases"-type instructions.  EagerLoader code is also much simpler now.
 
6197
- a new somewhat experimental flag "use_update" added to relations, indicates that
 
6198
this relationship should be handled by a second UPDATE statement, either after a
 
6199
primary INSERT or before a primary DELETE.  handles circular row dependencies.
 
6200
- added exceptions module, all raised exceptions (except for some
 
6201
KeyError/AttributeError exceptions) descend from these classes.
 
6202
- fix to date types with MySQL, returned timedelta converted to datetime.time
 
6203
- two-phase objectstore.commit operations (i.e. begin/commit) now return a
 
6204
transactional object (SessionTrans), to more clearly indicate transaction boundaries.
 
6205
- Index object with create/drop support added to schema
 
6206
- fix to postgres, where it will explicitly pre-execute a PassiveDefault on a table
 
6207
if it is a primary key column, pursuant to the ongoing "we cant get inserted rows
 
6208
back from postgres" issue
 
6209
- change to information_schema query that gets back postgres table defs, now
 
6210
uses explicit JOIN keyword, since one user had faster performance with 8.1
 
6211
- fix to engine.process_defaults so it works correctly with a table that has
 
6212
different column name/column keys (changset 982)
 
6213
- a column can only be attached to one table - this is now asserted
 
6214
- postgres time types descend from Time type
 
6215
- fix to alltests so that it runs types test (now named testtypes)
 
6216
- fix to Join object so that it correctly exports its foreign keys (cs 973)
 
6217
- creating relationships against mappers that use inheritance fixed (cs 973)
 
6218
 
 
6219
0.1.0
 
6220
initial release
 
6221
 
 
6222