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

« back to all changes in this revision

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

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

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
==============
 
3
0.4 Changelog
 
4
==============
 
5
 
 
6
                
 
7
.. changelog::
 
8
    :version: 0.4.8
 
9
    :released: Sun Oct 12 2008
 
10
 
 
11
    .. change::
 
12
        :tags: orm
 
13
        :tickets: 1039
 
14
 
 
15
      Fixed bug regarding inherit_condition passed
 
16
      with "A=B" versus "B=A" leading to errors
 
17
 
 
18
    .. change::
 
19
        :tags: orm
 
20
        :tickets: 
 
21
 
 
22
      Changes made to new, dirty and deleted
 
23
      collections in
 
24
      SessionExtension.before_flush() will take
 
25
      effect for that flush.
 
26
 
 
27
    .. change::
 
28
        :tags: orm
 
29
        :tickets: 
 
30
 
 
31
      Added label() method to InstrumentedAttribute
 
32
      to establish forwards compatibility with 0.5.
 
33
 
 
34
    .. change::
 
35
        :tags: sql
 
36
        :tickets: 1074
 
37
 
 
38
      column.in_(someselect) can now be used as
 
39
      a columns-clause expression without the subquery
 
40
      bleeding into the FROM clause
 
41
 
 
42
    .. change::
 
43
        :tags: mysql
 
44
        :tickets: 1146
 
45
 
 
46
      Added MSMediumInteger type.
 
47
 
 
48
    .. change::
 
49
        :tags: sqlite
 
50
        :tickets: 968
 
51
 
 
52
      Supplied a custom strftime() function which
 
53
      handles dates before 1900.
 
54
 
 
55
    .. change::
 
56
        :tags: sqlite
 
57
        :tickets: 
 
58
 
 
59
      String's (and Unicode's, UnicodeText's, etc.)
 
60
      convert_unicode logic disabled in the sqlite dialect,
 
61
      to adjust for pysqlite 2.5.0's new requirement that
 
62
      only Python unicode objects are accepted;
 
63
      http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
 
64
 
 
65
    .. change::
 
66
        :tags: oracle
 
67
        :tickets: 1155
 
68
 
 
69
      has_sequence() now takes schema name into account
 
70
 
 
71
    .. change::
 
72
        :tags: oracle
 
73
        :tickets: 1121
 
74
 
 
75
      added BFILE to the list of reflected types
 
76
 
 
77
.. changelog::
 
78
    :version: 0.4.7p1
 
79
    :released: Thu Jul 31 2008
 
80
 
 
81
    .. change::
 
82
        :tags: orm
 
83
        :tickets: 
 
84
 
 
85
      Added "add()" and "add_all()" to scoped_session
 
86
      methods.  Workaround for 0.4.7:
 
87
      
 
88
        from sqlalchemy.orm.scoping import ScopedSession,\
 
89
        instrument
 
90
        setattr(
 
91
            ScopedSession, "add", instrument("add"))
 
92
        setattr(
 
93
            ScopedSession, "add_all", instrument("add_all"))
 
94
 
 
95
    .. change::
 
96
        :tags: orm
 
97
        :tickets: 
 
98
 
 
99
      Fixed non-2.3 compatible usage of set() and generator
 
100
      expression within relation().
 
101
 
 
102
.. changelog::
 
103
    :version: 0.4.7
 
104
    :released: Sat Jul 26 2008
 
105
 
 
106
    .. change::
 
107
        :tags: orm
 
108
        :tickets: 1058
 
109
 
 
110
      The contains() operator when used with many-to-many
 
111
      will alias() the secondary (association) table so
 
112
      that multiple contains() calls will not conflict
 
113
      with each other
 
114
 
 
115
    .. change::
 
116
        :tags: orm
 
117
        :tickets: 
 
118
 
 
119
      fixed bug preventing merge() from functioning in
 
120
      conjunction with a comparable_property()
 
121
 
 
122
    .. change::
 
123
        :tags: orm
 
124
        :tickets: 
 
125
 
 
126
      the enable_typechecks=False setting on relation()
 
127
      now only allows subtypes with inheriting mappers.
 
128
      Totally unrelated types, or subtypes not set up with
 
129
      mapper inheritance against the target mapper are
 
130
      still not allowed.
 
131
 
 
132
    .. change::
 
133
        :tags: orm
 
134
        :tickets: 976
 
135
 
 
136
      Added is_active flag to Sessions to detect when
 
137
      a transaction is in progress.  This
 
138
      flag is always True with a "transactional"
 
139
      (in 0.5 a non-"autocommit") Session.
 
140
 
 
141
    .. change::
 
142
        :tags: sql
 
143
        :tickets: 
 
144
 
 
145
      Fixed bug when calling select([literal('foo')])
 
146
      or select([bindparam('foo')]).
 
147
 
 
148
    .. change::
 
149
        :tags: schema
 
150
        :tickets: 571
 
151
 
 
152
      create_all(), drop_all(), create(), drop() all raise
 
153
      an error if the table name or schema name contains
 
154
      more characters than that dialect's configured
 
155
      character limit.  Some DB's can handle too-long
 
156
      table names during usage, and SQLA can handle this
 
157
      as well. But various reflection/
 
158
      checkfirst-during-create scenarios fail since we are
 
159
      looking for the name within the DB's catalog tables.
 
160
 
 
161
    .. change::
 
162
        :tags: schema
 
163
        :tickets: 571, 820
 
164
 
 
165
      The index name generated when you say "index=True"
 
166
      on a Column is truncated to the length appropriate
 
167
      for the dialect. Additionally, an Index with a too-
 
168
      long name cannot be explicitly dropped with
 
169
      Index.drop(), similar to.
 
170
 
 
171
    .. change::
 
172
        :tags: postgres
 
173
        :tickets: 
 
174
 
 
175
      Repaired server_side_cursors to properly detect
 
176
      text() clauses.
 
177
 
 
178
    .. change::
 
179
        :tags: postgres
 
180
        :tickets: 1092
 
181
 
 
182
      Added PGCidr type.
 
183
 
 
184
    .. change::
 
185
        :tags: mysql
 
186
        :tickets: 
 
187
 
 
188
      Added 'CALL' to the list of SQL keywords which return
 
189
      result rows.
 
190
 
 
191
    .. change::
 
192
        :tags: oracle
 
193
        :tickets: 
 
194
 
 
195
      Oracle get_default_schema_name() "normalizes" the name
 
196
      before returning, meaning it returns a lower-case name
 
197
      when the identifier is detected as case insensitive.
 
198
 
 
199
    .. change::
 
200
        :tags: oracle
 
201
        :tickets: 709
 
202
 
 
203
      creating/dropping tables takes schema name into account
 
204
      when searching for the existing table, so that tables
 
205
      in other owner namespaces with the same name do not
 
206
      conflict
 
207
 
 
208
    .. change::
 
209
        :tags: oracle
 
210
        :tickets: 1062
 
211
 
 
212
      Cursors now have "arraysize" set to 50 by default on
 
213
      them, the value of which is configurable using the
 
214
      "arraysize" argument to create_engine() with the
 
215
      Oracle dialect.  This to account for cx_oracle's default
 
216
      setting of "1", which has the effect of many round trips
 
217
      being sent to Oracle.  This actually works well in
 
218
      conjunction with BLOB/CLOB-bound cursors, of which
 
219
      there are any number available but only for the life of
 
220
      that row request (so BufferedColumnRow is still needed,
 
221
      but less so).
 
222
 
 
223
    .. change::
 
224
        :tags: oracle
 
225
        :tickets: 
 
226
 
 
227
      sqlite
 
228
          - add SLFloat type, which matches the SQLite REAL
 
229
            type affinity.  Previously, only SLNumeric was provided
 
230
            which fulfills NUMERIC affinity, but that's not the
 
231
            same as REAL.
 
232
 
 
233
.. changelog::
 
234
    :version: 0.4.6
 
235
    :released: Sat May 10 2008
 
236
 
 
237
    .. change::
 
238
        :tags: orm
 
239
        :tickets: 
 
240
 
 
241
      Fix to the recent relation() refactoring which fixes
 
242
      exotic viewonly relations which join between local and
 
243
      remote table multiple times, with a common column shared
 
244
      between the joins.
 
245
 
 
246
    .. change::
 
247
        :tags: orm
 
248
        :tickets: 
 
249
 
 
250
      Also re-established viewonly relation() configurations
 
251
      that join across multiple tables.
 
252
 
 
253
    .. change::
 
254
        :tags: orm
 
255
        :tickets: 610
 
256
 
 
257
      Added experimental relation() flag to help with
 
258
      primaryjoins across functions, etc.,
 
259
      _local_remote_pairs=[tuples].  This complements a complex
 
260
      primaryjoin condition allowing you to provide the
 
261
      individual column pairs which comprise the relation's
 
262
      local and remote sides.  Also improved lazy load SQL
 
263
      generation to handle placing bind params inside of
 
264
      functions and other expressions.  (partial progress
 
265
      towards)
 
266
 
 
267
    .. change::
 
268
        :tags: orm
 
269
        :tickets: 1036
 
270
 
 
271
      repaired single table inheritance such that you
 
272
      can single-table inherit from a joined-table inherting
 
273
      mapper without issue.
 
274
 
 
275
    .. change::
 
276
        :tags: orm
 
277
        :tickets: 1027
 
278
 
 
279
      Fixed "concatenate tuple" bug which could occur with
 
280
      Query.order_by() if clause adaption had taken place.
 
281
 
 
282
    .. change::
 
283
        :tags: orm
 
284
        :tickets: 
 
285
 
 
286
      Removed ancient assertion that mapped selectables require
 
287
      "alias names" - the mapper creates its own alias now if
 
288
      none is present.  Though in this case you need to use the
 
289
      class, not the mapped selectable, as the source of column
 
290
      attributes - so a warning is still issued.
 
291
 
 
292
    .. change::
 
293
        :tags: orm
 
294
        :tickets: 
 
295
 
 
296
      fixes to the "exists" function involving inheritance (any(),
 
297
      has(), ~contains()); the full target join will be rendered
 
298
      into the EXISTS clause for relations that link to subclasses.
 
299
 
 
300
    .. change::
 
301
        :tags: orm
 
302
        :tickets: 
 
303
 
 
304
      restored usage of append_result() extension method for primary
 
305
      query rows, when the extension is present and only a single-
 
306
      entity result is being returned.
 
307
 
 
308
    .. change::
 
309
        :tags: orm
 
310
        :tickets: 
 
311
 
 
312
      Also re-established viewonly relation() configurations that
 
313
      join across multiple tables.
 
314
 
 
315
    .. change::
 
316
        :tags: orm
 
317
        :tickets: 
 
318
 
 
319
      removed ancient assertion that mapped selectables require
 
320
      "alias names" - the mapper creates its own alias now if
 
321
      none is present.  Though in this case you need to use
 
322
      the class, not the mapped selectable, as the source of
 
323
      column attributes - so a warning is still issued.
 
324
 
 
325
    .. change::
 
326
        :tags: orm
 
327
        :tickets: 1015
 
328
 
 
329
      refined mapper._save_obj() which was unnecessarily calling
 
330
      __ne__() on scalar values during flush
 
331
 
 
332
    .. change::
 
333
        :tags: orm
 
334
        :tickets: 1019
 
335
 
 
336
      added a feature to eager loading whereby subqueries set
 
337
      as column_property() with explicit label names (which is not
 
338
      necessary, btw) will have the label anonymized when
 
339
      the instance is part of the eager join, to prevent
 
340
      conflicts with a subquery or column of the same name
 
341
      on the parent object.
 
342
 
 
343
    .. change::
 
344
        :tags: orm
 
345
        :tickets: 
 
346
 
 
347
      set-based collections |=, -=, ^= and &= are stricter about
 
348
      their operands and only operate on sets, frozensets or
 
349
      subclasses of the collection type. Previously, they would
 
350
      accept any duck-typed set.
 
351
 
 
352
    .. change::
 
353
        :tags: orm
 
354
        :tickets: 
 
355
 
 
356
      added an example dynamic_dict/dynamic_dict.py, illustrating
 
357
      a simple way to place dictionary behavior on top of
 
358
      a dynamic_loader.
 
359
 
 
360
    .. change::
 
361
        :tags: declarative, extension
 
362
        :tickets: 
 
363
 
 
364
      Joined table inheritance mappers use a slightly relaxed
 
365
      function to create the "inherit condition" to the parent
 
366
      table, so that other foreign keys to not-yet-declared
 
367
      Table objects don't trigger an error.
 
368
 
 
369
    .. change::
 
370
        :tags: declarative, extension
 
371
        :tickets: 
 
372
 
 
373
      fixed reentrant mapper compile hang when
 
374
      a declared attribute is used within ForeignKey,
 
375
      ie. ForeignKey(MyOtherClass.someattribute)
 
376
 
 
377
    .. change::
 
378
        :tags: sql
 
379
        :tickets: 
 
380
 
 
381
      Added COLLATE support via the .collate(<collation>)
 
382
      expression operator and collate(<expr>, <collation>) sql
 
383
      function.
 
384
 
 
385
    .. change::
 
386
        :tags: sql
 
387
        :tickets: 
 
388
 
 
389
      Fixed bug with union() when applied to non-Table connected
 
390
      select statements
 
391
 
 
392
    .. change::
 
393
        :tags: sql
 
394
        :tickets: 1014
 
395
 
 
396
      improved behavior of text() expressions when used as
 
397
      FROM clauses, such as select().select_from(text("sometext"))
 
398
 
 
399
    .. change::
 
400
        :tags: sql
 
401
        :tickets: 1021
 
402
 
 
403
      Column.copy() respects the value of "autoincrement",
 
404
      fixes usage with Migrate
 
405
 
 
406
    .. change::
 
407
        :tags: engines
 
408
        :tickets: 
 
409
 
 
410
      Pool listeners can now be provided as a dictionary of
 
411
      callables or a (possibly partial) duck-type of
 
412
      PoolListener, your choice.
 
413
 
 
414
    .. change::
 
415
        :tags: engines
 
416
        :tickets: 
 
417
 
 
418
      added "rollback_returned" option to Pool which will
 
419
      disable the rollback() issued when connections are
 
420
      returned.  This flag is only safe to use with a database
 
421
      which does not support transactions (i.e. MySQL/MyISAM).
 
422
 
 
423
    .. change::
 
424
        :tags: ext
 
425
        :tickets: 
 
426
 
 
427
      set-based association proxies |=, -=, ^= and &= are
 
428
      stricter about their operands and only operate on sets,
 
429
      frozensets or other association proxies. Previously, they
 
430
      would accept any duck-typed set.
 
431
 
 
432
    .. change::
 
433
        :tags: mssql
 
434
        :tickets: 1005
 
435
 
 
436
      Added "odbc_autotranslate" parameter to engine / dburi
 
437
      parameters. Any given string will be passed through to the
 
438
      ODBC connection string as:
 
439
      
 
440
            "AutoTranslate=%s" % odbc_autotranslate
 
441
 
 
442
    .. change::
 
443
        :tags: mssql
 
444
        :tickets: 
 
445
 
 
446
      Added "odbc_options" parameter to engine / dburi
 
447
      parameters. The given string is simply appended to the
 
448
      SQLAlchemy-generated odbc connection string.
 
449
      
 
450
      This should obviate the need of adding a myriad of ODBC
 
451
      options in the future.
 
452
 
 
453
    .. change::
 
454
        :tags: firebird
 
455
        :tickets: 
 
456
 
 
457
      Handle the "SUBSTRING(:string FROM :start FOR :length)"
 
458
      builtin.
 
459
 
 
460
.. changelog::
 
461
    :version: 0.4.5
 
462
    :released: Fri Apr 04 2008
 
463
 
 
464
    .. change::
 
465
        :tags: orm
 
466
        :tickets: 
 
467
 
 
468
      A small change in behavior to session.merge() - existing
 
469
      objects are checked for based on primary key attributes, not
 
470
      necessarily _instance_key.  So the widely requested
 
471
      capability, that:
 
472
      
 
473
            x = MyObject(id=1)
 
474
            x = sess.merge(x)
 
475
      
 
476
      will in fact load MyObject with id #1 from the database if
 
477
      present, is now available.  merge() still copies the state
 
478
      of the given object to the persistent one, so an example
 
479
      like the above would typically have copied "None" from all
 
480
      attributes of "x" onto the persistent copy.  These can be
 
481
      reverted using session.expire(x).
 
482
 
 
483
    .. change::
 
484
        :tags: orm
 
485
        :tickets: 
 
486
 
 
487
      Also fixed behavior in merge() whereby collection elements
 
488
      present on the destination but not the merged collection
 
489
      were not being removed from the destination.
 
490
 
 
491
    .. change::
 
492
        :tags: orm
 
493
        :tickets: 995
 
494
 
 
495
      Added a more aggressive check for "uncompiled mappers",
 
496
      helps particularly with declarative layer
 
497
 
 
498
    .. change::
 
499
        :tags: orm
 
500
        :tickets: 
 
501
 
 
502
      The methodology behind "primaryjoin"/"secondaryjoin" has
 
503
      been refactored.  Behavior should be slightly more
 
504
      intelligent, primarily in terms of error messages which
 
505
      have been pared down to be more readable.  In a slight
 
506
      number of scenarios it can better resolve the correct
 
507
      foreign key than before.
 
508
 
 
509
    .. change::
 
510
        :tags: orm
 
511
        :tickets: 
 
512
 
 
513
      Added comparable_property(), adds query Comparator
 
514
      behavior to regular, unmanaged Python properties
 
515
 
 
516
    .. change::
 
517
        :tags: orm, Company.employees.of_type(Engineer), 'machines'
 
518
        :tickets: 
 
519
 
 
520
      the functionality of query.with_polymorphic() has
 
521
      been added to mapper() as a configuration option.
 
522
      
 
523
      It's set via several forms:
 
524
            with_polymorphic='*'
 
525
            with_polymorphic=[mappers]
 
526
            with_polymorphic=('*', selectable)
 
527
            with_polymorphic=([mappers], selectable)
 
528
      
 
529
      This controls the default polymorphic loading strategy
 
530
      for inherited mappers. When a selectable is not given,
 
531
      outer joins are created for all joined-table inheriting
 
532
      mappers requested. Note that the auto-create of joins
 
533
      is not compatible with concrete table inheritance.
 
534
      
 
535
      The existing select_table flag on mapper() is now
 
536
      deprecated and is synonymous with
 
537
      with_polymorphic('*', select_table).  Note that the
 
538
      underlying "guts" of select_table have been
 
539
      completely removed and replaced with the newer,
 
540
      more flexible approach.
 
541
      
 
542
      The new approach also automatically allows eager loads
 
543
      to work for subclasses, if they are present, for
 
544
      example
 
545
        sess.query(Company).options(
 
546
         eagerload_all(
 
547
         
 
548
        ))
 
549
      to load Company objects, their employees, and the
 
550
      'machines' collection of employees who happen to be
 
551
      Engineers. A "with_polymorphic" Query option should be
 
552
      introduced soon as well which would allow per-Query
 
553
      control of with_polymorphic() on relations.
 
554
 
 
555
    .. change::
 
556
        :tags: orm
 
557
        :tickets: 
 
558
 
 
559
      added two "experimental" features to Query,
 
560
      "experimental" in that their specific name/behavior
 
561
      is not carved in stone just yet:  _values() and
 
562
      _from_self().  We'd like feedback on these.
 
563
      
 
564
      - _values(*columns) is given a list of column
 
565
        expressions, and returns a new Query that only
 
566
        returns those columns. When evaluated, the return
 
567
        value is a list of tuples just like when using
 
568
        add_column() or add_entity(), the only difference is
 
569
        that "entity zero", i.e. the mapped class, is not
 
570
        included in the results. This means it finally makes
 
