1 2============= 30.5 Changelog 4============= 5 6 7.. changelog:: 8 :version: 0.5.9 9 :released: 10 11 .. change:: 12 :tags: sql 13 :tickets: 1661 14 15 Fixed erroneous self_group() call in expression package. 16 17.. changelog:: 18 :version: 0.5.8 19 :released: Sat Jan 16 2010 20 21 .. change:: 22 :tags: sql 23 :tickets: 24 25 The copy() method on Column now supports uninitialized, 26 unnamed Column objects. This allows easy creation of 27 declarative helpers which place common columns on multiple 28 subclasses. 29 30 .. change:: 31 :tags: sql 32 :tickets: 33 34 Default generators like Sequence() translate correctly 35 across a copy() operation. 36 37 .. change:: 38 :tags: sql 39 :tickets: 40 41 Sequence() and other DefaultGenerator objects are accepted 42 as the value for the "default" and "onupdate" keyword 43 arguments of Column, in addition to being accepted 44 positionally. 45 46 .. change:: 47 :tags: sql 48 :tickets: 1568, 1617 49 50 Fixed a column arithmetic bug that affected column 51 correspondence for cloned selectables which contain 52 free-standing column expressions. This bug is 53 generally only noticeable when exercising newer 54 ORM behavior only available in 0.6 via, 55 but is more correct at the SQL expression level 56 as well. 57 58 .. change:: 59 :tags: postgresql 60 :tickets: 1647 61 62 The extract() function, which was slightly improved in 63 0.5.7, needed a lot more work to generate the correct 64 typecast (the typecasts appear to be necessary in PG's 65 EXTRACT quite a lot of the time). The typecast is 66 now generated using a rule dictionary based 67 on PG's documentation for date/time/interval arithmetic. 68 It also accepts text() constructs again, which was broken 69 in 0.5.7. 70 71 .. change:: 72 :tags: firebird 73 :tickets: 1646 74 75 Recognize more errors as disconnections. 76 77.. changelog:: 78 :version: 0.5.7 79 :released: Sat Dec 26 2009 80 81 .. change:: 82 :tags: orm 83 :tickets: 1543 84 85 contains_eager() now works with the automatically 86 generated subquery that results when you say 87 "query(Parent).join(Parent.somejoinedsubclass)", i.e. 88 when Parent joins to a joined-table-inheritance subclass. 89 Previously contains_eager() would erroneously add the 90 subclass table to the query separately producing a 91 cartesian product. An example is in the ticket 92 description. 93 94 .. change:: 95 :tags: orm 96 :tickets: 1553 97 98 query.options() now only propagate to loaded objects 99 for potential further sub-loads only for options where 100 such behavior is relevant, keeping 101 various unserializable options like those generated 102 by contains_eager() out of individual instance states. 103 104 .. change:: 105 :tags: orm 106 :tickets: 1054 107 108 Session.execute() now locates table- and 109 mapper-specific binds based on a passed 110 in expression which is an insert()/update()/delete() 111 construct. 112 113 .. change:: 114 :tags: orm 115 :tickets: 116 117 Session.merge() now properly overwrites a many-to-one or 118 uselist=False attribute to None if the attribute 119 is also None in the given object to be merged. 120 121 .. change:: 122 :tags: orm 123 :tickets: 1618 124 125 Fixed a needless select which would occur when merging 126 transient objects that contained a null primary key 127 identifier. 128 129 .. change:: 130 :tags: orm 131 :tickets: 1585 132 133 Mutable collection passed to the "extension" attribute 134 of relation(), column_property() etc. will not be mutated 135 or shared among multiple instrumentation calls, preventing 136 duplicate extensions, such as backref populators, 137 from being inserted into the list. 138 139 .. change:: 140 :tags: orm 141 :tickets: 1504 142 143 Fixed the call to get_committed_value() on CompositeProperty. 144 145 .. change:: 146 :tags: orm 147 :tickets: 1602 148 149 Fixed bug where Query would crash if a join() with no clear 150 "left" side were called when a non-mapped column entity 151 appeared in the columns list. 152 153 .. change:: 154 :tags: orm 155 :tickets: 1616, 1480 156 157 Fixed bug whereby composite columns wouldn't load properly 158 when configured on a joined-table subclass, introduced in 159 version 0.5.6 as a result of the fix for. thx to Scott Torborg. 160 161 .. change:: 162 :tags: orm 163 :tickets: 1556 164 165 The "use get" behavior of many-to-one relations, i.e. that a 166 lazy load will fallback to the possibly cached query.get() 167 value, now works across join conditions where the two compared 168 types are not exactly the same class, but share the same 169 "affinity" - i.e. Integer and SmallInteger. Also allows 170 combinations of reflected and non-reflected types to work 171 with 0.5 style type reflection, such as PGText/Text (note 0.6 172 reflects types as their generic versions). 173 174 .. change:: 175 :tags: orm 176 :tickets: 1436 177 178 Fixed bug in query.update() when passing Cls.attribute 179 as keys in the value dict and using synchronize_session='expire' 180 ('fetch' in 0.6). 181 182 .. change:: 183 :tags: sql 184 :tickets: 1603 185 186 Fixed bug in two-phase transaction whereby commit() method 187 didn't set the full state which allows subsequent close() 188 call to succeed. 189 190 .. change:: 191 :tags: sql 192 :tickets: 193 194 Fixed the "numeric" paramstyle, which apparently is the 195 default paramstyle used by Informixdb. 196 197 .. change:: 198 :tags: sql 199 :tickets: 1574 200 201 Repeat expressions in the columns clause of a select 202 are deduped based on the identity of each clause element, 203 not the actual string. This allows positional 204 elements to render correctly even if they all render 205 identically, such as "qmark" style bind parameters. 206 207 .. change:: 208 :tags: sql 209 :tickets: 1632 210 211 The cursor associated with connection pool connections 212 (i.e. _CursorFairy) now proxies `__iter__()` to the 213 underlying cursor correctly. 214 215 .. change:: 216 :tags: sql 217 :tickets: 1556 218 219 types now support an "affinity comparison" operation, i.e. 220 that an Integer/SmallInteger are "compatible", or 221 a Text/String, PickleType/Binary, etc. Part of. 222 223 .. change:: 224 :tags: sql 225 :tickets: 1641 226 227 Fixed bug preventing alias() of an alias() from being 228 cloned or adapted (occurs frequently in ORM operations). 229 230 .. change:: 231 :tags: sqlite 232 :tickets: 1439 233 234 sqlite dialect properly generates CREATE INDEX for a table 235 that is in an alternate schema. 236 237 .. change:: 238 :tags: postgresql 239 :tickets: 1085 240 241 Added support for reflecting the DOUBLE PRECISION type, 242 via a new postgres.PGDoublePrecision object. 243 This is postgresql.DOUBLE_PRECISION in 0.6. 244 245 .. change:: 246 :tags: postgresql 247 :tickets: 460 248 249 Added support for reflecting the INTERVAL YEAR TO MONTH 250 and INTERVAL DAY TO SECOND syntaxes of the INTERVAL 251 type. 252 253 .. change:: 254 :tags: postgresql 255 :tickets: 1576 256 257 Corrected the "has_sequence" query to take current schema, 258 or explicit sequence-stated schema, into account. 259 260 .. change:: 261 :tags: postgresql 262 :tickets: 1611 263 264 Fixed the behavior of extract() to apply operator 265 precedence rules to the "::" operator when applying 266 the "timestamp" cast - ensures proper parenthesization. 267 268 .. change:: 269 :tags: mssql 270 :tickets: 1561 271 272 Changed the name of TrustedConnection to 273 Trusted_Connection when constructing pyodbc connect 274 arguments 275 276 .. change:: 277 :tags: oracle 278 :tickets: 1637 279 280 The "table_names" dialect function, used by MetaData 281 .reflect(), omits "index overflow tables", a system 282 table generated by Oracle when "index only tables" 283 with overflow are used. These tables aren't accessible 284 via SQL and can't be reflected. 285 286 .. change:: 287 :tags: ext 288 :tickets: 1570, 1523 289 290 A column can be added to a joined-table declarative 291 superclass after the class has been constructed 292 (i.e. via class-level attribute assignment), and 293 the column will be propagated down to 294 subclasses. This is the reverse 295 situation as that of, fixed in 0.5.6. 296 297 .. change:: 298 :tags: ext 299 :tickets: 1491 300 301 Fixed a slight inaccuracy in the sharding example. 302 Comparing equivalence of columns in the ORM is best 303 accomplished using col1.shares_lineage(col2). 304 305 .. change:: 306 :tags: ext 307 :tickets: 1606 308 309 Removed unused `load()` method from ShardedQuery. 310 311.. changelog:: 312 :version: 0.5.6 313 :released: Sat Sep 12 2009 314 315 .. change:: 316 :tags: orm 317 :tickets: 1300 318 319 Fixed bug whereby inheritance discriminator part of a 320 composite primary key would fail on updates. 321 Continuation of. 322 323 .. change:: 324 :tags: orm 325 :tickets: 1507 326 327 Fixed bug which disallowed one side of a many-to-many 328 bidirectional reference to declare itself as "viewonly" 329 330 .. change:: 331 :tags: orm 332 :tickets: 1526 333 334 Added an assertion that prevents a @validates function 335 or other AttributeExtension from loading an unloaded 336 collection such that internal state may be corrupted. 337 338 .. change:: 339 :tags: orm 340 :tickets: 1519 341 342 Fixed bug which prevented two entities from mutually 343 replacing each other's primary key values within a single 344 flush() for some orderings of operations. 345 346 .. change:: 347 :tags: orm 348 :tickets: 1485 349 350 Fixed an obscure issue whereby a joined-table subclass 351 with a self-referential eager load on the base class 352 would populate the related object's "subclass" table with 353 data from the "subclass" table of the parent. 354 355 .. change:: 356 :tags: orm 357 :tickets: 1477 358 359 relations() now have greater ability to be "overridden", 360 meaning a subclass that explicitly specifies a relation() 361 overriding that of the parent class will be honored 362 during a flush. This is currently to support 363 many-to-many relations from concrete inheritance setups. 364 Outside of that use case, YMMV. 365 366 .. change:: 367 :tags: orm 368 :tickets: 1483 369 370 Squeezed a few more unnecessary "lazy loads" out of 371 relation(). When a collection is mutated, many-to-one 372 backrefs on the other side will not fire off to load 373 the "old" value, unless "single_parent=True" is set. 374 A direct assignment of a many-to-one still loads 375 the "old" value in order to update backref collections 376 on that value, which may be present in the session 377 already, thus maintaining the 0.5 behavioral contract. 378 379 .. change:: 380 :tags: orm 381 :tickets: 1480 382 383 Fixed bug whereby a load/refresh of joined table 384 inheritance attributes which were based on 385 column_property() or similar would fail to evaluate. 386 387 .. change:: 388 :tags: orm 389 :tickets: 1488 390 391 Improved support for MapperProperty objects overriding 392 that of an inherited mapper for non-concrete 393 inheritance setups - attribute extensions won't randomly 394 collide with each other. 395 396 .. change:: 397 :tags: orm 398 :tickets: 1487 399 400 UPDATE and DELETE do not support ORDER BY, LIMIT, OFFSET, 401 etc. in standard SQL. Query.update() and Query.delete() 402 now raise an exception if any of limit(), offset(), 403 order_by(), group_by(), or distinct() have been 404 called. 405 406 .. change:: 407 :tags: orm 408 :tickets: 409 410 Added AttributeExtension to sqlalchemy.orm.__all__ 411 412 .. change:: 413 :tags: orm 414 :tickets: 1476 415 416 Improved error message when query() is called with 417 a non-SQL /entity expression. 418 419 .. change:: 420 :tags: orm 421 :tickets: 1440 422 423 Using False or 0 as a polymorphic discriminator now 424 works on the base class as well as a subclass. 425 426 .. change:: 427 :tags: orm 428 :tickets: 1424 429 430 Added enable_assertions(False) to Query which disables 431 the usual assertions for expected state - used 432 by Query subclasses to engineer custom state.. See 433 https://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery 434 for an example. 435 436 .. change:: 437 :tags: orm 438 :tickets: 1501 439 440 Fixed recursion issue which occurred if a mapped object's 441 `__len__()` or `__nonzero__()` method resulted in state 442 changes. 443 444 .. change:: 445 :tags: orm 446 :tickets: 1506 447 448 Fixed incorrect exception raise in 449 Weak/StrongIdentityMap.add() 450 451 .. change:: 452 :tags: orm 453 :tickets: 1522 454 455 Fixed the error message for "could not find a FROM clause" 456 in query.join() which would fail to issue correctly 457 if the query was against a pure SQL construct. 458 459 .. change:: 460 :tags: orm 461 :tickets: 1486 462 463 Fixed a somewhat hypothetical issue which would result 464 in the wrong primary key being calculated for a mapper 465 using the old polymorphic_union function - but this 466 is old stuff. 467 468 .. change:: 469 :tags: sql 470 :tickets: 1373 471 472 Fixed column.copy() to copy defaults and onupdates. 473 474 .. change:: 475 :tags: sql 476 :tickets: 477 478 Fixed a bug in extract() introduced in 0.5.4 whereby 479 the string "field" argument was getting treated as a 480 ClauseElement, causing various errors within more 481 complex SQL transformations. 482 483 .. change:: 484 :tags: sql 485 :tickets: 1420 486 487 Unary expressions such as DISTINCT propagate their 488 type handling to result sets, allowing conversions like 489 unicode and such to take place. 490 491 .. change:: 492 :tags: sql 493 :tickets: 1482 494 495 Fixed bug in Table and Column whereby passing empty 496 dict for "info" argument would raise an exception. 497 498 .. change:: 499 :tags: oracle 500 :tickets: 1309 501 502 Backported 0.6 fix for Oracle alias names not getting 503 truncated. 504 505 .. change:: 506 :tags: ext 507 :tickets: 1446 508 509 The collection proxies produced by associationproxy are now 510 pickleable. A user-defined proxy_factory however 511 is still not pickleable unless it defines __getstate__ 512 and __setstate__. 513 514 .. change:: 515 :tags: ext 516 :tickets: 1468 517 518 Declarative will raise an informative exception if 519 __table_args__ is passed as a tuple with no dict argument. 520 Improved documentation. 521 522 .. change:: 523 :tags: ext 524 :tickets: 1527 525 526 Table objects declared in the MetaData can now be used 527 in string expressions sent to primaryjoin/secondaryjoin/ 528 secondary - the name is pulled from the MetaData of the 529 declarative base. 530 531 .. change:: 532 :tags: ext 533 :tickets: 1523 534 535 A column can be added to a joined-table subclass after 536 the class has been constructed (i.e. via class-level 537 attribute assignment). The column is added to the underlying 538 Table as always, but now the mapper will rebuild its 539 "join" to include the new column, instead of raising 540 an error about "no such column, use column_property() 541 instead". 542 543 .. change:: 544 :tags: test 545 :tickets: 546 547 Added examples into the test suite so they get exercised 548 regularly and cleaned up a couple deprecation warnings. 549 550.. changelog:: 551 :version: 0.5.5 552 :released: Mon Jul 13 2009 553 554 .. change:: 555 :tags: general 556 :tickets: 970 557 558 unit tests have been migrated from unittest to nose. See 559 README.unittests for information on how to run the tests. 560 561 .. change:: 562 :tags: orm 563 :tickets: 564 565 The "foreign_keys" argument of relation() will now propagate 566 automatically to the backref in the same way that primaryjoin 567 and secondaryjoin do. For the extremely rare use case where 568 the backref of a relation() has intentionally different 569 "foreign_keys" configured, both sides now need to be 570 configured explicitly (if they do in fact require this setting, 571 see the next note...). 572 573 .. change:: 574 :tags: orm 575 :tickets: 576 577 ...the only known (and really, really rare) use case where a 578 different foreign_keys setting was used on the 579 forwards/backwards side, a composite foreign key that 580 partially points to its own columns, has been enhanced such 581 that the fk->itself aspect of the relation won't be used to 582 determine relation direction. 583 584 .. change:: 585 :tags: orm 586 :tickets: 587 588 Session.mapper is now *deprecated*. 589 590 Call session.add() if you'd like a free-standing object to be 591 part of your session. Otherwise, a DIY version of 592 Session.mapper is now documented at 593 https://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper 594 The method will remain deprecated throughout 0.6. 595 596 .. change:: 597 :tags: orm 598 :tickets: 1431 599 600 Fixed Query being able to join() from individual columns of a 601 joined-table subclass entity, i.e. query(SubClass.foo, 602 SubClass.bar).join(<anything>). In most cases, an error 603 "Could not find a FROM clause to join from" would be 604 raised. In a few others, the result would be returned in terms 605 of the base class rather than the subclass - so applications 606 which relied on this erroneous result need to be 607 adjusted. 608 609 .. change:: 610 :tags: orm 611 :tickets: 1461 612 613 Fixed a bug involving contains_eager(), which would apply 614 itself to a secondary (i.e. lazy) load in a particular rare 615 case, producing cartesian products. improved the targeting of 616 query.options() on secondary loads overall. 617 618 .. change:: 619 :tags: orm 620 :tickets: 621 622 Fixed bug introduced in 0.5.4 whereby Composite types fail 623 when default-holding columns are flushed. 624 625 .. change:: 626 :tags: orm 627 :tickets: 1426 628 629 Fixed another 0.5.4 bug whereby mutable attributes 630 (i.e. PickleType) wouldn't be deserialized correctly when the 631 whole object was serialized. 632 633 .. change:: 634 :tags: orm 635 :tickets: 636 637 Fixed bug whereby session.is_modified() would raise an 638 exception if any synonyms were in use. 639 640 .. change:: 641 :tags: orm 642 :tickets: 643 644 Fixed potential memory leak whereby previously pickled objects 645 placed back in a session would not be fully garbage collected 646 unless the Session were explicitly closed out. 647 648 .. change:: 649 :tags: orm 650 :tickets: 651 652 Fixed bug whereby list-based attributes, like pickletype and 653 PGArray, failed to be merged() properly. 654 655 .. change:: 656 :tags: orm 657 :tickets: 658 659 Repaired non-working attributes.set_committed_value function. 660 661 .. change:: 662 :tags: orm 663 :tickets: 664 665 Trimmed the pickle format for InstanceState which should 666 further reduce the memory footprint of pickled instances. The 667 format should be backwards compatible with that of 0.5.4 and 668 previous. 669 670 .. change:: 671 :tags: orm 672 :tickets: 1463 673 674 sqlalchemy.orm.join and sqlalchemy.orm.outerjoin are now 675 added to __all__ in sqlalchemy.orm.*. 676 677 .. change:: 678 :tags: orm 679 :tickets: 1458 680 681 Fixed bug where Query exception raise would fail when 682 a too-short composite primary key value were passed to 683 get(). 684 685 .. change:: 686 :tags: sql 687 :tickets: 688 689 Removed an obscure feature of execute() (including connection, 690 engine, Session) whereby a bindparam() construct can be sent 691 as a key to the params dictionary. This usage is undocumented 692 and is at the core of an issue whereby the bindparam() object 693 created implicitly by a text() construct may have the same 694 hash value as a string placed in the params dictionary and may 695 result in an inappropriate match when computing the final bind 696 parameters. Internal checks for this condition would add 697 significant latency to the critical task of parameter 698 rendering, so the behavior is removed. This is a backwards 699 incompatible change for any application that may have been 700 using this feature, however the feature has never been 701 documented. 702 703 .. change:: 704 :tags: engine/pool 705 :tickets: 706 707 Implemented recreate() for StaticPool. 708 709.. changelog:: 710 :version: 0.5.4p2 711 :released: Tue May 26 2009 712 713 .. change:: 714 :tags: sql 715 :tickets: 716 717 Repaired the printing of SQL exceptions which are not 718 based on parameters or are not executemany() style. 719 720 .. change:: 721 :tags: postgresql 722 :tickets: 723 724 Deprecated the hardcoded TIMESTAMP function, which when 725 used as func.TIMESTAMP(value) would render "TIMESTAMP value". 726 This breaks on some platforms as PostgreSQL doesn't allow 727 bind parameters to be used in this context. The hard-coded 728 uppercase is also inappropriate and there's lots of other 729 PG casts that we'd need to support. So instead, use 730 text constructs i.e. select(["timestamp '12/05/09'"]). 731 732.. changelog:: 733 :version: 0.5.4p1 734 :released: Mon May 18 2009 735 736 .. change:: 737 :tags: orm 738 :tickets: 739 740 Fixed an attribute error introduced in 0.5.4 which would 741 occur when merge() was used with an incomplete object. 742 743.. changelog:: 744 :version: 0.5.4 745 :released: Sun May 17 2009 746 747 .. change:: 748 :tags: orm 749 :tickets: 1398 750 751 Significant performance enhancements regarding Sessions/flush() 752 in conjunction with large mapper graphs, large numbers of 753 objects: 754 755 - Removed all* O(N) scanning behavior from the flush() process, 756 i.e. operations that were scanning the full session, 757 including an extremely expensive one that was erroneously 758 assuming primary key values were changing when this 759 was not the case. 760 761 * one edge case remains which may invoke a full scan, 762 if an existing primary key attribute is modified 763 to a new value. 764 765 - The Session's "weak referencing" behavior is now *full* - 766 no strong references whatsoever are made to a mapped object 767 or related items/collections in its __dict__. Backrefs and 768 other cycles in objects no longer affect the Session's ability 769 to lose all references to unmodified objects. Objects with 770 pending changes still are maintained strongly until flush. 771 772 773 The implementation also improves performance by moving 774 the "resurrection" process of garbage collected items 775 to only be relevant for mappings that map "mutable" 776 attributes (i.e. PickleType, composite attrs). This removes 777 overhead from the gc process and simplifies internal 778 behavior. 779 780 If a "mutable" attribute change is the sole change on an object 781 which is then dereferenced, the mapper will not have access to 782 other attribute state when the UPDATE is issued. This may present 783 itself differently to some MapperExtensions. 784 785 The change also affects the internal attribute API, but not 786 the AttributeExtension interface nor any of the publicly 787 documented attribute functions. 788 789 - The unit of work no longer generates a graph of "dependency" 790 processors for the full graph of mappers during flush(), instead 791 creating such processors only for those mappers which represent 792 objects with pending changes. This saves a tremendous number 793 of method calls in the context of a large interconnected 794 graph of mappers. 795 796 - Cached a wasteful "table sort" operation that previously 797 occurred multiple times per flush, also removing significant 798 method call count from flush(). 799 800 - Other redundant behaviors have been simplified in 801 mapper._save_obj(). 802 803 .. change:: 804 :tags: orm 805 :tickets: 806 807 Modified query_cls on DynamicAttributeImpl to accept a full 808 mixin version of the AppenderQuery, which allows subclassing 809 the AppenderMixin. 810 811 .. change:: 812 :tags: orm 813 :tickets: 1300 814 815 The "polymorphic discriminator" column may be part of a 816 primary key, and it will be populated with the correct 817 discriminator value. 818 819 .. change:: 820 :tags: orm 821 :tickets: 822 823 Fixed the evaluator not being able to evaluate IS NULL clauses. 824 825 .. change:: 826 :tags: orm 827 :tickets: 1352 828 829 Fixed the "set collection" function on "dynamic" relations to 830 initiate events correctly. Previously a collection could only 831 be assigned to a pending parent instance, otherwise modified 832 events would not be fired correctly. Set collection is now 833 compatible with merge(), fixes. 834 835 .. change:: 836 :tags: orm 837 :tickets: 838 839 Allowed pickling of PropertyOption objects constructed with 840 instrumented descriptors; previously, pickle errors would occur 841 when pickling an object which was loaded with a descriptor-based 842 option, such as query.options(eagerload(MyClass.foo)). 843 844 .. change:: 845 :tags: orm 846 :tickets: 1357 847 848 Lazy loader will not use get() if the "lazy load" SQL clause 849 matches the clause used by get(), but contains some parameters 850 hardcoded. Previously the lazy strategy would fail with the 851 get(). Ideally get() would be used with the hardcoded 852 parameters but this would require further development. 853 854 .. change:: 855 :tags: orm 856 :tickets: 1391 857 858 MapperOptions and other state associated with query.options() 859 is no longer bundled within callables associated with each 860 lazy/deferred-loading attribute during a load. 861 The options are now associated with the instance's 862 state object just once when it's populated. This removes 863 the need in most cases for per-instance/attribute loader 864 objects, improving load speed and memory overhead for 865 individual instances. 866 867 .. change:: 868 :tags: orm 869 :tickets: 1360 870 871 Fixed another location where autoflush was interfering 872 with session.merge(). autoflush is disabled completely 873 for the duration of merge() now. 874 875 .. change:: 876 :tags: orm 877 :tickets: 1406 878 879 Fixed bug which prevented "mutable primary key" dependency 880 logic from functioning properly on a one-to-one 881 relation(). 882 883 .. change:: 884 :tags: orm 885 :tickets: 886 887 Fixed bug in relation(), introduced in 0.5.3, 888 whereby a self referential relation 889 from a base class to a joined-table subclass would 890 not configure correctly. 891 892 .. change:: 893 :tags: orm 894 :tickets: 895 896 Fixed obscure mapper compilation issue when inheriting 897 mappers are used which would result in un-initialized 898 attributes. 899 900 .. change:: 901 :tags: orm 902 :tickets: 903 904 Fixed documentation for session weak_identity_map - 905 the default value is True, indicating a weak 906 referencing map in use. 907 908 .. change:: 909 :tags: orm 910 :tickets: 1376 911 912 Fixed a unit of work issue whereby the foreign 913 key attribute on an item contained within a collection 914 owned by an object being deleted would not be set to 915 None if the relation() was self-referential. 916 917 .. change:: 918 :tags: orm 919 :tickets: 1378 920 921 Fixed Query.update() and Query.delete() failures with eagerloaded 922 relations. 923 924 .. change:: 925 :tags: orm 926 :tickets: 927 928 It is now an error to specify both columns of a binary primaryjoin 929 condition in the foreign_keys or remote_side collection. Whereas 930 previously it was just nonsensical, but would succeed in a 931 non-deterministic way. 932 933 .. change:: 934 :tags: ticket: 594, 1341, schema 935 :tickets: 936 937 Added a quote_schema() method to the IdentifierPreparer class 938 so that dialects can override how schemas get handled. This 939 enables the MSSQL dialect to treat schemas as multipart 940 identifiers, such as 'database.owner'. 941 942 .. change:: 943 :tags: sql 944 :tickets: 945 946 Back-ported the "compiler" extension from SQLA 0.6. This 947 is a standardized interface which allows the creation of custom 948 ClauseElement subclasses and compilers. In particular it's 949 handy as an alternative to text() when you'd like to 950 build a construct that has database-specific compilations. 951 See the extension docs for details. 952 953 .. change:: 954 :tags: sql 955 :tickets: 1413 956 957 Exception messages are truncated when the list of bound 958 parameters is larger than 10, preventing enormous 959 multi-page exceptions from filling up screens and logfiles 960 for large executemany() statements. 961 962 .. change:: 963 :tags: sql 964 :tickets: 965 966 ``sqlalchemy.extract()`` is now dialect sensitive and can 967 extract components of timestamps idiomatically across the 968 supported databases, including SQLite. 969 970 .. change:: 971 :tags: sql 972 :tickets: 1353 973 974 Fixed __repr__() and other _get_colspec() methods on 975 ForeignKey constructed from __clause_element__() style 976 construct (i.e. declarative columns). 977 978 .. change:: 979 :tags: mysql 980 :tickets: 1405 981 982 Reflecting a FOREIGN KEY construct will take into account 983 a dotted schema.tablename combination, if the foreign key 984 references a table in a remote schema. 985 986 .. change:: 987 :tags: mssql 988 :tickets: 989 990 Modified how savepoint logic works to prevent it from 991 stepping on non-savepoint oriented routines. Savepoint 992 support is still very experimental. 993 994 .. change:: 995 :tags: mssql 996 :tickets: 1310 997 998 Added in reserved words for MSSQL that covers version 2008 999 and all prior versions. 1000 1001 .. change:: 1002 :tags: mssql 1003 :tickets: 1343 1004 1005 Corrected problem with information schema not working with a 1006 binary collation based database. Cleaned up information schema 1007 since it is only used by mssql now. 1008 1009 .. change:: 1010 :tags: sqlite 1011 :tickets: 1402 1012 1013 Corrected the SLBoolean type so that it properly treats only 1 1014 as True. 1015 1016 .. change:: 1017 :tags: sqlite 1018 :tickets: 1273 1019 1020 Corrected the float type so that it correctly maps to a 1021 SLFloat type when being reflected. 1022 1023 .. change:: 1024 :tags: extensions 1025 :tickets: 1379 1026 1027 Fixed adding of deferred or other column properties to a 1028 declarative class. 1029 1030.. changelog:: 1031 :version: 0.5.3 1032 :released: Tue Mar 24 2009 1033 1034 .. change:: 1035 :tags: orm 1036 :tickets: 1315 1037 1038 The "objects" argument to session.flush() is deprecated. 1039 State which represents the linkage between a parent and 1040 child object does not support "flushed" status on 1041 one side of the link and not the other, so supporting 1042 this operation leads to misleading results. 1043 1044 .. change:: 1045 :tags: orm 1046 :tickets: 1047 1048 Query now implements __clause_element__() which produces 1049 its selectable, which means a Query instance can be accepted 1050 in many SQL expressions, including col.in_(query), 1051 union(query1, query2), select([foo]).select_from(query), 1052 etc. 1053 1054 .. change:: 1055 :tags: orm 1056 :tickets: 1337 1057 1058 Query.join() can now construct multiple FROM clauses, if 1059 needed. Such as, query(A, B).join(A.x).join(B.y) 1060 might say SELECT A.*, B.* FROM A JOIN X, B JOIN Y. 1061 Eager loading can also tack its joins onto those 1062 multiple FROM clauses. 1063 1064 .. change:: 1065 :tags: orm 1066 :tickets: 1347 1067 1068 Fixed bug in dynamic_loader() where append/remove events 1069 after construction time were not being propagated to the 1070 UOW to pick up on flush(). 1071 1072 .. change:: 1073 :tags: orm 1074 :tickets: 1075 1076 Fixed bug where column_prefix wasn't being checked before 1077 not mapping an attribute that already had class-level 1078 name present. 1079 1080 .. change:: 1081 :tags: orm 1082 :tickets: 1315 1083 1084 a session.expire() on a particular collection attribute 1085 will clear any pending backref additions as well, so that 1086 the next access correctly returns only what was present 1087 in the database. Presents some degree of a workaround for, although we are considering removing the 1088 flush([objects]) feature altogether. 1089 1090 .. change:: 1091 :tags: orm 1092 :tickets: 1093 1094 Session.scalar() now converts raw SQL strings to text() 1095 the same way Session.execute() does and accepts same 1096 alternative \**kw args. 1097 1098 .. change:: 1099 :tags: orm 1100 :tickets: 1101 1102 improvements to the "determine direction" logic of 1103 relation() such that the direction of tricky situations 1104 like mapper(A.join(B)) -> relation-> mapper(B) can be 1105 determined. 1106 1107 .. change:: 1108 :tags: orm 1109 :tickets: 1306 1110 1111 When flushing partial sets of objects using session.flush([somelist]), 1112 pending objects which remain pending after the operation won't 1113 inadvertently be added as persistent. 1114 1115 .. change:: 1116 :tags: orm 1117 :tickets: 1314 1118 1119 Added "post_configure_attribute" method to InstrumentationManager, 1120 so that the "listen_for_events.py" example works again. 1121 1122 .. change:: 1123 :tags: orm 1124 :tickets: 1125 1126 a forward and complementing backwards reference which are both 1127 of the same direction, i.e. ONETOMANY or MANYTOONE, 1128 is now detected, and an error message is raised. 1129 Saves crazy CircularDependencyErrors later on. 1130 1131 .. change:: 1132 :tags: orm 1133 :tickets: 1134 1135 Fixed bugs in Query regarding simultaneous selection of 1136 multiple joined-table inheritance entities with common base 1137 classes: 1138 1139 - previously the adaption applied to "B" on 1140 "A JOIN B" would be erroneously partially applied 1141 to "A". 1142 1143 - comparisons on relations (i.e. A.related==someb) 1144 were not getting adapted when they should. 1145 1146 - Other filterings, like 1147 query(A).join(A.bs).filter(B.foo=='bar'), were erroneously 1148 adapting "B.foo" as though it were an "A". 1149 1150 .. change:: 1151 :tags: orm 1152 :tickets: 1325 1153 1154 Fixed adaptation of EXISTS clauses via any(), has(), etc. 1155 in conjunction with an aliased object on the left and 1156 of_type() on the right. 1157 1158 .. change:: 1159 :tags: orm 1160 :tickets: 1161 1162 Added an attribute helper method ``set_committed_value`` in 1163 sqlalchemy.orm.attributes. Given an object, attribute name, 1164 and value, will set the value on the object as part of its 1165 "committed" state, i.e. state that is understood to have 1166 been loaded from the database. Helps with the creation of 1167 homegrown collection loaders and such. 1168 1169 .. change:: 1170 :tags: orm 1171 :tickets: 1172 1173 Query won't fail with weakref error when a non-mapper/class 1174 instrumented descriptor is passed, raises 1175 "Invalid column expression". 1176 1177 .. change:: 1178 :tags: orm 1179 :tickets: 1180 1181 Query.group_by() properly takes into account aliasing applied 1182 to the FROM clause, such as with select_from(), using 1183 with_polymorphic(), or using from_self(). 1184 1185 .. change:: 1186 :tags: sql 1187 :tickets: 1188 1189 An alias() of a select() will convert to a "scalar subquery" 1190 when used in an unambiguously scalar context, i.e. it's used 1191 in a comparison operation. This applies to 1192 the ORM when using query.subquery() as well. 1193 1194 .. change:: 1195 :tags: sql 1196 :tickets: 1302 1197 1198 Fixed missing _label attribute on Function object, others 1199 when used in a select() with use_labels (such as when used 1200 in an ORM column_property()). 1201 1202 .. change:: 1203 :tags: sql 1204 :tickets: 1309 1205 1206 anonymous alias names now truncate down to the max length 1207 allowed by the dialect. More significant on DBs like 1208 Oracle with very small character limits. 1209 1210 .. change:: 1211 :tags: sql 1212 :tickets: 1213 1214 the __selectable__() interface has been replaced entirely 1215 by __clause_element__(). 1216 1217 .. change:: 1218 :tags: sql 1219 :tickets: 1299 1220 1221 The per-dialect cache used by TypeEngine to cache 1222 dialect-specific types is now a WeakKeyDictionary. 1223 This to prevent dialect objects from 1224 being referenced forever for an application that 1225 creates an arbitrarily large number of engines 1226 or dialects. There is a small performance penalty 1227 which will be resolved in 0.6. 1228 1229 .. change:: 1230 :tags: sqlite 1231 :tickets: 1232 1233 Fixed SQLite reflection methods so that non-present 1234 cursor.description, which triggers an auto-cursor 1235 close, will be detected so that no results doesn't 1236 fail on recent versions of pysqlite which raise 1237 an error when fetchone() called with no rows present. 1238 1239 .. change:: 1240 :tags: postgresql 1241 :tickets: 1242 1243 Index reflection won't fail when an index with 1244 multiple expressions is encountered. 1245 1246 .. change:: 1247 :tags: postgresql 1248 :tickets: 1327 1249 1250 Added PGUuid and PGBit types to 1251 sqlalchemy.databases.postgres. 1252 1253 .. change:: 1254 :tags: postgresql 1255 :tickets: 1327 1256 1257 Refection of unknown PG types won't crash when those 1258 types are specified within a domain. 1259 1260 .. change:: 1261 :tags: mssql 1262 :tickets: 1263 1264 Preliminary support for pymssql 1.0.1 1265 1266 .. change:: 1267 :tags: mssql 1268 :tickets: 1269 1270 Corrected issue on mssql where max_identifier_length was 1271 not being respected. 1272 1273 .. change:: 1274 :tags: extensions 1275 :tickets: 1276 1277 Fixed a recursive pickling issue in serializer, triggered 1278 by an EXISTS or other embedded FROM construct. 1279 1280 .. change:: 1281 :tags: extensions 1282 :tickets: 1283 1284 Declarative locates the "inherits" class using a search 1285 through __bases__, to skip over mixins that are local 1286 to subclasses. 1287 1288 .. change:: 1289 :tags: extensions 1290 :tickets: 1291 1292 Declarative figures out joined-table inheritance primary join 1293 condition even if "inherits" mapper argument is given 1294 explicitly. 1295 1296 .. change:: 1297 :tags: extensions 1298 :tickets: 1299 1300 Declarative will properly interpret the "foreign_keys" argument 1301 on a backref() if it's a string. 1302 1303 .. change:: 1304 :tags: extensions 1305 :tickets: 1306 1307 Declarative will accept a table-bound column as a property 1308 when used in conjunction with __table__, if the column is already 1309 present in __table__. The column will be remapped to the given 1310 key the same way as when added to the mapper() properties dict. 1311 1312.. changelog:: 1313 :version: 0.5.2 1314 :released: Sat Jan 24 2009 1315 1316 .. change:: 1317 :tags: orm 1318 :tickets: 1319 1320 Further refined 0.5.1's warning about delete-orphan cascade 1321 placed on a many-to-many relation. First, the bad news: 1322 the warning will apply to both many-to-many as well as 1323 many-to-one relations. This is necessary since in both 1324 cases, SQLA does not scan the full set of potential parents 1325 when determining "orphan" status - for a persistent object 1326 it only detects an in-python de-association event to establish 1327 the object as an "orphan". Next, the good news: to support 1328 one-to-one via a foreign key or association table, or to 1329 support one-to-many via an association table, a new flag 1330 single_parent=True may be set which indicates objects 1331 linked to the relation are only meant to have a single parent. 1332 The relation will raise an error if multiple parent-association 1333 events occur within Python. 1334 1335 .. change:: 1336 :tags: orm 1337 :tickets: 1292 1338 1339 Adjusted the attribute instrumentation change from 0.5.1 to 1340 fully establish instrumentation for subclasses where the mapper 1341 was created after the superclass had already been fully 1342 instrumented. 1343 1344 .. change:: 1345 :tags: orm 1346 :tickets: 1347 1348 Fixed bug in delete-orphan cascade whereby two one-to-one 1349 relations from two different parent classes to the same target 1350 class would prematurely expunge the instance. 1351 1352 .. change:: 1353 :tags: orm 1354 :tickets: 1355 1356 Fixed an eager loading bug whereby self-referential eager 1357 loading would prevent other eager loads, self referential or not, 1358 from joining to the parent JOIN properly. Thanks to Alex K 1359 for creating a great test case. 1360 1361 .. change:: 1362 :tags: orm 1363 :tickets: 1364 1365 session.expire() and related methods will not expire() unloaded 1366 deferred attributes. This prevents them from being needlessly 1367 loaded when the instance is refreshed. 1368 1369 .. change:: 1370 :tags: orm 1371 :tickets: 1293 1372 1373 query.join()/outerjoin() will now properly join an aliased() 1374 construct to the existing left side, even if query.from_self() 1375 or query.select_from(someselectable) has been called. 1376 1377 .. change:: 1378 :tags: sql 1379 :tickets: 1284 1380 1381 Further fixes to the "percent signs and spaces in column/table 1382 names" functionality. 1383 1384 .. change:: 1385 :tags: mssql 1386 :tickets: 1291 1387 1388 Restored convert_unicode handling. Results were being passed 1389 on through without conversion. 1390 1391 .. change:: 1392 :tags: mssql 1393 :tickets: 1282 1394 1395 Really fixing the decimal handling this time.. 1396 1397 .. change:: 1398 :tags: Ticket:1289, mssql 1399 :tickets: 1400 1401 Modified table reflection code to use only kwargs when 1402 constructing tables. 1403 1404.. changelog:: 1405 :version: 0.5.1 1406 :released: Sat Jan 17 2009 1407 1408 .. change:: 1409 :tags: orm 1410 :tickets: 1411 1412 Removed an internal join cache which could potentially leak 1413 memory when issuing query.join() repeatedly to ad-hoc 1414 selectables. 1415 1416 .. change:: 1417 :tags: orm 1418 :tickets: 1419 1420 The "clear()", "save()", "update()", "save_or_update()" 1421 Session methods have been deprecated, replaced by 1422 "expunge_all()" and "add()". "expunge_all()" has also 1423 been added to ScopedSession. 1424 1425 .. change:: 1426 :tags: orm 1427 :tickets: 1428 1429 Modernized the "no mapped table" exception and added a more 1430 explicit __table__/__tablename__ exception to declarative. 1431 1432 .. change:: 1433 :tags: orm 1434 :tickets: 1237 1435 1436 Concrete inheriting mappers now instrument attributes which 1437 are inherited from the superclass, but are not defined for 1438 the concrete mapper itself, with an InstrumentedAttribute that 1439 issues a descriptive error when accessed. 1440 1441 .. change:: 1442 :tags: orm 1443 :tickets: 1237, 781 1444 1445 Added a new `relation()` keyword `back_populates`. This 1446 allows configuration of backreferences using explicit 1447 relations. This is required when creating 1448 bidirectional relations between a hierarchy of concrete 1449 mappers and another class. 1450 1451 .. change:: 1452 :tags: orm 1453 :tickets: 1237 1454 1455 Test coverage added for `relation()` objects specified on 1456 concrete mappers. 1457 1458 .. change:: 1459 :tags: orm 1460 :tickets: 1276 1461 1462 Query.from_self() as well as query.subquery() both disable 1463 the rendering of eager joins inside the subquery produced. 1464 The "disable all eager joins" feature is available publicly 1465 via a new query.enable_eagerloads() generative. 1466 1467 .. change:: 1468 :tags: orm 1469 :tickets: 1470 1471 Added a rudimental series of set operations to Query that 1472 receive Query objects as arguments, including union(), 1473 union_all(), intersect(), except_(), intersect_all(), 1474 except_all(). See the API documentation for 1475 Query.union() for examples. 1476 1477 .. change:: 1478 :tags: orm 1479 :tickets: 1480 1481 Fixed bug that prevented Query.join() and eagerloads from 1482 attaching to a query that selected from a union or aliased union. 1483 1484 .. change:: 1485 :tags: orm 1486 :tickets: 1237 1487 1488 A short documentation example added for bidirectional 1489 relations specified on concrete mappers. 1490 1491 .. change:: 1492 :tags: orm 1493 :tickets: 1269 1494 1495 Mappers now instrument class attributes upon construction 1496 with the final InstrumentedAttribute object which remains 1497 persistent. The `_CompileOnAttr`/`__getattribute__()` 1498 methodology has been removed. The net effect is that 1499 Column-based mapped class attributes can now be used fully 1500 at the class level without invoking a mapper compilation 1501 operation, greatly simplifying typical usage patterns 1502 within declarative. 1503 1504 .. change:: 1505 :tags: orm 1506 :tickets: 1507 1508 ColumnProperty (and front-end helpers such as ``deferred``) no 1509 longer ignores unknown \**keyword arguments. 1510 1511 .. change:: 1512 :tags: orm 1513 :tickets: 1514 1515 Fixed a bug with the unitofwork's "row switch" mechanism, 1516 i.e. the conversion of INSERT/DELETE into an UPDATE, when 1517 combined with joined-table inheritance and an object 1518 which contained no defined values for the child table where 1519 an UPDATE with no SET clause would be rendered. 1520 1521 .. change:: 1522 :tags: orm 1523 :tickets: 1281 1524 1525 Using delete-orphan on a many-to-many relation is deprecated. 1526 This produces misleading or erroneous results since SQLA does 1527 not retrieve the full list of "parents" for m2m. To get delete-orphan 1528 behavior with an m2m table, use an explicit association class 1529 so that the individual association row is treated as a parent. 1530 1531 .. change:: 1532 :tags: orm 1533 :tickets: 1281 1534 1535 delete-orphan cascade always requires delete cascade. Specifying 1536 delete-orphan without delete now raises a deprecation warning. 1537 1538 .. change:: 1539 :tags: sql 1540 :tickets: 1256 1541 1542 Improved the methodology to handling percent signs in column 1543 names from. Added more tests. MySQL and 1544 PostgreSQL dialects still do not issue correct CREATE TABLE 1545 statements for identifiers with percent signs in them. 1546 1547 .. change:: 1548 :tags: schema 1549 :tickets: 1214 1550 1551 Index now accepts column-oriented InstrumentedAttributes 1552 (i.e. column-based mapped class attributes) as column 1553 arguments. 1554 1555 .. change:: 1556 :tags: schema 1557 :tickets: 1558 1559 Column with no name (as in declarative) won't raise a 1560 NoneType error when its string output is requested 1561 (such as in a stack trace). 1562 1563 .. change:: 1564 :tags: schema 1565 :tickets: 1278 1566 1567 Fixed bug when overriding a Column with a ForeignKey 1568 on a reflected table, where derived columns (i.e. the 1569 "virtual" columns of a select, etc.) would inadvertently 1570 call upon schema-level cleanup logic intended only 1571 for the original column. 1572 1573 .. change:: 1574 :tags: declarative 1575 :tickets: 1576 1577 Can now specify Column objects on subclasses which have no 1578 table of their own (i.e. use single table inheritance). 1579 The columns will be appended to the base table, but only 1580 mapped by the subclass. 1581 1582 .. change:: 1583 :tags: declarative 1584 :tickets: 1585 1586 For both joined and single inheriting subclasses, the subclass 1587 will only map those columns which are already mapped on the 1588 superclass and those explicit on the subclass. Other 1589 columns that are present on the `Table` will be excluded 1590 from the mapping by default, which can be disabled 1591 by passing a blank `exclude_properties` collection to the 1592 `__mapper_args__`. This is so that single-inheriting 1593 classes which define their own columns are the only classes 1594 to map those columns. The effect is actually a more organized 1595 mapping than you'd normally get with explicit `mapper()` 1596 calls unless you set up the `exclude_properties` arguments 1597 explicitly. 1598 1599 .. change:: 1600 :tags: declarative 1601 :tickets: 1602 1603 It's an error to add new Column objects to a declarative class 1604 that specified an existing table using __table__. 1605 1606 .. change:: 1607 :tags: mysql 1608 :tickets: 1609 1610 Added the missing keywords from MySQL 4.1 so they get escaped 1611 properly. 1612 1613 .. change:: 1614 :tags: mssql 1615 :tickets: 1280 1616 1617 Corrected handling of large decimal values with more robust 1618 tests. Removed string manipulation on floats. 1619 1620 .. change:: 1621 :tags: mssql 1622 :tickets: 1623 1624 Modified the do_begin handling in mssql to use the Cursor not 1625 the Connection so it is DBAPI compatible. 1626 1627 .. change:: 1628 :tags: mssql 1629 :tickets: 1630 1631 Corrected SAVEPOINT support on adodbapi by changing the 1632 handling of savepoint_release, which is unsupported on mssql. 1633 1634.. changelog:: 1635 :version: 0.5.0 1636 :released: Tue Jan 06 2009 1637 1638 .. change:: 1639 :tags: general 1640 :tickets: 1641 1642 Documentation has been converted to Sphinx. In particular, 1643 the generated API documentation has been constructed into a 1644 full blown "API Reference" section which organizes editorial 1645 documentation combined with generated docstrings. Cross 1646 linking between sections and API docs are vastly improved, a 1647 javascript-powered search feature is provided, and a full 1648 index of all classes, functions and members is provided. 1649 1650 .. change:: 1651 :tags: general 1652 :tickets: 1653 1654 setup.py now imports setuptools only optionally. If not 1655 present, distutils is used. The new "pip" installer is 1656 recommended over easy_install as it installs in a more 1657 simplified way. 1658 1659 .. change:: 1660 :tags: general 1661 :tickets: 1662 1663 added an extremely basic illustration of a PostGIS integration 1664 to the examples folder. 1665 1666 .. change:: 1667 :tags: orm 1668 :tickets: 1669 1670 Query.with_polymorphic() now accepts a third argument 1671 "discriminator" which will replace the value of 1672 mapper.polymorphic_on for that query. Mappers themselves no 1673 longer require polymorphic_on to be set, even if the mapper 1674 has a polymorphic_identity. When not set, the mapper will 1675 load non-polymorphically by default. Together, these two 1676 features allow a non-polymorphic concrete inheritance setup to 1677 use polymorphic loading on a per-query basis, since concrete 1678 setups are prone to many issues when used polymorphically in 1679 all cases. 1680 1681 .. change:: 1682 :tags: orm 1683 :tickets: 1684 1685 dynamic_loader accepts a query_class= to customize the Query 1686 classes used for both the dynamic collection and the queries 1687 built from it. 1688 1689 .. change:: 1690 :tags: orm 1691 :tickets: 1079 1692 1693 query.order_by() accepts None which will remove any pending 1694 order_by state from the query, as well as cancel out any 1695 mapper/relation configured ordering. This is primarily useful 1696 for overriding the ordering specified on a dynamic_loader(). 1697 1698 .. change:: 1699 :tags: sql 1700 :tickets: 935 1701 1702 RowProxy objects can be used in place of dictionary arguments 1703 sent to connection.execute() and friends. 1704 1705 .. change:: 1706 :tags: dialect 1707 :tickets: 1708 1709 Added a new description_encoding attribute on the dialect that 1710 is used for encoding the column name when processing the 1711 metadata. This usually defaults to utf-8. 1712 1713 .. change:: 1714 :tags: mssql 1715 :tickets: 1716 1717 Added in a new MSGenericBinary type. This maps to the Binary 1718 type so it can implement the specialized behavior of treating 1719 length specified types as fixed-width Binary types and 1720 non-length types as an unbound variable length Binary type. 1721 1722 .. change:: 1723 :tags: mssql 1724 :tickets: 1249 1725 1726 Added in new types: MSVarBinary and MSImage. 1727 1728 .. change:: 1729 :tags: mssql 1730 :tickets: 1731 1732 Added in the MSReal, MSNText, MSSmallDateTime, MSTime, 1733 MSDateTimeOffset, and MSDateTime2 types 1734 1735 .. change:: 1736 :tags: sqlite 1737 :tickets: 1266 1738 1739 Table reflection now stores the actual DefaultClause value for 1740 the column. 1741 1742 .. change:: 1743 :tags: sqlite 1744 :tickets: 1745 1746 bugfixes, behavioral changes 1747 1748 .. change:: 1749 :tags: orm 1750 :tickets: 1751 1752 Exceptions raised during compile_mappers() are now preserved 1753 to provide "sticky behavior" - if a hasattr() call on a 1754 pre-compiled mapped attribute triggers a failing compile and 1755 suppresses the exception, subsequent compilation is blocked 1756 and the exception will be reiterated on the next compile() 1757 call. This issue occurs frequently when using declarative. 1758 1759 .. change:: 1760 :tags: orm 1761 :tickets: 1762 1763 property.of_type() is now recognized on a single-table 1764 inheriting target, when used in the context of 1765 prop.of_type(..).any()/has(), as well as 1766 query.join(prop.of_type(...)). 1767 1768 .. change:: 1769 :tags: orm 1770 :tickets: 1771 1772 query.join() raises an error when the target of the join 1773 doesn't match the property-based attribute - while it's 1774 unlikely anyone is doing this, the SQLAlchemy author was 1775 guilty of this particular loosey-goosey behavior. 1776 1777 .. change:: 1778 :tags: orm 1779 :tickets: 1272 1780 1781 Fixed bug when using weak_instance_map=False where modified 1782 events would not be intercepted for a flush(). 1783 1784 .. change:: 1785 :tags: orm 1786 :tickets: 1268 1787 1788 Fixed some deep "column correspondence" issues which could 1789 impact a Query made against a selectable containing multiple 1790 versions of the same table, as well as unions and similar 1791 which contained the same table columns in different column 1792 positions at different levels. 1793 1794 .. change:: 1795 :tags: orm 1796 :tickets: 1797 1798 Custom comparator classes used in conjunction with 1799 column_property(), relation() etc. can define new comparison 1800 methods on the Comparator, which will become available via 1801 __getattr__() on the InstrumentedAttribute. In the case of 1802 synonym() or comparable_property(), attributes are resolved 1803 first on the user-defined descriptor, then on the user-defined 1804 comparator. 1805 1806 .. change:: 1807 :tags: orm 1808 :tickets: 976 1809 1810 Added ScopedSession.is_active accessor. 1811 1812 .. change:: 1813 :tags: orm 1814 :tickets: 1262 1815 1816 Can pass mapped attributes and column objects as keys to 1817 query.update({}). 1818 1819 .. change:: 1820 :tags: orm 1821 :tickets: 1822 1823 Mapped attributes passed to the values() of an expression 1824 level insert() or update() will use the keys of the mapped 1825 columns, not that of the mapped attribute. 1826 1827 .. change:: 1828 :tags: orm 1829 :tickets: 1242 1830 1831 Corrected problem with Query.delete() and Query.update() not 1832 working properly with bind parameters. 1833 1834 .. change:: 1835 :tags: orm 1836 :tickets: 1837 1838 Query.select_from(), from_statement() ensure that the given 1839 argument is a FromClause, or Text/Select/Union, respectively. 1840 1841 .. change:: 1842 :tags: orm 1843 :tickets: 1253 1844 1845 Query() can be passed a "composite" attribute as a column 1846 expression and it will be expanded. Somewhat related to. 1847 1848 .. change:: 1849 :tags: orm 1850 :tickets: 1851 1852 Query() is a little more robust when passed various column 1853 expressions such as strings, clauselists, text() constructs 1854 (which may mean it just raises an error more nicely). 1855 1856 .. change:: 1857 :tags: orm 1858 :tickets: 1859 1860 first() works as expected with Query.from_statement(). 1861 1862 .. change:: 1863 :tags: orm 1864 :tickets: 1865 1866 Fixed bug introduced in 0.5rc4 involving eager loading not 1867 functioning for properties which were added to a mapper 1868 post-compile using add_property() or equivalent. 1869 1870 .. change:: 1871 :tags: orm 1872 :tickets: 1873 1874 Fixed bug where many-to-many relation() with viewonly=True 1875 would not correctly reference the link between 1876 secondary->remote. 1877 1878 .. change:: 1879 :tags: orm 1880 :tickets: 1232 1881 1882 Duplicate items in a list-based collection will be maintained 1883 when issuing INSERTs to a "secondary" table in a many-to-many 1884 relation. Assuming the m2m table has a unique or primary key 1885 constraint on it, this will raise the expected constraint 1886 violation instead of silently dropping the duplicate 1887 entries. Note that the old behavior remains for a one-to-many 1888 relation since collection entries in that case don't result in 1889 INSERT statements and SQLA doesn't manually police 1890 collections. 1891 1892 .. change:: 1893 :tags: orm 1894 :tickets: 1895 1896 Query.add_column() can accept FromClause objects in the same 1897 manner as session.query() can. 1898 1899 .. change:: 1900 :tags: orm 1901 :tickets: 1902 1903 Comparison of many-to-one relation to NULL is properly 1904 converted to IS NOT NULL based on not_(). 1905 1906 .. change:: 1907 :tags: orm 1908 :tickets: 1087 1909 1910 Extra checks added to ensure explicit 1911 primaryjoin/secondaryjoin are ClauseElement instances, to 1912 prevent more confusing errors later on. 1913 1914 .. change:: 1915 :tags: orm 1916 :tickets: 1236 1917 1918 Improved mapper() check for non-class classes. 1919 1920 .. change:: 1921 :tags: orm 1922 :tickets: 5051 1923 1924 comparator_factory argument is now documented and supported by 1925 all MapperProperty types, including column_property(), 1926 relation(), backref(), and synonym(). 1927 1928 .. change:: 1929 :tags: orm 1930 :tickets: 1931 1932 Changed the name of PropertyLoader to RelationProperty, to be 1933 consistent with all the other names. PropertyLoader is still 1934 present as a synonym. 1935 1936 .. change:: 1937 :tags: orm 1938 :tickets: 1099, 1228 1939 1940 fixed "double iter()" call causing bus errors in shard API, 1941 removed errant result.close() left over from the 0.4 1942 version. 1943 1944 .. change:: 1945 :tags: orm 1946 :tickets: 1947 1948 made Session.merge cascades not trigger autoflush. Fixes 1949 merged instances getting prematurely inserted with missing 1950 values. 1951 1952 .. change:: 1953 :tags: orm 1954 :tickets: 1955 1956 Two fixes to help prevent out-of-band columns from being 1957 rendered in polymorphic_union inheritance scenarios (which 1958 then causes extra tables to be rendered in the FROM clause 1959 causing cartesian products): 1960 1961 - improvements to "column adaption" for a->b->c inheritance 1962 situations to better locate columns that are related to 1963 one another via multiple levels of indirection, rather 1964 than rendering the non-adapted column. 1965 1966 - the "polymorphic discriminator" column is only rendered 1967 for the actual mapper being queried against. The column 1968 won't be "pulled in" from a subclass or superclass mapper 1969 since it's not needed. 1970 1971 .. change:: 1972 :tags: orm 1973 :tickets: 1072 1974 1975 Fixed shard_id argument on ShardedSession.execute(). 1976 1977 .. change:: 1978 :tags: sql 1979 :tickets: 1256 1980 1981 Columns can again contain percent signs within their 1982 names. 1983 1984 .. change:: 1985 :tags: sql 1986 :tickets: 1987 1988 sqlalchemy.sql.expression.Function is now a public class. It 1989 can be subclassed to provide user-defined SQL functions in an 1990 imperative style, including with pre-established behaviors. 1991 The postgis.py example illustrates one usage of this. 1992 1993 .. change:: 1994 :tags: sql 1995 :tickets: 1996 1997 PickleType now favors == comparison by default, if the 1998 incoming object (such as a dict) implements __eq__(). If the 1999 object does not implement __eq__() and mutable=True, a 2000 deprecation warning is raised. 2001 2002 .. change:: 2003 :tags: sql 2004 :tickets: 1215 2005 2006 Fixed the import weirdness in sqlalchemy.sql to not export 2007 __names__. 2008 2009 .. change:: 2010 :tags: sql 2011 :tickets: 1238 2012 2013 Using the same ForeignKey object repeatedly raises an error 2014 instead of silently failing later. 2015 2016 .. change:: 2017 :tags: sql 2018 :tickets: 2019 2020 Added NotImplementedError for params() method on 2021 Insert/Update/Delete constructs. These items currently don't 2022 support this functionality, which also would be a little 2023 misleading compared to values(). 2024 2025 .. change:: 2026 :tags: sql 2027 :tickets: 650 2028 2029 Reflected foreign keys will properly locate their referenced 2030 column, even if the column was given a "key" attribute 2031 different from the reflected name. This is achieved via a new 2032 flag on ForeignKey/ForeignKeyConstraint called "link_to_name", 2033 if True means the given name is the referred-to column's name, 2034 not its assigned key. 2035 2036 .. change:: 2037 :tags: sql 2038 :tickets: 1253 2039 2040 select() can accept a ClauseList as a column in the same way 2041 as a Table or other selectable and the interior expressions 2042 will be used as column elements. 2043 2044 .. change:: 2045 :tags: sql 2046 :tickets: 2047 2048 the "passive" flag on session.is_modified() is correctly 2049 propagated to the attribute manager. 2050 2051 .. change:: 2052 :tags: sql 2053 :tickets: 2054 2055 union() and union_all() will not whack any order_by() that has 2056 been applied to the select()s inside. If you union() a 2057 select() with order_by() (presumably to support LIMIT/OFFSET), 2058 you should also call self_group() on it to apply parenthesis. 2059 2060 .. change:: 2061 :tags: engine/pool 2062 :tickets: 1246 2063 2064 Connection.invalidate() checks for closed status to avoid 2065 attribute errors. 2066 2067 .. change:: 2068 :tags: engine/pool 2069 :tickets: 1094 2070 2071 NullPool supports reconnect on failure behavior. 2072 2073 .. change:: 2074 :tags: engine/pool 2075 :tickets: 799 2076 2077 Added a mutex for the initial pool creation when using 2078 pool.manage(dbapi). This prevents a minor case of "dogpile" 2079 behavior which would otherwise occur upon a heavy load 2080 startup. 2081 2082 .. change:: 2083 :tags: engine/pool 2084 :tickets: 2085 2086 _execute_clauseelement() goes back to being a private method. 2087 Subclassing Connection is not needed now that ConnectionProxy 2088 is available. 2089 2090 .. change:: 2091 :tags: documentation 2092 :tickets: 1149, 1200 2093 2094 Tickets. 2095 2096 .. change:: 2097 :tags: documentation 2098 :tickets: 2099 2100 Added note about create_session() defaults. 2101 2102 .. change:: 2103 :tags: documentation 2104 :tickets: 2105 2106 Added section about metadata.reflect(). 2107 2108 .. change:: 2109 :tags: documentation 2110 :tickets: 2111 2112 Updated `TypeDecorator` section. 2113 2114 .. change:: 2115 :tags: documentation 2116 :tickets: 2117 2118 Rewrote the "threadlocal" strategy section of the docs due to 2119 recent confusion over this feature. 2120 2121 .. change:: 2122 :tags: documentation 2123 :tickets: 2124 2125 Removed badly out of date 'polymorphic_fetch' and 2126 'select_table' docs from inheritance, reworked the second half 2127 of "joined table inheritance". 2128 2129 .. change:: 2130 :tags: documentation 2131 :tickets: 2132 2133 Documented `comparator_factory` kwarg, added new doc section 2134 "Custom Comparators". 2135 2136 .. change:: 2137 :tags: mssql 2138 :tickets: 1254 2139 2140 Refactored the Date/Time types. The ``smalldatetime`` data 2141 type no longer truncates to a date only, and will now be 2142 mapped to the MSSmallDateTime type. 2143 2144 .. change:: 2145 :tags: mssql 2146 :tickets: 2147 2148 Corrected an issue with Numerics to accept an int. 2149 2150 .. change:: 2151 :tags: mssql 2152 :tickets: 2153 2154 Mapped ``char_length`` to the ``LEN()`` function. 2155 2156 .. change:: 2157 :tags: mssql 2158 :tickets: 2159 2160 If an ``INSERT`` includes a subselect the ``INSERT`` is 2161 converted from an ``INSERT INTO VALUES`` construct to a 2162 ``INSERT INTO SELECT`` construct. 2163 2164 .. change:: 2165 :tags: mssql 2166 :tickets: 2167 2168 If the column is part of a ``primary_key`` it will be ``NOT 2169 NULL`` since MSSQL doesn't allow ``NULL`` in primary_key 2170 columns. 2171 2172 .. change:: 2173 :tags: mssql 2174 :tickets: 1249 2175 2176 ``MSBinary`` now returns a ``BINARY`` instead of an 2177 ``IMAGE``. This is a backwards incompatible change in that 2178 ``BINARY`` is a fixed length data type whereas ``IMAGE`` is a 2179 variable length data type. 2180 2181 .. change:: 2182 :tags: mssql 2183 :tickets: 1258 2184 2185 ``get_default_schema_name`` is now reflected from the database 2186 based on the user's default schema. This only works with MSSQL 2187 2005 and later. 2188 2189 .. change:: 2190 :tags: mssql 2191 :tickets: 1248 2192 2193 Added collation support through the use of a new collation 2194 argument. This is supported on the following types: char, 2195 nchar, varchar, nvarchar, text, ntext. 2196 2197 .. change:: 2198 :tags: mssql 2199 :tickets: 2200 2201 Changes to the connection string parameters favor DSN as the 2202 default specification for pyodbc. See the mssql.py docstring 2203 for detailed usage instructions. 2204 2205 .. change:: 2206 :tags: mssql 2207 :tickets: 2208 2209 Added experimental support of savepoints. It currently does 2210 not work fully with sessions. 2211 2212 .. change:: 2213 :tags: mssql 2214 :tickets: 1243 2215 2216 Support for three levels of column nullability: NULL, NOT 2217 NULL, and the database's configured default. The default 2218 Column configuration (nullable=True) will now generate NULL in 2219 the DDL. Previously no specification was emitted and the 2220 database default would take effect (usually NULL, but not 2221 always). To explicitly request the database default, 2222 configure columns with nullable=None and no specification will 2223 be emitted in DDL. This is backwards incompatible 2224 behavior. 2225 2226 .. change:: 2227 :tags: postgres 2228 :tickets: 1267 2229 2230 "%" signs in text() constructs are automatically escaped to 2231 "%%". Because of the backwards incompatible nature of this 2232 change, a warning is emitted if '%%' is detected in the 2233 string. 2234 2235 .. change:: 2236 :tags: postgres 2237 :tickets: 2238 2239 Calling alias.execute() in conjunction with 2240 server_side_cursors won't raise AttributeError. 2241 2242 .. change:: 2243 :tags: postgres 2244 :tickets: 714 2245 2246 Added Index reflection support to PostgreSQL, using a great 2247 patch we long neglected, submitted by Ken 2248 Kuhlman. 2249 2250 .. change:: 2251 :tags: oracle 2252 :tickets: 2253 2254 Adjusted the format of create_xid() to repair two-phase 2255 commit. We now have field reports of Oracle two-phase commit 2256 working properly with this change. 2257 2258 .. change:: 2259 :tags: oracle 2260 :tickets: 1233 2261 2262 Added OracleNVarchar type, produces NVARCHAR2, and also 2263 subclasses Unicode so that convert_unicode=True by default. 2264 NVARCHAR2 reflects into this type automatically so these 2265 columns pass unicode on a reflected table with no explicit 2266 convert_unicode=True flags. 2267 2268 .. change:: 2269 :tags: oracle 2270 :tickets: 1265 2271 2272 Fixed bug which was preventing out params of certain types 2273 from being received; thanks a ton to huddlej at wwu.edu ! 2274 2275 .. change:: 2276 :tags: mysql 2277 :tickets: 2278 2279 "%" signs in text() constructs are automatically escaped to 2280 "%%". Because of the backwards incompatible nature of this 2281 change, a warning is emitted if '%%' is detected in the 2282 string. 2283 2284 .. change:: 2285 :tags: mysql 2286 :tickets: 1241 2287 2288 Fixed bug in exception raise when FK columns not present 2289 during reflection. 2290 2291 .. change:: 2292 :tags: mysql 2293 :tickets: 2294 2295 Fixed bug involving reflection of a remote-schema table with a 2296 foreign key ref to another table in that schema. 2297 2298 .. change:: 2299 :tags: associationproxy 2300 :tickets: 2301 2302 The association proxy properties are make themselves available 2303 at the class level, e.g. MyClass.aproxy. Previously this 2304 evaluated to None. 2305 2306 .. change:: 2307 :tags: declarative 2308 :tickets: 2309 2310 The full list of arguments accepted as string by backref() 2311 includes 'primaryjoin', 'secondaryjoin', 'secondary', 2312 'foreign_keys', 'remote_side', 'order_by'. 2313 2314.. changelog:: 2315 :version: 0.5.0rc4 2316 :released: Fri Nov 14 2008 2317 2318 .. change:: 2319 :tags: orm 2320 :tickets: 2321 2322 Query.count() has been enhanced to do the "right thing" in a 2323 wider variety of cases. It can now count multiple-entity 2324 queries, as well as column-based queries. Note that this means 2325 if you say query(A, B).count() without any joining criterion, 2326 it's going to count the cartesian product of A*B. Any query 2327 which is against column-based entities will automatically 2328 issue "SELECT count(1) FROM (SELECT...)" so that the real 2329 rowcount is returned, meaning a query such as 2330 query(func.count(A.name)).count() will return a value of one, 2331 since that query would return one row. 2332 2333 .. change:: 2334 :tags: orm 2335 :tickets: 2336 2337 Lots of performance tuning. A rough guesstimate over various 2338 ORM operations places it 10% faster over 0.5.0rc3, 25-30% over 2339 0.4.8. 2340 2341 .. change:: 2342 :tags: orm 2343 :tickets: 2344 2345 bugfixes and behavioral changes 2346 2347 .. change:: 2348 :tags: general 2349 :tickets: 2350 2351 global "propigate"->"propagate" change. 2352 2353 .. change:: 2354 :tags: orm 2355 :tickets: 2356 2357 Adjustments to the enhanced garbage collection on 2358 InstanceState to better guard against errors due to lost 2359 state. 2360 2361 .. change:: 2362 :tags: orm 2363 :tickets: 1220 2364 2365 Query.get() returns a more informative error message when 2366 executed against multiple entities. 2367 2368 .. change:: 2369 :tags: orm 2370 :tickets: 1140, 1221 2371 2372 Restored NotImplementedError on Cls.relation.in_() 2373 2374 .. change:: 2375 :tags: orm 2376 :tickets: 1226 2377 2378 Fixed PendingDeprecationWarning involving order_by parameter 2379 on relation(). 2380 2381 .. change:: 2382 :tags: sql 2383 :tickets: 2384 2385 Removed the 'properties' attribute of the Connection object, 2386 Connection.info should be used. 2387 2388 .. change:: 2389 :tags: sql 2390 :tickets: 2391 2392 Restored "active rowcount" fetch before ResultProxy autocloses 2393 the cursor. This was removed in 0.5rc3. 2394 2395 .. change:: 2396 :tags: sql 2397 :tickets: 2398 2399 Rearranged the `load_dialect_impl()` method in `TypeDecorator` 2400 such that it will take effect even if the user-defined 2401 `TypeDecorator` uses another `TypeDecorator` as its impl. 2402 2403 .. change:: 2404 :tags: access 2405 :tickets: 2406 2407 Added support for Currency type. 2408 2409 .. change:: 2410 :tags: access 2411 :tickets: 1017 2412 2413 Functions were not return their result. 2414 2415 .. change:: 2416 :tags: access 2417 :tickets: 1017 2418 2419 Corrected problem with joins. Access only support LEFT OUTER 2420 or INNER not just JOIN by itself. 2421 2422 .. change:: 2423 :tags: mssql 2424 :tickets: 2425 2426 Lots of cleanup and fixes to correct problems with limit and 2427 offset. 2428 2429 .. change:: 2430 :tags: mssql 2431 :tickets: 2432 2433 Correct situation where subqueries as part of a binary 2434 expression need to be translated to use the IN and NOT IN 2435 syntax. 2436 2437 .. change:: 2438 :tags: mssql 2439 :tickets: 1216 2440 2441 Fixed E Notation issue that prevented the ability to insert 2442 decimal values less than 1E-6. 2443 2444 .. change:: 2445 :tags: mssql 2446 :tickets: 1217 2447 2448 Corrected problems with reflection when dealing with schemas, 2449 particularly when those schemas are the default 2450 schema. 2451 2452 .. change:: 2453 :tags: mssql 2454 :tickets: 2455 2456 Corrected problem with casting a zero length item to a 2457 varchar. It now correctly adjusts the CAST. 2458 2459 .. change:: 2460 :tags: ext 2461 :tickets: 2462 2463 Can now use a custom "inherit_condition" in __mapper_args__ 2464 when using declarative. 2465 2466 .. change:: 2467 :tags: ext 2468 :tickets: 2469 2470 fixed string-based "remote_side", "order_by" and others not 2471 propagating correctly when used in backref(). 2472 2473.. changelog:: 2474 :version: 0.5.0rc3 2475 :released: Fri Nov 07 2008 2476 2477 .. change:: 2478 :tags: orm 2479 :tickets: 2480 2481 Added two new hooks to SessionExtension: after_bulk_delete() 2482 and after_bulk_update(). after_bulk_delete() is called after 2483 a bulk delete() operation on a query. after_bulk_update() is 2484 called after a bulk update() operation on a query. 2485 2486 .. change:: 2487 :tags: sql 2488 :tickets: 2489 2490 SQL compiler optimizations and complexity reduction. The call 2491 count for compiling a typical select() construct is 20% less 2492 versus 0.5.0rc2. 2493 2494 .. change:: 2495 :tags: sql 2496 :tickets: 1211 2497 2498 Dialects can now generate label names of adjustable 2499 length. Pass in the argument "label_length=<value>" to 2500 create_engine() to adjust how many characters max will be 2501 present in dynamically generated column labels, i.e. 2502 "somecolumn AS somelabel". Any value less than 6 will result 2503 in a label of minimal size, consisting of an underscore and a 2504 numeric counter. The compiler uses the value of 2505 dialect.max_identifier_length as a default. 2506 2507 .. change:: 2508 :tags: ext 2509 :tickets: 2510 2511 Added a new extension sqlalchemy.ext.serializer. Provides 2512 Serializer/Deserializer "classes" which mirror 2513 Pickle/Unpickle, as well as dumps() and loads(). This 2514 serializer implements an "external object" pickler which keeps 2515 key context-sensitive objects, including engines, sessions, 2516 metadata, Tables/Columns, and mappers, outside of the pickle 2517 stream, and can later restore the pickle using any 2518 engine/metadata/session provider. This is used not for 2519 pickling regular object instances, which are pickleable 2520 without any special logic, but for pickling expression objects 2521 and full Query objects, such that all mapper/engine/session 2522 dependencies can be restored at unpickle time. 2523 2524 .. change:: 2525 :tags: oracle 2526 :tickets: 2527 2528 Wrote a docstring for Oracle dialect. Apparently that Ohloh 2529 "few source code comments" label is starting to sting :). 2530 2531 .. change:: 2532 :tags: oracle 2533 :tickets: 536 2534 2535 Removed FIRST_ROWS() optimize flag when using LIMIT/OFFSET, 2536 can be re-enabled with optimize_limits=True create_engine() 2537 flag. 2538 2539 .. change:: 2540 :tags: oracle 2541 :tickets: 2542 2543 bugfixes and behavioral changes 2544 2545 .. change:: 2546 :tags: orm 2547 :tickets: 2548 2549 "not equals" comparisons of simple many-to-one relation to an 2550 instance will not drop into an EXISTS clause and will compare 2551 foreign key columns instead. 2552 2553 .. change:: 2554 :tags: orm 2555 :tickets: 2556 2557 Removed not-really-working use cases of comparing a collection 2558 to an iterable. Use contains() to test for collection 2559 membership. 2560 2561 .. change:: 2562 :tags: orm 2563 :tickets: 1171 2564 2565 Improved the behavior of aliased() objects such that they more 2566 accurately adapt the expressions generated, which helps 2567 particularly with self-referential comparisons. 2568 2569 .. change:: 2570 :tags: orm 2571 :tickets: 2572 2573 Fixed bug involving primaryjoin/secondaryjoin conditions 2574 constructed from class-bound attributes (as often occurs when 2575 using declarative), which later would be inappropriately 2576 aliased by Query, particularly with the various EXISTS based 2577 comparators. 2578 2579 .. change:: 2580 :tags: orm 2581 :tickets: 2582 2583 Fixed bug when using multiple query.join() with an 2584 aliased-bound descriptor which would lose the left alias. 2585 2586 .. change:: 2587 :tags: orm 2588 :tickets: 2589 2590 Improved weakref identity map memory management to no longer 2591 require mutexing, resurrects garbage collected instance on a 2592 lazy basis for an InstanceState with pending changes. 2593 2594 .. change:: 2595 :tags: orm 2596 :tickets: 2597 2598 InstanceState object now removes circular references to itself 2599 upon disposal to keep it outside of cyclic garbage collection. 2600 2601 .. change:: 2602 :tags: orm 2603 :tickets: 2604 2605 relation() won't hide unrelated ForeignKey errors inside of 2606 the "please specify primaryjoin" message when determining join 2607 condition. 2608 2609 .. change:: 2610 :tags: orm 2611 :tickets: 1218 2612 2613 Fixed bug in Query involving order_by() in conjunction with 2614 multiple aliases of the same class (will add tests in) 2615 2616 .. change:: 2617 :tags: orm 2618 :tickets: 2619 2620 When using Query.join() with an explicit clause for the ON 2621 clause, the clause will be aliased in terms of the left side 2622 of the join, allowing scenarios like query(Source). 2623 from_self().join((Dest, Source.id==Dest.source_id)) to work 2624 properly. 2625 2626 .. change:: 2627 :tags: orm 2628 :tickets: 2629 2630 polymorphic_union() function respects the "key" of each Column 2631 if they differ from the column's name. 2632 2633 .. change:: 2634 :tags: orm 2635 :tickets: 1183 2636 2637 Repaired support for "passive-deletes" on a many-to-one 2638 relation() with "delete" cascade. 2639 2640 .. change:: 2641 :tags: orm 2642 :tickets: 1213 2643 2644 Fixed bug in composite types which prevented a primary-key 2645 composite type from being mutated. 2646 2647 .. change:: 2648 :tags: orm 2649 :tickets: 1202 2650 2651 Added more granularity to internal attribute access, such that 2652 cascade and flush operations will not initialize unloaded 2653 attributes and collections, leaving them intact for a 2654 lazy-load later on. Backref events still initialize attributes 2655 and collections for pending instances. 2656 2657 .. change:: 2658 :tags: sql 2659 :tickets: 1212 2660 2661 Simplified the check for ResultProxy "autoclose without 2662 results" to be based solely on presence of 2663 cursor.description. All the regexp-based guessing about 2664 statements returning rows has been removed. 2665 2666 .. change:: 2667 :tags: sql 2668 :tickets: 1194 2669 2670 Direct execution of a union() construct will properly set up 2671 result-row processing. 2672 2673 .. change:: 2674 :tags: sql 2675 :tickets: 2676 2677 The internal notion of an "OID" or "ROWID" column has been 2678 removed. It's basically not used by any dialect, and the 2679 possibility of its usage with psycopg2's cursor.lastrowid is 2680 basically gone now that INSERT..RETURNING is available. 2681 2682 .. change:: 2683 :tags: sql 2684 :tickets: 2685 2686 Removed "default_order_by()" method on all FromClause objects. 2687 2688 .. change:: 2689 :tags: sql 2690 :tickets: 2691 2692 Repaired the table.tometadata() method so that a passed-in 2693 schema argument is propagated to ForeignKey constructs. 2694 2695 .. change:: 2696 :tags: sql 2697 :tickets: 2698 2699 Slightly changed behavior of IN operator for comparing to 2700 empty collections. Now results in inequality comparison 2701 against self. More portable, but breaks with stored procedures 2702 that aren't pure functions. 2703 2704 .. change:: 2705 :tags: oracle 2706 :tickets: 2707 2708 Setting the auto_convert_lobs to False on create_engine() will 2709 also instruct the OracleBinary type to return the cx_oracle 2710 LOB object unchanged. 2711 2712 .. change:: 2713 :tags: mysql 2714 :tickets: 2715 2716 Fixed foreign key reflection in the edge case where a Table's 2717 explicit schema= is the same as the schema (database) the 2718 connection is attached to. 2719 2720 .. change:: 2721 :tags: mysql 2722 :tickets: 2723 2724 No longer expects include_columns in table reflection to be 2725 lower case. 2726 2727 .. change:: 2728 :tags: ext 2729 :tickets: 1174 2730 2731 Fixed bug preventing declarative-bound "column" objects from 2732 being used in column_mapped_collection(). 2733 2734 .. change:: 2735 :tags: misc 2736 :tickets: 1077 2737 2738 util.flatten_iterator() func doesn't interpret strings with 2739 __iter__() methods as iterators, such as in pypy. 2740 2741.. changelog:: 2742 :version: 0.5.0rc2 2743 :released: Sun Oct 12 2008 2744 2745 .. change:: 2746 :tags: orm 2747 :tickets: 2748 2749 Fixed bug involving read/write relation()s that contain 2750 literal or other non-column expressions within their 2751 primaryjoin condition equated to a foreign key column. 2752 2753 .. change:: 2754 :tags: orm 2755 :tickets: 2756 2757 "non-batch" mode in mapper(), a feature which allows mapper 2758 extension methods to be called as each instance is 2759 updated/inserted, now honors the insert order of the objects 2760 given. 2761 2762 .. change:: 2763 :tags: orm 2764 :tickets: 2765 2766 Fixed RLock-related bug in mapper which could deadlock upon 2767 reentrant mapper compile() calls, something that occurs when 2768 using declarative constructs inside of ForeignKey objects. 2769 2770 .. change:: 2771 :tags: orm 2772 :tickets: 2773 2774 ScopedSession.query_property now accepts a query_cls factory, 2775 overriding the session's configured query_cls. 2776 2777 .. change:: 2778 :tags: orm 2779 :tickets: 2780 2781 Fixed shared state bug interfering with ScopedSession.mapper's 2782 ability to apply default __init__ implementations on object 2783 subclasses. 2784 2785 .. change:: 2786 :tags: orm 2787 :tickets: 1177 2788 2789 Fixed up slices on Query (i.e. query[x:y]) to work properly 2790 for zero length slices, slices with None on either end. 2791 2792 .. change:: 2793 :tags: orm 2794 :tickets: 2795 2796 Added an example illustrating Celko's "nested sets" as a 2797 SQLA mapping. 2798 2799 .. change:: 2800 :tags: orm 2801 :tickets: 2802 2803 contains_eager() with an alias argument works even when 2804 the alias is embedded in a SELECT, as when sent to the 2805 Query via query.select_from(). 2806 2807 .. change:: 2808 :tags: orm 2809 :tickets: 1180 2810 2811 contains_eager() usage is now compatible with a Query that 2812 also contains a regular eager load and limit/offset, in that 2813 the columns are added to the Query-generated subquery. 2814 2815 .. change:: 2816 :tags: orm 2817 :tickets: 2818 2819 session.execute() will execute a Sequence object passed to 2820 it (regression from 0.4). 2821 2822 .. change:: 2823 :tags: orm 2824 :tickets: 2825 2826 Removed the "raiseerror" keyword argument from object_mapper() 2827 and class_mapper(). These functions raise in all cases 2828 if the given class/instance is not mapped. 2829 2830 .. change:: 2831 :tags: orm 2832 :tickets: 2833 2834 Fixed session.transaction.commit() on a autocommit=False 2835 session not starting a new transaction. 2836 2837 .. change:: 2838 :tags: orm 2839 :tickets: 2840 2841 Some adjustments to Session.identity_map's weak referencing 2842 behavior to reduce asynchronous GC side effects. 2843 2844 .. change:: 2845 :tags: orm 2846 :tickets: 1182 2847 2848 Adjustment to Session's post-flush accounting of newly 2849 "clean" objects to better protect against operating on 2850 objects as they're asynchronously gc'ed. 2851 2852 .. change:: 2853 :tags: sql 2854 :tickets: 1074 2855 2856 column.in_(someselect) can now be used as a columns-clause 2857 expression without the subquery bleeding into the FROM clause 2858 2859 .. change:: 2860 :tags: sqlite 2861 :tickets: 968 2862 2863 Overhauled SQLite date/time bind/result processing to use 2864 regular expressions and format strings, rather than 2865 strptime/strftime, to generically support pre-1900 dates, 2866 dates with microseconds. 2867 2868 .. change:: 2869 :tags: sqlite 2870 :tickets: 2871 2872 String's (and Unicode's, UnicodeText's, etc.) convert_unicode 2873 logic disabled in the sqlite dialect, to adjust for pysqlite 2874 2.5.0's new requirement that only Python unicode objects are 2875 accepted; 2876 https://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html 2877 2878 .. change:: 2879 :tags: mysql 2880 :tickets: 2881 2882 Temporary tables are now reflectable. 2883 2884 .. change:: 2885 :tags: oracle 2886 :tickets: 1187 2887 2888 Oracle will detect string-based statements which contain 2889 comments at the front before a SELECT as SELECT statements. 2890 2891.. changelog:: 2892 :version: 0.5.0rc1 2893 :released: Thu Sep 11 2008 2894 2895 .. change:: 2896 :tags: orm 2897 :tickets: 2898 2899 Query now has delete() and update(values) methods. This allows 2900 to perform bulk deletes/updates with the Query object. 2901 2902 .. change:: 2903 :tags: orm 2904 :tickets: 2905 2906 The RowTuple object returned by Query(\*cols) now features 2907 keynames which prefer mapped attribute names over column keys, 2908 column keys over column names, i.e. Query(Class.foo, 2909 Class.bar) will have names "foo" and "bar" even if those are 2910 not the names of the underlying Column objects. Direct Column 2911 objects such as Query(table.c.col) will return the "key" 2912 attribute of the Column. 2913 2914 .. change:: 2915 :tags: orm 2916 :tickets: 2917 2918 Added scalar() and value() methods to Query, each return a 2919 single scalar value. scalar() takes no arguments and is 2920 roughly equivalent to first()[0], value() 2921 takes a single column expression and is roughly equivalent to 2922 values(expr).next()[0]. 2923 2924 .. change:: 2925 :tags: orm 2926 :tickets: 2927 2928 Improved the determination of the FROM clause when placing SQL 2929 expressions in the query() list of entities. In particular 2930 scalar subqueries should not "leak" their inner FROM objects 2931 out into the enclosing query. 2932 2933 .. change:: 2934 :tags: orm 2935 :tickets: 2936 2937 Joins along a relation() from a mapped class to a mapped 2938 subclass, where the mapped subclass is configured with single 2939 table inheritance, will include an IN clause which limits the 2940 subtypes of the joined class to those requested, within the ON 2941 clause of the join. This takes effect for eager load joins as 2942 well as query.join(). Note that in some scenarios the IN 2943 clause will appear in the WHERE clause of the query as well 2944 since this discrimination has multiple trigger points. 2945 2946 .. change:: 2947 :tags: orm 2948 :tickets: 2949 2950 AttributeExtension has been refined such that the event 2951 is fired before the mutation actually occurs. Additionally, 2952 the append() and set() methods must now return the given value, 2953 which is used as the value to be used in the mutation operation. 2954 This allows creation of validating AttributeListeners which 2955 raise before the action actually occurs, and which can change 2956 the given value into something else before its used. 2957 2958 .. change:: 2959 :tags: orm 2960 :tickets: 2961 2962 column_property(), composite_property(), and relation() now 2963 accept a single or list of AttributeExtensions using the 2964 "extension" keyword argument. 2965 2966 .. change:: 2967 :tags: orm 2968 :tickets: 2969 2970 query.order_by().get() silently drops the "ORDER BY" from 2971 the query issued by GET but does not raise an exception. 2972 2973 .. change:: 2974 :tags: orm 2975 :tickets: 2976 2977 Added a Validator AttributeExtension, as well as a 2978 @validates decorator which is used in a similar fashion 2979 as @reconstructor, and marks a method as validating 2980 one or more mapped attributes. 2981 2982 .. change:: 2983 :tags: orm 2984 :tickets: 1140 2985 2986 class.someprop.in_() raises NotImplementedError pending the 2987 implementation of "in\_" for relation 2988 2989 .. change:: 2990 :tags: orm 2991 :tickets: 1127 2992 2993 Fixed primary key update for many-to-many collections where 2994 the collection had not been loaded yet 2995 2996 .. change:: 2997 :tags: orm 2998 :tickets: 2999 3000 Fixed bug whereby deferred() columns with a group in conjunction 3001 with an otherwise unrelated synonym() would produce 3002 an AttributeError during deferred load. 3003 3004 .. change:: 3005 :tags: orm 3006 :tickets: 1128 3007 3008 The before_flush() hook on SessionExtension takes place before 3009 the list of new/dirty/deleted is calculated for the final 3010 time, allowing routines within before_flush() to further 3011 change the state of the Session before the flush proceeds. 3012 3013 .. change:: 3014 :tags: orm 3015 :tickets: 3016 3017 The "extension" argument to Session and others can now 3018 optionally be a list, supporting events sent to multiple 3019 SessionExtension instances. Session places SessionExtensions 3020 in Session.extensions. 3021 3022 .. change:: 3023 :tags: orm 3024 :tickets: 3025 3026 Reentrant calls to flush() raise an error. This also serves 3027 as a rudimentary, but not foolproof, check against concurrent 3028 calls to Session.flush(). 3029 3030 .. change:: 3031 :tags: orm 3032 :tickets: 3033 3034 Improved the behavior of query.join() when joining to 3035 joined-table inheritance subclasses, using explicit join 3036 criteria (i.e. not on a relation). 3037 3038 .. change:: 3039 :tags: orm 3040 :tickets: 3041 3042 @orm.attributes.reconstitute and 3043 MapperExtension.reconstitute have been renamed to 3044 @orm.reconstructor and MapperExtension.reconstruct_instance 3045 3046 .. change:: 3047 :tags: orm 3048 :tickets: 1129 3049 3050 Fixed @reconstructor hook for subclasses which inherit from a 3051 base class. 3052 3053 .. change:: 3054 :tags: orm 3055 :tickets: 1132 3056 3057 The composite() property type now supports a 3058 __set_composite_values__() method on the composite class which 3059 is required if the class represents state using attribute 3060 names other than the column's keynames; default-generated 3061 values now get populated properly upon flush. Also, 3062 composites with attributes set to None compare correctly. 3063 3064 .. change:: 3065 :tags: orm 3066 :tickets: 3067 3068 The 3-tuple of iterables returned by attributes.get_history() 3069 may now be a mix of lists and tuples. (Previously members 3070 were always lists.) 3071 3072 .. change:: 3073 :tags: orm 3074 :tickets: 1151 3075 3076 Fixed bug whereby changing a primary key attribute on an 3077 entity where the attribute's previous value had been expired 3078 would produce an error upon flush(). 3079 3080 .. change:: 3081 :tags: orm 3082 :tickets: 3083 3084 Fixed custom instrumentation bug whereby get_instance_dict() 3085 was not called for newly constructed instances not loaded 3086 by the ORM. 3087 3088 .. change:: 3089 :tags: orm 3090 :tickets: 1150 3091 3092 Session.delete() adds the given object to the session if 3093 not already present. This was a regression bug from 0.4. 3094 3095 .. change:: 3096 :tags: orm 3097 :tickets: 3098 3099 The `echo_uow` flag on `Session` is deprecated, and unit-of-work 3100 logging is now application-level only, not per-session level. 3101 3102 .. change:: 3103 :tags: orm 3104 :tickets: 1153 3105 3106 Removed conflicting `contains()` operator from 3107 `InstrumentedAttribute` which didn't accept `escape` kwaarg. 3108 3109 .. change:: 3110 :tags: declarative 3111 :tickets: 1161 3112 3113 Fixed bug whereby mapper couldn't initialize if a composite 3114 primary key referenced another table that was not defined 3115 yet. 3116 3117 .. change:: 3118 :tags: declarative 3119 :tickets: 3120 3121 Fixed exception throw which would occur when string-based 3122 primaryjoin condition was used in conjunction with backref. 3123 3124 .. change:: 3125 :tags: schema 3126 :tickets: 1033 3127 3128 Added "sorted_tables" accessor to MetaData, which returns 3129 Table objects sorted in order of dependency as a list. 3130 This deprecates the MetaData.table_iterator() method. 3131 The "reverse=False" keyword argument has also been 3132 removed from util.sort_tables(); use the Python 3133 'reversed' function to reverse the results. 3134 3135 .. change:: 3136 :tags: schema 3137 :tickets: 3138 3139 The 'length' argument to all Numeric types has been renamed 3140 to 'scale'. 'length' is deprecated and is still accepted 3141 with a warning. 3142 3143 .. change:: 3144 :tags: schema 3145 :tickets: 3146 3147 Dropped 0.3-compatibility for user defined types 3148 (convert_result_value, convert_bind_param). 3149 3150 .. change:: 3151 :tags: sql 3152 :tickets: 1068 3153 3154 Temporarily rolled back the "ORDER BY" enhancement from. This feature is on hold pending further 3155 development. 3156 3157 .. change:: 3158 :tags: sql 3159 :tickets: 3160 3161 The exists() construct won't "export" its contained list 3162 of elements as FROM clauses, allowing them to be used more 3163 effectively in the columns clause of a SELECT. 3164 3165 .. change:: 3166 :tags: sql 3167 :tickets: 798 3168 3169 and_() and or_() now generate a ColumnElement, allowing 3170 boolean expressions as result columns, i.e. 3171 select([and_(1, 0)]). 3172 3173 .. change:: 3174 :tags: sql 3175 :tickets: 3176 3177 Bind params now subclass ColumnElement which allows them to be 3178 selectable by orm.query (they already had most ColumnElement 3179 semantics). 3180 3181 .. change:: 3182 :tags: sql 3183 :tickets: 3184 3185 Added select_from() method to exists() construct, which becomes 3186 more and more compatible with a regular select(). 3187 3188 .. change:: 3189 :tags: sql 3190 :tickets: 1160 3191 3192 Added func.min(), func.max(), func.sum() as "generic functions", 3193 which basically allows for their return type to be determined 3194 automatically. Helps with dates on SQLite, decimal types, 3195 others. 3196 3197 .. change:: 3198 :tags: sql 3199 :tickets: 3200 3201 added decimal.Decimal as an "auto-detect" type; bind parameters 3202 and generic functions will set their type to Numeric when a 3203 Decimal is used. 3204 3205 .. change:: 3206 :tags: mysql 3207 :tickets: 3208 3209 The 'length' argument to MSInteger, MSBigInteger, MSTinyInteger, 3210 MSSmallInteger and MSYear has been renamed to 'display_width'. 3211 3212 .. change:: 3213 :tags: mysql 3214 :tickets: 1146 3215 3216 Added MSMediumInteger type. 3217 3218 .. change:: 3219 :tags: mysql 3220 :tickets: 3221 3222 the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without 3223 the parenthesis, which seem to get in the way when using in 3224 conjunction with executemany(). 3225 3226 .. change:: 3227 :tags: oracle 3228 :tickets: 536 3229 3230 limit/offset no longer uses ROW NUMBER OVER to limit rows, 3231 and instead uses subqueries in conjunction with a special 3232 Oracle optimization comment. Allows LIMIT/OFFSET to work 3233 in conjunction with DISTINCT. 3234 3235 .. change:: 3236 :tags: oracle 3237 :tickets: 1155 3238 3239 has_sequence() now takes the current "schema" argument into 3240 account 3241 3242 .. change:: 3243 :tags: oracle 3244 :tickets: 1121 3245 3246 added BFILE to reflected type names 3247 3248.. changelog:: 3249 :version: 0.5.0beta3 3250 :released: Mon Aug 04 2008 3251 3252 .. change:: 3253 :tags: orm 3254 :tickets: 3255 3256 The "entity_name" feature of SQLAlchemy mappers has been 3257 removed. For rationale, see https://tinyurl.com/6nm2ne 3258 3259 .. change:: 3260 :tags: orm 3261 :tickets: 3262 3263 the "autoexpire" flag on Session, sessionmaker(), and 3264 scoped_session() has been renamed to "expire_on_commit". It 3265 does not affect the expiration behavior of rollback(). 3266 3267 .. change:: 3268 :tags: orm 3269 :tickets: 3270 3271 fixed endless loop bug which could occur within a mapper's 3272 deferred load of inherited attributes. 3273 3274 .. change:: 3275 :tags: orm 3276 :tickets: 3277 3278 a legacy-support flag "_enable_transaction_accounting" flag 3279 added to Session which when False, disables all 3280 transaction-level object accounting, including expire on 3281 rollback, expire on commit, new/deleted list maintenance, and 3282 autoflush on begin. 3283 3284 .. change:: 3285 :tags: orm 3286 :tickets: 3287 3288 The 'cascade' parameter to relation() accepts None as a value, 3289 which is equivalent to no cascades. 3290 3291 .. change:: 3292 :tags: orm 3293 :tickets: 3294 3295 A critical fix to dynamic relations allows the "modified" 3296 history to be properly cleared after a flush(). 3297 3298 .. change:: 3299 :tags: orm 3300 :tickets: 3301 3302 user-defined @properties on a class are detected and left in 3303 place during mapper initialization. This means that a 3304 table-bound column of the same name will not be mapped at all 3305 if a @property is in the way (and the column is not remapped 3306 to a different name), nor will an instrumented attribute from 3307 an inherited class be applied. The same rules apply for names 3308 excluded using the include_properties/exclude_properties 3309 collections. 3310 3311 .. change:: 3312 :tags: orm 3313 :tickets: 3314 3315 Added a new SessionExtension hook called after_attach(). This 3316 is called at the point of attachment for objects via add(), 3317 add_all(), delete(), and merge(). 3318 3319 .. change:: 3320 :tags: orm 3321 :tickets: 1111 3322 3323 A mapper which inherits from another, when inheriting the 3324 columns of its inherited mapper, will use any reassigned 3325 property names specified in that inheriting mapper. 3326 Previously, if "Base" had reassigned "base_id" to the name 3327 "id", "SubBase(Base)" would still get an attribute called 3328 "base_id". This could be worked around by explicitly stating 3329 the column in each submapper as well but this is fairly 3330 unworkable and also impossible when using declarative. 3331 3332 .. change:: 3333 :tags: orm 3334 :tickets: 3335 3336 Fixed a series of potential race conditions in Session whereby 3337 asynchronous GC could remove unmodified, no longer referenced 3338 items from the session as they were present in a list of items 3339 to be processed, typically during session.expunge_all() and 3340 dependent methods. 3341 3342 .. change:: 3343 :tags: orm 3344 :tickets: 3345 3346 Some improvements to the _CompileOnAttr mechanism which should 3347 reduce the probability of "Attribute x was not replaced during 3348 compile" warnings. (this generally applies to SQLA hackers, 3349 like Elixir devs). 3350 3351 .. change:: 3352 :tags: orm 3353 :tickets: 3354 3355 Fixed bug whereby the "unsaved, pending instance" FlushError 3356 raised for a pending orphan would not take superclass mappers 3357 into account when generating the list of relations responsible 3358 for the error. 3359 3360 .. change:: 3361 :tags: sql 3362 :tickets: 3363 3364 func.count() with no arguments renders as COUNT(*), equivalent 3365 to func.count(text('*')). 3366 3367 .. change:: 3368 :tags: sql 3369 :tickets: 1068 3370 3371 simple label names in ORDER BY expressions render as 3372 themselves, and not as a re-statement of their corresponding 3373 expression. This feature is currently enabled only for 3374 SQLite, MySQL, and PostgreSQL. It can be enabled on other 3375 dialects as each is shown to support this 3376 behavior. 3377 3378 .. change:: 3379 :tags: ext 3380 :tickets: 3381 3382 Class-bound attributes sent as arguments to relation()'s 3383 remote_side and foreign_keys parameters are now accepted, 3384 allowing them to be used with declarative. Additionally fixed 3385 bugs involving order_by being specified as a class-bound 3386 attribute in conjunction with eager loading. 3387 3388 .. change:: 3389 :tags: ext 3390 :tickets: 3391 3392 declarative initialization of Columns adjusted so that 3393 non-renamed columns initialize in the same way as a non 3394 declarative mapper. This allows an inheriting mapper to set 3395 up its same-named "id" columns in particular such that the 3396 parent "id" column is favored over the child column, reducing 3397 database round trips when this value is requested. 3398 3399 .. change:: 3400 :tags: mysql 3401 :tickets: 1110 3402 3403 Quoting of MSEnum values for use in CREATE TABLE is now 3404 optional & will be quoted on demand as required. (Quoting was 3405 always optional for use with existing tables.) 3406 3407.. changelog:: 3408 :version: 0.5.0beta2 3409 :released: Mon Jul 14 2008 3410 3411 .. change:: 3412 :tags: orm 3413 :tickets: 870 3414 3415 In addition to expired attributes, deferred attributes also 3416 load if their data is present in the result set. 3417 3418 .. change:: 3419 :tags: orm 3420 :tickets: 3421 3422 session.refresh() raises an informative error message if the 3423 list of attributes does not include any column-based 3424 attributes. 3425 3426 .. change:: 3427 :tags: orm 3428 :tickets: 3429 3430 query() raises an informative error message if no columns or 3431 mappers are specified. 3432 3433 .. change:: 3434 :tags: orm 3435 :tickets: 3436 3437 lazy loaders now trigger autoflush before proceeding. This 3438 allows expire() of a collection or scalar relation to function 3439 properly in the context of autoflush. 3440 3441 .. change:: 3442 :tags: orm 3443 :tickets: 887 3444 3445 column_property() attributes which represent SQL expressions 3446 or columns that are not present in the mapped tables (such as 3447 those from views) are automatically expired after an INSERT or 3448 UPDATE, assuming they have not been locally modified, so that 3449 they are refreshed with the most recent data upon access. 3450 3451 .. change:: 3452 :tags: orm 3453 :tickets: 1082 3454 3455 Fixed explicit, self-referential joins between two 3456 joined-table inheritance mappers when using query.join(cls, 3457 aliased=True). 3458 3459 .. change:: 3460 :tags: orm 3461 :tickets: 3462 3463 Fixed query.join() when used in conjunction with a 3464 columns-only clause and a SQL-expression ON clause in the 3465 join. 3466 3467 .. change:: 3468 :tags: orm 3469 :tickets: 3470 3471 The "allow_column_override" flag from mapper() has been 3472 removed. This flag is virtually always misunderstood. Its 3473 specific functionality is available via the 3474 include_properties/exclude_properties mapper arguments. 3475 3476 .. change:: 3477 :tags: orm 3478 :tickets: 1066 3479 3480 Repaired `__str__()` method on Query. 3481 3482 .. change:: 3483 :tags: orm 3484 :tickets: 3485 3486 Session.bind gets used as a default even when table/mapper 3487 specific binds are defined. 3488 3489 .. change:: 3490 :tags: schema 3491 :tickets: 1075 3492 3493 Added prefixes option to `Table` that accepts a list of 3494 strings to insert after CREATE in the CREATE TABLE statement. 3495 3496 .. change:: 3497 :tags: schema 3498 :tickets: 3499 3500 Unicode, UnicodeText types now set "assert_unicode" and 3501 "convert_unicode" by default, but accept overriding 3502 \**kwargs for these values. 3503 3504 .. change:: 3505 :tags: sql 3506 :tickets: 3507 3508 Added new match() operator that performs a full-text search. 3509 Supported on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle 3510 backends. 3511 3512 .. change:: 3513 :tags: sqlite 3514 :tickets: 1090 3515 3516 Modified SQLite's representation of "microseconds" to match 3517 the output of str(somedatetime), i.e. in that the microseconds 3518 are represented as fractional seconds in string format. This 3519 makes SQLA's SQLite date type compatible with datetimes that 3520 were saved directly using Pysqlite (which just calls str()). 3521 Note that this is incompatible with the existing microseconds 3522 values in a SQLA 0.4 generated SQLite database file. 3523 3524 To get the old behavior globally: 3525 3526 from sqlalchemy.databases.sqlite import DateTimeMixin 3527 DateTimeMixin.__legacy_microseconds__ = True 3528 3529 To get the behavior on individual DateTime types: 3530 3531 t = sqlite.SLDateTime() 3532 t.__legacy_microseconds__ = True 3533 3534 Then use "t" as the type on the Column. 3535 3536 .. change:: 3537 :tags: sqlite 3538 :tickets: 3539 3540 SQLite Date, DateTime, and Time types only accept Python 3541 datetime objects now, not strings. If you'd like to format 3542 dates as strings yourself with SQLite, use a String type. If 3543 you'd like them to return datetime objects anyway despite 3544 their accepting strings as input, make a TypeDecorator around 3545 String - SQLA doesn't encourage this pattern. 3546 3547 .. change:: 3548 :tags: extensions 3549 :tickets: 1096 3550 3551 Declarative supports a __table_args__ class variable, which is 3552 either a dictionary, or tuple of the form (arg1, arg2, ..., 3553 {kwarg1:value, ...}) which contains positional + kw arguments 3554 to be passed to the Table constructor. 3555 3556.. changelog:: 3557 :version: 0.5.0beta1 3558 :released: Thu Jun 12 2008 3559 3560 .. change:: 3561 :tags: 3562 :tickets: 3563 3564 The "__init__" trigger/decorator added by mapper now attempts 3565 to exactly mirror the argument signature of the original 3566 __init__. The pass-through for '_sa_session' is no longer 3567 implicit- you must allow for this keyword argument in your 3568 constructor. 3569 3570 .. change:: 3571 :tags: 3572 :tickets: 3573 3574 ClassState is renamed to ClassManager. 3575 3576 .. change:: 3577 :tags: 3578 :tickets: 3579 3580 Classes may supply their own InstrumentationManager by 3581 providing a __sa_instrumentation_manager__ property. 3582 3583 .. change:: 3584 :tags: 3585 :tickets: 3586 3587 Custom instrumentation may use any mechanism to associate a 3588 ClassManager with a class and an InstanceState with an 3589 instance. Attributes on those objects are still the default 3590 association mechanism used by SQLAlchemy's native 3591 instrumentation. 3592 3593 .. change:: 3594 :tags: 3595 :tickets: 3596 3597 Moved entity_name, _sa_session_id, and _instance_key from the 3598 instance object to the instance state. These values are still 3599 available in the old way, which is now deprecated, using 3600 descriptors attached to the class. A deprecation warning will 3601 be issued when accessed. 3602 3603 .. change:: 3604 :tags: 3605 :tickets: 3606 3607 The _prepare_instrumentation alias for prepare_instrumentation 3608 has been removed. 3609 3610 .. change:: 3611 :tags: 3612 :tickets: 3613 3614 sqlalchemy.exceptions has been renamed to sqlalchemy.exc. The 3615 module may be imported under either name. 3616 3617 .. change:: 3618 :tags: 3619 :tickets: 3620 3621 ORM-related exceptions are now defined in sqlalchemy.orm.exc. 3622 ConcurrentModificationError, FlushError, and 3623 UnmappedColumnError compatibility aliases are installed in 3624 sqlalchemy.exc during the import of sqlalchemy.orm. 3625 3626 .. change:: 3627 :tags: 3628 :tickets: 3629 3630 sqlalchemy.logging has been renamed to sqlalchemy.log. 3631 3632 .. change:: 3633 :tags: 3634 :tickets: 3635 3636 The transitional sqlalchemy.log.SADeprecationWarning alias for 3637 the warning's definition in sqlalchemy.exc has been removed. 3638 3639 .. change:: 3640 :tags: 3641 :tickets: 3642 3643 exc.AssertionError has been removed and usage replaced with 3644 Python's built-in AssertionError. 3645 3646 .. change:: 3647 :tags: 3648 :tickets: 3649 3650 The behavior of MapperExtensions attached to multiple, 3651 entity_name= primary mappers for a single class has been 3652 altered. The first mapper() defined for a class is the only 3653 mapper eligible for the MapperExtension 'instrument_class', 3654 'init_instance' and 'init_failed' events. This is backwards 3655 incompatible; previously the extensions of last mapper defined 3656 would receive these events. 3657 3658 .. change:: 3659 :tags: firebird 3660 :tickets: 3661 3662 Added support for returning values from inserts (2.0+ only), 3663 updates and deletes (2.1+ only). 3664 3665 .. change:: 3666 :tags: general 3667 :tickets: 3668 3669 global "propigate"->"propagate" change. 3670 3671 .. change:: 3672 :tags: orm 3673 :tickets: 3674 3675 polymorphic_union() function respects the "key" of each 3676 Column if they differ from the column's name. 3677 3678 .. change:: 3679 :tags: orm 3680 :tickets: 1199 3681 3682 Fixed 0.4-only bug preventing composite columns 3683 from working properly with inheriting mappers 3684 3685 .. change:: 3686 :tags: orm 3687 :tickets: 3688 3689 Fixed RLock-related bug in mapper which could deadlock upon 3690 reentrant mapper compile() calls, something that occurs when 3691 using declarative constructs inside of ForeignKey objects. 3692 Ported from 0.5. 3693 3694 .. change:: 3695 :tags: orm 3696 :tickets: 1213 3697 3698 Fixed bug in composite types which prevented a primary-key 3699 composite type from being mutated. 3700 3701 .. change:: 3702 :tags: orm 3703 :tickets: 976 3704 3705 Added ScopedSession.is_active accessor. 3706 3707 .. change:: 3708 :tags: orm 3709 :tickets: 939 3710 3711 Class-bound accessor can be used as the argument to 3712 relation() order_by. 3713 3714 .. change:: 3715 :tags: orm 3716 :tickets: 1072 3717 3718 Fixed shard_id argument on ShardedSession.execute(). 3719 3720 .. change:: 3721 :tags: sql 3722 :tickets: 1246 3723 3724 Connection.invalidate() checks for closed status 3725 to avoid attribute errors. 3726 3727 .. change:: 3728 :tags: sql 3729 :tickets: 1094 3730 3731 NullPool supports reconnect on failure behavior. 3732 3733 .. change:: 3734 :tags: sql 3735 :tickets: 1299 3736 3737 The per-dialect cache used by TypeEngine to cache 3738 dialect-specific types is now a WeakKeyDictionary. 3739 This to prevent dialect objects from 3740 being referenced forever for an application that 3741 creates an arbitrarily large number of engines 3742 or dialects. There is a small performance penalty 3743 which will be resolved in 0.6. 3744 3745 .. change:: 3746 :tags: sql 3747 :tickets: 3748 3749 Fixed SQLite reflection methods so that non-present 3750 cursor.description, which triggers an auto-cursor 3751 close, will be detected so that no results doesn't 3752 fail on recent versions of pysqlite which raise 3753 an error when fetchone() called with no rows present. 3754 3755 .. change:: 3756 :tags: postgres 3757 :tickets: 714 3758 3759 Added Index reflection support to Postgres, using a 3760 great patch we long neglected, submitted by 3761 Ken Kuhlman. 3762 3763 .. change:: 3764 :tags: mysql 3765 :tickets: 1241 3766 3767 Fixed bug in exception raise when FK columns not present 3768 during reflection. 3769 3770 .. change:: 3771 :tags: oracle 3772 :tickets: 1265 3773 3774 Fixed bug which was preventing out params of certain types 3775 from being received; thanks a ton to huddlej at wwu.edu ! 3776