571
        sense to use group_by() and having() on Query, which
 
572
        have been sitting around uselessly until now.
 
573
      
 
574
        A future change to this method may include that its
 
575
        ability to join, filter and allow other options not
 
576
        related to a "resultset" are removed, so the feedback
 
577
        we're looking for is how people want to use
 
578
        _values()...i.e. at the very end, or do people prefer
 
579
        to continue generating after it's called.
 
580
      
 
581
      - _from_self() compiles the SELECT statement for the
 
582
        Query (minus any eager loaders), and returns a new
 
583
        Query that selects from that SELECT. So basically you
 
584
        can query from a Query without needing to extract the
 
585
        SELECT statement manually. This gives meaning to
 
586
        operations like query[3:5]._from_self().filter(some
 
587
        criterion). There's not much controversial here
 
588
        except that you can quickly create highly nested
 
589
        queries that are less efficient, and we want feedback
 
590
        on the naming choice.
 
591
 
 
592
    .. change::
 
593
        :tags: orm
 
594
        :tickets: 
 
595
 
 
596
      query.order_by() and query.group_by() will accept
 
597
      multiple arguments using *args (like select()
 
598
      already does).
 
599
 
 
600
    .. change::
 
601
        :tags: orm
 
602
        :tickets: 
 
603
 
 
604
      Added some convenience descriptors to Query:
 
605
      query.statement returns the full SELECT construct,
 
606
      query.whereclause returns just the WHERE part of the
 
607
      SELECT construct.
 
608
 
 
609
    .. change::
 
610
        :tags: orm
 
611
        :tickets: 
 
612
 
 
613
      Fixed/covered case when using a False/0 value as a
 
614
      polymorphic discriminator.
 
615
 
 
616
    .. change::
 
617
        :tags: orm
 
618
        :tickets: 
 
619
 
 
620
      Fixed bug which was preventing synonym() attributes from
 
621
      being used with inheritance
 
622
 
 
623
    .. change::
 
624
        :tags: orm
 
625
        :tickets: 996
 
626
 
 
627
      Fixed SQL function truncation of trailing underscores
 
628
 
 
629
    .. change::
 
630
        :tags: orm
 
631
        :tickets: 
 
632
 
 
633
      When attributes are expired on a pending instance, an
 
634
      error will not be raised when the "refresh" action is
 
635
      triggered and no result is found.
 
636
 
 
637
    .. change::
 
638
        :tags: orm
 
639
        :tickets: 
 
640
 
 
641
      Session.execute can now find binds from metadata
 
642
 
 
643
    .. change::
 
644
        :tags: orm
 
645
        :tickets: 
 
646
 
 
647
      Adjusted the definition of "self-referential" to be any
 
648
      two mappers with a common parent (this affects whether or
 
649
      not aliased=True is required when joining with Query).
 
650
 
 
651
    .. change::
 
652
        :tags: orm
 
653
        :tickets: 
 
654
 
 
655
      Made some fixes to the "from_joinpoint" argument to
 
656
      query.join() so that if the previous join was aliased and
 
657
      this one isn't, the join still happens successfully.
 
658
 
 
659
    .. change::
 
660
        :tags: orm
 
661
        :tickets: 895
 
662
 
 
663
      Assorted "cascade deletes" fixes:
 
664
        - Fixed "cascade delete" operation of dynamic relations,
 
665
          which had only been implemented for foreign-key
 
666
          nulling behavior in 0.4.2 and not actual cascading
 
667
          deletes
 
668
      
 
669
        - Delete cascade without delete-orphan cascade on a
 
670
          many-to-one will not delete orphans which were
 
671
          disconnected from the parent before session.delete()
 
672
          is called on the parent (one-to-many already had
 
673
          this).
 
674
      
 
675
        - Delete cascade with delete-orphan will delete orphans
 
676
          whether or not it remains attached to its also-deleted
 
677
          parent.
 
678
      
 
679
        - delete-orphan casacde is properly detected on relations
 
680
          that are present on superclasses when using inheritance.
 
681
 
 
682
    .. change::
 
683
        :tags: orm
 
684
        :tickets: 
 
685
 
 
686
      Fixed order_by calculation in Query to properly alias
 
687
      mapper-config'ed order_by when using select_from()
 
688
 
 
689
    .. change::
 
690
        :tags: orm
 
691
        :tickets: 
 
692
 
 
693
      Refactored the diffing logic that kicks in when replacing
 
694
      one collection with another into collections.bulk_replace,
 
695
      useful to anyone building multi-level collections.
 
696
 
 
697
    .. change::
 
698
        :tags: orm
 
699
        :tickets: 
 
700
 
 
701
      Cascade traversal algorithm converted from recursive to
 
702
      iterative to support deep object graphs.
 
703
 
 
704
    .. change::
 
705
        :tags: sql
 
706
        :tickets: 999
 
707
 
 
708
      schema-qualified tables now will place the schemaname
 
709
      ahead of the tablename in all column expressions as well
 
710
      as when generating column labels.  This prevents cross-
 
711
      schema name collisions in all cases
 
712
 
 
713
    .. change::
 
714
        :tags: sql
 
715
        :tickets: 
 
716
 
 
717
      can now allow selects which correlate all FROM clauses
 
718
      and have no FROM themselves.  These are typically
 
719
      used in a scalar context, i.e. SELECT x, (SELECT x WHERE y)
 
720
      FROM table.  Requires explicit correlate() call.
 
721
 
 
722
    .. change::
 
723
        :tags: sql
 
724
        :tickets: 
 
725
 
 
726
      'name' is no longer a required constructor argument for
 
727
      Column().  It (and .key) may now be deferred until the
 
728
      column is added to a Table.
 
729
 
 
730
    .. change::
 
731
        :tags: sql
 
732
        :tickets: 791, 993
 
733
 
 
734
      like(), ilike(), contains(), startswith(), endswith() take
 
735
      an optional keyword argument "escape=<somestring>", which
 
736
      is set as the escape character using the syntax "x LIKE y
 
737
      ESCAPE '<somestring>'".
 
738
 
 
739
    .. change::
 
740
        :tags: sql
 
741
        :tickets: 
 
742
 
 
743
      random() is now a generic sql function and will compile to
 
744
      the database's random implementation, if any.
 
745
 
 
746
    .. change::
 
747
        :tags: sql
 
748
        :tickets: 
 
749
 
 
750
      update().values() and insert().values() take keyword
 
751
      arguments.
 
752
 
 
753
    .. change::
 
754
        :tags: sql
 
755
        :tickets: 
 
756
 
 
757
      Fixed an issue in select() regarding its generation of
 
758
      FROM clauses, in rare circumstances two clauses could be
 
759
      produced when one was intended to cancel out the other.
 
760
      Some ORM queries with lots of eager loads might have seen
 
761
      this symptom.
 
762
 
 
763
    .. change::
 
764
        :tags: sql
 
765
        :tickets: 
 
766
 
 
767
      The case() function now also takes a dictionary as its
 
768
      whens parameter.  It also interprets the "THEN"
 
769
      expressions as values by default, meaning case([(x==y,
 
770
      "foo")]) will interpret "foo" as a bound value, not a SQL
 
771
      expression.  use text(expr) for literal SQL expressions in
 
772
      this case.  For the criterion itself, these may be literal
 
773
      strings only if the "value" keyword is present, otherwise
 
774
      SA will force explicit usage of either text() or
 
775
      literal().
 
776
 
 
777
    .. change::
 
778
        :tags: oracle
 
779
        :tickets: 
 
780
 
 
781
      The "owner" keyword on Table is now deprecated, and is
 
782
      exactly synonymous with the "schema" keyword.  Tables can
 
783
      now be reflected with alternate "owner" attributes,
 
784
      explicitly stated on the Table object or not using
 
785
      "schema".
 
786
 
 
787
    .. change::
 
788
        :tags: oracle
 
789
        :tickets: 
 
790
 
 
791
      All of the "magic" searching for synonyms, DBLINKs etc.
 
792
      during table reflection are disabled by default unless you
 
793
      specify "oracle_resolve_synonyms=True" on the Table
 
794
      object.  Resolving synonyms necessarily leads to some
 
795
      messy guessing which we'd rather leave off by default.
 
796
      When the flag is set, tables and related tables will be
 
797
      resolved against synonyms in all cases, meaning if a
 
798
      synonym exists for a particular table, reflection will use
 
799
      it when reflecting related tables.  This is stickier
 
800
      behavior than before which is why it's off by default.
 
801
 
 
802
    .. change::
 
803
        :tags: declarative, extension
 
804
        :tickets: 
 
805
 
 
806
      The "synonym" function is now directly usable with
 
807
      "declarative".  Pass in the decorated property using the
 
808
      "descriptor" keyword argument, e.g.: somekey =
 
809
      synonym('_somekey', descriptor=property(g, s))
 
810
 
 
811
    .. change::
 
812
        :tags: declarative, extension
 
813
        :tickets: 
 
814
 
 
815
      The "deferred" function is usable with "declarative".
 
816
      Simplest usage is to declare deferred and Column together,
 
817
      e.g.: data = deferred(Column(Text))
 
818
 
 
819
    .. change::
 
820
        :tags: declarative, extension
 
821
        :tickets: 
 
822
 
 
823
      Declarative also gained @synonym_for(...) and
 
824
      @comparable_using(...), front-ends for synonym and
 
825
      comparable_property.
 
826
 
 
827
    .. change::
 
828
        :tags: declarative, extension
 
829
        :tickets: 995
 
830
 
 
831
      Improvements to mapper compilation when using declarative;
 
832
      already-compiled mappers will still trigger compiles of
 
833
      other uncompiled mappers when used
 
834
 
 
835
    .. change::
 
836
        :tags: declarative, extension
 
837
        :tickets: 
 
838
 
 
839
      Declarative will complete setup for Columns lacking names,
 
840
      allows a more DRY syntax.
 
841
      
 
842
        class Foo(Base):
 
843
            __tablename__ = 'foos'
 
844
            id = Column(Integer, primary_key=True)
 
845
 
 
846
    .. change::
 
847
        :tags: declarative, extension
 
848
        :tickets: 
 
849
 
 
850
      inheritance in declarative can be disabled when sending
 
851
      "inherits=None" to __mapper_args__.
 
852
 
 
853
    .. change::
 
854
        :tags: declarative, extension
 
855
        :tickets: 
 
856
 
 
857
      declarative_base() takes optional kwarg "mapper", which
 
858
      is any callable/class/method that produces a mapper,
 
859
      such as declarative_base(mapper=scopedsession.mapper).
 
860
      This property can also be set on individual declarative
 
861
      classes using the "__mapper_cls__" property.
 
862
 
 
863
    .. change::
 
864
        :tags: postgres
 
865
        :tickets: 1001
 
866
 
 
867
      Got PG server side cursors back into shape, added fixed
 
868
      unit tests as part of the default test suite.  Added
 
869
      better uniqueness to the cursor ID
 
870
 
 
871
    .. change::
 
872
        :tags: oracle
 
873
        :tickets: 
 
874
 
 
875
      The "owner" keyword on Table is now deprecated, and is
 
876
      exactly synonymous with the "schema" keyword.  Tables can
 
877
      now be reflected with alternate "owner" attributes,
 
878
      explicitly stated on the Table object or not using
 
879
      "schema".
 
880
 
 
881
    .. change::
 
882
        :tags: oracle
 
883
        :tickets: 
 
884
 
 
885
      All of the "magic" searching for synonyms, DBLINKs etc.
 
886
      during table reflection are disabled by default unless you
 
887
      specify "oracle_resolve_synonyms=True" on the Table
 
888
      object.  Resolving synonyms necessarily leads to some
 
889
      messy guessing which we'd rather leave off by default.
 
890
      When the flag is set, tables and related tables will be
 
891
      resolved against synonyms in all cases, meaning if a
 
892
      synonym exists for a particular table, reflection will use
 
893
      it when reflecting related tables.  This is stickier
 
894
      behavior than before which is why it's off by default.
 
895
 
 
896
    .. change::
 
897
        :tags: mssql
 
898
        :tickets: 979
 
899
 
 
900
      Reflected tables will now automatically load other tables
 
901
      which are referenced by Foreign keys in the auto-loaded
 
902
      table,.
 
903
 
 
904
    .. change::
 
905
        :tags: mssql
 
906
        :tickets: 916
 
907
 
 
908
      Added executemany check to skip identity fetch,.
 
909
 
 
910
    .. change::
 
911
        :tags: mssql
 
912
        :tickets: 884
 
913
 
 
914
      Added stubs for small date type.
 
915
 
 
916
    .. change::
 
917
        :tags: mssql
 
918
        :tickets: 
 
919
 
 
920
      Added a new 'driver' keyword parameter for the pyodbc dialect.
 
921
      Will substitute into the ODBC connection string if given,
 
922
      defaults to 'SQL Server'.
 
923
 
 
924
    .. change::
 
925
        :tags: mssql
 
926
        :tickets: 
 
927
 
 
928
      Added a new 'max_identifier_length' keyword parameter for
 
929
      the pyodbc dialect.
 
930
 
 
931
    .. change::
 
932
        :tags: mssql
 
933
        :tickets: 
 
934
 
 
935
      Improvements to pyodbc + Unix. If you couldn't get that
 
936
      combination to work before, please try again.
 
937
 
 
938
    .. change::
 
939
        :tags: mysql
 
940
        :tickets: 
 
941
 
 
942
      The connection.info keys the dialect uses to cache server
 
943
      settings have changed and are now namespaced.
 
944
 
 
945
.. changelog::
 
946
    :version: 0.4.4
 
947
    :released: Wed Mar 12 2008
 
948
 
 
949
    .. change::
 
950
        :tags: sql
 
951
        :tickets: 975
 
952
 
 
953
      Can again create aliases of selects against textual FROM
 
954
      clauses.
 
955
 
 
956
    .. change::
 
957
        :tags: sql
 
958
        :tickets: 
 
959
 
 
960
      The value of a bindparam() can be a callable, in which
 
961
      case it's evaluated at statement execution time to get the
 
962
      value.
 
963
 
 
964
    .. change::
 
965
        :tags: sql
 
966
        :tickets: 978
 
967
 
 
968
      Added exception wrapping/reconnect support to result set
 
969
      fetching.  Reconnect works for those databases that raise
 
970
      a catchable data error during results (i.e. doesn't work
 
971
      on MySQL)
 
972
 
 
973
    .. change::
 
974
        :tags: sql
 
975
        :tickets: 936
 
976
 
 
977
      Implemented two-phase API for "threadlocal" engine, via
 
978
      engine.begin_twophase(), engine.prepare()
 
979
 
 
980
    .. change::
 
981
        :tags: sql
 
982
        :tickets: 986
 
983
 
 
984
      Fixed bug which was preventing UNIONS from being
 
985
      cloneable.
 
986
 
 
987
    .. change::
 
988
        :tags: sql
 
989
        :tickets: 
 
990
 
 
991
      Added "bind" keyword argument to insert(), update(),
 
992
      delete() and DDL(). The .bind property is now assignable
 
993
      on those statements as well as on select().
 
994
 
 
995
    .. change::
 
996
        :tags: sql
 
997
        :tickets: 
 
998
 
 
999
      Insert statements can now be compiled with extra "prefix"
 
1000
      words between INSERT and INTO, for vendor extensions like
 
1001
      MySQL's INSERT IGNORE INTO table.
 
1002
 
 
1003
    .. change::
 
1004
        :tags: orm
 
1005
        :tickets: 
 
1006
 
 
1007
      any(), has(), contains(), ~contains(), attribute level ==
 
1008
      and != now work properly with self-referential relations -
 
1009
      the clause inside the EXISTS is aliased on the "remote"
 
1010
      side to distinguish it from the parent table.  This
 
1011
      applies to single table self-referential as well as
 
1012
      inheritance-based self-referential.
 
1013
 
 
1014
    .. change::
 
1015
        :tags: orm
 
1016
        :tickets: 985
 
1017
 
 
1018
      Repaired behavior of == and != operators at the relation()
 
1019
      level when compared against NULL for one-to-one relations
 
1020
 
 
1021
    .. change::
 
1022
        :tags: orm
 
1023
        :tickets: 
 
1024
 
 
1025
      Fixed bug whereby session.expire() attributes were not
 
1026
      loading on an polymorphically-mapped instance mapped by a
 
1027
      select_table mapper.
 
1028
 
 
1029
    .. change::
 
1030
        :tags: orm
 
1031
        :tickets: 
 
1032
 
 
1033
      Added query.with_polymorphic() - specifies a list of
 
1034
      classes which descend from the base class, which will be
 
1035
      added to the FROM clause of the query.  Allows subclasses
 
1036
      to be used within filter() criterion as well as eagerly
 
1037
      loads the attributes of those subclasses.
 
1038
 
 
1039
    .. change::
 
1040
        :tags: orm
 
1041
        :tickets: 
 
1042
 
 
1043
      Your cries have been heard: removing a pending item from
 
1044
      an attribute or collection with delete-orphan expunges the
 
1045
      item from the session; no FlushError is raised.  Note that
 
1046
      if you session.save()'ed the pending item explicitly, the
 
1047
      attribute/collection removal still knocks it out.
 
1048
 
 
1049
    .. change::
 
1050
        :tags: orm
 
1051
        :tickets: 
 
1052
 
 
1053
      session.refresh() and session.expire() raise an error when
 
1054
      called on instances which are not persistent within the
 
1055
      session
 
1056
 
 
1057
    .. change::
 
1058
        :tags: orm
 
1059
        :tickets: 
 
1060
 
 
1061
      Fixed potential generative bug when the same Query was
 
1062
      used to generate multiple Query objects using join().
 
1063
 
 
1064
    .. change::
 
1065
        :tags: orm
 
1066
        :tickets: 
 
1067
 
 
1068
      Fixed bug which was introduced in 0.4.3, whereby loading
 
1069
      an already-persistent instance mapped with joined table
 
1070
      inheritance would trigger a useless "secondary" load from
 
1071
      its joined table, when using the default "select"
 
1072
      polymorphic_fetch.  This was due to attributes being
 
1073
      marked as expired during its first load and not getting
 
1074
      unmarked from the previous "secondary" load.  Attributes
 
1075
      are now unexpired based on presence in __dict__ after any
 
1076
      load or commit operation succeeds.
 
1077
 
 
1078
    .. change::
 
1079
        :tags: orm
 
1080
        :tickets: 
 
1081
 
 
1082
      Deprecated Query methods apply_sum(), apply_max(),
 
1083
      apply_min(), apply_avg().  Better methodologies are
 
1084
      coming....
 
1085
 
 
1086
    .. change::
 
1087
        :tags: orm
 
1088
        :tickets: 
 
1089
 
 
1090
      relation() can accept a callable for its first argument,
 
1091
      which returns the class to be related.  This is in place
 
1092
      to assist declarative packages to define relations without
 
1093
      classes yet being in place.
 
1094
 
 
1095
    .. change::
 
1096
        :tags: orm
 
1097
        :tickets: 
 
1098
 
 
1099
      Added a new "higher level" operator called "of_type()":
 
1100
      used in join() as well as with any() and has(), qualifies
 
1101
      the subclass which will be used in filter criterion, e.g.:
 
1102
      
 
1103
        query.filter(Company.employees.of_type(Engineer).
 
1104
          any(Engineer.name=='foo'))
 
1105
      
 
1106
        or
 
1107
      
 
1108
        query.join(Company.employees.of_type(Engineer)).
 
1109
          filter(Engineer.name=='foo')
 
1110
 
 
1111
    .. change::
 
1112
        :tags: orm
 
1113
        :tickets: 
 
1114
 
 
1115
      Preventive code against a potential lost-reference bug in
 
1116
      flush().
 
1117
 
 
1118
    .. change::
 
1119
        :tags: orm
 
1120
        :tickets: 
 
1121
 
 
1122
      Expressions used in filter(), filter_by() and others, when
 
1123
      they make usage of a clause generated from a relation
 
1124
      using the identity of a child object (e.g.,
 
1125
      filter(Parent.child==<somechild>)), evaluate the actual
 
1126
      primary key value of <somechild> at execution time so that
 
1127
      the autoflush step of the Query can complete, thereby
 
1128
      populating the PK value of <somechild> in the case that
 
1129
      <somechild> was pending.
 
1130
 
 
1131
    .. change::
 
1132
        :tags: orm
 
1133
        :tickets: 
 
1134
 
 
1135
      setting the relation()-level order by to a column in the
 
1136
      many-to-many "secondary" table will now work with eager
 
1137
      loading, previously the "order by" wasn't aliased against
 
1138
      the secondary table's alias.
 
1139
 
 
1140
    .. change::
 
1141
        :tags: orm
 
1142
        :tickets: 
 
1143
 
 
1144
      Synonyms riding on top of existing descriptors are now
 
1145
      full proxies to those descriptors.
 
1146
 
 
1147
    .. change::
 
1148
        :tags: dialects
 
1149
        :tickets: 
 
1150
 
 
1151
      Invalid SQLite connection URLs now raise an error.
 
1152
 
 
1153
    .. change::
 
1154
        :tags: dialects
 
1155
        :tickets: 981
 
1156
 
 
1157
      postgres TIMESTAMP renders correctly
 
1158
 
 
1159
    .. change::
 
1160
        :tags: dialects
 
1161
        :tickets: 
 
1162
 
 
1163
      postgres PGArray is a "mutable" type by default; when used
 
1164
      with the ORM, mutable-style equality/ copy-on-write
 
1165
      techniques are used to test for changes.
 
1166
 
 
1167
    .. change::
 
1168
        :tags: extensions
 
1169
        :tickets: 
 
1170
 
 
1171
      a new super-small "declarative" extension has been added,
 
1172
      which allows Table and mapper() configuration to take
 
1173
      place inline underneath a class declaration.  This
 
1174
      extension differs from ActiveMapper and Elixir in that it
 
1175
      does not redefine any SQLAlchemy semantics at all; literal
 
1176
      Column, Table and relation() constructs are used to define
 
1177
      the class behavior and table definition.
 
1178
 
 
1179
.. changelog::
 
1180
    :version: 0.4.3
 
1181
    :released: Thu Feb 14 2008
 
1182
 
 
1183
    .. change::
 
1184
        :tags: sql
 
1185
        :tickets: 
 
1186
 
 
1187
      Added "schema.DDL", an executable free-form DDL statement.
 
1188
      DDLs can be executed in isolation or attached to Table or
 
1189
      MetaData instances and executed automatically when those
 
1190
      objects are created and/or dropped.
 
1191
 
 
1192
    .. change::
 
1193
        :tags: sql
 
1194
        :tickets: 
 
1195
 
 
1196
      Table columns and constraints can be overridden on a an
 
1197
      existing table (such as a table that was already reflected)
 
1198
      using the 'useexisting=True' flag, which now takes into
 
1199
      account the arguments passed along with it.
 
1200
 
 
1201
    .. change::
 
1202
        :tags: sql
 
1203
        :tickets: 
 
1204
 
 
1205
      Added a callable-based DDL events interface, adds hooks
 
1206
      before and after Tables and MetaData create and drop.
 
1207
 
 
1208
    .. change::
 
1209
        :tags: sql
 
1210
        :tickets: 
 
1211
 
 
1212
      Added generative where(<criterion>) method to delete() and
 
1213
      update() constructs which return a new object with criterion
 
1214
      joined to existing criterion via AND, just like
 
1215
      select().where().
 
1216
 
 
1217
    .. change::
 
1218
        :tags: sql
 
1219
        :tickets: 727
 
1220
 
 
1221
      Added "ilike()" operator to column operations.  Compiles to
 
1222
      ILIKE on postgres, lower(x) LIKE lower(y) on all
 
1223
      others.
 
1224
 
 
1225
    .. change::
 
1226
        :tags: sql
 
1227
        :tickets: 943
 
1228
 
 
1229
      Added "now()" as a generic function; on SQLite, Oracle
 
1230
      and MSSQL compiles as "CURRENT_TIMESTAMP"; "now()" on
 
1231
      all others.
 
1232
 
 
1233
    .. change::
 
1234
        :tags: sql
 
1235
        :tickets: 962
 
1236
 
 
1237
      The startswith(), endswith(), and contains() operators now
 
1238
      concatenate the wildcard operator with the given operand in
 
1239
      SQL, i.e. "'%' || <bindparam>" in all cases, accept
 
1240
      text('something') operands properly
 
1241
 
 
1242
    .. change::
 
1243
        :tags: sql
 
1244
        :tickets: 962
 
1245
 
 
1246
      cast() accepts text('something') and other non-literal
 
1247
      operands properly
 
1248
 
 
1249
    .. change::
 
1250
        :tags: sql
 
1251
        :tickets: 
 
1252
 
 
1253
      fixed bug in result proxy where anonymously generated
 
1254
      column labels would not be accessible using their straight
 
1255
      string name
 
1256
 
 
1257
    .. change::
 
1258
        :tags: sql
 
1259
        :tickets: 
 
1260
 
 
1261
      Deferrable constraints can now be defined.
 
1262
 
 
1263
    .. change::
 
1264
        :tags: sql
 
1265
        :tickets: 915
 
1266
 
 
1267
      Added "autocommit=True" keyword argument to select() and
 
1268
      text(), as well as generative autocommit() method on
 
1269
      select(); for statements which modify the database through
 
1270
      some user-defined means other than the usual INSERT/UPDATE/
 
1271
      DELETE etc.  This flag will enable "autocommit" behavior
 
1272
      during execution if no transaction is in progress.
 
1273
 
 
1274
    .. change::
 
1275
        :tags: sql
 
1276
        :tickets: 
 
1277
 
 
1278
      The '.c.' attribute on a selectable now gets an entry for
 
1279
      every column expression in its columns clause.  Previously,
 
1280
      "unnamed" columns like functions and CASE statements weren't
 
1281
      getting put there.  Now they will, using their full string
 
1282
      representation if no 'name' is available.
 
1283
 
 
1284
    .. change::
 
1285
        :tags: sql
 
1286
        :tickets: 
 
1287
 
 
1288
      a CompositeSelect, i.e. any union(), union_all(),
 
1289
      intersect(), etc. now asserts that each selectable contains
 
1290
      the same number of columns.  This conforms to the
 
1291
      corresponding SQL requirement.
 
1292
 
 
1293
    .. change::
 
1294
        :tags: sql
 
1295
        :tickets: 
 
1296
 
 
1297
      The anonymous 'label' generated for otherwise unlabeled
 
1298
      functions and expressions now propagates outwards at compile
 
1299
      time for expressions like select([select([func.foo()])]).
 
1300
 
 
1301
    .. change::
 
1302
        :tags: sql
 
1303
        :tickets: 
 
1304
 
 
1305
      Building on the above ideas, CompositeSelects now build up
 
1306
      their ".c." collection based on the names present in the
 
1307
      first selectable only; corresponding_column() now works
 
1308
      fully for all embedded selectables.
 
1309
 
 
1310
    .. change::
 
1311
        :tags: sql
 
1312
        :tickets: 
 
1313
 
 
1314
      Oracle and others properly encode SQL used for defaults like
 
1315
      sequences, etc., even if no unicode idents are used since
 
1316
      identifier preparer may return a cached unicode identifier.
 
1317
 
 
1318
    .. change::
 
1319
        :tags: sql
 
1320
        :tickets: 
 
1321
 
 
1322
      Column and clause comparisons to datetime objects on the
 
1323
      left hand side of the expression now work (d < table.c.col).
 
1324
      (datetimes on the RHS have always worked, the LHS exception
 
1325
      is a quirk of the datetime implementation.)
 
1326
 
 
1327
    .. change::
 
1328
        :tags: orm
 
1329
        :tickets: 
 
1330
 
 
1331
      Every Session.begin() must now be accompanied by a
 
1332
      corresponding commit() or rollback() unless the session is
 
1333
      closed with Session.close().  This also includes the begin()
 
1334
      which is implicit to a session created with
 
1335
      transactional=True.  The biggest change introduced here is
 
1336
      that when a Session created with transactional=True raises
 
1337
      an exception during flush(), you must call
 
1338
      Session.rollback() or Session.close() in order for that
 
1339
      Session to continue after an exception.
 
1340
 
 
1341
    .. change::
 
1342
        :tags: orm
 
1343
        :tickets: 961
 
1344
 
 
1345
      Fixed merge() collection-doubling bug when merging transient
 
1346
      entities with backref'ed collections.
 
1347
 
 
1348
    .. change::
 
1349
        :tags: orm
 
1350
        :tickets: 
 
1351
 
 
1352
      merge(dont_load=True) does not accept transient entities,
 
1353
      this is in continuation with the fact that
 
1354
      merge(dont_load=True) does not accept any "dirty" objects
 
1355
      either.
 
1356
 
 
1357
    .. change::
 
1358
        :tags: orm
 
1359
        :tickets: 
 
1360
 
 
1361
      Added standalone "query" class attribute generated by a
 
1362
      scoped_session.  This provides MyClass.query without using
 
1363
      Session.mapper.  Use via:
 
1364
      
 
1365
        MyClass.query = Session.query_property()
 
1366
 
 
1367
    .. change::
 
1368
        :tags: orm
 
1369
        :tickets: 
 
1370
 
 
1371
      The proper error message is raised when trying to access
 
1372
      expired instance attributes with no session present
 
1373
 
 
1374
    .. change::
 
1375
        :tags: orm
 
1376
        :tickets: 
 
1377
 
 
1378
      dynamic_loader() / lazy="dynamic" now accepts and uses
 
1379
      the order_by parameter in the same way in which it works
 
1380
      with relation().
 
1381
 
 
1382
    .. change::
 
1383
        :tags: orm
 
1384
        :tickets: 
 
1385
 
 
1386
      Added expire_all() method to Session.  Calls expire() for
 
1387
      all persistent instances.  This is handy in conjunction
 
1388
      with...
 
1389
 
 
1390
    .. change::
 
1391
        :tags: orm
 
1392
        :tickets: 
 
1393
 
 
1394
      Instances which have been partially or fully expired will
 
1395
      have their expired attributes populated during a regular
 
1396
      Query operation which affects those objects, preventing a
 
1397
      needless second SQL statement for each instance.
 
1398
 
 
1399
    .. change::
 
1400
        :tags: orm
 
1401
        :tickets: 938
 
1402
 
 
1403
      Dynamic relations, when referenced, create a strong
 
1404
      reference to the parent object so that the query still has a
 
1405
      parent to call against even if the parent is only created
 
1406
      (and otherwise dereferenced) within the scope of a single
 
1407
      expression.
 
1408
 
 
1409
    .. change::
 
1410
        :tags: orm
 
1411
        :tickets: 
 
1412
 
 
1413
      Added a mapper() flag "eager_defaults". When set to True,
 
1414
      defaults that are generated during an INSERT or UPDATE
 
1415
      operation are post-fetched immediately, instead of being
 
1416
      deferred until later.  This mimics the old 0.3 behavior.
 
1417
 
 
1418
    .. change::
 
1419
        :tags: orm
 
1420
        :tickets: 
 
1421
 
 
1422
      query.join() can now accept class-mapped attributes as
 
1423
      arguments. These can be used in place or in any combination
 
1424
      with strings.  In particular this allows construction of
 
1425
      joins to subclasses on a polymorphic relation, i.e.:
 
1426
      
 
1427
        query(Company).join(['employees', Engineer.name])
 
1428
 
 
1429
    .. change::
 
1430
        :tags: orm, ('employees', people.join(engineer)), Engineer.name
 
1431
        :tickets: 
 
1432
 
 
1433
      query.join() can also accept tuples of attribute name/some
 
1434
      selectable as arguments.  This allows construction of joins
 
1435
      *from* subclasses of a polymorphic relation, i.e.:
 
1436
      
 
1437
        query(Company).\
 
1438
        join(
 
1439
         
 
1440
        )
 
1441
 
 
1442
    .. change::
 
1443
        :tags: orm
 
1444
        :tickets: 
 
1445
 
 
1446
      General improvements to the behavior of join() in
 
1447
      conjunction with polymorphic mappers, i.e. joining from/to
 
1448
      polymorphic mappers and properly applying aliases.
 
1449
 
 
1450
    .. change::
 
1451
        :tags: orm
 
1452
        :tickets: 933
 
1453
 
 
1454
      Fixed/improved behavior when a mapper determines the natural
 
1455
      "primary key" of a mapped join, it will more effectively
 
1456
      reduce columns which are equivalent via foreign key
 
1457
      relation.  This affects how many arguments need to be sent
 
1458
      to query.get(), among other things.
 
1459
 
 
1460
    .. change::
 
1461
        :tags: orm
 
1462
        :tickets: 946
 
1463
 
 
1464
      The lazy loader can now handle a join condition where the
 
1465
      "bound" column (i.e. the one that gets the parent id sent as
 
1466
      a bind parameter) appears more than once in the join
 
1467
      condition.  Specifically this allows the common task of a
 
1468
      relation() which contains a parent-correlated subquery, such
 
1469
      as "select only the most recent child item".
 
1470
 
 
1471
    .. change::
 
1472
        :tags: orm
 
1473
        :tickets: 
 
1474
 
 
1475
      Fixed bug in polymorphic inheritance where an incorrect
 
1476
      exception is raised when base polymorphic_on column does not
 
1477
      correspond to any columns within the local selectable of an
 
1478
      inheriting mapper more than one level deep
 
1479
 
 
1480
    .. change::
 
1481
        :tags: orm
 
1482
        :tickets: 
 
1483
 
 
1484
      Fixed bug in polymorphic inheritance which made it difficult
 
1485
      to set a working "order_by" on a polymorphic mapper.
 
1486
 
 
1487
    .. change::
 
1488
        :tags: orm
 
1489
        :tickets: 
 
1490
 
 
1491
      Fixed a rather expensive call in Query that was slowing down
 
1492
      polymorphic queries.
 
1493
 
 
1494
    .. change::
 
1495
        :tags: orm
 
1496
        :tickets: 954
 
1497
 
 
1498
      "Passive defaults" and other "inline" defaults can now be
 
1499
      loaded during a flush() call if needed; in particular, this
 
1500
      allows constructing relations() where a foreign key column
 
1501
      references a server-side-generated, non-primary-key
 
1502
      column.
 
1503
 
 
1504
    .. change::
 
1505
        :tags: orm
 
1506
        :tickets: 
 
1507
 
 
1508
      Additional Session transaction fixes/changes:
 
1509
        - Fixed bug with session transaction management: parent
 
1510
          transactions weren't started on the connection when
 
1511
          adding a connection to a nested transaction.
 
1512
      
 
1513
        - session.transaction now always refers to the innermost
 
1514
          active transaction, even when commit/rollback are called
 
1515
          directly on the session transaction object.
 
1516
      
 
1517
        - Two-phase transactions can now be prepared.
 
1518
      
 
1519
        - When preparing a two-phase transaction fails on one
 
1520
          connection, all the connections are rolled back.
 
1521
      
 
1522
        - session.close() didn't close all transactions when
 
1523
          nested transactions were used.
 
1524
      
 
1525
        - rollback() previously erroneously set the current
 
1526
          transaction directly to the parent of the transaction
 
1527
          that could be rolled back to. Now it rolls back the next
 
1528
          transaction up that can handle it, but sets the current
 
1529
          transaction to it's parent and inactivates the
 
1530
          transactions in between. Inactive transactions can only
 
1531
          be rolled back or closed, any other call results in an
 
1532
          error.
 
1533
      
 
1534
        - autoflush for commit() wasn't flushing for simple
 
1535
          subtransactions.
 
1536
      
 
1537
        - unitofwork flush didn't close the failed transaction
 
1538
          when the session was not in a transaction and commiting
 
1539
          the transaction failed.
 
1540
 
 
1541
    .. change::
 
1542
        :tags: orm
 
1543
        :tickets: 964, 940
 
1544
 
 
1545
      Miscellaneous tickets:
 
1546
 
 
1547
    .. change::
 
1548
        :tags: general
 
1549
        :tickets: 
 
1550
 
 
1551
      Fixed a variety of hidden and some not-so-hidden
 
1552
      compatibility issues for Python 2.3, thanks to new support
 
1553
      for running the full test suite on 2.3.
 
1554
 
 
1555
    .. change::
 
1556
        :tags: general
 
1557
        :tickets: 
 
1558
 
 
1559
      Warnings are now issued as type exceptions.SAWarning.
 
1560
 
 
1561
    .. change::
 
1562
        :tags: dialects
 
1563
        :tickets: 
 
1564
 
 
1565
      Better support for schemas in SQLite (linked in by ATTACH
 
1566
      DATABASE ... AS name).  In some cases in the past, schema
 
1567
      names were ommitted from generated SQL for SQLite.  This is
 
1568
      no longer the case.
 
1569
 
 
1570
    .. change::
 
1571
        :tags: dialects
 
1572
        :tickets: 
 
1573
 
 
1574
      table_names on SQLite now picks up temporary tables as well.
 
1575
 
 
1576
    .. change::
 
1577
        :tags: dialects
 
1578
        :tickets: 
 
1579
 
 
1580
      Auto-detect an unspecified MySQL ANSI_QUOTES mode during
 
1581
      reflection operations, support for changing the mode
 
1582
      midstream.  Manual mode setting is still required if no
 
1583
      reflection is used.
 
1584
 
 
1585
    .. change::
 
1586
        :tags: dialects
 
1587
        :tickets: 
 
1588
 
 
1589
      Fixed reflection of TIME columns on SQLite.
 
1590
 
 
1591
    .. change::
 
1592
        :tags: dialects
 
1593
        :tickets: 580
 
1594
 
 
1595
      Finally added PGMacAddr type to postgres
 
1596
 
 
1597
    .. change::
 
1598
        :tags: dialects
 
1599
        :tickets: 
 
1600
 
 
1601
      Reflect the sequence associated to a PK field (typically
 
1602
      with a BEFORE INSERT trigger) under Firebird
 
1603
 
 
1604
    .. change::
 
1605
        :tags: dialects
 
1606
        :tickets: 941
 
1607
 
 
1608
      Oracle assembles the correct columns in the result set
 
1609
      column mapping when generating a LIMIT/OFFSET subquery,
 
1610
      allows columns to map properly to result sets even if
 
1611
      long-name truncation kicks in
 
1612
 
 
1613
    .. change::
 
1614
        :tags: dialects
 
1615
        :tickets: 
 
1616
 
 
1617
      MSSQL now includes EXEC in the _is_select regexp, which
 
1618
      should allow row-returning stored procedures to be used.
 
1619
 
 
1620
    .. change::
 
1621
        :tags: dialects
 
1622
        :tickets: 
 
1623
 
 
1624
      MSSQL now includes an experimental implementation of
 
1625
      LIMIT/OFFSET using the ANSI SQL row_number() function, so it
 
1626
      requires MSSQL-2005 or higher. To enable the feature, add
 
1627
      "has_window_funcs" to the keyword arguments for connect, or
 
1628
      add "?has_window_funcs=1" to your dburi query arguments.
 
1629
 
 
1630
    .. change::
 
1631
        :tags: ext
 
1632
        :tickets: 
 
1633
 
 
1634
      Changed ext.activemapper to use a non-transactional session
 
1635
      for the objectstore.
 
1636
 
 
1637
    .. change::
 
1638
        :tags: ext
 
1639
        :tickets: 
 
1640
 
 
1641
      Fixed output order of "['a'] + obj.proxied" binary operation
 
1642
      on association-proxied lists.
 
1643
 
 
1644
.. changelog::
 
1645
    :version: 0.4.2p3
 
1646
    :released: Wed Jan 09 2008
 
1647
 
 
1648
    .. change::
 
1649
        :tags: general
 
1650
        :tickets: 
 
1651
 
 
1652
      sub version numbering scheme changed to suite
 
1653
      setuptools version number rules; easy_install -u
 
1654
      should now get this version over 0.4.2.
 
1655
 
 
1656
    .. change::
 
1657
        :tags: sql
 
1658
        :tickets: 912
 
1659
 
 
1660
      Text type is properly exported now and does not
 
1661
      raise a warning on DDL create; String types with no
 
1662
      length only raise warnings during CREATE TABLE
 
1663
 
 
1664
    .. change::
 
1665
        :tags: sql
 
1666
        :tickets: 
 
1667
 
 
1668
      new UnicodeText type is added, to specify an
 
1669
      encoded, unlengthed Text type
 
1670
 
 
1671
    .. change::
 
1672
        :tags: sql
 
1673
        :tickets: 
 
1674
 
 
1675
      fixed bug in union() so that select() statements
 
1676
      which don't derive from FromClause objects can be
 
1677
      unioned
 
1678
 
 
1679
    .. change::
 
1680
        :tags: orm
 
1681
        :tickets: 
 
1682
 
 
1683
      fixed bug with session.dirty when using "mutable
 
1684
      scalars" (such as PickleTypes)
 
1685
 
 
1686
    .. change::
 
1687
        :tags: orm
 
1688
        :tickets: 
 
1689
 
 
1690
      added a more descriptive error message when flushing
 
1691
      on a relation() that has non-locally-mapped columns
 
1692
      in its primary or secondary join condition
 
1693
 
 
1694
    .. change::
 
1695
        :tags: dialects
 
1696
        :tickets: 
 
1697
 
 
1698
      Fixed reflection of mysql empty string column
 
1699
      defaults.
 
1700
 
 
1701
    .. change::
 
1702
        :tags: sql
 
1703
        :tickets: 912
 
1704
 
 
1705
      changed name of TEXT to Text since its a "generic"
 
1706
      type; TEXT name is deprecated until 0.5. The
 
1707
      "upgrading" behavior of String to Text when no
 
1708
      length is present is also deprecated until 0.5; will
 
1709
      issue a warning when used for CREATE TABLE
 
1710
      statements (String with no length for SQL expression
 
1711
      purposes is still fine)
 
1712
 
 
1713
    .. change::
 
1714
        :tags: sql
 
1715
        :tickets: 924
 
1716
 
 
1717
      generative select.order_by(None) / group_by(None)
 
1718
      was not managing to reset order by/group by
 
1719
      criterion, fixed
 
1720
 
 
1721
    .. change::
 
1722
        :tags: orm
 
1723
        :tickets: 
 
1724
 
 
1725
      suppressing *all* errors in
 
1726
      InstanceState.__cleanup() now.
 
1727
 
 
1728
    .. change::
 
1729
        :tags: orm
 
1730
        :tickets: 922
 
1731
 
 
1732
      fixed an attribute history bug whereby assigning a
 
1733
      new collection to a collection-based attribute which
 
1734
      already had pending changes would generate incorrect
 
1735
      history
 
1736
 
 
1737
    .. change::
 
1738
        :tags: orm
 
1739
        :tickets: 925
 
1740
 
 
1741
      fixed delete-orphan cascade bug whereby setting the
 
1742
      same object twice to a scalar attribute could log it
 
1743
      as an orphan
 
1744
 
 
1745
    .. change::
 
1746
        :tags: orm
 
1747
        :tickets: 
 
1748
 
 
1749
      Fixed cascades on a += assignment to a list-based
 
1750
      relation.
 
1751
 
 
1752
    .. change::
 
1753
        :tags: orm
 
1754
        :tickets: 919
 
1755
 
 
1756
      synonyms can now be created against props that don't
 
1757
      exist yet, which are later added via add_property().
 
1758
      This commonly includes backrefs. (i.e. you can make
 
1759
      synonyms for backrefs without worrying about the
 
1760
      order of operations)
 
1761
 
 
1762
    .. change::
 
1763
        :tags: orm
 
1764
        :tickets: 
 
1765
 
 
1766
      fixed bug which could occur with polymorphic "union"
 
1767
      mapper which falls back to "deferred" loading of
 
1768
      inheriting tables
 
1769
 
 
1770
    .. change::
 
1771
        :tags: orm
 
1772
        :tickets: 
 
1773
 
 
1774
      the "columns" collection on a mapper/mapped class
 
1775
      (i.e. 'c') is against the mapped table, not the
 
1776
      select_table in the case of polymorphic "union"
 
1777
      loading (this shouldn't be noticeable).
 
1778
 
 
1779
    .. change::
 
1780
        :tags: ext
 
1781
        :tickets: 
 
1782
 
 
1783
      '+', '*', '+=' and '*=' support for association
 
1784
      proxied lists.
 
1785
 
 
1786
    .. change::
 
1787
        :tags: dialects
 
1788
        :tickets: 923
 
1789
 
 
1790
      mssql - narrowed down the test for "date"/"datetime"
 
1791
      in MSDate/ MSDateTime subclasses so that incoming
 
1792
      "datetime" objects don't get mis-interpreted as
 
1793
      "date" objects and vice versa.
 
1794
 
 
1795
    .. change::
 
1796
        :tags: orm
 
1797
        :tickets: 
 
1798
 
 
1799
      fixed fairly critical bug whereby the same instance could be listed
 
1800
      more than once in the unitofwork.new collection; most typically
 
1801
      reproduced when using a combination of inheriting mappers and
 
1802
      ScopedSession.mapper, as the multiple __init__ calls per instance
 
1803
      could save() the object with distinct _state objects
 
1804
 
 
1805
    .. change::
 
1806
        :tags: orm
 
1807
        :tickets: 
 
1808
 
 
1809
      added very rudimentary yielding iterator behavior to Query.  Call
 
1810
      query.yield_per(<number of rows>) and evaluate the Query in an
 
1811
      iterative context; every collection of N rows will be packaged up
 
1812
      and yielded.  Use this method with extreme caution since it does
 
1813
      not attempt to reconcile eagerly loaded collections across
 
1814
      result batch boundaries, nor will it behave nicely if the same
 
1815
      instance occurs in more than one batch.  This means that an eagerly
 
1816
      loaded collection will get cleared out if it's referenced in more than
 
1817
      one batch, and in all cases attributes will be overwritten on instances
 
1818
      that occur in more than one batch.
 
1819
 
 
1820
    .. change::
 
1821
        :tags: orm
 
1822
        :tickets: 920
 
1823
 
 
1824
      Fixed in-place set mutation operators for set collections and association
 
1825
      proxied sets.
 
1826
 
 
1827
    .. change::
 
1828
        :tags: dialects
 
1829
        :tickets: 913
 
1830
 
 
1831
      Fixed the missing call to subtype result processor for the PGArray
 
1832
      type.
 
1833
 
 
1834
.. changelog::
 
1835
    :version: 0.4.2
 
1836
    :released: Wed Jan 02 2008
 
1837
 
 
1838
    .. change::
 
1839
        :tags: sql
 
1840
        :tickets: 615
 
1841
 
 
1842
      generic functions ! we introduce a database of known SQL functions, such
 
1843
      as current_timestamp, coalesce, and create explicit function objects
 
1844
      representing them. These objects have constrained argument lists, are
 
1845
      type aware, and can compile in a dialect-specific fashion. So saying
 
1846
      func.char_length("foo", "bar") raises an error (too many args),
 
1847
      func.coalesce(datetime.date(2007, 10, 5), datetime.date(2005, 10, 15))
 
1848
      knows that its return type is a Date. We only have a few functions
 
1849
      represented so far but will continue to add to the system
 
1850
 
 
1851
    .. change::
 
1852
        :tags: sql
 
1853
        :tickets: 
 
1854
 
 
1855
      auto-reconnect support improved; a Connection can now automatically
 
1856
      reconnect after its underlying connection is invalidated, without
 
1857
      needing to connect() again from the engine.  This allows an ORM session
 
1858
      bound to a single Connection to not need a reconnect.
 
1859
      Open transactions on the Connection must be rolled back after an invalidation
 
1860
      of the underlying connection else an error is raised.  Also fixed
 
1861
      bug where disconnect detect was not being called for cursor(), rollback(),
 
1862
      or commit().
 
1863
 
 
1864
    .. change::
 
1865
        :tags: sql
 
1866
        :tickets: 
 
1867
 
 
1868
      added new flag to String and create_engine(),
 
1869
      assert_unicode=(True|False|'warn'|None). Defaults to `False` or `None` on
 
1870
      create_engine() and String, `'warn'` on the Unicode type. When `True`,
 
1871
      results in all unicode conversion operations raising an exception when a
 
1872
      non-unicode bytestring is passed as a bind parameter. 'warn' results
 
1873
      in a warning. It is strongly advised that all unicode-aware applications
 
1874
      make proper use of Python unicode objects (i.e. u'hello' and not 'hello')
 
1875
      so that data round trips accurately.
 
1876
 
 
1877
    .. change::
 
1878
        :tags: sql
 
1879
        :tickets: 
 
1880
 
 
1881
      generation of "unique" bind parameters has been simplified to use the same
 
1882
      "unique identifier" mechanisms as everything else.  This doesn't affect
 
1883
      user code, except any code that might have been hardcoded against the generated
 
1884
      names.  Generated bind params now have the form "<paramname>_<num>",
 
1885
      whereas before only the second bind of the same name would have this form.
 
1886
 
 
1887
    .. change::
 
1888
        :tags: sql
 
1889
        :tickets: 
 
1890
 
 
1891
      select().as_scalar() will raise an exception if the select does not have
 
1892
      exactly one expression in its columns clause.
 
1893
 
 
1894
    .. change::
 
1895
        :tags: sql
 
1896
        :tickets: 
 
1897
 
 
1898
      bindparam() objects themselves can be used as keys for execute(), i.e.
 
1899
      statement.execute({bind1:'foo', bind2:'bar'})
 
1900
 
 
1901
    .. change::
 
1902
        :tags: sql
 
1903
        :tickets: 
 
1904
 
 
1905
      added new methods to TypeDecorator, process_bind_param() and
 
1906
      process_result_value(), which automatically take advantage of the processing
 
1907
      of the underlying type.  Ideal for using with Unicode or Pickletype.
 
1908
      TypeDecorator should now be the primary way to augment the behavior of any
 
1909
      existing type including other TypeDecorator subclasses such as PickleType.
 
1910
 
 
1911
    .. change::
 
1912
        :tags: sql
 
1913
        :tickets: 
 
1914
 
 
1915
      selectables (and others) will issue a warning when two columns in
 
1916
      their exported columns collection conflict based on name.
 
1917
 
 
1918
    .. change::
 
1919
        :tags: sql
 
1920
        :tickets: 890
 
1921
 
 
1922
      tables with schemas can still be used in sqlite, firebird,
 
1923
      schema name just gets dropped
 
1924
 
 
1925
    .. change::
 
1926
        :tags: sql
 
1927
        :tickets: 
 
1928
 
 
1929
      changed the various "literal" generation functions to use an anonymous
 
1930
      bind parameter.  not much changes here except their labels now look
 
1931
      like ":param_1", ":param_2" instead of ":literal"
 
1932
 
 
1933
    .. change::
 
1934
        :tags: sql
 
1935
        :tickets: 
 
1936
 
 
1937
      column labels in the form "tablename.columname", i.e. with a dot, are now
 
1938
      supported.
 
1939
 
 
1940
    .. change::
 
1941
        :tags: sql
 
1942
        :tickets: 
 
1943
 
 
1944
      from_obj keyword argument to select() can be a scalar or a list.
 
1945
 
 
1946
    .. change::
 
1947
        :tags: orm
 
1948
        :tickets: 871
 
1949
 
 
1950
      a major behavioral change to collection-based backrefs: they no
 
1951
      longer trigger lazy loads !  "reverse" adds and removes
 
1952
      are queued up and are merged with the collection when it is
 
1953
      actually read from and loaded; but do not trigger a load beforehand.
 
1954
      For users who have noticed this behavior, this should be much more
 
1955
      convenient than using dynamic relations in some cases; for those who
 
1956
      have not, you might notice your apps using a lot fewer queries than
 
1957
      before in some situations.
 
1958
 
 
1959
    .. change::
 
1960
        :tags: orm
 
1961
        :tickets: 
 
1962
 
 
1963
      mutable primary key support is added. primary key columns can be
 
1964
      changed freely, and the identity of the instance will change upon
 
1965
      flush. In addition, update cascades of foreign key referents (primary
 
1966
      key or not) along relations are supported, either in tandem with the
 
1967
      database's ON UPDATE CASCADE (required for DB's like Postgres) or
 
1968
      issued directly by the ORM in the form of UPDATE statements, by setting
 
1969
      the flag "passive_cascades=False".
 
1970
 
 
1971
    .. change::
 
1972
        :tags: orm
 
1973
        :tickets: 490
 
1974
 
 
1975
      inheriting mappers now inherit the MapperExtensions of their parent
 
1976
      mapper directly, so that all methods for a particular MapperExtension
 
1977
      are called for subclasses as well.  As always, any MapperExtension
 
1978
      can return either EXT_CONTINUE to continue extension processing
 
1979
      or EXT_STOP to stop processing.  The order of mapper resolution is:
 
1980
      <extensions declared on the classes mapper> <extensions declared on the
 
1981
      classes' parent mapper> <globally declared extensions>.
 
1982
      
 
1983
      Note that if you instantiate the same extension class separately
 
1984
      and then apply it individually for two mappers in the same inheritance
 
1985
      chain, the extension will be applied twice to the inheriting class,
 
1986
      and each method will be called twice.
 
1987
      
 
1988
      To apply a mapper extension explicitly to each inheriting class but
 
1989
      have each method called only once per operation, use the same
 
1990
      instance of the extension for both mappers.
 
1991
 
 
1992
    .. change::
 
1993
        :tags: orm
 
1994
        :tickets: 907
 
1995
 
 
1996
      MapperExtension.before_update() and after_update() are now called
 
1997
      symmetrically; previously, an instance that had no modified column
 
1998
      attributes (but had a relation() modification) could be called with
 
1999
      before_update() but not after_update()
 
2000
 
 
2001
    .. change::
 
2002
        :tags: orm
 
2003
        :tickets: 
 
2004
 
 
2005
      columns which are missing from a Query's select statement
 
2006
      now get automatically deferred during load.
 
2007
 
 
2008
    .. change::
 
2009
        :tags: orm
 
2010
        :tickets: 908
 
2011
 
 
2012
      mapped classes which extend "object" and do not provide an
 
2013
      __init__() method will now raise TypeError if non-empty *args
 
2014
      or **kwargs are present at instance construction time (and are
 
2015
      not consumed by any extensions such as the scoped_session mapper),
 
2016
      consistent with the behavior of normal Python classes
 
2017
 
 
2018
    .. change::
 
2019
        :tags: orm
 
2020
        :tickets: 899
 
2021
 
 
2022
      fixed Query bug when filter_by() compares a relation against None
 
2023
 
 
2024
    .. change::
 
2025
        :tags: orm
 
2026
        :tickets: 
 
2027
 
 
2028
      improved support for pickling of mapped entities.  Per-instance
 
2029
      lazy/deferred/expired callables are now serializable so that
 
2030
      they serialize and deserialize with _state.
 
2031
 
 
2032
    .. change::
 
2033
        :tags: orm
 
2034
        :tickets: 801
 
2035
 
 
2036
      new synonym() behavior: an attribute will be placed on the mapped
 
2037
      class, if one does not exist already, in all cases. if a property
 
2038
      already exists on the class, the synonym will decorate the property
 
2039
      with the appropriate comparison operators so that it can be used in
 
2040
      column expressions just like any other mapped attribute (i.e. usable in
 
2041
      filter(), etc.) the "proxy=True" flag is deprecated and no longer means
 
2042
      anything. Additionally, the flag "map_column=True" will automatically
 
2043
      generate a ColumnProperty corresponding to the name of the synonym,
 
2044
      i.e.: 'somename':synonym('_somename', map_column=True) will map the
 
2045
      column named 'somename' to the attribute '_somename'. See the example
 
2046
      in the mapper docs.
 
2047
 
 
2048
    .. change::
 
2049
        :tags: orm
 
2050
        :tickets: 
 
2051
 
 
2052
      Query.select_from() now replaces all existing FROM criterion with
 
2053
      the given argument; the previous behavior of constructing a list
 
2054
      of FROM clauses was generally not useful as is required
 
2055
      filter() calls to create join criterion, and new tables introduced
 
2056
      within filter() already add themselves to the FROM clause.  The
 
2057
      new behavior allows not just joins from the main table, but select
 
2058
      statements as well.  Filter criterion, order bys, eager load
 
2059
      clauses will be "aliased" against the given statement.
 
2060
 
 
2061
    .. change::
 
2062
        :tags: orm
 
2063
        :tickets: 
 
2064
 
 
2065
      this month's refactoring of attribute instrumentation changes
 
2066
      the "copy-on-load" behavior we've had since midway through 0.3
 
2067
      with "copy-on-modify" in most cases.  This takes a sizable chunk
 
2068
      of latency out of load operations and overall does less work
 
2069
      as only attributes which are actually modified get their
 
2070
      "committed state" copied.  Only "mutable scalar" attributes
 
2071
      (i.e. a pickled object or other mutable item), the reason for
 
2072
      the copy-on-load change in the first place, retain the old
 
2073
      behavior.
 
2074
 
 
2075
    .. change::
 
2076
        :tags: attrname, orm
 
2077
        :tickets: 
 
2078
 
 
2079
      a slight behavioral change to attributes is, del'ing an attribute
 
2080
      does *not* cause the lazyloader of that attribute to fire off again;
 
2081
      the "del" makes the effective value of the attribute "None".  To
 
2082
      re-trigger the "loader" for an attribute, use
 
2083
      session.expire(instance,).
 
2084
 
 
2085
    .. change::
 
2086
        :tags: orm
 
2087
        :tickets: 
 
2088
 
 
2089
      query.filter(SomeClass.somechild == None), when comparing
 
2090
      a many-to-one property to None, properly generates "id IS NULL"
 
2091
      including that the NULL is on the right side.
 
2092
 
 
2093
    .. change::
 
2094
        :tags: orm
 
2095
        :tickets: 
 
2096
 
 
2097
      query.order_by() takes into account aliased joins, i.e.
 
2098
      query.join('orders', aliased=True).order_by(Order.id)
 
2099
 
 
2100
    .. change::
 
2101
        :tags: orm
 
2102
        :tickets: 
 
2103
 
 
2104
      eagerload(), lazyload(), eagerload_all() take an optional
 
2105
      second class-or-mapper argument, which will select the mapper
 
2106
      to apply the option towards.  This can select among other
 
2107
      mappers which were added using add_entity().
 
2108
 
 
2109
    .. change::
 
2110
        :tags: orm
 
2111
        :tickets: 
 
2112
 
 
2113
      eagerloading will work with mappers added via add_entity().
 
2114
 
 
2115
    .. change::
 
2116
        :tags: orm
 
2117
        :tickets: 
 
2118
 
 
2119
      added "cascade delete" behavior to "dynamic" relations just like
 
2120
      that of regular relations.  if passive_deletes flag (also just added)
 
2121
      is not set, a delete of the parent item will trigger a full load of
 
2122
      the child items so that they can be deleted or updated accordingly.
 
2123
 
 
2124
    .. change::
 
2125
        :tags: orm
 
2126
        :tickets: 
 
2127
 
 
2128
      also with dynamic, implemented correct count() behavior as well
 
2129
      as other helper methods.
 
2130
 
 
2131
    .. change::
 
2132
        :tags: orm
 
2133
        :tickets: 
 
2134
 
 
2135
      fix to cascades on polymorphic relations, such that cascades
 
2136
      from an object to a polymorphic collection continue cascading
 
2137
      along the set of attributes specific to each element in the collection.
 
2138
 
 
2139
    .. change::
 
2140
        :tags: orm
 
2141
        :tickets: 893
 
2142
 
 
2143
      query.get() and query.load() do not take existing filter or other
 
2144
      criterion into account; these methods *always* look up the given id
 
2145
      in the database or return the current instance from the identity map,
 
2146
      disregarding any existing filter, join, group_by or other criterion
 
2147
      which has been configured.
 
2148
 
 
2149
    .. change::
 
2150
        :tags: orm
 
2151
        :tickets: 883
 
2152
 
 
2153
      added support for version_id_col in conjunction with inheriting mappers.
 
2154
      version_id_col is typically set on the base mapper in an inheritance
 
2155
      relationship where it takes effect for all inheriting mappers.
 
2156
 
 
2157
    .. change::
 
2158
        :tags: orm
 
2159
        :tickets: 
 
2160
 
 
2161
      relaxed rules on column_property() expressions having labels; any
 
2162
      ColumnElement is accepted now, as the compiler auto-labels non-labeled
 
2163
      ColumnElements now.  a selectable, like a select() statement, still
 
2164
      requires conversion to ColumnElement via as_scalar() or label().
 
2165
 
 
2166
    .. change::
 
2167
        :tags: orm
 
2168
        :tickets: 
 
2169
 
 
2170
      fixed backref bug where you could not del instance.attr if attr
 
2171
      was None
 
2172
 
 
2173
    .. change::
 
2174
        :tags: orm
 
2175
        :tickets: 
 
2176
 
 
2177
      several ORM attributes have been removed or made private:
 
2178
      mapper.get_attr_by_column(), mapper.set_attr_by_column(),
 
2179
      mapper.pks_by_table, mapper.cascade_callable(),
 
2180
      MapperProperty.cascade_callable(), mapper.canload(),
 
2181
      mapper.save_obj(), mapper.delete_obj(), mapper._mapper_registry,
 
2182
      attributes.AttributeManager
 
2183
 
 
2184
    .. change::
 
2185
        :tags: orm
 
2186
        :tickets: 
 
2187
 
 
2188
      Assigning an incompatible collection type to a relation attribute now
 
2189
      raises TypeError instead of sqlalchemy's ArgumentError.
 
2190
 
 
2191
    .. change::
 
2192
        :tags: orm
 
2193
        :tickets: 886
 
2194
 
 
2195
      Bulk assignment of a MappedCollection now raises an error if a key in the
 
2196
      incoming dictionary does not match the key that the collection's keyfunc
 
2197
      would use for that value.
 
2198
 
 
2199
    .. change::
 
2200
        :tags: orm, newval1, newval2
 
2201
        :tickets: 
 
2202
 
 
2203
      Custom collections can now specify a @converter method to translate
 
2204
      objects used in "bulk" assignment into a stream of values, as in::
 
2205
      
 
2206
         obj.col =
 
2207
         # or
 
2208
         obj.dictcol = {'foo': newval1, 'bar': newval2}
 
2209
      
 
2210
      The MappedCollection uses this hook to ensure that incoming key/value
 
2211
      pairs are sane from the collection's perspective.
 
2212
 
 
2213
    .. change::
 
2214
        :tags: orm
 
2215
        :tickets: 872
 
2216
 
 
2217
      fixed endless loop issue when using lazy="dynamic" on both
 
2218
      sides of a bi-directional relationship
 
2219
 
 
2220
    .. change::
 
2221
        :tags: orm
 
2222
        :tickets: 904
 
2223
 
 
2224
      more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,
 
2225
      in this case when mapped against a select statement
 
2226
 
 
2227
    .. change::
 
2228
        :tags: orm
 
2229
        :tickets: 
 
2230
 
 
2231
      fix to self-referential eager loading such that if the same mapped
 
2232
      instance appears in two or more distinct sets of columns in the same
 
2233
      result set, its eagerly loaded collection will be populated regardless
 
2234
      of whether or not all of the rows contain a set of "eager" columns for
 
2235
      that collection.  this would also show up as a KeyError when fetching
 
2236
      results with join_depth turned on.
 
2237
 
 
2238
    .. change::
 
2239
        :tags: orm
 
2240
        :tickets: 
 
2241
 
 
2242
      fixed bug where Query would not apply a subquery to the SQL when LIMIT
 
2243
      was used in conjunction with an inheriting mapper where the eager
 
2244
      loader was only in the parent mapper.
 
2245
 
 
2246
    .. change::
 
2247
        :tags: orm
 
2248
        :tickets: 
 
2249
 
 
2250
      clarified the error message which occurs when you try to update()
 
2251
      an instance with the same identity key as an instance already present
 
2252
      in the session.
 
2253
 
 
2254
    .. change::
 
2255
        :tags: orm
 
2256
        :tickets: 
 
2257
 
 
2258
      some clarifications and fixes to merge(instance, dont_load=True).
 
2259
      fixed bug where lazy loaders were getting disabled on returned instances.
 
2260
      Also, we currently do not support merging an instance which has uncommitted
 
2261
      changes on it, in the case that dont_load=True is used....this will
 
2262
      now raise an error.  This is due to complexities in merging the
 
2263
      "committed state" of the given instance to correctly correspond to the
 
2264
      newly copied instance, as well as other modified state.
 
2265
      Since the use case for dont_load=True is caching, the given instances
 
2266
      shouldn't have any uncommitted changes on them anyway.
 
2267
      We also copy the instances over without using any events now, so that
 
2268
      the 'dirty' list on the new session remains unaffected.
 
2269
 
 
2270
    .. change::
 
2271
        :tags: orm
 
2272
        :tickets: 
 
2273
 
 
2274
      fixed bug which could arise when using session.begin_nested() in conjunction
 
2275
      with more than one level deep of enclosing session.begin() statements
 
2276
 
 
2277
    .. change::
 
2278
        :tags: orm
 
2279
        :tickets: 914
 
2280
 
 
2281
      fixed session.refresh() with instance that has custom entity_name
 
2282
 
 
2283
    .. change::
 
2284
        :tags: dialects
 
2285
        :tickets: 
 
2286
 
 
2287
      sqlite SLDate type will not erroneously render "microseconds" portion
 
2288
      of a datetime or time object.
 
2289
 
 
2290
    .. change::
 
2291
        :tags: dialects
 
2292
        :tickets: 902
 
2293
 
 
2294
      oracle
 
2295
       - added disconnect detection support for Oracle
 
2296
       - some cleanup to binary/raw types so that cx_oracle.LOB is detected
 
2297
         on an ad-hoc basis
 
2298
 
 
2299
    .. change::
 
2300
        :tags: dialects
 
2301
        :tickets: 824, 839, 842, 901
 
2302
 
 
2303
      MSSQL
 
2304
       - PyODBC no longer has a global "set nocount on".
 
2305
       - Fix non-identity integer PKs on autload
 
2306
       - Better support for convert_unicode
 
2307
       - Less strict date conversion for pyodbc/adodbapi
 
2308
       - Schema-qualified tables / autoload
 
2309
 
 
2310
    .. change::
 
2311
        :tags: firebird, backend
 
2312
        :tickets: 410
 
2313
 
 
2314
      does properly reflect domains (partially fixing) and
 
2315
      PassiveDefaults
 
2316
 
 
2317
    .. change::
 
2318
        :tags: 3562, firebird, backend
 
2319
        :tickets: 
 
2320
 
 
2321
      reverted to use default poolclass (was set to SingletonThreadPool in
 
2322
      0.4.0 for test purposes)
 
2323
 
 
2324
    .. change::
 
2325
        :tags: firebird, backend
 
2326
        :tickets: 
 
2327
 
 
2328
      map func.length() to 'char_length' (easily overridable with the UDF
 
2329
      'strlen' on old versions of Firebird)
 
2330
 
 
2331
.. changelog::
 
2332
    :version: 0.4.1
 
2333
    :released: Sun Nov 18 2007
 
2334
 
 
2335
    .. change::
 
2336
        :tags: sql
 
2337
        :tickets: 
 
2338
 
 
2339
      the "shortname" keyword parameter on bindparam() has been
 
2340
      deprecated.
 
2341
 
 
2342
    .. change::
 
2343
        :tags: sql
 
2344
        :tickets: 
 
2345
 
 
2346
      Added contains operator (generates a "LIKE %<other>%" clause).
 
2347
 
 
2348
    .. change::
 
2349
        :tags: sql
 
2350
        :tickets: 
 
2351
 
 
2352
      anonymous column expressions are automatically labeled.
 
2353
      e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1".
 
2354
      This allows the labelname to be present in the cursor.description
 
2355
      which can then be appropriately matched to result-column processing
 
2356
      rules. (we can't reliably use positional tracking for result-column
 
2357
      matches since text() expressions may represent multiple columns).
 
2358
 
 
2359
    .. change::
 
2360
        :tags: sql
 
2361
        :tickets: 
 
2362
 
 
2363
      operator overloading is now controlled by TypeEngine objects - the
 
2364
      one built-in operator overload so far is String types overloading
 
2365
      '+' to be the string concatenation operator.
 
2366
      User-defined types can also define their own operator overloading
 
2367
      by overriding the adapt_operator(self, op) method.
 
2368
 
 
2369
    .. change::
 
2370
        :tags: sql
 
2371
        :tickets: 819
 
2372
 
 
2373
      untyped bind parameters on the right side of a binary expression
 
2374
      will be assigned the type of the left side of the operation, to better
 
2375
      enable the appropriate bind parameter processing to take effect
 
2376
 
 
2377
    .. change::
 
2378
        :tags: sql
 
2379
        :tickets: 833
 
2380
 
 
2381
      Removed regular expression step from most statement compilations.
 
2382
      Also fixes
 
2383
 
 
2384
    .. change::
 
2385
        :tags: sql
 
2386
        :tickets: 
 
2387
 
 
2388
      Fixed empty (zero column) sqlite inserts, allowing inserts on
 
2389
      autoincrementing single column tables.
 
2390
 
 
2391
    .. change::
 
2392
        :tags: sql
 
2393
        :tickets: 
 
2394
 
 
2395
      Fixed expression translation of text() clauses; this repairs various
 
2396
      ORM scenarios where literal text is used for SQL expressions
 
2397
 
 
2398
    .. change::
 
2399
        :tags: sql
 
2400
        :tickets: 
 
2401
 
 
2402
      Removed ClauseParameters object; compiled.params returns a regular
 
2403
      dictionary now, as well as result.last_inserted_params() /
 
2404
      last_updated_params().
 
2405
 
 
2406
    .. change::
 
2407
        :tags: sql
 
2408
        :tickets: 
 
2409
 
 
2410
      Fixed INSERT statements w.r.t. primary key columns that have
 
2411
      SQL-expression based default generators on them; SQL expression
 
2412
      executes inline as normal but will not trigger a "postfetch" condition
 
2413
      for the column, for those DB's who provide it via cursor.lastrowid
 
2414
 
 
2415
    .. change::
 
2416
        :tags: sql
 
2417
        :tickets: 844
 
2418
 
 
2419
      func. objects can be pickled/unpickled
 
2420
 
 
2421
    .. change::
 
2422
        :tags: sql
 
2423
        :tickets: 
 
2424
 
 
2425
      rewrote and simplified the system used to "target" columns across
 
2426
      selectable expressions.  On the SQL side this is represented by the
 
2427
      "corresponding_column()" method. This method is used heavily by the ORM
 
2428
      to "adapt" elements of an expression to similar, aliased expressions,
 
2429
      as well as to target result set columns originally bound to a
 
2430
      table or selectable to an aliased, "corresponding" expression.  The new
 
2431
      rewrite features completely consistent and accurate behavior.
 
2432
 
 
2433
    .. change::
 
2434
        :tags: sql
 
2435
        :tickets: 573
 
2436
 
 
2437
      Added a field ("info") for storing arbitrary data on schema items
 
2438
 
 
2439
    .. change::
 
2440
        :tags: sql
 
2441
        :tickets: 
 
2442
 
 
2443
      The "properties" collection on Connections has been renamed "info" to
 
2444
      match schema's writable collections.  Access is still available via
 
2445
      the "properties" name until 0.5.
 
2446
 
 
2447
    .. change::
 
2448
        :tags: sql
 
2449
        :tickets: 
 
2450
 
 
2451
      fixed the close() method on Transaction when using strategy='threadlocal'
 
2452
 
 
2453
    .. change::
 
2454
        :tags: sql
 
2455
        :tickets: 853
 
2456
 
 
2457
      fix to compiled bind parameters to not mistakenly populate None
 
2458
 
 
2459
    .. change::
 
2460
        :tags: sql
 
2461
        :tickets: 
 
2462
 
 
2463
      <Engine|Connection>._execute_clauseelement becomes a public method
 
2464
      Connectable.execute_clauseelement
 
2465
 
 
2466
    .. change::
 
2467
        :tags: orm
 
2468
        :tickets: 843
 
2469
 
 
2470
      eager loading with LIMIT/OFFSET applied no longer adds the primary
 
2471
      table joined to a limited subquery of itself; the eager loads now
 
2472
      join directly to the subquery which also provides the primary table's
 
2473
      columns to the result set.  This eliminates a JOIN from all eager loads
 
2474
      with LIMIT/OFFSET.
 
2475
 
 
2476
    .. change::
 
2477
        :tags: orm
 
2478
        :tickets: 802
 
2479
 
 
2480
      session.refresh() and session.expire() now support an additional argument
 
2481
      "attribute_names", a list of individual attribute keynames to be refreshed
 
2482
      or expired, allowing partial reloads of attributes on an already-loaded
 
2483
      instance.
 
2484
 
 
2485
    .. change::
 
2486
        :tags: orm
 
2487
        :tickets: 767
 
2488
 
 
2489
      added op() operator to instrumented attributes; i.e.
 
2490
      User.name.op('ilike')('%somename%')
 
2491
 
 
2492
    .. change::
 
2493
        :tags: orm
 
2494
        :tickets: 676
 
2495
 
 
2496
      Mapped classes may now define __eq__, __hash__, and __nonzero__ methods
 
2497
      with arbitrary semantics.  The orm now handles all mapped instances on
 
2498
      an identity-only basis. (e.g. 'is' vs '==')
 
2499
 
 
2500
    .. change::
 
2501
        :tags: orm
 
2502
        :tickets: 
 
2503
 
 
2504
      the "properties" accessor on Mapper is removed; it now throws an informative
 
2505
      exception explaining the usage of mapper.get_property() and
 
2506
      mapper.iterate_properties
 
2507
 
 
2508
    .. change::
 
2509
        :tags: orm
 
2510
        :tickets: 
 
2511
 
 
2512
      added having() method to Query, applies HAVING to the generated statement
 
2513
      in the same way as filter() appends to the WHERE clause.
 
2514
 
 
2515
    .. change::
 
2516
        :tags: orm
 
2517
        :tickets: 777
 
2518
 
 
2519
      The behavior of query.options() is now fully based on paths, i.e. an
 
2520
      option such as eagerload_all('x.y.z.y.x') will apply eagerloading to
 
2521
      only those paths, i.e. and not 'x.y.x'; eagerload('children.children')
 
2522
      applies only to exactly two-levels deep, etc.
 
2523
 
 
2524
    .. change::
 
2525
        :tags: orm
 
2526
        :tickets: 
 
2527
 
 
2528
      PickleType will compare using `==` when set up with mutable=False,
 
2529
      and not the `is` operator.  To use `is` or any other comparator, send
 
2530
      in a custom comparison function using PickleType(comparator=my_custom_comparator).
 
2531
 
 
2532
    .. change::
 
2533
        :tags: orm
 
2534
        :tickets: 848
 
2535
 
 
2536
      query doesn't throw an error if you use distinct() and an order_by()
 
2537
      containing UnaryExpressions (or other) together
 
2538
 
 
2539
    .. change::
 
2540
        :tags: orm
 
2541
        :tickets: 786
 
2542
 
 
2543
      order_by() expressions from joined tables are properly added to columns
 
2544
      clause when using distinct()
 
2545
 
 
2546
    .. change::
 
2547
        :tags: orm
 
2548
        :tickets: 858
 
2549
 
 
2550
      fixed error where Query.add_column() would not accept a class-bound
 
2551
      attribute as an argument; Query also raises an error if an invalid
 
2552
      argument was sent to add_column() (at instances() time)
 
2553
 
 
2554
    .. change::
 
2555
        :tags: orm
 
2556
        :tickets: 
 
2557
 
 
2558
      added a little more checking for garbage-collection dereferences in
 
2559
      InstanceState.__cleanup() to reduce "gc ignored" errors on app
 
2560
      shutdown
 
2561
 
 
2562
    .. change::
 
2563
        :tags: orm
 
2564
        :tickets: 
 
2565
 
 
2566
      The session API has been solidified:
 
2567
 
 
2568
    .. change::
 
2569
        :tags: orm
 
2570
        :tickets: 840
 
2571
 
 
2572
      It's an error to session.save() an object which is already
 
2573
      persistent
 
2574
 
 
2575
    .. change::
 
2576
        :tags: orm
 
2577
        :tickets: 
 
2578
 
 
2579
      It's an error to session.delete() an object which is *not*
 
2580
      persistent.
 
2581
 
 
2582
    .. change::
 
2583
        :tags: orm
 
2584
        :tickets: 
 
2585
 
 
2586
      session.update() and session.delete() raise an error when updating
 
2587
      or deleting an instance that is already in the session with a
 
2588
      different identity.
 
2589
 
 
2590
    .. change::
 
2591
        :tags: orm
 
2592
        :tickets: 
 
2593
 
 
2594
      The session checks more carefully when determining "object X already
 
2595
      in another session"; e.g. if you pickle a series of objects and
 
2596
      unpickle (i.e. as in a Pylons HTTP session or similar), they can go
 
2597
      into a new session without any conflict
 
2598
 
 
2599
    .. change::
 
2600
        :tags: orm
 
2601
        :tickets: 
 
2602
 
 
2603
      merge() includes a keyword argument "dont_load=True".  setting this
 
2604
      flag will cause the merge operation to not load any data from the
 
2605
      database in response to incoming detached objects, and will accept
 
2606
      the incoming detached object as though it were already present in
 
2607
      that session.  Use this to merge detached objects from external
 
2608
      caching systems into the session.
 
2609
 
 
2610
    .. change::
 
2611
        :tags: orm
 
2612
        :tickets: 
 
2613
 
 
2614
      Deferred column attributes no longer trigger a load operation when the
 
2615
      attribute is assigned to.  In those cases, the newly assigned value
 
2616
      will be present in the flushes' UPDATE statement unconditionally.
 
2617
 
 
2618
    .. change::
 
2619
        :tags: orm
 
2620
        :tickets: 834
 
2621
 
 
2622
      Fixed a truncation error when re-assigning a subset of a collection
 
2623
      (obj.relation = obj.relation[1:])
 
2624
 
 
2625
    .. change::
 
2626
        :tags: orm
 
2627
        :tickets: 832
 
2628
 
 
2629
      De-cruftified backref configuration code, backrefs which step on
 
2630
      existing properties now raise an error
 
2631
 
 
2632
    .. change::
 
2633
        :tags: orm
 
2634
        :tickets: 831
 
2635
 
 
2636
      Improved behavior of add_property() etc., fixed involving
 
2637
      synonym/deferred.
 
2638
 
 
2639
    .. change::
 
2640
        :tags: orm
 
2641
        :tickets: 
 
2642
 
 
2643
      Fixed clear_mappers() behavior to better clean up after itself.
 
2644
 
 
2645
    .. change::
 
2646
        :tags: orm
 
2647
        :tickets: 841
 
2648
 
 
2649
      Fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined
 
2650
      into a single UPDATE; many-to-many relations on the parent object
 
2651
      update properly.
 
2652
 
 
2653
    .. change::
 
2654
        :tags: orm
 
2655
        :tickets: 
 
2656
 
 
2657
      Fixed __hash__ for association proxy- these collections are unhashable,
 
2658
      just like their mutable Python counterparts.
 
2659
 
 
2660
    .. change::
 
2661
        :tags: orm
 
2662
        :tickets: 
 
2663
 
 
2664
      Added proxying of save_or_update, __contains__ and __iter__ methods for
 
2665
      scoped sessions.
 
2666
 
 
2667
    .. change::
 
2668
        :tags: orm
 
2669
        :tickets: 852
 
2670
 
 
2671
      fixed very hard-to-reproduce issue where by the FROM clause of Query
 
2672
      could get polluted by certain generative calls
 
2673
 
 
2674
    .. change::
 
2675
        :tags: dialects
 
2676
        :tickets: 
 
2677
 
 
2678
      Added experimental support for MaxDB (versions >= 7.6.03.007 only).
 
2679
 
 
2680
    .. change::
 
2681
        :tags: dialects
 
2682
        :tickets: 
 
2683
 
 
2684
      oracle will now reflect "DATE" as an OracleDateTime column, not
 
2685
      OracleDate
 
2686
 
 
2687
    .. change::
 
2688
        :tags: dialects
 
2689
        :tickets: 847
 
2690
 
 
2691
      added awareness of schema name in oracle table_names() function,
 
2692
      fixes metadata.reflect(schema='someschema')
 
2693
 
 
2694
    .. change::
 
2695
        :tags: dialects
 
2696
        :tickets: 
 
2697
 
 
2698
      MSSQL anonymous labels for selection of functions made deterministic
 
2699
 
 
2700
    .. change::
 
2701
        :tags: dialects
 
2702
        :tickets: 
 
2703
 
 
2704
      sqlite will reflect "DECIMAL" as a numeric column.
 
2705
 
 
2706
    .. change::
 
2707
        :tags: dialects
 
2708
        :tickets: 828
 
2709
 
 
2710
      Made access dao detection more reliable
 
2711
 
 
2712
    .. change::
 
2713
        :tags: dialects
 
2714
        :tickets: 
 
2715
 
 
2716
      Renamed the Dialect attribute 'preexecute_sequences' to
 
2717
      'preexecute_pk_sequences'.  An attribute porxy is in place for
 
2718
      out-of-tree dialects using the old name.
 
2719
 
 
2720
    .. change::
 
2721
        :tags: dialects
 
2722
        :tickets: 
 
2723
 
 
2724
      Added test coverage for unknown type reflection. Fixed sqlite/mysql
 
2725
      handling of type reflection for unknown types.
 
2726
 
 
2727
    .. change::
 
2728
        :tags: dialects
 
2729
        :tickets: 
 
2730
 
 
2731
      Added REAL for mysql dialect (for folks exploiting the
 
2732
      REAL_AS_FLOAT sql mode).
 
2733
 
 
2734
    .. change::
 
2735
        :tags: dialects
 
2736
        :tickets: 
 
2737
 
 
2738
      mysql Float, MSFloat and MSDouble constructed without arguments
 
2739
      now produce no-argument DDL, e.g.'FLOAT'.
 
2740
 
 
2741
    .. change::
 
2742
        :tags: misc
 
2743
        :tickets: 
 
2744
 
 
2745
      Removed unused util.hash().
 
2746
 
 
2747
.. changelog::
 
2748
    :version: 0.4.0
 
2749
    :released: Wed Oct 17 2007
 
2750
 
 
2751
    .. change::
 
2752
        :tags: 
 
2753
        :tickets: 
 
2754
 
 
2755
      (see 0.4.0beta1 for the start of major changes against 0.3,
 
2756
      as well as http://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 )
 
2757
 
 
2758
    .. change::
 
2759
        :tags: 
 
2760
        :tickets: 785
 
2761
 
 
2762
      Added initial Sybase support (mxODBC so far)
 
2763
 
 
2764
    .. change::
 
2765
        :tags: 
 
2766
        :tickets: 
 
2767
 
 
2768
      Added partial index support for PostgreSQL. Use the postgres_where keyword
 
2769
      on the Index.
 
2770
 
 
2771
    .. change::
 
2772
        :tags: 
 
2773
        :tickets: 817
 
2774
 
 
2775
      string-based query param parsing/config file parser understands
 
2776
      wider range of string values for booleans
 
2777
 
 
2778
    .. change::
 
2779
        :tags: 
 
2780
        :tickets: 813
 
2781
 
 
2782
      backref remove object operation doesn't fail if the other-side
 
2783
      collection doesn't contain the item, supports noload collections
 
2784
 
 
2785
    .. change::
 
2786
        :tags: 
 
2787
        :tickets: 818
 
2788
 
 
2789
      removed __len__ from "dynamic" collection as it would require issuing
 
2790
      a SQL "count()" operation, thus forcing all list evaluations to issue
 
2791
      redundant SQL
 
2792
 
 
2793
    .. change::
 
2794
        :tags: 
 
2795
        :tickets: 816
 
2796
 
 
2797
      inline optimizations added to locate_dirty() which can greatly speed up
 
2798
      repeated calls to flush(), as occurs with autoflush=True
 
2799
 
 
2800
    .. change::
 
2801
        :tags: 
 
2802
        :tickets: 
 
2803
 
 
2804
      The IdentifierPreprarer's _requires_quotes test is now regex based.  Any
 
2805
      out-of-tree dialects that provide custom sets of legal_characters or
 
2806
      illegal_initial_characters will need to move to regexes or override
 
2807
      _requires_quotes.
 
2808
 
 
2809
    .. change::
 
2810
        :tags: 
 
2811
        :tickets: 
 
2812
 
 
2813
      Firebird has supports_sane_rowcount and supports_sane_multi_rowcount set
 
2814
      to False due to ticket #370 (right way).
 
2815
 
 
2816
    .. change::
 
2817
        :tags: 
 
2818
        :tickets: 
 
2819
 
 
2820
      Improvements and fixes on Firebird reflection:
 
2821
      . FBDialect now mimics OracleDialect, regarding case-sensitivity of TABLE and
 
2822
        COLUMN names (see 'case_sensitive remotion' topic on this current file).
 
2823
      . FBDialect.table_names() doesn't bring system tables (ticket:796).
 
2824
      . FB now reflects Column's nullable property correctly.
 
2825
 
 
2826
    .. change::
 
2827
        :tags: 
 
2828
        :tickets: 
 
2829
 
 
2830
      Fixed SQL compiler's awareness of top-level column labels as used
 
2831
      in result-set processing; nested selects which contain the same column
 
2832
      names don't affect the result or conflict with result-column metadata.
 
2833
 
 
2834
    .. change::
 
2835
        :tags: 
 
2836
        :tickets: 
 
2837
 
 
2838
      query.get() and related functions (like many-to-one lazyloading)
 
2839
      use compile-time-aliased bind parameter names, to prevent
 
2840
      name conflicts with bind parameters that already exist in the
 
2841
      mapped selectable.
 
2842
 
 
2843
    .. change::
 
2844
        :tags: 
 
2845
        :tickets: 795
 
2846
 
 
2847
      Fixed three- and multi-level select and deferred inheritance loading
 
2848
      (i.e. abc inheritance with no select_table).
 
2849
 
 
2850
    .. change::
 
2851
        :tags: 
 
2852
        :tickets: 
 
2853
 
 
2854
      Ident passed to id_chooser in shard.py always a list.
 
2855
 
 
2856
    .. change::
 
2857
        :tags: 
 
2858
        :tickets: 
 
2859
 
 
2860
      The no-arg ResultProxy._row_processor() is now the class attribute
 
2861
      `_process_row`.
 
2862
 
 
2863
    .. change::
 
2864
        :tags: 
 
2865
        :tickets: 797
 
2866
 
 
2867
      Added support for returning values from inserts and updates for
 
2868
      PostgreSQL 8.2+.
 
2869
 
 
2870
    .. change::
 
2871
        :tags: 
 
2872
        :tickets: 
 
2873
 
 
2874
      PG reflection, upon seeing the default schema name being used explicitly
 
2875
      as the "schema" argument in a Table, will assume that this is the
 
2876
      user's desired convention, and will explicitly set the "schema" argument
 
2877
      in foreign-key-related reflected tables, thus making them match only
 
2878
      with Table constructors that also use the explicit "schema" argument
 
2879
      (even though its the default schema).
 
2880
      In other words, SA assumes the user is being consistent in this usage.
 
2881
 
 
2882
    .. change::
 
2883
        :tags: 
 
2884
        :tickets: 808
 
2885
 
 
2886
      fixed sqlite reflection of BOOL/BOOLEAN
 
2887
 
 
2888
    .. change::
 
2889
        :tags: 
 
2890
        :tickets: 
 
2891
 
 
2892
      Added support for UPDATE with LIMIT on mysql.
 
2893
 
 
2894
    .. change::
 
2895
        :tags: 
 
2896
        :tickets: 803
 
2897
 
 
2898
      null foreign key on a m2o doesn't trigger a lazyload
 
2899
 
 
2900
    .. change::
 
2901
        :tags: 
 
2902
        :tickets: 800
 
2903
 
 
2904
      oracle does not implicitly convert to unicode for non-typed result
 
2905
      sets (i.e. when no TypeEngine/String/Unicode type is even being used;
 
2906
      previously it was detecting DBAPI types and converting regardless).
 
2907
      should fix
 
2908
 
 
2909
    .. change::
 
2910
        :tags: 
 
2911
        :tickets: 806
 
2912
 
 
2913
      fix to anonymous label generation of long table/column names
 
2914
 
 
2915
    .. change::
 
2916
        :tags: 
 
2917
        :tickets: 
 
2918
 
 
2919
      Firebird dialect now uses SingletonThreadPool as poolclass.
 
2920
 
 
2921
    .. change::
 
2922
        :tags: 
 
2923
        :tickets: 
 
2924
 
 
2925
      Firebird now uses dialect.preparer to format sequences names
 
2926
 
 
2927
    .. change::
 
2928
        :tags: 
 
2929
        :tickets: 810
 
2930
 
 
2931
      Fixed breakage with postgres and multiple two-phase transactions. Two-phase
 
2932
      commits and rollbacks didn't automatically end up with a new transaction
 
2933
      as the usual dbapi commits/rollbacks do.
 
2934
 
 
2935
    .. change::
 
2936
        :tags: 
 
2937
        :tickets: 
 
2938
 
 
2939
      Added an option to the _ScopedExt mapper extension to not automatically
 
2940
      save new objects to session on object initialization.
 
2941
 
 
2942
    .. change::
 
2943
        :tags: 
 
2944
        :tickets: 
 
2945
 
 
2946
      fixed Oracle non-ansi join syntax
 
2947
 
 
2948
    .. change::
 
2949
        :tags: 
 
2950
        :tickets: 
 
2951
 
 
2952
      PickleType and Interval types (on db not supporting it natively) are now
 
2953
      slightly faster.
 
2954
 
 
2955
    .. change::
 
2956
        :tags: 
 
2957
        :tickets: 
 
2958
 
 
2959
      Added Float and Time types to Firebird (FBFloat and FBTime). Fixed
 
2960
      BLOB SUB_TYPE for TEXT and Binary types.
 
2961
 
 
2962
    .. change::
 
2963
        :tags: 
 
2964
        :tickets: 
 
2965
 
 
2966
      Changed the API for the in_ operator. in_() now accepts a single argument
 
2967
      that is a sequence of values or a selectable. The old API of passing in
 
2968
      values as varargs still works but is deprecated.
 
2969
 
 
2970
.. changelog::
 
2971
    :version: 0.4.0beta6
 
2972
    :released: Thu Sep 27 2007
 
2973
 
 
2974
    .. change::
 
2975
        :tags: 
 
2976
        :tickets: 
 
2977
 
 
2978
      The Session identity map is now *weak referencing* by default, use
 
2979
      weak_identity_map=False to use a regular dict.  The weak dict we are using
 
2980
      is customized to detect instances which are "dirty" and maintain a
 
2981
      temporary strong reference to those instances until changes are flushed.
 
2982
 
 
2983
    .. change::
 
2984
        :tags: 
 
2985
        :tickets: 758
 
2986
 
 
2987
      Mapper compilation has been reorganized such that most compilation occurs
 
2988
      upon mapper construction.  This allows us to have fewer calls to
 
2989
      mapper.compile() and also to allow class-based properties to force a
 
2990
      compilation (i.e. User.addresses == 7 will compile all mappers; this is).  The only caveat here is that an inheriting mapper now
 
2991
      looks for its inherited mapper upon construction; so mappers within
 
2992
      inheritance relationships need to be constructed in inheritance order
 
2993
      (which should be the normal case anyway).
 
2994
 
 
2995
    .. change::
 
2996
        :tags: 
 
2997
        :tickets: 
 
2998
 
 
2999
      added "FETCH" to the keywords detected by Postgres to indicate a
 
3000
      result-row holding statement (i.e. in addition to "SELECT").
 
3001
 
 
3002
    .. change::
 
3003
        :tags: 
 
3004
        :tickets: 
 
3005
 
 
3006
      Added full list of SQLite reserved keywords so that they get escaped
 
3007
      properly.
 
3008
 
 
3009
    .. change::
 
3010
        :tags: 
 
3011
        :tickets: 
 
3012
 
 
3013
      Tightened up the relationship between the Query's generation of "eager
 
3014
      load" aliases, and Query.instances() which actually grabs the eagerly
 
3015
      loaded rows.  If the aliases were not specifically generated for that
 
3016
      statement by EagerLoader, the EagerLoader will not take effect when the
 
3017
      rows are fetched.  This prevents columns from being grabbed accidentally
 
3018
      as being part of an eager load when they were not meant for such, which
 
3019
      can happen with textual SQL as well as some inheritance situations.  It's
 
3020
      particularly important since the "anonymous aliasing" of columns uses
 
3021
      simple integer counts now to generate labels.
 
3022
 
 
3023
    .. change::
 
3024
        :tags: 
 
3025
        :tickets: 
 
3026
 
 
3027
      Removed "parameters" argument from clauseelement.compile(), replaced with
 
3028
      "column_keys".  The parameters sent to execute() only interact with the
 
3029
      insert/update statement compilation process in terms of the column names
 
3030
      present but not the values for those columns.  Produces more consistent
 
3031
      execute/executemany behavior, simplifies things a bit internally.
 
3032
 
 
3033
    .. change::
 
3034
        :tags: 
 
3035
        :tickets: 560
 
3036
 
 
3037
      Added 'comparator' keyword argument to PickleType.  By default, "mutable"
 
3038
      PickleType does a "deep compare" of objects using their dumps()
 
3039
      representation.  But this doesn't work for dictionaries.  Pickled objects
 
3040
      which provide an adequate __eq__() implementation can be set up with
 
3041
      "PickleType(comparator=operator.eq)"
 
3042
 
 
3043
    .. change::
 
3044
        :tags: 
 
3045
        :tickets: 
 
3046
 
 
3047
      Added session.is_modified(obj) method; performs the same "history"
 
3048
      comparison operation as occurs within a flush operation; setting
 
3049
      include_collections=False gives the same result as is used when the flush
 
3050
      determines whether or not to issue an UPDATE for the instance's row.
 
3051
 
 
3052
    .. change::
 
3053
        :tags: 
 
3054
        :tickets: 584, 761
 
3055
 
 
3056
      Added "schema" argument to Sequence; use this with Postgres /Oracle when
 
3057
      the sequence is located in an alternate schema.  Implements part of, should fix.
 
3058
 
 
3059
    .. change::
 
3060
        :tags: 
 
3061
        :tickets: 
 
3062
 
 
3063
      Fixed reflection of the empty string for mysql enums.
 
3064
 
 
3065
    .. change::
 
3066
        :tags: 
 
3067
        :tickets: 794
 
3068
 
 
3069
      Changed MySQL dialect to use the older LIMIT <offset>, <limit> syntax
 
3070
      instead of LIMIT <l> OFFSET <o> for folks using 3.23.
 
3071
 
 
3072
    .. change::
 
3073
        :tags: 
 
3074
        :tickets: 
 
3075
 
 
3076
      Added 'passive_deletes="all"' flag to relation(), disables all nulling-out
 
3077
      of foreign key attributes during a flush where the parent object is
 
3078
      deleted.
 
3079
 
 
3080
    .. change::
 
3081
        :tags: 
 
3082
        :tickets: 
 
3083
 
 
3084
      Column defaults and onupdates, executing inline, will add parenthesis for
 
3085
      subqueries and other parenthesis-requiring expressions
 
3086
 
 
3087
    .. change::
 
3088
        :tags: 
 
3089
        :tickets: 793
 
3090
 
 
3091
      The behavior of String/Unicode types regarding that they auto-convert to
 
3092
      TEXT/CLOB when no length is present now occurs *only* for an exact type of
 
3093
      String or Unicode with no arguments.  If you use VARCHAR or NCHAR
 
3094
      (subclasses of String/Unicode) with no length, they will be interpreted by
 
3095
      the dialect as VARCHAR/NCHAR; no "magic" conversion happens there.  This
 
3096
      is less surprising behavior and in particular this helps Oracle keep
 
3097
      string-based bind parameters as VARCHARs and not CLOBs.
 
3098
 
 
3099
    .. change::
 
3100
        :tags: 
 
3101
        :tickets: 771
 
3102
 
 
3103
      Fixes to ShardedSession to work with deferred columns.
 
3104
 
 
3105
    .. change::
 
3106
        :tags: 
 
3107
        :tickets: 
 
3108
 
 
3109
      User-defined shard_chooser() function must accept "clause=None" argument;
 
3110
      this is the ClauseElement passed to session.execute(statement) and can be
 
3111
      used to determine correct shard id (since execute() doesn't take an
 
3112
      instance.)
 
3113
 
 
3114
    .. change::
 
3115
        :tags: 
 
3116
        :tickets: 764
 
3117
 
 
3118
      Adjusted operator precedence of NOT to match '==' and others, so that
 
3119
      ~(x <operator> y) produces NOT (x <op> y), which is better compatible
 
3120
      with older MySQL versions..  This doesn't apply to "~(x==y)"
 
3121
      as it does in 0.3 since ~(x==y) compiles to "x != y", but still applies
 
3122
      to operators like BETWEEN.
 
3123
 
 
3124
    .. change::
 
3125
        :tags: 
 
3126
        :tickets: 757, 768, 779, 728
 
3127
 
 
3128
      Other tickets:,,.
 
3129
 
 
3130
.. changelog::
 
3131
    :version: 0.4.0beta5
 
3132
    :released: 
 
3133
 
 
3134
    .. change::
 
3135
        :tags: 
 
3136
        :tickets: 754
 
3137
 
 
3138
      Connection pool fixes; the better performance of beta4 remains but fixes
 
3139
      "connection overflow" and other bugs which were present (like).
 
3140
 
 
3141
    .. change::
 
3142
        :tags: 
 
3143
        :tickets: 769
 
3144
 
 
3145
      Fixed bugs in determining proper sync clauses from custom inherit
 
3146
      conditions.
 
3147
 
 
3148
    .. change::
 
3149
        :tags: 
 
3150
        :tickets: 763
 
3151
 
 
3152
      Extended 'engine_from_config' coercion for QueuePool size / overflow.
 
3153
 
 
3154
    .. change::
 
3155
        :tags: 
 
3156
        :tickets: 748
 
3157
 
 
3158
      mysql views can be reflected again.
 
3159
 
 
3160
    .. change::
 
3161
        :tags: 
 
3162
        :tickets: 
 
3163
 
 
3164
      AssociationProxy can now take custom getters and setters.
 
3165
 
 
3166
    .. change::
 
3167
        :tags: 
 
3168
        :tickets: 
 
3169
 
 
3170
      Fixed malfunctioning BETWEEN in orm queries.
 
3171
 
 
3172
    .. change::
 
3173
        :tags: 
 
3174
        :tickets: 762
 
3175
 
 
3176
      Fixed OrderedProperties pickling
 
3177
 
 
3178
    .. change::
 
3179
        :tags: 
 
3180
        :tickets: 
 
3181
 
 
3182
      SQL-expression defaults and sequences now execute "inline" for all
 
3183
      non-primary key columns during an INSERT or UPDATE, and for all columns
 
3184
      during an executemany()-style call. inline=True flag on any insert/update
 
3185
      statement also forces the same behavior with a single execute().
 
3186
      result.postfetch_cols() is a collection of columns for which the previous
 
3187
      single insert or update statement contained a SQL-side default expression.
 
3188
 
 
3189
    .. change::
 
3190
        :tags: 
 
3191
        :tickets: 759
 
3192
 
 
3193
      Fixed PG executemany() behavior.
 
3194
 
 
3195
    .. change::
 
3196
        :tags: 
 
3197
        :tickets: 
 
3198
 
 
3199
      postgres reflects tables with autoincrement=False for primary key columns
 
3200
      which have no defaults.
 
3201
 
 
3202
    .. change::
 
3203
        :tags: 
 
3204
        :tickets: 
 
3205
 
 
3206
      postgres no longer wraps executemany() with individual execute() calls,
 
3207
      instead favoring performance.  "rowcount"/"concurrency" checks with
 
3208
      deleted items (which use executemany) are disabled with PG since psycopg2
 
3209
      does not report proper rowcount for executemany().
 
3210
 
 
3211
    .. change::
 
3212
        :tags: tickets, fixed
 
3213
        :tickets: 742
 
3214
 
 
3215
      
 
3216
 
 
3217
    .. change::
 
3218
        :tags: tickets, fixed
 
3219
        :tickets: 748
 
3220
 
 
3221
      
 
3222
 
 
3223
    .. change::
 
3224
        :tags: tickets, fixed
 
3225
        :tickets: 760
 
3226
 
 
3227
      
 
3228
 
 
3229
    .. change::
 
3230
        :tags: tickets, fixed
 
3231
        :tickets: 762
 
3232
 
 
3233
      
 
3234
 
 
3235
    .. change::
 
3236
        :tags: tickets, fixed
 
3237
        :tickets: 763
 
3238
 
 
3239
      
 
3240
 
 
3241
.. changelog::
 
3242
    :version: 0.4.0beta4
 
3243
    :released: Wed Aug 22 2007
 
3244
 
 
3245
    .. change::
 
3246
        :tags: 
 
3247
        :tickets: 
 
3248
 
 
3249
      Tidied up what ends up in your namespace when you 'from sqlalchemy import *':
 
3250
 
 
3251
    .. change::
 
3252
        :tags: 
 
3253
        :tickets: 
 
3254
 
 
3255
      'table' and 'column' are no longer imported.  They remain available by
 
3256
      direct reference (as in 'sql.table' and 'sql.column') or a glob import
 
3257
      from the sql package.  It was too easy to accidentally use a
 
3258
      sql.expressions.table instead of schema.Table when just starting out
 
3259
      with SQLAlchemy, likewise column.
 
3260
 
 
3261
    .. change::
 
3262
        :tags: 
 
3263
        :tickets: 
 
3264
 
 
3265
      Internal-ish classes like ClauseElement, FromClause, NullTypeEngine,
 
3266
      etc., are also no longer imported into your namespace
 
3267
 
 
3268
    .. change::
 
3269
        :tags: 
 
3270
        :tickets: 
 
3271
 
 
3272
      The 'Smallinteger' compatiblity name (small i!) is no longer imported,
 
3273
      but remains in schema.py for now.  SmallInteger (big I!) is still
 
3274
      imported.
 
3275
 
 
3276
    .. change::
 
3277
        :tags: 
 
3278
        :tickets: 
 
3279
 
 
3280
      The connection pool uses a "threadlocal" strategy internally to return
 
3281
      the same connection already bound to a thread, for "contextual" connections;
 
3282
      these are the connections used when you do a "connectionless" execution
 
3283
      like insert().execute().  This is like a "partial" version of the
 
3284
      "threadlocal" engine strategy but without the thread-local transaction part
 
3285
      of it.  We're hoping it reduces connection pool overhead as well as
 
3286
      database usage.  However, if it proves to impact stability in a negative way,
 
3287
      we'll roll it right back.
 
3288
 
 
3289
    .. change::
 
3290
        :tags: 
 
3291
        :tickets: 
 
3292
 
 
3293
      Fix to bind param processing such that "False" values (like blank strings)
 
3294
      still get processed/encoded.
 
3295
 
 
3296
    .. change::
 
3297
        :tags: 
 
3298
        :tickets: 752
 
3299
 
 
3300
      Fix to select() "generative" behavior, such that calling column(),
 
3301
      select_from(), correlate(), and with_prefix() does not modify the
 
3302
      original select object
 
3303
 
 
3304
    .. change::
 
3305
        :tags: 
 
3306
        :tickets: 
 
3307
 
 
3308
      Added a "legacy" adapter to types, such that user-defined TypeEngine
 
3309
      and TypeDecorator classes which define convert_bind_param() and/or
 
3310
      convert_result_value() will continue to function.  Also supports
 
3311
      calling the super() version of those methods.
 
3312
 
 
3313
    .. change::
 
3314
        :tags: 
 
3315
        :tickets: 
 
3316
 
 
3317
      Added session.prune(), trims away instances cached in a session that
 
3318
      are no longer referenced elsewhere. (A utility for strong-ref
 
3319
      identity maps).
 
3320
 
 
3321
    .. change::
 
3322
        :tags: 
 
3323
        :tickets: 
 
3324
 
 
3325
      Added close() method to Transaction.  Closes out a transaction using
 
3326
      rollback if it's the outermost transaction, otherwise just ends
 
3327
      without affecting the outer transaction.
 
3328
 
 
3329
    .. change::
 
3330
        :tags: 
 
3331
        :tickets: 
 
3332
 
 
3333
      Transactional and non-transactional Session integrates better with
 
3334
      bound connection; a close() will ensure that connection
 
3335
      transactional state is the same as that which existed on it before
 
3336
      being bound to the Session.
 
3337
 
 
3338
    .. change::
 
3339
        :tags: 
 
3340
        :tickets: 735
 
3341
 
 
3342
      Modified SQL operator functions to be module-level operators,
 
3343
      allowing SQL expressions to be pickleable.
 
3344
 
 
3345
    .. change::
 
3346
        :tags: 
 
3347
        :tickets: 
 
3348
 
 
3349
      Small adjustment to mapper class.__init__ to allow for Py2.6
 
3350
      object.__init__() behavior.
 
3351
 
 
3352
    .. change::
 
3353
        :tags: 
 
3354
        :tickets: 
 
3355
 
 
3356
      Fixed 'prefix' argument for select()
 
3357
 
 
3358
    .. change::
 
3359
        :tags: 
 
3360
        :tickets: 
 
3361
 
 
3362
      Connection.begin() no longer accepts nested=True, this logic is now
 
3363
      all in begin_nested().
 
3364
 
 
3365
    .. change::
 
3366
        :tags: 
 
3367
        :tickets: 
 
3368
 
 
3369
      Fixes to new "dynamic" relation loader involving cascades
 
3370
 
 
3371
    .. change::
 
3372
        :tags: tickets, fixed
 
3373
        :tickets: 735
 
3374
 
 
3375
      
 
3376
 
 
3377
    .. change::
 
3378
        :tags: tickets, fixed
 
3379
        :tickets: 752
 
3380
 
 
3381
      
 
3382
 
 
3383
.. changelog::
 
3384
    :version: 0.4.0beta3
 
3385
    :released: Thu Aug 16 2007
 
3386
 
 
3387
    .. change::
 
3388
        :tags: 
 
3389
        :tickets: 
 
3390
 
 
3391
      SQL types optimization:
 
3392
 
 
3393
    .. change::
 
3394
        :tags: 
 
3395
        :tickets: 
 
3396
 
 
3397
      New performance tests show a combined mass-insert/mass-select test as
 
3398
      having 68% fewer function calls than the same test run against 0.3.
 
3399
 
 
3400
    .. change::
 
3401
        :tags: 
 
3402
        :tickets: 
 
3403
 
 
3404
      General performance improvement of result set iteration is around 10-20%.
 
3405
 
 
3406
    .. change::
 
3407
        :tags: 
 
3408
        :tickets: 
 
3409
 
 
3410
      In types.AbstractType, convert_bind_param() and convert_result_value()
 
3411
      have migrated to callable-returning bind_processor() and
 
3412
      result_processor() methods.  If no callable is returned, no pre/post
 
3413
      processing function is called.
 
3414
 
 
3415
    .. change::
 
3416
        :tags: 
 
3417
        :tickets: 
 
3418
 
 
3419
      Hooks added throughout base/sql/defaults to optimize the calling of bind
 
3420
      aram/result processors so that method call overhead is minimized.
 
3421
 
 
3422
    .. change::
 
3423
        :tags: 
 
3424
        :tickets: 
 
3425
 
 
3426
      Support added for executemany() scenarios such that unneeded "last row id"
 
3427
      logic doesn't kick in, parameters aren't excessively traversed.
 
3428
 
 
3429
    .. change::
 
3430
        :tags: 
 
3431
        :tickets: 
 
3432
 
 
3433
      Added 'inherit_foreign_keys' arg to mapper().
 
3434
 
 
3435
    .. change::
 
3436
        :tags: 
 
3437
        :tickets: 
 
3438
 
 
3439
      Added support for string date passthrough in sqlite.
 
3440
 
 
3441
    .. change::
 
3442
        :tags: tickets, fixed
 
3443
        :tickets: 738
 
3444
 
 
3445
      
 
3446
 
 
3447
    .. change::
 
3448
        :tags: tickets, fixed
 
3449
        :tickets: 739
 
3450
 
 
3451
      
 
3452
 
 
3453
    .. change::
 
3454
        :tags: tickets, fixed
 
3455
        :tickets: 743
 
3456
 
 
3457
      
 
3458
 
 
3459
    .. change::
 
3460
        :tags: tickets, fixed
 
3461
        :tickets: 744
 
3462
 
 
3463
      
 
3464
 
 
3465
.. changelog::
 
3466
    :version: 0.4.0beta2
 
3467
    :released: Tue Aug 14 2007
 
3468
 
 
3469
    .. change::
 
3470
        :tags: oracle, improvements.
 
3471
        :tickets: 
 
3472
 
 
3473
      Auto-commit after LOAD DATA INFILE for mysql.
 
3474
 
 
3475
    .. change::
 
3476
        :tags: oracle, improvements.
 
3477
        :tickets: 
 
3478
 
 
3479
      A rudimental SessionExtension class has been added, allowing user-defined
 
3480
      functionality to take place at flush(), commit(), and rollback() boundaries.
 
3481
 
 
3482
    .. change::
 
3483
        :tags: oracle, improvements.
 
3484
        :tickets: 
 
3485
 
 
3486
      Added engine_from_config() function for helping to create_engine() from an
 
3487
      .ini style config.
 
3488
 
 
3489
    .. change::
 
3490
        :tags: oracle, improvements.
 
3491
        :tickets: 
 
3492
 
 
3493
      base_mapper() becomes a plain attribute.
 
3494
 
 
3495
    .. change::
 
3496
        :tags: oracle, improvements.
 
3497
        :tickets: 
 
3498
 
 
3499
      session.execute() and scalar() can search for a Table with which to bind from
 
3500
      using the given ClauseElement.
 
3501
 
 
3502
    .. change::
 
3503
        :tags: oracle, improvements.
 
3504
        :tickets: 
 
3505
 
 
3506
      Session automatically extrapolates tables from mappers with binds, also uses
 
3507
      base_mapper so that inheritance hierarchies bind automatically.
 
3508
 
 
3509
    .. change::
 
3510
        :tags: oracle, improvements.
 
3511
        :tickets: 
 
3512
 
 
3513
      Moved ClauseVisitor traversal back to inlined non-recursive.
 
3514
 
 
3515
    .. change::
 
3516
        :tags: tickets, fixed
 
3517
        :tickets: 730
 
3518
 
 
3519
      
 
3520
 
 
3521
    .. change::
 
3522
        :tags: tickets, fixed
 
3523
        :tickets: 732
 
3524
 
 
3525
      
 
3526
 
 
3527
    .. change::
 
3528
        :tags: tickets, fixed
 
3529
        :tickets: 733
 
3530
 
 
3531
      
 
3532
 
 
3533
    .. change::
 
3534
        :tags: tickets, fixed
 
3535
        :tickets: 734
 
3536
 
 
3537
      
 
3538
 
 
3539
.. changelog::
 
3540
    :version: 0.4.0beta1
 
3541
    :released: Sun Aug 12 2007
 
3542
 
 
3543
    .. change::
 
3544
        :tags: orm
 
3545
        :tickets: 
 
3546
 
 
3547
      Speed! Along with recent speedups to ResultProxy, total number of function
 
3548
      calls significantly reduced for large loads.
 
3549
 
 
3550
    .. change::
 
3551
        :tags: orm
 
3552
        :tickets: 
 
3553
 
 
3554
      test/perf/masseagerload.py reports 0.4 as having the fewest number of
 
3555
      function calls across all SA versions (0.1, 0.2, and 0.3).
 
3556
 
 
3557
    .. change::
 
3558
        :tags: orm
 
3559
        :tickets: 213
 
3560
 
 
3561
      New collection_class api and implementation. Collections are
 
3562
      now instrumented via decorations rather than proxying.  You can now have
 
3563
      collections that manage their own membership, and your class instance will
 
3564
      be directly exposed on the relation property.  The changes are transparent
 
3565
      for most users.
 
3566
 
 
3567
    .. change::
 
3568
        :tags: orm
 
3569
        :tickets: 
 
3570
 
 
3571
      InstrumentedList (as it was) is removed, and relation properties no
 
3572
      longer have 'clear()', '.data', or any other added methods beyond those
 
3573
      provided by the collection type. You are free, of course, to add them to
 
3574
      a custom class.
 
3575
 
 
3576
    .. change::
 
3577
        :tags: orm
 
3578
        :tickets: 
 
3579
 
 
3580
      __setitem__-like assignments now fire remove events for the existing
 
3581
      value, if any.
 
3582
 
 
3583
    .. change::
 
3584
        :tags: orm
 
3585
        :tickets: 
 
3586
 
 
3587
      dict-likes used as collection classes no longer need to change __iter__
 
3588
      semantics- itervalues() is used by default instead. This is a backwards
 
3589
      incompatible change.
 
3590
 
 
3591
    .. change::
 
3592
        :tags: orm
 
3593
        :tickets: 
 
3594
 
 
3595
      Subclassing dict for a mapped collection is no longer needed in most
 
3596
      cases. orm.collections provides canned implementations that key objects
 
3597
      by a specified column or a custom function of your choice.
 
3598
 
 
3599
    .. change::
 
3600
        :tags: orm
 
3601
        :tickets: 
 
3602
 
 
3603
      Collection assignment now requires a compatible type- assigning None to
 
3604
      clear a collection or assigning a list to a dict collection will now
 
3605
      raise an argument error.
 
3606
 
 
3607
    .. change::
 
3608
        :tags: orm
 
3609
        :tickets: 
 
3610
 
 
3611
      AttributeExtension moved to interfaces, and .delete is now .remove The
 
3612
      event method signature has also been swapped around.
 
3613
 
 
3614
    .. change::
 
3615
        :tags: orm
 
3616
        :tickets: 
 
3617
 
 
3618
      Major overhaul for Query:
 
3619
 
 
3620
    .. change::
 
3621
        :tags: orm
 
3622
        :tickets: 
 
3623
 
 
3624
      All selectXXX methods are deprecated.  Generative methods are now the
 
3625
      standard way to do things, i.e. filter(), filter_by(), all(), one(),
 
3626
      etc.  Deprecated methods are docstring'ed with their new replacements.
 
3627
 
 
3628
    .. change::
 
3629
        :tags: orm
 
3630
        :tickets: 643
 
3631
 
 
3632
      Class-level properties are now usable as query elements... no more
 
3633
      '.c.'!  "Class.c.propname" is now superceded by "Class.propname".  All
 
3634
      clause operators are supported, as well as higher level operators such
 
3635
      as Class.prop==<some instance> for scalar attributes,
 
3636
      Class.prop.contains(<some instance>) and Class.prop.any(<some
 
3637
      expression>) for collection-based attributes (all are also
 
3638
      negatable).  Table-based column expressions as well as columns mounted
 
3639
      on mapped classes via 'c' are of course still fully available and can be
 
3640
      freely mixed with the new attributes.
 
3641
 
 
3642
    .. change::
 
3643
        :tags: orm
 
3644
        :tickets: 
 
3645
 
 
3646
      Removed ancient query.select_by_attributename() capability.
 
3647
 
 
3648
    .. change::
 
3649
        :tags: orm
 
3650
        :tickets: 
 
3651
 
 
3652
      The aliasing logic used by eager loading has been generalized, so that
 
3653
      it also adds full automatic aliasing support to Query.  It's no longer
 
3654
      necessary to create an explicit Alias to join to the same tables
 
3655
      multiple times; *even for self-referential relationships*.
 
3656
      
 
3657
      - join() and outerjoin() take arguments "aliased=True".  Yhis causes
 
3658
        their joins to be built on aliased tables; subsequent calls to
 
3659
        filter() and filter_by() will translate all table expressions (yes,
 
3660
        real expressions using the original mapped Table) to be that of the
 
3661
        Alias for the duration of that join() (i.e. until reset_joinpoint() or
 
3662
        another join() is called).
 
3663
      
 
3664
      - join() and outerjoin() take arguments "id=<somestring>".  When used
 
3665
        with "aliased=True", the id can be referenced by add_entity(cls,
 
3666
        id=<somestring>) so that you can select the joined instances even if
 
3667
        they're from an alias.
 
3668
      
 
3669
      - join() and outerjoin() now work with self-referential relationships!
 
3670
        Using "aliased=True", you can join as many levels deep as desired,
 
3671
        i.e. query.join(['children', 'children'], aliased=True); filter
 
3672
        criterion will be against the rightmost joined table
 
3673
 
 
3674
    .. change::
 
3675
        :tags: orm
 
3676
        :tickets: 660
 
3677
 
 
3678
      Added query.populate_existing(), marks the query to reload all
 
3679
      attributes and collections of all instances touched in the query,
 
3680
      including eagerly-loaded entities.
 
3681
 
 
3682
    .. change::
 
3683
        :tags: orm
 
3684
        :tickets: 
 
3685
 
 
3686
      Added eagerload_all(), allows eagerload_all('x.y.z') to specify eager
 
3687
      loading of all properties in the given path.
 
3688
 
 
3689
    .. change::
 
3690
        :tags: orm
 
3691
        :tickets: 
 
3692
 
 
3693
      Major overhaul for Session:
 
3694
 
 
3695
    .. change::
 
3696
        :tags: orm
 
3697
        :tickets: 
 
3698
 
 
3699
      New function which "configures" a session called "sessionmaker()".  Send
 
3700
      various keyword arguments to this function once, returns a new class
 
3701
      which creates a Session against that stereotype.
 
3702
 
 
3703
    .. change::
 
3704
        :tags: orm
 
3705
        :tickets: 
 
3706
 
 
3707
      SessionTransaction removed from "public" API.  You now can call begin()/
 
3708
      commit()/rollback() on the Session itself.
 
3709
 
 
3710
    .. change::
 
3711
        :tags: orm
 
3712
        :tickets: 
 
3713
 
 
3714
      Session also supports SAVEPOINT transactions; call begin_nested().
 
3715
 
 
3716
    .. change::
 
3717
        :tags: orm
 
3718
        :tickets: 
 
3719
 
 
3720
      Session supports two-phase commit behavior when vertically or
 
3721
      horizontally partitioning (i.e., using more than one engine).  Use
 
3722
      twophase=True.
 
3723
 
 
3724
    .. change::
 
3725
        :tags: orm
 
3726
        :tickets: 
 
3727
 
 
3728
      Session flag "transactional=True" produces a session which always places
 
3729
      itself into a transaction when first used.  Upon commit(), rollback() or
 
3730
      close(), the transaction ends; but begins again on the next usage.
 
3731
 
 
3732
    .. change::
 
3733
        :tags: orm
 
3734
        :tickets: 
 
3735
 
 
3736
      Session supports "autoflush=True".  This issues a flush() before each
 
3737
      query.  Use in conjunction with transactional, and you can just
 
3738
      save()/update() and then query, the new objects will be there.  Use
 
3739
      commit() at the end (or flush() if non-transactional) to flush remaining
 
3740
      changes.
 
3741
 
 
3742
    .. change::
 
3743
        :tags: orm
 
3744
        :tickets: 
 
3745
 
 
3746
      New scoped_session() function replaces SessionContext and assignmapper.
 
3747
      Builds onto "sessionmaker()" concept to produce a class whos Session()
 
3748
      construction returns the thread-local session.  Or, call all Session
 
3749
      methods as class methods, i.e. Session.save(foo); Session.commit().
 
3750
      just like the old "objectstore" days.
 
3751
 
 
3752
    .. change::
 
3753
        :tags: orm
 
3754
        :tickets: 
 
3755
 
 
3756
      Added new "binds" argument to Session to support configuration of
 
3757
      multiple binds with sessionmaker() function.
 
3758
 
 
3759
    .. change::
 
3760
        :tags: orm
 
3761
        :tickets: 
 
3762
 
 
3763
      A rudimental SessionExtension class has been added, allowing
 
3764
      user-defined functionality to take place at flush(), commit(), and
 
3765
      rollback() boundaries.
 
3766
 
 
3767
    .. change::
 
3768
        :tags: orm
 
3769
        :tickets: 
 
3770
 
 
3771
      Query-based relation()s available with dynamic_loader().  This is a
 
3772
      *writable* collection (supporting append() and remove()) which is also a
 
3773
      live Query object when accessed for reads.  Ideal for dealing with very
 
3774
      large collections where only partial loading is desired.
 
3775
 
 
3776
    .. change::
 
3777
        :tags: orm
 
3778
        :tickets: 
 
3779
 
 
3780
      flush()-embedded inline INSERT/UPDATE expressions.  Assign any SQL
 
3781
      expression, like "sometable.c.column + 1", to an instance's attribute.
 
3782
      Upon flush(), the mapper detects the expression and embeds it directly in
 
3783
      the INSERT or UPDATE statement; the attribute gets deferred on the
 
3784
      instance so it loads the new value the next time you access it.
 
3785
 
 
3786
    .. change::
 
3787
        :tags: orm
 
3788
        :tickets: 618
 
3789
 
 
3790
      A rudimental sharding (horizontal scaling) system is introduced.  This
 
3791
      system uses a modified Session which can distribute read and write
 
3792
      operations among multiple databases, based on user-defined functions
 
3793
      defining the "sharding strategy".  Instances and their dependents can be
 
3794
      distributed and queried among multiple databases based on attribute
 
3795
      values, round-robin approaches or any other user-defined
 
3796
      system.
 
3797
 
 
3798
    .. change::
 
3799
        :tags: orm
 
3800
        :tickets: 659
 
3801
 
 
3802
      Eager loading has been enhanced to allow even more joins in more places.
 
3803
      It now functions at any arbitrary depth along self-referential and
 
3804
      cyclical structures.  When loading cyclical structures, specify
 
3805
      "join_depth" on relation() indicating how many times you'd like the table
 
3806
      to join to itself; each level gets a distinct table alias.  The alias
 
3807
      names themselves are generated at compile time using a simple counting
 
3808
      scheme now and are a lot easier on the eyes, as well as of course
 
3809
      completely deterministic.
 
3810
 
 
3811
    .. change::
 
3812
        :tags: orm
 
3813
        :tickets: 211
 
3814
 
 
3815
      Added composite column properties.  This allows you to create a type which
 
3816
      is represented by more than one column, when using the ORM.  Objects of
 
3817
      the new type are fully functional in query expressions, comparisons,
 
3818
      query.get() clauses, etc. and act as though they are regular single-column
 
3819
      scalars... except they're not!  Use the function composite(cls, *columns)
 
3820
      inside of the mapper's "properties" dict, and instances of cls will be
 
3821
      created/mapped to a single attribute, comprised of the values correponding
 
3822
      to *columns.
 
3823
 
 
3824
    .. change::
 
3825
        :tags: orm
 
3826
        :tickets: 
 
3827
 
 
3828
      Improved support for custom column_property() attributes which feature
 
3829
      correlated subqueries, works better with eager loading now.
 
3830
 
 
3831
    .. change::
 
3832
        :tags: orm
 
3833
        :tickets: 611
 
3834
 
 
3835
      Primary key "collapse" behavior; the mapper will analyze all columns in
 
3836
      its given selectable for primary key "equivalence", that is, columns which
 
3837
      are equivalent via foreign key relationship or via an explicit
 
3838
      inherit_condition. primarily for joined-table inheritance scenarios where
 
3839
      different named PK columns in inheriting tables should "collapse" into a
 
3840
      single-valued (or fewer-valued) primary key.  Fixes things like.
 
3841
 
 
3842
    .. change::
 
3843
        :tags: orm
 
3844
        :tickets: 
 
3845
 
 
3846
      Joined-table inheritance will now generate the primary key columns of all
 
3847
      inherited classes against the root table of the join only.  This implies
 
3848
      that each row in the root table is distinct to a single instance.  If for
 
3849
      some rare reason this is not desireable, explicit primary_key settings on
 
3850
      individual mappers will override it.
 
3851
 
 
3852
    .. change::
 
3853
        :tags: orm
 
3854
        :tickets: 
 
3855
 
 
3856
      When "polymorphic" flags are used with joined-table or single-table
 
3857
      inheritance, all identity keys are generated against the root class of the
 
3858
      inheritance hierarchy; this allows query.get() to work polymorphically
 
3859
      using the same caching semantics as a non-polymorphic get.  Note that this
 
3860
      currently does not work with concrete inheritance.
 
3861
 
 
3862
    .. change::
 
3863
        :tags: orm
 
3864
        :tickets: 
 
3865
 
 
3866
      Secondary inheritance loading: polymorphic mappers can be constructed
 
3867
      *without* a select_table argument. inheriting mappers whose tables were
 
3868
      not represented in the initial load will issue a second SQL query
 
3869
      immediately, once per instance (i.e. not very efficient for large lists),
 
3870
      in order to load the remaining columns.
 
3871
 
 
3872
    .. change::
 
3873
        :tags: orm
 
3874
        :tickets: 
 
3875
 
 
3876
      Secondary inheritance loading can also move its second query into a
 
3877
      column-level "deferred" load, via the "polymorphic_fetch" argument, which
 
3878
      can be set to 'select' or 'deferred'
 
3879
 
 
3880
    .. change::
 
3881
        :tags: orm
 
3882
        :tickets: 696
 
3883
 
 
3884
      It's now possible to map only a subset of available selectable columns
 
3885
      onto mapper properties, using include_columns/exclude_columns..
 
3886
 
 
3887
    .. change::
 
3888
        :tags: orm
 
3889
        :tickets: 
 
3890
 
 
3891
      Added undefer_group() MapperOption, sets a set of "deferred" columns
 
3892
      joined by a "group" to load as "undeferred".
 
3893
 
 
3894
    .. change::
 
3895
        :tags: orm
 
3896
        :tickets: 
 
3897
 
 
3898
      Rewrite of the "deterministic alias name" logic to be part of the SQL
 
3899
      layer, produces much simpler alias and label names more in the style of
 
3900
      Hibernate
 
3901
 
 
3902
    .. change::
 
3903
        :tags: sql
 
3904
        :tickets: 
 
3905
 
 
3906
      Speed!  Clause compilation as well as the mechanics of SQL constructs have
 
3907
      been streamlined and simplified to a signficant degree, for a 20-30%
 
3908
      improvement of the statement construction/compilation overhead of 0.3.
 
3909
 
 
3910
    .. change::
 
3911
        :tags: sql
 
3912
        :tickets: 
 
3913
 
 
3914
      All "type" keyword arguments, such as those to bindparam(), column(),
 
3915
      Column(), and func.<something>(), renamed to "type_".  Those objects still
 
3916
      name their "type" attribute as "type".
 
3917
 
 
3918
    .. change::
 
3919
        :tags: sql
 
3920
        :tickets: 
 
3921
 
 
3922
      case_sensitive=(True|False) setting removed from schema items, since
 
3923
      checking this state added a lot of method call overhead and there was no
 
3924
      decent reason to ever set it to False.  Table and column names which are
 
3925
      all lower case will be treated as case-insenstive (yes we adjust for
 
3926
      Oracle's UPPERCASE style too).
 
3927
 
 
3928
    .. change::
 
3929
        :tags: transactions
 
3930
        :tickets: 
 
3931
 
 
3932
      Added context manager (with statement) support for transactions.
 
3933
 
 
3934
    .. change::
 
3935
        :tags: transactions
 
3936
        :tickets: 
 
3937
 
 
3938
      Added support for two phase commit, works with mysql and postgres so far.
 
3939
 
 
3940
    .. change::
 
3941
        :tags: transactions
 
3942
        :tickets: 
 
3943
 
 
3944
      Added a subtransaction implementation that uses savepoints.
 
3945
 
 
3946
    .. change::
 
3947
        :tags: transactions
 
3948
        :tickets: 
 
3949
 
 
3950
      Added support for savepoints.
 
3951
 
 
3952
    .. change::
 
3953
        :tags: metadata
 
3954
        :tickets: 
 
3955
 
 
3956
      Tables can be reflected from the database en-masse without declaring
 
3957
      them in advance.  MetaData(engine, reflect=True) will load all tables
 
3958
      present in the database, or use metadata.reflect() for finer control.
 
3959
 
 
3960
    .. change::
 
3961
        :tags: metadata
 
3962
        :tickets: 
 
3963
 
 
3964
      DynamicMetaData has been renamed to ThreadLocalMetaData
 
3965
 
 
3966
    .. change::
 
3967
        :tags: metadata
 
3968
        :tickets: 
 
3969
 
 
3970
      The ThreadLocalMetaData constructor now takes no arguments.
 
3971
 
 
3972
    .. change::
 
3973
        :tags: metadata
 
3974
        :tickets: 
 
3975
 
 
3976
      BoundMetaData has been removed- regular MetaData is equivalent
 
3977
 
 
3978
    .. change::
 
3979
        :tags: metadata
 
3980
        :tickets: 646
 
3981
 
 
3982
      Numeric and Float types now have an "asdecimal" flag; defaults to True for
 
3983
      Numeric, False for Float.  When True, values are returned as
 
3984
      decimal.Decimal objects; when False, values are returned as float().  The
 
3985
      defaults of True/False are already the behavior for PG and MySQL's DBAPI
 
3986
      modules.
 
3987
 
 
3988
    .. change::
 
3989
        :tags: metadata
 
3990
        :tickets: 475
 
3991
 
 
3992
      New SQL operator implementation which removes all hardcoded operators from
 
3993
      expression structures and moves them into compilation; allows greater
 
3994
      flexibility of operator compilation; for example, "+" compiles to "||"
 
3995
      when used in a string context, or "concat(a,b)" on MySQL; whereas in a
 
3996
      numeric context it compiles to "+".  Fixes.
 
3997
 
 
3998
    .. change::
 
3999
        :tags: metadata
 
4000
        :tickets: 
 
4001
 
 
4002
      "Anonymous" alias and label names are now generated at SQL compilation
 
4003
      time in a completely deterministic fashion... no more random hex IDs
 
4004
 
 
4005
    .. change::
 
4006
        :tags: metadata
 
4007
        :tickets: 
 
4008
 
 
4009
      Significant architectural overhaul to SQL elements (ClauseElement).  All
 
4010
      elements share a common "mutability" framework which allows a consistent
 
4011
      approach to in-place modifications of elements as well as generative
 
4012
      behavior.  Improves stability of the ORM which makes heavy usage of
 
4013
      mutations to SQL expressions.
 
4014
 
 
4015
    .. change::
 
4016
        :tags: metadata
 
4017
        :tickets: 
 
4018
 
 
4019
      select() and union()'s now have "generative" behavior.  Methods like
 
4020
      order_by() and group_by() return a *new* instance - the original instance
 
4021
      is left unchanged.  Non-generative methods remain as well.
 
4022
 
 
4023
    .. change::
 
4024
        :tags: metadata
 
4025
        :tickets: 569, 52
 
4026
 
 
4027
      The internals of select/union vastly simplified- all decision making
 
4028
      regarding "is subquery" and "correlation" pushed to SQL generation phase.
 
4029
      select() elements are now *never* mutated by their enclosing containers or
 
4030
      by any dialect's compilation process
 
4031
 
 
4032
    .. change::
 
4033
        :tags: metadata
 
4034
        :tickets: 
 
4035
 
 
4036
      select(scalar=True) argument is deprecated; use select(..).as_scalar().
 
4037
      The resulting object obeys the full "column" interface and plays better
 
4038
      within expressions.
 
4039
 
 
4040
    .. change::
 
4041
        :tags: metadata
 
4042
        :tickets: 504
 
4043
 
 
4044
      Added select().with_prefix('foo') allowing any set of keywords to be
 
4045
      placed before the columns clause of the SELECT
 
4046
 
 
4047
    .. change::
 
4048
        :tags: metadata
 
4049
        :tickets: 686
 
4050
 
 
4051
      Added array slice support to row[<index>]
 
4052
 
 
4053
    .. change::
 
4054
        :tags: metadata
 
4055
        :tickets: 
 
4056
 
 
4057
      Result sets make a better attempt at matching the DBAPI types present in
 
4058
      cursor.description to the TypeEngine objects defined by the dialect, which
 
4059
      are then used for result-processing. Note this only takes effect for
 
4060
      textual SQL; constructed SQL statements always have an explicit type map.
 
4061
 
 
4062
    .. change::
 
4063
        :tags: metadata
 
4064
        :tickets: 
 
4065
 
 
4066
      Result sets from CRUD operations close their underlying cursor immediately
 
4067
      and will also autoclose the connection if defined for the operation; this
 
4068
      allows more efficient usage of connections for successive CRUD operations
 
4069
      with less chance of "dangling connections".
 
4070
 
 
4071
    .. change::
 
4072
        :tags: metadata
 
4073
        :tickets: 559
 
4074
 
 
4075
      Column defaults and onupdate Python functions (i.e. passed to
 
4076
      ColumnDefault) may take zero or one arguments; the one argument is the
 
4077
      ExecutionContext, from which you can call "context.parameters[someparam]"
 
4078
      to access the other bind parameter values affixed to the statement.  The connection used for the execution is available as well
 
4079
      so that you can pre-execute statements.
 
4080
 
 
4081
    .. change::
 
4082
        :tags: metadata
 
4083
        :tickets: 
 
4084
 
 
4085
      Added "explcit" create/drop/execute support for sequences (i.e. you can
 
4086
      pass a "connectable" to each of those methods on Sequence).
 
4087
 
 
4088
    .. change::
 
4089
        :tags: metadata
 
4090
        :tickets: 
 
4091
 
 
4092
      Better quoting of identifiers when manipulating schemas.
 
4093
 
 
4094
    .. change::
 
4095
        :tags: metadata
 
4096
        :tickets: 
 
4097
 
 
4098
      Standardized the behavior for table reflection where types can't be
 
4099
      located; NullType is substituted instead, warning is raised.
 
4100
 
 
4101
    .. change::
 
4102
        :tags: metadata
 
4103
        :tickets: 606
 
4104
 
 
4105
      ColumnCollection (i.e. the 'c' attribute on tables) follows dictionary
 
4106
      semantics for "__contains__"
 
4107
 
 
4108
    .. change::
 
4109
        :tags: engines
 
4110
        :tickets: 
 
4111
 
 
4112
      Speed! The mechanics of result processing and bind parameter processing
 
4113
      have been overhauled, streamlined and optimized to issue as little method
 
4114
      calls as possible.  Bench tests for mass INSERT and mass rowset iteration
 
4115
      both show 0.4 to be over twice as fast as 0.3, using 68% fewer function
 
4116
      calls.
 
4117
 
 
4118
    .. change::
 
4119
        :tags: engines
 
4120
        :tickets: 
 
4121
 
 
4122
      You can now hook into the pool lifecycle and run SQL statements or other
 
4123
      logic at new each DBAPI connection, pool check-out and check-in.
 
4124
 
 
4125
    .. change::
 
4126
        :tags: engines
 
4127
        :tickets: 
 
4128
 
 
4129
      Connections gain a .properties collection, with contents scoped to the
 
4130
      lifetime of the underlying DBAPI connection
 
4131
 
 
4132
    .. change::
 
4133
        :tags: engines
 
4134
        :tickets: 
 
4135
 
 
4136
      Removed auto_close_cursors and disallow_open_cursors arguments from Pool;
 
4137
      reduces overhead as cursors are normally closed by ResultProxy and
 
4138
      Connection.
 
4139
 
 
4140
    .. change::
 
4141
        :tags: extensions
 
4142
        :tickets: 
 
4143
 
 
4144
      proxyengine is temporarily removed, pending an actually working
 
4145
      replacement.
 
4146
 
 
4147
    .. change::
 
4148
        :tags: extensions
 
4149
        :tickets: 
 
4150
 
 
4151
      SelectResults has been replaced by Query.  SelectResults /
 
4152
      SelectResultsExt still exist but just return a slightly modified Query
 
4153
      object for backwards-compatibility.  join_to() method from SelectResults
 
4154
      isn't present anymore, need to use join().
 
4155
 
 
4156
    .. change::
 
4157
        :tags: mysql
 
4158
        :tickets: 
 
4159
 
 
4160
      Table and column names loaded via reflection are now Unicode.
 
4161
 
 
4162
    .. change::
 
4163
        :tags: mysql
 
4164
        :tickets: 
 
4165
 
 
4166
      All standard column types are now supported, including SET.
 
4167
 
 
4168
    .. change::
 
4169
        :tags: mysql
 
4170
        :tickets: 
 
4171
 
 
4172
      Table reflection can now be performed in as little as one round-trip.
 
4173
 
 
4174
    .. change::
 
4175
        :tags: mysql
 
4176
        :tickets: 
 
4177
 
 
4178
      ANSI and ANSI_QUOTES sql modes are now supported.
 
4179
 
 
4180
    .. change::
 
4181
        :tags: mysql
 
4182
        :tickets: 
 
4183
 
 
4184
      Indexes are now reflected.
 
4185
 
 
4186
    .. change::
 
4187
        :tags: postgres
 
4188
        :tickets: 
 
4189
 
 
4190
      Added PGArray datatype for using postgres array datatypes.
 
4191
 
 
4192
    .. change::
 
4193
        :tags: oracle
 
4194
        :tickets: 507
 
4195
 
 
4196
      Very rudimental support for OUT parameters added; use sql.outparam(name,
 
4197
      type) to set up an OUT parameter, just like bindparam(); after execution,
 
4198
      values are avaiable via result.out_parameters dictionary.