1 2============= 30.8 Changelog 4============= 5 6.. changelog_imports:: 7 8 .. include:: changelog_07.rst 9 :start-line: 5 10 11.. changelog:: 12 :version: 0.8.7 13 :released: July 22, 2014 14 15 .. change:: 16 :tags: bug, mssql 17 :versions: 1.0.0b1, 0.9.7 18 19 Added statement encoding to the "SET IDENTITY_INSERT" 20 statements which operate when an explicit INSERT is being 21 interjected into an IDENTITY column, to support non-ascii table 22 identifiers on drivers such as pyodbc + unix + py2k that don't 23 support unicode statements. 24 25 .. change:: 26 :tags: bug, mssql 27 :versions: 1.0.0b1, 0.9.7 28 :tickets: 3091 29 30 In the SQL Server pyodbc dialect, repaired the implementation 31 for the ``description_encoding`` dialect parameter, which when 32 not explicitly set was preventing cursor.description from 33 being parsed correctly in the case of result sets that 34 contained names in alternate encodings. This parameter 35 shouldn't be needed going forward. 36 37 .. change:: 38 :tags: bug, sql 39 :versions: 1.0.0b1, 0.9.7 40 :tickets: 3124 41 42 Fixed bug in :class:`.Enum` and other :class:`.SchemaType` 43 subclasses where direct association of the type with a 44 :class:`.MetaData` would lead to a hang when events 45 (like create events) were emitted on the :class:`.MetaData`. 46 47 .. change:: 48 :tags: bug, sql 49 :versions: 1.0.0b1, 0.9.7 50 :tickets: 3102 51 52 Fixed a bug within the custom operator plus :meth:`.TypeEngine.with_variant` 53 system, whereby using a :class:`.TypeDecorator` in conjunction with 54 variant would fail with an MRO error when a comparison operator was used. 55 56 .. change:: 57 :tags: bug, mysql 58 :versions: 1.0.0b1, 0.9.7 59 :tickets: 3101 60 61 MySQL error 2014 "commands out of sync" appears to be raised as a 62 ProgrammingError, not OperationalError, in modern MySQL-Python versions; 63 all MySQL error codes that are tested for "is disconnect" are now 64 checked within OperationalError and ProgrammingError regardless. 65 66 .. change:: 67 :tags: bug, mysql 68 :versions: 1.0.0b1, 0.9.5 69 :tickets: 3085 70 71 Fixed bug where column names added to ``mysql_length`` parameter 72 on an index needed to have the same quoting for quoted names in 73 order to be recognized. The fix makes the quotes optional but 74 also provides the old behavior for backwards compatibility with those 75 using the workaround. 76 77 .. change:: 78 :tags: bug, declarative 79 :versions: 1.0.0b1, 0.9.5 80 :tickets: 3062 81 82 The ``__mapper_args__`` dictionary is copied from a declarative 83 mixin or abstract class when accessed, so that modifications made 84 to this dictionary by declarative itself won't conflict with that 85 of other mappings. The dictionary is modified regarding the 86 ``version_id_col`` and ``polymorphic_on`` arguments, replacing the 87 column within with the one that is officially mapped to the local 88 class/table. 89 90 .. change:: 91 :tags: bug, sql 92 :versions: 0.9.5, 1.0.0b1 93 :tickets: 3044 94 95 Fixed bug in INSERT..FROM SELECT construct where selecting from a 96 UNION would wrap the union in an anonymous (e.g. unlabled) subquery. 97 98 .. change:: 99 :tags: bug, postgresql 100 :versions: 0.9.5, 1.0.0b1 101 :tickets: 3053 102 103 Added the ``hashable=False`` flag to the PG :class:`.HSTORE` type, which 104 is needed to allow the ORM to skip over trying to "hash" an ORM-mapped 105 HSTORE column when requesting it in a mixed column/entity list. 106 Patch courtesy Gunnlaugur Þór Briem. 107 108 .. change:: 109 :tags: bug, orm 110 :versions: 0.9.5, 1.0.0b1 111 :tickets: 3055 112 113 Fixed bug in subquery eager loading where a long chain of 114 eager loads across a polymorphic-subclass boundary in conjunction 115 with polymorphic loading would fail to locate the subclass-link in the 116 chain, erroring out with a missing property name on an 117 :class:`.AliasedClass`. 118 119 .. change:: 120 :tags: bug, ext 121 :versions: 0.9.5, 1.0.0b1 122 :tickets: 3051, 3093 123 124 Fixed bug in mutable extension where :class:`.MutableDict` did not 125 report change events for the ``setdefault()`` dictionary operation. 126 127 .. change:: 128 :tags: bug, ext 129 :versions: 0.9.5, 1.0.0b1 130 :pullreq: bitbucket:24 131 :tickets: 3093, 3051 132 133 Fixed bug where :meth:`.MutableDict.setdefault` didn't return the 134 existing or new value (this bug was not released in any 0.8 version). 135 Pull request courtesy Thomas Hervé. 136 137 .. change:: 138 :tags: bug, mysql 139 :versions: 0.9.5, 1.0.0b1 140 :pullreq: bitbucket:15 141 142 Added support for reflecting tables where an index includes 143 KEY_BLOCK_SIZE using an equal sign. Pull request courtesy 144 Sean McGivern. 145 146 .. change:: 147 :tags: bug, orm 148 :tickets: 3047 149 :versions: 0.9.5, 1.0.0b1 150 151 Fixed ORM bug where the :func:`.class_mapper` function would mask 152 AttributeErrors or KeyErrors that should raise during mapper 153 configuration due to user errors. The catch for attribute/keyerror 154 has been made more specific to not include the configuration step. 155 156 .. change:: 157 :tags: bug, sql 158 :tickets: 3045 159 :versions: 0.9.5, 1.0.0b1 160 161 Fixed bug where :meth:`.Table.update` and :meth:`.Table.delete` 162 would produce an empty WHERE clause when an empty :func:`.and_()` 163 or :func:`.or_()` or other blank expression were applied. This is 164 now consistent with that of :func:`.select`. 165 166 .. change:: 167 :tags: bug, postgresql 168 :pullreq: bitbucket:13 169 :versions: 0.9.5, 1.0.0b1 170 171 Added a new "disconnect" message "connection has been closed unexpectedly". 172 This appears to be related to newer versions of SSL. 173 Pull request courtesy Antti Haapala. 174 175.. changelog:: 176 :version: 0.8.6 177 :released: March 28, 2014 178 179 .. change:: 180 :tags: bug, orm 181 :tickets: 3006 182 :versions: 0.9.4 183 184 Fixed ORM bug where changing the primary key of an object, then marking 185 it for DELETE would fail to target the correct row for DELETE. 186 187 .. change:: 188 :tags: feature, postgresql 189 :versions: 0.9.4 190 191 Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as 192 this seems to be supported as of psycopg2 2.0.9. 193 194 .. change:: 195 :tags: bug, postgresql 196 :tickets: 3000 197 :versions: 0.9.4 198 199 Fixed regression caused by release 0.8.5 / 0.9.3's compatibility 200 enhancements where index reflection on PostgreSQL versions specific 201 to only the 8.1, 8.2 series again 202 broke, surrounding the ever problematic int2vector type. While 203 int2vector supports array operations as of 8.1, apparently it only 204 supports CAST to a varchar as of 8.3. 205 206 .. change:: 207 :tags: bug, orm 208 :tickets: 2995, 209 :versions: 0.9.4 210 211 Fixed regression from 0.8.3 as a result of :ticket:`2818` 212 where :meth:`.Query.exists` wouldn't work on a query that only 213 had a :meth:`.Query.select_from` entry but no other entities. 214 215 .. change:: 216 :tags: bug, general 217 :tickets: 2986 218 :versions: 0.9.4 219 220 Adjusted ``setup.py`` file to support the possible future 221 removal of the ``setuptools.Feature`` extension from setuptools. 222 If this keyword isn't present, the setup will still succeed 223 with setuptools rather than falling back to distutils. C extension 224 building can be disabled now also by setting the 225 DISABLE_SQLALCHEMY_CEXT environment variable. This variable works 226 whether or not setuptools is even available. 227 228 .. change:: 229 :tags: bug, ext 230 :versions: 0.9.4 231 :tickets: 2997 232 233 Fixed bug in mutable extension as well as 234 :func:`.attributes.flag_modified` where the change event would not be 235 propagated if the attribute had been reassigned to itself. 236 237 .. change:: 238 :tags: bug, orm 239 :versions: 0.9.4 240 241 Improved an error message which would occur if a query() were made 242 against a non-selectable, such as a :func:`.literal_column`, and then 243 an attempt was made to use :meth:`.Query.join` such that the "left" 244 side would be determined as ``None`` and then fail. This condition 245 is now detected explicitly. 246 247 .. change:: 248 :tags: bug, sql 249 :versions: 0.9.4 250 :tickets: 2977 251 252 Fixed bug in :func:`.tuple_` construct where the "type" of essentially 253 the first SQL expression would be applied as the "comparison type" 254 to a compared tuple value; this has the effect in some cases of an 255 inappropriate "type coersion" occurring, such as when a tuple that 256 has a mix of String and Binary values improperly coerces target 257 values to Binary even though that's not what they are on the left 258 side. :func:`.tuple_` now expects heterogeneous types within its 259 list of values. 260 261 .. change:: 262 :tags: orm, bug 263 :versions: 0.9.4 264 :tickets: 2975 265 266 Removed stale names from ``sqlalchemy.orm.interfaces.__all__`` and 267 refreshed with current names, so that an ``import *`` from this 268 module again works. 269 270.. changelog:: 271 :version: 0.8.5 272 :released: February 19, 2014 273 274 .. change:: 275 :tags: postgresql, bug 276 :versions: 0.9.3 277 :tickets: 2936 278 279 Added an additional message to psycopg2 disconnect detection, 280 "could not send data to server", which complements the existing 281 "could not receive data from server" and has been observed by users. 282 283 .. change:: 284 :tags: postgresql, bug 285 :versions: 0.9.3 286 287 Support has been improved for PostgreSQL reflection behavior on very old 288 (pre 8.1) versions of PostgreSQL, and potentially other PG engines 289 such as Redshift (assuming Redshift reports the version as < 8.1). 290 The query for "indexes" as well as "primary keys" relies upon inspecting 291 a so-called "int2vector" datatype, which refuses to coerce to an array 292 prior to 8.1 causing failures regarding the "ANY()" operator used 293 in the query. Extensive googling has located the very hacky, but 294 recommended-by-PG-core-developer query to use when PG version < 8.1 295 is in use, so index and primary key constraint reflection now work 296 on these versions. 297 298 299 .. change:: 300 :tags: feature, mysql 301 :versions: 0.9.3 302 :tickets: 2941 303 304 Added new MySQL-specific :class:`.mysql.DATETIME` which includes 305 fractional seconds support; also added fractional seconds support 306 to :class:`.mysql.TIMESTAMP`. DBAPI support is limited, though 307 fractional seconds are known to be supported by MySQL Connector/Python. 308 Patch courtesy Geert JM Vanderkelen. 309 310 .. change:: 311 :tags: bug, mysql 312 :versions: 0.9.3 313 :tickets: 2966 314 :pullreq: bitbucket:12 315 316 Added support for the ``PARTITION BY`` and ``PARTITIONS`` 317 MySQL table keywords, specified as ``mysql_partition_by='value'`` and 318 ``mysql_partitions='value'`` to :class:`.Table`. Pull request 319 courtesy Marcus McCurdy. 320 321 .. change:: 322 :tags: bug, sql 323 :versions: 0.9.3 324 :tickets: 2944 325 326 Fixed bug where calling :meth:`.Insert.values` with an empty list 327 or tuple would raise an IndexError. It now produces an empty 328 insert construct as would be the case with an empty dictionary. 329 330 .. change:: 331 :tags: bug, engine, pool 332 :versions: 0.9.3 333 :tickets: 2880, 2964 334 335 Fixed a critical regression caused by :ticket:`2880` where the newly 336 concurrent ability to return connections from the pool means that the 337 "first_connect" event is now no longer synchronized either, thus leading 338 to dialect mis-configurations under even minimal concurrency situations. 339 340 .. change:: 341 :tags: bug, sqlite 342 :pullreq: github:72 343 344 Restored a change that was missed in the backport of unique 345 constraint reflection to 0.8, where :class:`.UniqueConstraint` 346 with SQLite would fail if reserved keywords were included in the 347 names of columns. Pull request courtesy Roman Podolyaka. 348 349 .. change:: 350 :tags: bug, postgresql 351 :tickets: 2291 352 :versions: 0.9.3 353 354 Revised this very old issue where the PostgreSQL "get primary key" 355 reflection query were updated to take into account primary key constraints 356 that were renamed; the newer query fails on very old versions of 357 PostgreSQL such as version 7, so the old query is restored in those cases 358 when server_version_info < (8, 0) is detected. 359 360 .. change:: 361 :tags: bug, sql 362 :tickets: 2957 363 :versions: 0.9.3 364 365 Fixed bug where :meth:`.in_()` would go into an endless loop if 366 erroneously passed a column expression whose comparator included 367 the ``__getitem__()`` method, such as a column that uses the 368 :class:`.postgresql.ARRAY` type. 369 370 .. change:: 371 :tags: bug, orm 372 :tickets: 2951 373 :versions: 0.9.3 374 375 Fixed bug where :meth:`.Query.get` would fail to consistently 376 raise the :class:`.InvalidRequestError` that invokes when called 377 on a query with existing criterion, when the given identity is 378 already present in the identity map. 379 380 .. change:: 381 :tags: bug, mysql 382 :tickets: 2933 383 :versions: 0.9.3 384 385 Fixed bug which prevented MySQLdb-based dialects (e.g. 386 pymysql) from working in Py3K, where a check for "connection 387 charset" would fail due to Py3K's more strict value comparison 388 rules. The call in question wasn't taking the database 389 version into account in any case as the server version was 390 still None at that point, so the method overall has been 391 simplified to rely upon connection.character_set_name(). 392 393 .. change:: 394 :tags: bug, mysql 395 :pullreq: github:61 396 :versions: 0.9.2 397 398 Some missing methods added to the cymysql dialect, including 399 _get_server_version_info() and _detect_charset(). Pullreq 400 courtesy Hajime Nakagami. 401 402 .. change:: 403 :tags: bug, py3k 404 :pullreq: github:63 405 406 Fixed Py3K bug where a missing import would cause "literal binary" 407 mode to fail to import "util.binary_type" when rendering a bound 408 parameter. 0.9 handles this differently. Pull request courtesy 409 Andreas Zeidler. 410 411 .. change:: 412 :tags: bug, orm 413 :versions: 0.9.2 414 :pullreq: github:58 415 416 Fixed error message when an iterator object is passed to 417 :func:`.class_mapper` or similar, where the error would fail to 418 render on string formatting. Pullreq courtesy Kyle Stark. 419 420 .. change:: 421 :tags: bug, firebird 422 :versions: 0.9.0 423 :tickets: 2897 424 425 The firebird dialect will quote identifiers which begin with an 426 underscore. Courtesy Treeve Jelbert. 427 428 .. change:: 429 :tags: bug, firebird 430 :versions: 0.9.0 431 432 Fixed bug in Firebird index reflection where the columns within the 433 index were not sorted correctly; they are now sorted 434 in order of RDB$FIELD_POSITION. 435 436 .. change:: 437 :tags: bug, mssql, firebird 438 :versions: 0.9.0 439 440 The "asdecimal" flag used with the :class:`.Float` type will now 441 work with Firebird as well as the mssql+pyodbc dialects; previously the 442 decimal conversion was not occurring. 443 444 .. change:: 445 :tags: bug, mssql, pymssql 446 :versions: 0.9.0 447 :pullreq: github:51 448 449 Added "Net-Lib error during Connection reset by peer" message 450 to the list of messages checked for "disconnect" within the 451 pymssql dialect. Courtesy John Anderson. 452 453 .. change:: 454 :tags: bug, sql 455 :versions: 0.9.0 456 :tickets: 2896 457 458 Fixed issue where a primary key column that has a Sequence on it, 459 yet the column is not the "auto increment" column, either because 460 it has a foreign key constraint or ``autoincrement=False`` set, 461 would attempt to fire the Sequence on INSERT for backends that don't 462 support sequences, when presented with an INSERT missing the primary 463 key value. This would take place on non-sequence backends like 464 SQLite, MySQL. 465 466 .. change:: 467 :tags: bug, sql 468 :versions: 0.9.0 469 :tickets: 2895 470 471 Fixed bug with :meth:`.Insert.from_select` method where the order 472 of the given names would not be taken into account when generating 473 the INSERT statement, thus producing a mismatch versus the column 474 names in the given SELECT statement. Also noted that 475 :meth:`.Insert.from_select` implies that Python-side insert defaults 476 cannot be used, since the statement has no VALUES clause. 477 478 .. change:: 479 :tags: enhancement, sql 480 :versions: 0.9.0 481 482 The exception raised when a :class:`.BindParameter` is present 483 in a compiled statement without a value now includes the key name 484 of the bound parameter in the error message. 485 486 .. change:: 487 :tags: bug, orm 488 :versions: 0.9.0 489 :tickets: 2887 490 491 An adjustment to the :func:`.subqueryload` strategy which ensures that 492 the query runs after the loading process has begun; this is so that 493 the subqueryload takes precedence over other loaders that may be 494 hitting the same attribute due to other eager/noload situations 495 at the wrong time. 496 497 .. change:: 498 :tags: bug, orm 499 :versions: 0.9.0 500 :tickets: 2885 501 502 Fixed bug when using joined table inheritance from a table to a 503 select/alias on the base, where the PK columns were also not same 504 named; the persistence system would fail to copy primary key values 505 from the base table to the inherited table upon INSERT. 506 507 .. change:: 508 :tags: bug, orm 509 :versions: 0.9.0 510 :tickets: 2889 511 512 :func:`.composite` will raise an informative error message when the 513 columns/attribute (names) passed don't resolve to a Column or mapped 514 attribute (such as an erroneous tuple); previously raised an unbound 515 local. 516 517 .. change:: 518 :tags: bug, declarative 519 :versions: 0.9.0 520 :tickets: 2888 521 522 Error message when a string arg sent to :func:`.relationship` which 523 doesn't resolve to a class or mapper has been corrected to work 524 the same way as when a non-string arg is received, which indicates 525 the name of the relationship which had the configurational error. 526 527.. changelog:: 528 :version: 0.8.4 529 :released: December 8, 2013 530 531 .. change:: 532 :tags: bug, engine 533 :versions: 0.9.0 534 :tickets: 2881 535 536 A DBAPI that raises an error on ``connect()`` which is not a subclass 537 of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.) 538 will propagate the exception unchanged. Previously, 539 the error handling specific to the ``connect()`` routine would both 540 inappropriately run the exception through the dialect's 541 :meth:`.Dialect.is_disconnect` routine as well as wrap it in 542 a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged 543 in the same way as occurs within the execute process. 544 545 .. change:: 546 :tags: bug, engine, pool 547 :versions: 0.9.0 548 :tickets: 2880 549 550 The :class:`.QueuePool` has been enhanced to not block new connection 551 attempts when an existing connection attempt is blocking. Previously, 552 the production of new connections was serialized within the block 553 that monitored overflow; the overflow counter is now altered within 554 its own critical section outside of the connection process itself. 555 556 .. change:: 557 :tags: bug, engine, pool 558 :versions: 0.9.0 559 :tickets: 2522 560 561 Made a slight adjustment to the logic which waits for a pooled 562 connection to be available, such that for a connection pool 563 with no timeout specified, it will every half a second break out of 564 the wait to check for the so-called "abort" flag, which allows the 565 waiter to break out in case the whole connection pool was dumped; 566 normally the waiter should break out due to a notify_all() but it's 567 possible this notify_all() is missed in very slim cases. 568 This is an extension of logic first introduced in 0.8.0, and the 569 issue has only been observed occasionally in stress tests. 570 571 .. change:: 572 :tags: bug, mssql 573 :versions: 0.9.0 574 :pullreq: bitbucket:7 575 576 Fixed bug introduced in 0.8.0 where the ``DROP INDEX`` 577 statement for an index in MSSQL would render incorrectly if the 578 index were in an alternate schema; the schemaname/tablename 579 would be reversed. The format has been also been revised to 580 match current MSSQL documentation. Courtesy Derek Harland. 581 582 .. change:: 583 :tags: feature, sql 584 :tickets: 1443 585 :versions: 0.9.0b1 586 587 Added support for "unique constraint" reflection, via the 588 :meth:`.Inspector.get_unique_constraints` method. 589 Thanks for Roman Podolyaka for the patch. 590 591 .. change:: 592 :tags: bug, oracle 593 :tickets: 2864 594 :versions: 0.9.0 595 596 Added ORA-02396 "maximum idle time" error code to list of 597 "is disconnect" codes with cx_oracle. 598 599 .. change:: 600 :tags: bug, engine 601 :tickets: 2871 602 :versions: 0.9.0 603 604 Fixed bug where SQL statement would be improperly ASCII-encoded 605 when a pre-DBAPI :class:`.StatementError` were raised within 606 :meth:`.Connection.execute`, causing encoding errors for 607 non-ASCII statements. The stringification now remains within 608 Python unicode thus avoiding encoding errors. 609 610 .. change:: 611 :tags: bug, oracle 612 :tickets: 2870 613 :versions: 0.9.0 614 615 Fixed bug where Oracle ``VARCHAR`` types given with no length 616 (e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR`` 617 or similar. 618 619 .. change:: 620 :tags: bug, ext 621 :tickets: 2869 622 :versions: 0.9.0 623 624 Fixed bug which prevented the ``serializer`` extension from working 625 correctly with table or column names that contain non-ASCII 626 characters. 627 628 .. change:: 629 :tags: bug, orm 630 :tickets: 2818 631 :versions: 0.9.0 632 633 Fixed a regression introduced by :ticket:`2818` where the EXISTS 634 query being generated would produce a "columns being replaced" 635 warning for a statement with two same-named columns, 636 as the internal SELECT wouldn't have use_labels set. 637 638 .. change:: 639 :tags: bug, postgresql 640 :tickets: 2855 641 :versions: 0.9.0 642 643 Fixed bug where index reflection would mis-interpret indkey values 644 when using the pypostgresql adapter, which returns these values 645 as lists vs. psycopg2's return type of string. 646 647.. changelog:: 648 :version: 0.8.3 649 :released: October 26, 2013 650 651 .. change:: 652 :tags: bug, oracle 653 :tickets: 2853 654 :versions: 0.9.0b1 655 656 Fixed bug where Oracle table reflection using synonyms would fail 657 if the synonym and the table were in different remote schemas. 658 Patch to fix courtesy Kyle Derr. 659 660 .. change:: 661 :tags: bug, sql 662 :tickets: 2849 663 :versions: 0.9.0b1 664 665 Fixed bug where :func:`.type_coerce` would not interpret ORM 666 elements with a ``__clause_element__()`` method properly. 667 668 .. change:: 669 :tags: bug, sql 670 :tickets: 2842 671 :versions: 0.9.0b1 672 673 The :class:`.Enum` and :class:`.Boolean` types now bypass 674 any custom (e.g. TypeDecorator) type in use when producing the 675 CHECK constraint for the "non native" type. This so that the custom type 676 isn't involved in the expression within the CHECK, since this 677 expression is against the "impl" value and not the "decorated" value. 678 679 .. change:: 680 :tags: bug, postgresql 681 :tickets: 2844 682 :versions: 0.9.0b1 683 684 Removed a 128-character truncation from the reflection of the 685 server default for a column; this code was original from 686 PG system views which truncated the string for readability. 687 688 .. change:: 689 :tags: bug, mysql 690 :tickets: 2721, 2839 691 :versions: 0.9.0b1 692 693 The change in :ticket:`2721`, which is that the ``deferrable`` keyword 694 of :class:`.ForeignKeyConstraint` is silently ignored on the MySQL 695 backend, will be reverted as of 0.9; this keyword will now render again, raising 696 errors on MySQL as it is not understood - the same behavior will also 697 apply to the ``initially`` keyword. In 0.8, the keywords will remain 698 ignored but a warning is emitted. Additionally, the ``match`` keyword 699 now raises a :exc:`.CompileError` on 0.9 and emits a warning on 0.8; 700 this keyword is not only silently ignored by MySQL but also breaks 701 the ON UPDATE/ON DELETE options. 702 703 To use a :class:`.ForeignKeyConstraint` 704 that does not render or renders differently on MySQL, use a custom 705 compilation option. An example of this usage has been added to the 706 documentation, see :ref:`mysql_foreign_keys`. 707 708 .. change:: 709 :tags: bug, sql 710 :tickets: 2825 711 :versions: 0.9.0b1 712 713 The ``.unique`` flag on :class:`.Index` could be produced as ``None`` 714 if it was generated from a :class:`.Column` that didn't specify ``unique`` 715 (where it defaults to ``None``). The flag will now always be ``True`` or 716 ``False``. 717 718 .. change:: 719 :tags: feature, orm 720 :tickets: 2836 721 :versions: 0.9.0b1 722 723 Added new option to :func:`.relationship` ``distinct_target_key``. 724 This enables the subquery eager loader strategy to apply a DISTINCT 725 to the innermost SELECT subquery, to assist in the case where 726 duplicate rows are generated by the innermost query which corresponds 727 to this relationship (there's not yet a general solution to the issue 728 of dupe rows within subquery eager loading, however, when joins outside 729 of the innermost subquery produce dupes). When the flag 730 is set to ``True``, the DISTINCT is rendered unconditionally, and when 731 it is set to ``None``, DISTINCT is rendered if the innermost relationship 732 targets columns that do not comprise a full primary key. 733 The option defaults to False in 0.8 (e.g. off by default in all cases), 734 None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval 735 for help with this. 736 737 .. seealso:: 738 739 :ref:`change_2836` 740 741 .. change:: 742 :tags: bug, mysql 743 :tickets: 2515 744 :versions: 0.9.0b1 745 746 MySQL-connector dialect now allows options in the create_engine 747 query string to override those defaults set up in the connect, 748 including "buffered" and "raise_on_warnings". 749 750 .. change:: 751 :tags: bug, postgresql 752 :tickets: 2742 753 :versions: 0.9.0b1 754 755 Parenthesis will be applied to a compound SQL expression as 756 rendered in the column list of a CREATE INDEX statement. 757 758 .. change:: 759 :tags: bug, sql 760 :tickets: 2742 761 :versions: 0.9.0b1 762 763 Fixed bug in default compiler plus those of postgresql, mysql, and 764 mssql to ensure that any literal SQL expression values are 765 rendered directly as literals, instead of as bound parameters, 766 within a CREATE INDEX statement. This also changes the rendering 767 scheme for other DDL such as constraints. 768 769 .. change:: 770 :tags: bug, sql 771 :tickets: 2815 772 :versions: 0.9.0b1 773 774 A :func:`.select` that is made to refer to itself in its FROM clause, 775 typically via in-place mutation, will raise an informative error 776 message rather than causing a recursion overflow. 777 778 .. change:: 779 :tags: bug, orm 780 :tickets: 2813 781 :versions: 0.9.0b1 782 783 Fixed bug where using an annotation such as :func:`.remote` or 784 :func:`.foreign` on a :class:`.Column` before association with a parent 785 :class:`.Table` could produce issues related to the parent table not 786 rendering within joins, due to the inherent copy operation performed 787 by an annotation. 788 789 .. change:: 790 :tags: bug, sql 791 :tickets: 2831 792 793 Non-working "schema" argument on :class:`.ForeignKey` is deprecated; 794 raises a warning. Removed in 0.9. 795 796 .. change:: 797 :tags: bug, postgresql 798 :tickets: 2819 799 :versions: 0.9.0b1 800 801 Fixed bug where PostgreSQL version strings that had a prefix preceding 802 the words "PostgreSQL" or "EnterpriseDB" would not parse. 803 Courtesy Scott Schaefer. 804 805 .. change:: 806 :tags: feature, engine 807 :tickets: 2821 808 :versions: 0.9.0b1 809 810 ``repr()`` for the :class:`.URL` of an :class:`.Engine` 811 will now conceal the password using asterisks. 812 Courtesy Gunnlaugur Þór Briem. 813 814 .. change:: 815 :tags: bug, orm 816 :tickets: 2818 817 :versions: 0.9.0b1 818 819 Fixed bug where :meth:`.Query.exists` failed to work correctly 820 without any WHERE criterion. Courtesy Vladimir Magamedov. 821 822 .. change:: 823 :tags: bug, sql 824 :tickets: 2811 825 :versions: 0.9.0b1 826 827 Fixed bug where using the ``column_reflect`` event to change the ``.key`` 828 of the incoming :class:`.Column` would prevent primary key constraints, 829 indexes, and foreign key constraints from being correctly reflected. 830 831 .. change:: 832 :tags: feature 833 :versions: 0.9.0b1 834 835 Added a new flag ``system=True`` to :class:`.Column`, which marks 836 the column as a "system" column which is automatically made present 837 by the database (such as PostgreSQL ``oid`` or ``xmin``). The 838 column will be omitted from the ``CREATE TABLE`` statement but will 839 otherwise be available for querying. In addition, the 840 :class:`.CreateColumn` construct can be appled to a custom 841 compilation rule which allows skipping of columns, by producing 842 a rule that returns ``None``. 843 844 .. change:: 845 :tags: bug, orm 846 :tickets: 2779 847 848 Backported a change from 0.9 whereby the iteration of a hierarchy 849 of mappers used in polymorphic inheritance loads is sorted, 850 which allows the SELECT statements generated for polymorphic queries 851 to have deterministic rendering, which in turn helps with caching 852 schemes that cache on the SQL string itself. 853 854 .. change:: 855 :tags: bug, orm 856 :tickets: 2794 857 :versions: 0.9.0b1 858 859 Fixed a potential issue in an ordered sequence implementation used 860 by the ORM to iterate mapper hierarchies; under the Jython interpreter 861 this implementation wasn't ordered, even though cPython and Pypy 862 maintained ordering. 863 864 .. change:: 865 :tags: bug, examples 866 :versions: 0.9.0b1 867 868 Added "autoincrement=False" to the history table created in the 869 versioning example, as this table shouldn't have autoinc on it 870 in any case, courtesy Patrick Schmid. 871 872 .. change:: 873 :tags: bug, sql 874 :versions: 0.9.0b1 875 876 The :meth:`.ColumnOperators.notin_` operator added in 0.8 now properly 877 produces the negation of the expression "IN" returns 878 when used against an empty collection. 879 880 .. change:: 881 :tags: feature, examples 882 :versions: 0.9.0b1 883 884 Improved the examples in ``examples/generic_associations``, including 885 that ``discriminator_on_association.py`` makes use of single table 886 inheritance do the work with the "discriminator". Also 887 added a true "generic foreign key" example, which works similarly 888 to other popular frameworks in that it uses an open-ended integer 889 to point to any other table, foregoing traditional referential 890 integrity. While we don't recommend this pattern, information wants 891 to be free. 892 893 .. change:: 894 :tags: feature, orm, declarative 895 :versions: 0.9.0b1 896 897 Added a convenience class decorator :func:`.as_declarative`, is 898 a wrapper for :func:`.declarative_base` which allows an existing base 899 class to be applied using a nifty class-decorated approach. 900 901 .. change:: 902 :tags: bug, orm 903 :tickets: 2786 904 :versions: 0.9.0b1 905 906 Fixed bug in ORM-level event registration where the "raw" or 907 "propagate" flags could potentially be mis-configured in some 908 "unmapped base class" configurations. 909 910 .. change:: 911 :tags: bug, orm 912 :tickets: 2778 913 :versions: 0.9.0b1 914 915 A performance fix related to the usage of the :func:`.defer` option 916 when loading mapped entities. The function overhead of applying 917 a per-object deferred callable to an instance at load time was 918 significantly higher than that of just loading the data from the row 919 (note that ``defer()`` is meant to reduce DB/network overhead, not 920 necessarily function call count); the function call overhead is now 921 less than that of loading data from the column in all cases. There 922 is also a reduction in the number of "lazy callable" objects created 923 per load from N (total deferred values in the result) to 1 (total 924 number of deferred cols). 925 926 .. change:: 927 :tags: bug, sqlite 928 :tickets: 2781 929 :versions: 0.9.0b1 930 931 The newly added SQLite DATETIME arguments storage_format and 932 regexp apparently were not fully implemented correctly; while the 933 arguments were accepted, in practice they would have no effect; 934 this has been fixed. 935 936 .. change:: 937 :tags: bug, sql, postgresql 938 :tickets: 2780 939 :versions: 0.9.0b1 940 941 Fixed bug where the expression system relied upon the ``str()`` 942 form of a some expressions when referring to the ``.c`` collection 943 on a ``select()`` construct, but the ``str()`` form isn't available 944 since the element relies on dialect-specific compilation constructs, 945 notably the ``__getitem__()`` operator as used with a PostgreSQL 946 ``ARRAY`` element. The fix also adds a new exception class 947 :exc:`.UnsupportedCompilationError` which is raised in those cases 948 where a compiler is asked to compile something it doesn't know 949 how to. 950 951 .. change:: 952 :tags: bug, engine, oracle 953 :tickets: 2776 954 :versions: 0.9.0b1 955 956 Dialect.initialize() is not called a second time if an :class:`.Engine` 957 is recreated, due to a disconnect error. This fixes a particular 958 issue in the Oracle 8 dialect, but in general the dialect.initialize() 959 phase should only be once per dialect. 960 961 .. change:: 962 :tags: feature, sql 963 :tickets: 722 964 965 Added new method to the :func:`.insert` construct 966 :meth:`.Insert.from_select`. Given a list of columns and 967 a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``. 968 969 .. change:: 970 :tags: feature, sql 971 :versions: 0.9.0b1 972 973 The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs 974 will now interpret ORM entities as target tables to be operated upon, 975 e.g.:: 976 977 from sqlalchemy import insert, update, delete 978 979 ins = insert(SomeMappedClass).values(x=5) 980 981 del_ = delete(SomeMappedClass).where(SomeMappedClass.id == 5) 982 983 upd = update(SomeMappedClass).where(SomeMappedClass.id == 5).values(name='ed') 984 985 .. change:: 986 :tags: bug, orm 987 :tickets: 2773 988 :versions: 0.9.0b1 989 990 Fixed bug whereby attribute history functions would fail 991 when an object we moved from "persistent" to "pending" 992 using the :func:`.make_transient` function, for operations 993 involving collection-based backrefs. 994 995 .. change:: 996 :tags: bug, engine, pool 997 :tickets: 2772 998 :versions: 0.9.0b1 999 1000 Fixed bug where :class:`.QueuePool` would lose the correct 1001 checked out count if an existing pooled connection failed to reconnect 1002 after an invalidate or recycle event. 1003 1004.. changelog:: 1005 :version: 0.8.2 1006 :released: July 3, 2013 1007 1008 .. change:: 1009 :tags: bug, mysql 1010 :tickets: 2768 1011 :versions: 0.9.0b1 1012 1013 Fixed bug when using multi-table UPDATE where a supplemental 1014 table is a SELECT with its own bound parameters, where the positioning 1015 of the bound parameters would be reversed versus the statement 1016 itself when using MySQL's special syntax. 1017 1018 .. change:: 1019 :tags: bug, sqlite 1020 :tickets: 2764 1021 :versions: 0.9.0b1 1022 1023 Added :class:`sqlalchemy.types.BIGINT` to the list of type names that can be 1024 reflected by the SQLite dialect; courtesy Russell Stuart. 1025 1026 .. change:: 1027 :tags: feature, orm, declarative 1028 :tickets: 2761 1029 :versions: 0.9.0b1 1030 1031 ORM descriptors such as hybrid properties can now be referenced 1032 by name in a string argument used with ``order_by``, 1033 ``primaryjoin``, or similar in :func:`.relationship`, 1034 in addition to column-bound attributes. 1035 1036 .. change:: 1037 :tags: feature, firebird 1038 :tickets: 2763 1039 :versions: 0.9.0b1 1040 1041 Added new flag ``retaining=True`` to the kinterbasdb and fdb dialects. 1042 This controls the value of the ``retaining`` flag sent to the 1043 ``commit()`` and ``rollback()`` methods of the DBAPI connection. 1044 Due to historical concerns, this flag defaults to ``True`` in 0.8.2, 1045 however in 0.9.0b1 this flag defaults to ``False``. 1046 1047 .. change:: 1048 :tags: requirements 1049 :versions: 0.9.0b1 1050 1051 The Python `mock <https://pypi.python.org/pypi/mock>`_ library 1052 is now required in order to run the unit test suite. While part 1053 of the standard library as of Python 3.3, previous Python installations 1054 will need to install this in order to run unit tests or to 1055 use the ``sqlalchemy.testing`` package for external dialects. 1056 1057 .. change:: 1058 :tags: bug, orm 1059 :tickets: 2750 1060 :versions: 0.9.0b1 1061 1062 A warning is emitted when trying to flush an object of an inherited 1063 class where the polymorphic discriminator has been assigned 1064 to a value that is invalid for the class. 1065 1066 .. change:: 1067 :tags: bug, postgresql 1068 :tickets: 2740 1069 :versions: 0.9.0b1 1070 1071 The behavior of :func:`.extract` has been simplified on the 1072 PostgreSQL dialect to no longer inject a hardcoded ``::timestamp`` 1073 or similar cast into the given expression, as this interfered 1074 with types such as timezone-aware datetimes, but also 1075 does not appear to be at all necessary with modern versions 1076 of psycopg2. 1077 1078 1079 .. change:: 1080 :tags: bug, firebird 1081 :tickets: 2757 1082 :versions: 0.9.0b1 1083 1084 Type lookup when reflecting the Firebird types LONG and 1085 INT64 has been fixed so that LONG is treated as INTEGER, 1086 INT64 treated as BIGINT, unless the type has a "precision" 1087 in which case it's treated as NUMERIC. Patch courtesy 1088 Russell Stuart. 1089 1090 .. change:: 1091 :tags: bug, postgresql 1092 :tickets: 2766 1093 :versions: 0.9.0b1 1094 1095 Fixed bug in HSTORE type where keys/values that contained 1096 backslashed quotes would not be escaped correctly when 1097 using the "non native" (i.e. non-psycopg2) means 1098 of translating HSTORE data. Patch courtesy Ryan Kelly. 1099 1100 .. change:: 1101 :tags: bug, postgresql 1102 :tickets: 2767 1103 :versions: 0.9.0b1 1104 1105 Fixed bug where the order of columns in a multi-column 1106 PostgreSQL index would be reflected in the wrong order. 1107 Courtesy Roman Podolyaka. 1108 1109 .. change:: 1110 :tags: bug, sql 1111 :tickets: 2746, 2668 1112 :versions: 0.9.0b1 1113 1114 Multiple fixes to the correlation behavior of 1115 :class:`.Select` constructs, first introduced in 0.8.0: 1116 1117 * To satisfy the use case where FROM entries should be 1118 correlated outwards to a SELECT that encloses another, 1119 which then encloses this one, correlation now works 1120 across multiple levels when explicit correlation is 1121 established via :meth:`.Select.correlate`, provided 1122 that the target select is somewhere along the chain 1123 contained by a WHERE/ORDER BY/columns clause, not 1124 just nested FROM clauses. This makes 1125 :meth:`.Select.correlate` act more compatibly to 1126 that of 0.7 again while still maintaining the new 1127 "smart" correlation. 1128 1129 * When explicit correlation is not used, the usual 1130 "implicit" correlation limits its behavior to just 1131 the immediate enclosing SELECT, to maximize compatibility 1132 with 0.7 applications, and also prevents correlation 1133 across nested FROMs in this case, maintaining compatibility 1134 with 0.8.0/0.8.1. 1135 1136 * The :meth:`.Select.correlate_except` method was not 1137 preventing the given FROM clauses from correlation in 1138 all cases, and also would cause FROM clauses to be incorrectly 1139 omitted entirely (more like what 0.7 would do), 1140 this has been fixed. 1141 1142 * Calling `select.correlate_except(None)` will enter 1143 all FROM clauses into correlation as would be expected. 1144 1145 .. change:: 1146 :tags: bug, ext 1147 :versions: 0.9.0b1 1148 1149 Fixed bug whereby if a composite type were set up 1150 with a function instead of a class, the mutable extension 1151 would trip up when it tried to check that column 1152 for being a :class:`.MutableComposite` (which it isn't). 1153 Courtesy asldevi. 1154 1155 .. change:: 1156 :tags: feature, sql 1157 :tickets: 2744, 2734 1158 1159 Provided a new attribute for :class:`.TypeDecorator` 1160 called :attr:`.TypeDecorator.coerce_to_is_types`, 1161 to make it easier to control how comparisons using 1162 ``==`` or ``!=`` to ``None`` and boolean types goes 1163 about producing an ``IS`` expression, or a plain 1164 equality expression with a bound parameter. 1165 1166 .. change:: 1167 :tags: feature, postgresql 1168 :versions: 0.9.0b1 1169 1170 Support for PostgreSQL 9.2 range types has been added. 1171 Currently, no type translation is provided, so works 1172 directly with strings or psycopg2 2.5 range extension types 1173 at the moment. Patch courtesy Chris Withers. 1174 1175 .. change:: 1176 :tags: bug, examples 1177 :versions: 0.9.0b1 1178 1179 Fixed an issue with the "versioning" recipe whereby a many-to-one 1180 reference could produce a meaningless version for the target, 1181 even though it was not changed, when backrefs were present. 1182 Patch courtesy Matt Chisholm. 1183 1184 .. change:: 1185 :tags: feature, postgresql 1186 :tickets: 2072 1187 :versions: 0.9.0b1 1188 1189 Added support for "AUTOCOMMIT" isolation when using the psycopg2 1190 DBAPI. The keyword is available via the ``isolation_level`` 1191 execution option. Patch courtesy Roman Podolyaka. 1192 1193 .. change:: 1194 :tags: bug, orm 1195 :tickets: 2759 1196 :versions: 0.9.0b1 1197 1198 Fixed bug in polymorphic SQL generation where multiple joined-inheritance 1199 entities against the same base class joined to each other as well 1200 would not track columns on the base table independently of each other if 1201 the string of joins were more than two entities long. 1202 1203 .. change:: 1204 :tags: bug, engine 1205 :pullreq: github:6 1206 :versions: 0.9.0b1 1207 1208 Fixed bug where the ``reset_on_return`` argument to various :class:`.Pool` 1209 implementations would not be propagated when the pool was regenerated. 1210 Courtesy Eevee. 1211 1212 .. change:: 1213 :tags: bug, orm 1214 :tickets: 2754 1215 :versions: 0.9.0b1 1216 1217 Fixed bug where sending a composite attribute into :meth:`.Query.order_by` 1218 would produce a parenthesized expression not accepted by some databases. 1219 1220 .. change:: 1221 :tags: bug, orm 1222 :tickets: 2755 1223 :versions: 0.9.0b1 1224 1225 Fixed the interaction between composite attributes and 1226 the :func:`.aliased` function. Previously, composite attributes 1227 wouldn't work correctly in comparison operations when aliasing 1228 was applied. 1229 1230 .. change:: 1231 :tags: bug, mysql 1232 :tickets: 2715 1233 :versions: 0.9.0b1 1234 1235 Added another conditional to the ``mysql+gaerdbms`` dialect to 1236 detect so-called "development" mode, where we should use the 1237 ``rdbms_mysqldb`` DBAPI. Patch courtesy Brett Slatkin. 1238 1239 .. change:: 1240 :tags: feature, mysql 1241 :tickets: 2704 1242 :versions: 0.9.0b1 1243 1244 The ``mysql_length`` parameter used with :class:`.Index` can now 1245 be passed as a dictionary of column names/lengths, for use 1246 with composite indexes. Big thanks to Roman Podolyaka for the 1247 patch. 1248 1249 .. change:: 1250 :tags: bug, mssql 1251 :tickets: 2747 1252 :versions: 0.9.0b1 1253 1254 When querying the information schema on SQL Server 2000, removed 1255 a CAST call that was added in 0.8.1 to help with driver issues, 1256 which apparently is not compatible on 2000. 1257 The CAST remains in place for SQL Server 2005 and greater. 1258 1259 .. change:: 1260 :tags: bug, mysql 1261 :tickets: 2721 1262 :versions: 0.9.0b1 1263 1264 The ``deferrable`` keyword argument on :class:`.ForeignKey` and 1265 :class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword 1266 on the MySQL dialect. For a long time we left this in place because 1267 a non-deferrable foreign key would act very differently than a deferrable 1268 one, but some environments just disable FKs on MySQL, so we'll be less 1269 opinionated here. 1270 1271 .. change:: 1272 :tags: bug, ext, orm 1273 :tickets: 2730 1274 :versions: 0.9.0b1 1275 1276 Fixed bug where :class:`.MutableDict` didn't report a change event 1277 when ``clear()`` was called. 1278 1279 .. change:: 1280 :tags: bug, sql 1281 :tickets: 2738 1282 :versions: 0.9.0b1 1283 1284 Fixed bug whereby joining a select() of a table "A" with multiple 1285 foreign key paths to a table "B", to that table "B", would fail 1286 to produce the "ambiguous join condition" error that would be 1287 reported if you join table "A" directly to "B"; it would instead 1288 produce a join condition with multiple criteria. 1289 1290 .. change:: 1291 :tags: bug, sql, reflection 1292 :tickets: 2728 1293 :versions: 0.9.0b1 1294 1295 Fixed bug whereby using :meth:`.MetaData.reflect` across a remote 1296 schema as well as a local schema could produce wrong results 1297 in the case where both schemas had a table of the same name. 1298 1299 .. change:: 1300 :tags: bug, sql 1301 :tickets: 2726 1302 :versions: 0.9.0b1 1303 1304 Removed the "not implemented" ``__iter__()`` call from the base 1305 :class:`.ColumnOperators` class, while this was introduced 1306 in 0.8.0 to prevent an endless, memory-growing loop when one also 1307 implements a ``__getitem__()`` method on a custom 1308 operator and then calls erroneously ``list()`` on that object, 1309 it had the effect of causing column elements to report that they 1310 were in fact iterable types which then throw an error when you try 1311 to iterate. There's no real way to have both sides here so we 1312 stick with Python best practices. Careful with implementing 1313 ``__getitem__()`` on your custom operators! 1314 1315 .. change:: 1316 :tags: feature, orm 1317 :tickets: 2736 1318 1319 Added a new method :meth:`.Query.select_entity_from` which 1320 will in 0.9 replace part of the functionality of 1321 :meth:`.Query.select_from`. In 0.8, the two methods perform 1322 the same function, so that code can be migrated to use the 1323 :meth:`.Query.select_entity_from` method as appropriate. 1324 See the 0.9 migration guide for details. 1325 1326 .. change:: 1327 :tags: bug, orm 1328 :tickets: 2737 1329 1330 Fixed a regression caused by :ticket:`2682` whereby the 1331 evaluation invoked by :meth:`.Query.update` and :meth:`.Query.delete` 1332 would hit upon unsupported ``True`` and ``False`` symbols 1333 which now appear due to the usage of ``IS``. 1334 1335 .. change:: 1336 :tags: bug, postgresql 1337 :pullreq: github:2 1338 :tickets: 2735 1339 1340 Fixed the HSTORE type to correctly encode/decode for unicode. 1341 This is always on, as the hstore is a textual type, and 1342 matches the behavior of psycopg2 when using Python 3. 1343 Courtesy Dmitry Mugtasimov. 1344 1345 .. change:: 1346 :tags: bug, examples 1347 1348 Fixed a small bug in the dogpile example where the generation 1349 of SQL cache keys wasn't applying deduping labels to the 1350 statement the same way :class:`.Query` normally does. 1351 1352 .. change:: 1353 :tags: bug, engine, sybase 1354 :tickets: 2732 1355 1356 Fixed a bug where the routine to detect the correct kwargs 1357 being sent to :func:`.create_engine` would fail in some cases, 1358 such as with the Sybase dialect. 1359 1360 .. change:: 1361 :tags: bug, orm 1362 :tickets: 2481 1363 1364 Fixed a regression from 0.7 caused by this ticket, which 1365 made the check for recursion overflow in self-referential 1366 eager joining too loose, missing a particular circumstance 1367 where a subclass had lazy="joined" or "subquery" configured 1368 and the load was a "with_polymorphic" against the base. 1369 1370 .. change:: 1371 :tags: bug, orm 1372 :tickets: 2718 1373 1374 Fixed a regression from 0.7 where the contextmanager feature 1375 of :meth:`.Session.begin_nested` would fail to correctly 1376 roll back the transaction when a flush error occurred, instead 1377 raising its own exception while leaving the session still 1378 pending a rollback. 1379 1380 .. change:: 1381 :tags: bug, mysql 1382 1383 Updated mysqlconnector dialect to check for disconnect based 1384 on the apparent string message sent in the exception; tested 1385 against mysqlconnector 1.0.9. 1386 1387 .. change:: 1388 :tags: bug, sql, mssql 1389 :tickets: 2682 1390 1391 Regression from this ticket caused the unsupported keyword 1392 "true" to render, added logic to convert this to 1/0 1393 for SQL server. 1394 1395.. changelog:: 1396 :version: 0.8.1 1397 :released: April 27, 2013 1398 1399 .. change:: 1400 :tags: bug, orm 1401 :tickets: 2698 1402 1403 Fixes to the ``sqlalchemy.ext.serializer`` extension, including 1404 that the "id" passed from the pickler is turned into a string 1405 to prevent against bytes being parsed on Py3K, as well as that 1406 ``relationship()`` and ``orm.join()`` constructs are now properly 1407 serialized. 1408 1409 .. change:: 1410 :tags: bug, orm 1411 :tickets: 2714 1412 1413 A significant improvement to the inner workings of query.join(), 1414 such that the decisionmaking involved on how to join has been 1415 dramatically simplified. New test cases now pass such as 1416 multiple joins extending from the middle of an already complex 1417 series of joins involving inheritance and such. Joining from 1418 deeply nested subquery structures is still complicated and 1419 not without caveats, but with these improvements the edge 1420 cases are hopefully pushed even farther out to the edges. 1421 1422 .. change:: 1423 :tags: feature, orm 1424 :tickets: 2673 1425 1426 Added a convenience method to Query that turns a query into an 1427 EXISTS subquery of the form 1428 ``EXISTS (SELECT 1 FROM ... WHERE ...)``. 1429 1430 .. change:: 1431 :tags: bug, orm 1432 1433 Added a conditional to the unpickling process for ORM 1434 mapped objects, such that if the reference to the object 1435 were lost when the object was pickled, we don't 1436 erroneously try to set up _sa_instance_state - fixes 1437 a NoneType error. 1438 1439 .. change:: 1440 :tags: bug, postgresql 1441 :tickets: 2712 1442 1443 Opened up the checking for "disconnect" with psycopg2/libpq 1444 to check for all the various "disconnect" messages within 1445 the full exception hierarchy. Specifically the 1446 "closed the connection unexpectedly" message has now been 1447 seen in at least three different exception types. 1448 Courtesy Eli Collins. 1449 1450 .. change:: 1451 :tags: bug, sql, mysql 1452 :tickets: 2682 1453 1454 Fully implemented the IS and IS NOT operators with 1455 regards to the True/False constants. An expression like 1456 ``col.is_(True)`` will now render ``col IS true`` 1457 on the target platform, rather than converting the True/ 1458 False constant to an integer bound parameter. 1459 This allows the ``is_()`` operator to work on MySQL when 1460 given True/False constants. 1461 1462 .. change:: 1463 :tags: bug, postgresql 1464 :tickets: 2681 1465 1466 The operators for the PostgreSQL ARRAY type supports 1467 input types of sets, generators, etc. even when 1468 a dimension is not specified, by turning the given 1469 iterable into a collection unconditionally. 1470 1471 .. change:: 1472 :tags: bug, mysql 1473 1474 Fixes to support the latest cymysql DBAPI, courtesy 1475 Hajime Nakagami. 1476 1477 .. change:: 1478 :tags: bug, mysql 1479 :tickets: 2663 1480 1481 Improvements to the operation of the pymysql dialect on 1482 Python 3, including some important decode/bytes steps. 1483 Issues remain with BLOB types due to driver issues. 1484 Courtesy Ben Trofatter. 1485 1486 .. change:: 1487 :tags: bug, orm 1488 :tickets: 2710 1489 1490 Fixed bug where many-to-many relationship with uselist=False 1491 would fail to delete the association row and raise an error 1492 if the scalar attribute were set to None. This was a 1493 regression introduced by the changes for :ticket:`2229`. 1494 1495 .. change:: 1496 :tags: bug, orm 1497 :tickets: 2708 1498 1499 Improved the behavior of instance management regarding 1500 the creation of strong references within the Session; 1501 an object will no longer have an internal reference cycle 1502 created if it's in the transient state or moves into the 1503 detached state - the strong ref is created only when the 1504 object is attached to a Session and is removed when the 1505 object is detached. This makes it somewhat safer for an 1506 object to have a `__del__()` method, even though this is 1507 not recommended, as relationships with backrefs produce 1508 cycles too. A warning has been added when a class with 1509 a `__del__()` method is mapped. 1510 1511 .. change:: 1512 :tags: bug, sql 1513 :tickets: 2702 1514 1515 A major fix to the way in which a select() object produces 1516 labeled columns when apply_labels() is used; this mode 1517 produces a SELECT where each column is labeled as in 1518 <tablename>_<columnname>, to remove column name collisions 1519 for a multiple table select. The fix is that if two labels 1520 collide when combined with the table name, i.e. 1521 "foo.bar_id" and "foo_bar.id", anonymous aliasing will be 1522 applied to one of the dupes. This allows the ORM to handle 1523 both columns independently; previously, 0.7 1524 would in some cases silently emit a second SELECT for the 1525 column that was "duped", and in 0.8 an ambiguous column error 1526 would be emitted. The "keys" applied to the .c. collection 1527 of the select() will also be deduped, so that the "column 1528 being replaced" warning will no longer emit for any select() 1529 that specifies use_labels, though the dupe key will be given 1530 an anonymous label which isn't generally user-friendly. 1531 1532 .. change:: 1533 :tags: bug, mysql 1534 1535 Updated a regexp to correctly extract error code on 1536 google app engine v1.7.5 and newer. Courtesy 1537 Dan Ring. 1538 1539 .. change:: 1540 :tags: bug, examples 1541 1542 Fixed a long-standing bug in the caching example, where 1543 the limit/offset parameter values wouldn't be taken into 1544 account when computing the cache key. The 1545 _key_from_query() function has been simplified to work 1546 directly from the final compiled statement in order to get 1547 at both the full statement as well as the fully processed 1548 parameter list. 1549 1550 .. change:: 1551 :tags: bug, mssql 1552 :tickets: 2355 1553 1554 Part of a longer series of fixes needed for pyodbc+ 1555 mssql, a CAST to NVARCHAR(max) has been added to the bound 1556 parameter for the table name and schema name in all information schema 1557 queries to avoid the issue of comparing NVARCHAR to NTEXT, 1558 which seems to be rejected by the ODBC driver in some cases, 1559 such as FreeTDS (0.91 only?) plus unicode bound parameters being passed. 1560 The issue seems to be specific to the SQL Server information 1561 schema tables and the workaround is harmless for those cases 1562 where the problem doesn't exist in the first place. 1563 1564 .. change:: 1565 :tags: bug, sql 1566 :tickets: 2691 1567 1568 Fixed bug where disconnect detect on error would 1569 raise an attribute error if the error were being 1570 raised after the Connection object had already 1571 been closed. 1572 1573 .. change:: 1574 :tags: bug, sql 1575 :tickets: 2703 1576 1577 Reworked internal exception raises that emit 1578 a rollback() before re-raising, so that the stack 1579 trace is preserved from sys.exc_info() before entering 1580 the rollback. This so that the traceback is preserved 1581 when using coroutine frameworks which may have switched 1582 contexts before the rollback function returns. 1583 1584 .. change:: 1585 :tags: bug, orm 1586 :tickets: 2697 1587 1588 Fixed bug whereby ORM would run the wrong kind of 1589 query when refreshing an inheritance-mapped class 1590 where the superclass was mapped to a non-Table 1591 object, like a custom join() or a select(), 1592 running a query that assumed a hierarchy that's 1593 mapped to individual Table-per-class. 1594 1595 .. change:: 1596 :tags: bug, orm 1597 1598 Fixed `__repr__()` on mapper property constructs 1599 to work before the object is initialized, so 1600 that Sphinx builds with recent Sphinx versions 1601 can read them. 1602 1603 .. change:: 1604 :tags: bug, sql, postgresql 1605 1606 The _Binary base type now converts values through 1607 the bytes() callable when run on Python 3; in particular 1608 psycopg2 2.5 with Python 3.3 seems to now be returning 1609 the "memoryview" type, so this is converted to bytes 1610 before return. 1611 1612 .. change:: 1613 :tags: bug, sql 1614 :tickets: 2695 1615 1616 Improvements to Connection auto-invalidation 1617 handling. If a non-disconnect error occurs, 1618 but leads to a delayed disconnect error within error 1619 handling (happens with MySQL), the disconnect condition 1620 is detected. The Connection can now also be closed 1621 when in an invalid state, meaning it will raise "closed" 1622 on next usage, and additionally the "close with result" 1623 feature will work even if the autorollback in an error 1624 handling routine fails and regardless of whether the 1625 condition is a disconnect or not. 1626 1627 1628 .. change:: 1629 :tags: bug, orm, declarative 1630 :tickets: 2656 1631 1632 Fixed indirect regression regarding :func:`.has_inherited_table`, 1633 where since it considers the current class' ``__table__``, was 1634 sensitive to when it was called. This is 0.7's behavior also, 1635 but in 0.7 things tended to "work out" within events like 1636 ``__mapper_args__()``. :func:`.has_inherited_table` now only 1637 considers superclasses, so should return the same answer 1638 regarding the current class no matter when it's called 1639 (obviously assuming the state of the superclass). 1640 1641 .. change:: 1642 :tags: bug, mssql 1643 1644 Added support for additional "disconnect" messages 1645 to the pymssql dialect. Courtesy John Anderson. 1646 1647 .. change:: 1648 :tags: feature, sql 1649 1650 Loosened the check on dialect-specific argument names 1651 passed to Table(); since we want to support external dialects 1652 and also want to support args without a certain dialect 1653 being installed, it only checks the format of the arg now, 1654 rather than looking for that dialect in sqlalchemy.dialects. 1655 1656 .. change:: 1657 :tags: bug, sql 1658 1659 Fixed bug whereby a DBAPI that can return "0" 1660 for cursor.lastrowid would not function correctly 1661 in conjunction with :attr:`.ResultProxy.inserted_primary_key`. 1662 1663 .. change:: 1664 :tags: bug, mssql 1665 :tickets: 2683 1666 1667 Fixed Py3K bug regarding "binary" types and 1668 pymssql. Courtesy Marc Abramowitz. 1669 1670 .. change:: 1671 :tags: bug, postgresql 1672 :tickets: 2680 1673 1674 Added missing HSTORE type to postgresql type names 1675 so that the type can be reflected. 1676 1677.. changelog:: 1678 :version: 0.8.0 1679 :released: March 9, 2013 1680 1681 .. note:: 1682 1683 There are some new behavioral changes as of 0.8.0 1684 not present in 0.8.0b2. They are present in the 1685 migration document as follows: 1686 1687 * :ref:`legacy_is_orphan_addition` 1688 1689 * :ref:`metadata_create_drop_tables` 1690 1691 * :ref:`correlation_context_specific` 1692 1693 .. change:: 1694 :tags: feature, orm 1695 :tickets: 2675 1696 1697 A meaningful :attr:`.QueryableAttribute.info` attribute is 1698 added, which proxies down to the ``.info`` attribute on either 1699 the :class:`.schema.Column` object if directly present, or 1700 the :class:`.MapperProperty` otherwise. The full behavior 1701 is documented and ensured by tests to remain stable. 1702 1703 .. change:: 1704 :tags: bug, sql 1705 :tickets: 2668 1706 1707 The behavior of SELECT correlation has been improved such that 1708 the :meth:`.Select.correlate` and :meth:`.Select.correlate_except` 1709 methods, as well as their ORM analogues, will still retain 1710 "auto-correlation" behavior in that the FROM clause is modified 1711 only if the output would be legal SQL; that is, the FROM clause 1712 is left intact if the correlated SELECT is not used in the context 1713 of an enclosing SELECT inside of the WHERE, columns, or HAVING clause. 1714 The two methods now only specify conditions to the default 1715 "auto correlation", rather than absolute FROM lists. 1716 1717 .. change:: 1718 :tags: feature, mysql 1719 1720 New dialect for CyMySQL added, courtesy Hajime Nakagami. 1721 1722 .. change:: 1723 :tags: bug, orm 1724 :tickets: 2674 1725 1726 Improved checking for an existing backref name conflict during 1727 mapper configuration; will now test for name conflicts on 1728 superclasses and subclasses, in addition to the current mapper, 1729 as these conflicts break things just as much. This is new for 1730 0.8, but see below for a warning that will also be triggered 1731 in 0.7.11. 1732 1733 .. change:: 1734 :tags: bug, orm 1735 :tickets: 2674 1736 1737 Improved the error message emitted when a "backref loop" is detected, 1738 that is when an attribute event triggers a bidirectional 1739 assignment between two other attributes with no end. 1740 This condition can occur not just when an object of the wrong 1741 type is assigned, but also when an attribute is mis-configured 1742 to backref into an existing backref pair. Also in 0.7.11. 1743 1744 .. change:: 1745 :tags: bug, orm 1746 :tickets: 2674 1747 1748 A warning is emitted when a MapperProperty is assigned to a mapper 1749 that replaces an existing property, if the properties in question 1750 aren't plain column-based properties. Replacement of relationship 1751 properties is rarely (ever?) what is intended and usually refers to a 1752 mapper mis-configuration. Also in 0.7.11. 1753 1754 .. change:: 1755 :tags: feature, orm 1756 1757 Can set/change the "cascade" attribute on a :func:`.relationship` 1758 construct after it's been constructed already. This is not 1759 a pattern for normal use but we like to change the setting 1760 for demonstration purposes in tutorials. 1761 1762 .. change:: 1763 :tags: bug, schema 1764 :tickets: 2664 1765 1766 :meth:`.MetaData.create_all` and :meth:`.MetaData.drop_all` will 1767 now accommodate an empty list as an instruction to not create/drop 1768 any items, rather than ignoring the collection. 1769 1770 1771 .. change:: 1772 :tags: bug, tests 1773 :tickets: 2669 1774 1775 Fixed an import of "logging" in test_execute which was not 1776 working on some linux platforms. Also in 0.7.11. 1777 1778 .. change:: 1779 :tags: bug, orm 1780 :tickets: 2662 1781 1782 A clear error message is emitted if an event handler 1783 attempts to emit SQL on a Session within the after_commit() 1784 handler, where there is not a viable transaction in progress. 1785 1786 .. change:: 1787 :tags: bug, orm 1788 :tickets: 2665 1789 1790 Detection of a primary key change within the process 1791 of cascading a natural primary key update will succeed 1792 even if the key is composite and only some of the 1793 attributes have changed. 1794 1795 .. change:: 1796 :tags: feature, orm 1797 :tickets: 2658 1798 1799 Added new helper function :func:`.was_deleted`, returns True 1800 if the given object was the subject of a :meth:`.Session.delete` 1801 operation. 1802 1803 .. change:: 1804 :tags: bug, orm 1805 :tickets: 2658 1806 1807 An object that's deleted from a session will be de-associated with 1808 that session fully after the transaction is committed, that is 1809 the :func:`.object_session` function will return None. 1810 1811 .. change:: 1812 :tags: bug, oracle 1813 1814 The cx_oracle dialect will no longer run the bind parameter names 1815 through ``encode()``, as this is not valid on Python 3, and prevented 1816 statements from functioning correctly on Python 3. We now 1817 encode only if ``supports_unicode_binds`` is False, which is not 1818 the case for cx_oracle when at least version 5 of cx_oracle is used. 1819 1820 .. change:: 1821 :tags: bug, orm 1822 :tickets: 2661 1823 1824 Fixed bug whereby :meth:`.Query.yield_per` would set the execution 1825 options incorrectly, thereby breaking subsequent usage of the 1826 :meth:`.Query.execution_options` method. Courtesy Ryan Kelly. 1827 1828 .. change:: 1829 :tags: bug, orm 1830 :tickets: 1768 1831 1832 Fixed the consideration of the ``between()`` operator 1833 so that it works correctly with the new relationship local/remote 1834 system. 1835 1836 .. change:: 1837 :tags: bug, sql 1838 :tickets: 2660, 1768 1839 1840 Fixed a bug regarding column annotations which in particular 1841 could impact some usages of the new :func:`.orm.remote` and 1842 :func:`.orm.local` annotation functions, where annotations 1843 could be lost when the column were used in a subsequent 1844 expression. 1845 1846 .. change:: 1847 :tags: bug, mysql, gae 1848 :tickets: 2649 1849 1850 Added a conditional import to the ``gaerdbms`` dialect which attempts 1851 to import rdbms_apiproxy vs. rdbms_googleapi to work 1852 on both dev and production platforms. Also now honors the 1853 ``instance`` attribute. Courtesy Sean Lynch. 1854 Also in 0.7.10. 1855 1856 .. change:: 1857 :tags: bug, sql 1858 :tickets: 2496 1859 1860 The :meth:`.ColumnOperators.in_` operator will now coerce 1861 values of ``None`` to :func:`.null`. 1862 1863 .. change:: 1864 :tags: feature, sql 1865 :tickets: 2657 1866 1867 Added a new argument to :class:`.Enum` and its base 1868 :class:`.SchemaType` ``inherit_schema``. When set to ``True``, 1869 the type will set its ``schema`` attribute of that of the 1870 :class:`.Table` to which it is associated. This also occurs 1871 during a :meth:`.Table.tometadata` operation; the :class:`.SchemaType` 1872 is now copied in all cases when :meth:`.Table.tometadata` happens, 1873 and if ``inherit_schema=True``, the type will take on the new 1874 schema name passed to the method. The ``schema`` is important 1875 when used with the PostgreSQL backend, as the type results in 1876 a ``CREATE TYPE`` statement. 1877 1878 .. change:: 1879 :tags: feature, postgresql 1880 1881 Added :meth:`.postgresql.ARRAY.Comparator.any` and 1882 :meth:`.postgresql.ARRAY.Comparator.all` 1883 methods, as well as standalone expression constructs. Big thanks 1884 to Audrius Kažukauskas for the terrific work here. 1885 1886 .. change:: 1887 :tags: sql, bug 1888 :tickets: 2643 1889 1890 Fixed bug where :meth:`.Table.tometadata` would fail if a 1891 :class:`.Column` had both a foreign key as well as an 1892 alternate ".key" name for the column. Also in 0.7.10. 1893 1894 .. change:: 1895 :tags: sql, bug 1896 :tickets: 2629 1897 1898 insert().returning() raises an informative CompileError if attempted 1899 to compile on a dialect that doesn't support RETURNING. 1900 1901 .. change:: 1902 :tags: orm, bug 1903 :tickets: 2655 1904 1905 the consideration of a pending object as 1906 an "orphan" has been modified to more closely match the 1907 behavior as that of persistent objects, which is that the object 1908 is expunged from the :class:`.Session` as soon as it is 1909 de-associated from any of its orphan-enabled parents. Previously, 1910 the pending object would be expunged only if de-associated 1911 from all of its orphan-enabled parents. The new flag ``legacy_is_orphan`` 1912 is added to :func:`.orm.mapper` which re-establishes the 1913 legacy behavior. 1914 1915 See the change note and example case at :ref:`legacy_is_orphan_addition` 1916 for a detailed discussion of this change. 1917 1918 .. change:: 1919 :tags: orm, bug 1920 :tickets: 2653 1921 1922 Fixed the (most likely never used) "@collection.link" collection 1923 method, which fires off each time the collection is associated 1924 or de-associated with a mapped object - the decorator 1925 was not tested or functional. The decorator method 1926 is now named :meth:`.collection.linker` though the name "link" 1927 remains for backwards compatibility. Courtesy Luca Wehrstedt. 1928 1929 .. change:: 1930 :tags: orm, bug 1931 :tickets: 2654 1932 1933 Made some fixes to the system of producing custom instrumented 1934 collections, mainly that the usage of the @collection decorators 1935 will now honor the __mro__ of the given class, applying the 1936 logic of the sub-most classes' version of a particular collection 1937 method. Previously, it wasn't predictable when subclassing 1938 an existing instrumented class such as :class:`.MappedCollection` 1939 whether or not custom methods would resolve correctly. 1940 1941 .. change:: 1942 :tags: orm, removed 1943 1944 The undocumented (and hopefully unused) system of producing 1945 custom collections using an ``__instrumentation__`` datastructure 1946 associated with the collection has been removed, as this was a complex 1947 and untested feature which was also essentially redundant versus the 1948 decorator approach. Other internal simplifcations to the 1949 orm.collections module have been made as well. 1950 1951 .. change:: 1952 :tags: mssql, feature 1953 1954 Added ``mssql_include`` and ``mssql_clustered`` options to 1955 :class:`.Index`, renders the ``INCLUDE`` and ``CLUSTERED`` keywords, 1956 respectively. Courtesy Derek Harland. 1957 1958 .. change:: 1959 :tags: sql, feature 1960 :tickets: 695 1961 1962 :class:`.Index` now supports arbitrary SQL expressions and/or 1963 functions, in addition to straight columns. Common modifiers 1964 include using ``somecolumn.desc()`` for a descending index and 1965 ``func.lower(somecolumn)`` for a case-insensitive index, depending on the 1966 capabilities of the target backend. 1967 1968 .. change:: 1969 :tags: mssql, bug 1970 :tickets: 2638 1971 1972 Added a py3K conditional around unnecessary .decode() 1973 call in mssql information schema, fixes reflection 1974 in Py3K. Also in 0.7.10. 1975 1976 .. change:: 1977 :tags: orm, bug 1978 :tickets: 2650 1979 1980 Fixed potential memory leak which could occur if an 1981 arbitrary number of :class:`.sessionmaker` objects 1982 were created. The anonymous subclass created by 1983 the sessionmaker, when dereferenced, would not be garbage 1984 collected due to remaining class-level references from the 1985 event package. This issue also applies to any custom system 1986 that made use of ad-hoc subclasses in conjunction with 1987 an event dispatcher. Also in 0.7.10. 1988 1989 .. change:: 1990 :tags: mssql, bug 1991 1992 Fixed a regression whereby the "collation" parameter 1993 of the character types CHAR, NCHAR, etc. stopped working, 1994 as "collation" is now supported by the base string types. 1995 The TEXT, NCHAR, CHAR, VARCHAR types within the 1996 MSSQL dialect are now synonyms for the base types. 1997 1998 .. change:: 1999 :tags: mssql, feature 2000 :tickets: 2644 2001 2002 DDL for IDENTITY columns is now supported on 2003 non-primary key columns, by establishing a 2004 :class:`.Sequence` construct on any 2005 integer column. Courtesy Derek Harland. 2006 2007 .. change:: 2008 :tags: examples, bug 2009 2010 Fixed a regression in the examples/dogpile_caching example 2011 which was due to the change in :ticket:`2614`. 2012 2013 .. change:: 2014 :tags: orm, bug 2015 :tickets: 2640 2016 2017 :meth:`.Query.merge_result` can now load rows from an outer join 2018 where an entity may be ``None`` without throwing an error. 2019 Also in 0.7.10. 2020 2021 .. change:: 2022 :tags: sql, bug 2023 :tickets: 2648 2024 2025 Tweaked the "REQUIRED" symbol used by the compiler to identify 2026 INSERT/UPDATE bound parameters that need to be passed, so that 2027 it's more easily identifiable when writing custom bind-handling 2028 code. 2029 2030 .. change:: 2031 :tags: postgresql, bug 2032 2033 Fixed bug in :class:`~sqlalchemy.dialects.postgresql.array()` construct whereby using it 2034 inside of an :func:`.expression.insert` construct would produce an 2035 error regarding a parameter issue in the ``self_group()`` method. 2036 2037 .. change:: 2038 :tags: orm, feature 2039 2040 Extended the :doc:`/core/inspection` system so that all Python descriptors 2041 associated with the ORM or its extensions can be retrieved. 2042 This fulfills the common request of being able to inspect 2043 all :class:`.QueryableAttribute` descriptors in addition to 2044 extension types such as :class:`.hybrid_property` and 2045 :class:`.AssociationProxy`. See :attr:`.Mapper.all_orm_descriptors`. 2046 2047 .. change:: 2048 :tags: mysql, feature 2049 2050 GAE dialect now accepts username/password arguments in the URL, 2051 courtesy Owen Nelson. 2052 2053 .. change:: 2054 :tags: mysql, bug 2055 2056 GAE dialect won't fail on None match if the error code can't be extracted 2057 from the exception throw; courtesy Owen Nelson. 2058 2059 .. change:: 2060 :tags: orm, bug 2061 :tickets: 2637 2062 2063 Fixes to the "dynamic" loader on :func:`.relationship`, includes 2064 that backrefs will work properly even when autoflush is disabled, 2065 history events are more accurate in scenarios where multiple add/remove 2066 of the same object occurs. 2067 2068.. changelog:: 2069 :version: 0.8.0b2 2070 :released: December 14, 2012 2071 2072 .. change:: 2073 :tags: orm, bug 2074 :tickets: 2635 2075 2076 The :meth:`.Query.select_from` method can now be used with a 2077 :func:`.aliased` construct without it interfering with the entities 2078 being selected. Basically, a statement like this:: 2079 2080 ua = aliased(User) 2081 session.query(User.name).select_from(ua).join(User, User.name > ua.name) 2082 2083 Will maintain the columns clause of the SELECT as coming from the 2084 unaliased "user", as specified; the select_from only takes place in the 2085 FROM clause:: 2086 2087 SELECT users.name AS users_name FROM users AS users_1 2088 JOIN users ON users.name < users_1.name 2089 2090 Note that this behavior is in contrast 2091 to the original, older use case for :meth:`.Query.select_from`, which is that 2092 of restating the mapped entity in terms of a different selectable:: 2093 2094 session.query(User.name).\ 2095 select_from(user_table.select().where(user_table.c.id > 5)) 2096 2097 Which produces:: 2098 2099 SELECT anon_1.name AS anon_1_name FROM (SELECT users.id AS id, 2100 users.name AS name FROM users WHERE users.id > :id_1) AS anon_1 2101 2102 It was the "aliasing" behavior of the latter use case that was 2103 getting in the way of the former use case. The method now 2104 specifically considers a SQL expression like 2105 :func:`.expression.select` or :func:`.expression.alias` 2106 separately from a mapped entity like a :func:`.aliased` 2107 construct. 2108 2109 .. change:: 2110 :tags: sql, bug 2111 :tickets: 2633 2112 2113 Fixed a regression caused by :ticket:`2410` whereby a 2114 :class:`.CheckConstraint` would apply itself back to the 2115 original table during a :meth:`.Table.tometadata` operation, as 2116 it would parse the SQL expression for a parent table. The 2117 operation now copies the given expression to correspond to the 2118 new table. 2119 2120 .. change:: 2121 :tags: oracle, bug 2122 :tickets: 2619 2123 2124 Fixed table reflection for Oracle when accessing a synonym that refers 2125 to a DBLINK remote database; while the syntax has been present in the 2126 Oracle dialect for some time, up until now it has never been tested. 2127 The syntax has been tested against a sample database linking to itself, 2128 however there's still some uncertainty as to what should be used for the 2129 "owner" when querying the remote database for table information. 2130 Currently, the value of "username" from user_db_links is used to 2131 match the "owner". 2132 2133 .. change:: 2134 :tags: orm, feature 2135 :tickets: 2601 2136 2137 Added :meth:`.KeyedTuple._asdict` and :attr:`.KeyedTuple._fields` 2138 to the :class:`.KeyedTuple` class to provide some degree of compatibility 2139 with the Python standard library ``collections.namedtuple()``. 2140 2141 .. change:: 2142 :tags: sql, bug 2143 :tickets: 2610 2144 2145 Fixed bug whereby using a label_length on dialect that was smaller 2146 than the size of actual column identifiers would fail to render 2147 the columns correctly in a SELECT statement. 2148 2149 .. change:: 2150 :tags: sql, feature 2151 :tickets: 2623 2152 2153 The :class:`.Insert` construct now supports multi-valued inserts, 2154 that is, an INSERT that renders like 2155 "INSERT INTO table VALUES (...), (...), ...". 2156 Supported by PostgreSQL, SQLite, and MySQL. 2157 Big thanks to Idan Kamara for doing the legwork on this one. 2158 2159 .. seealso:: 2160 2161 :ref:`feature_2623` 2162 2163 .. change:: 2164 :tags: oracle, bug 2165 :tickets: 2620 2166 2167 The Oracle LONG type, while an unbounded text type, does not appear 2168 to use the cx_Oracle.LOB type when result rows are returned, 2169 so the dialect has been repaired to exclude LONG from 2170 having cx_Oracle.LOB filtering applied. Also in 0.7.10. 2171 2172 .. change:: 2173 :tags: oracle, bug 2174 :tickets: 2611 2175 2176 Repaired the usage of ``.prepare()`` in conjunction with 2177 cx_Oracle so that a return value of ``False`` will result 2178 in no call to ``connection.commit()``, hence avoiding 2179 "no transaction" errors. Two-phase transactions have 2180 now been shown to work in a rudimental fashion with 2181 SQLAlchemy and cx_oracle, however are subject to caveats 2182 observed with the driver; check the documentation 2183 for details. Also in 0.7.10. 2184 2185 .. change:: 2186 :tags: sql, bug 2187 :tickets: 2618 2188 2189 The :class:`~sqlalchemy.types.DECIMAL` type now honors the "precision" and 2190 "scale" arguments when rendering DDL. 2191 2192 .. change:: 2193 :tags: orm, bug 2194 :tickets: 2624 2195 2196 The :class:`.MutableComposite` type did not allow for the 2197 :meth:`.MutableBase.coerce` method to be used, even though 2198 the code seemed to indicate this intent, so this now works 2199 and a brief example is added. As a side-effect, 2200 the mechanics of this event handler have been changed so that 2201 new :class:`.MutableComposite` types no longer add per-type 2202 global event handlers. Also in 0.7.10. 2203 2204 .. change:: 2205 :tags: sql, bug 2206 :tickets: 2621 2207 2208 Made an adjustment to the "boolean", (i.e. ``__nonzero__``) 2209 evaluation of binary expressions, i.e. ``x1 == x2``, such 2210 that the "auto-grouping" applied by :class:`.BinaryExpression` 2211 in some cases won't get in the way of this comparison. 2212 Previously, an expression like:: 2213 2214 expr1 = mycolumn > 2 2215 bool(expr1 == expr1) 2216 2217 Would evaluate as ``False``, even though this is an identity 2218 comparison, because ``mycolumn > 2`` would be "grouped" before 2219 being placed into the :class:`.BinaryExpression`, thus changing 2220 its identity. :class:`.BinaryExpression` now keeps track 2221 of the "original" objects passed in. 2222 Additionally the ``__nonzero__`` method now only returns if 2223 the operator is ``==`` or ``!=`` - all others raise ``TypeError``. 2224 2225 .. change:: 2226 :tags: firebird, bug 2227 :tickets: 2622 2228 2229 Added missing import for "fdb" to the experimental 2230 "firebird+fdb" dialect. 2231 2232 .. change:: 2233 :tags: orm, feature 2234 2235 Allow synonyms to be used when defining primary and secondary 2236 joins for relationships. 2237 2238 .. change:: 2239 :tags: orm, bug 2240 :tickets: 2614 2241 2242 A second overhaul of aliasing/internal pathing mechanics 2243 now allows two subclasses to have different relationships 2244 of the same name, supported with subquery or joined eager 2245 loading on both simultaneously when a full polymorphic 2246 load is used. 2247 2248 .. change:: 2249 :tags: orm, bug 2250 :tickets: 2617 2251 2252 Fixed bug whereby a multi-hop subqueryload within 2253 a particular with_polymorphic load would produce a KeyError. 2254 Takes advantage of the same internal pathing overhaul 2255 as :ticket:`2614`. 2256 2257 .. change:: 2258 :tags: sql, bug 2259 2260 Fixed a gotcha where inadvertently calling list() on a 2261 :class:`.ColumnElement` would go into an endless loop, if 2262 :meth:`.ColumnOperators.__getitem__` were implemented. 2263 A new NotImplementedError is emitted via ``__iter__()``. 2264 2265 .. change:: 2266 :tags: orm, extensions, feature 2267 2268 The :mod:`sqlalchemy.ext.mutable` extension now includes the 2269 example :class:`.MutableDict` class as part of the extension. 2270 2271 .. change:: 2272 :tags: postgresql, feature 2273 :tickets: 2606 2274 2275 :class:`.HSTORE` is now available in the PostgreSQL dialect. 2276 Will also use psycopg2's extensions if available. Courtesy 2277 Audrius Kažukauskas. 2278 2279 .. change:: 2280 :tags: sybase, feature 2281 :tickets: 1753 2282 2283 Reflection support has been added to the Sybase dialect. 2284 Big thanks to Ben Trofatter for all the work developing and 2285 testing this. 2286 2287 .. change:: 2288 :tags: engine, feature 2289 2290 The :meth:`.Connection.connect` and :meth:`.Connection.contextual_connect` 2291 methods now return a "branched" version so that the :meth:`.Connection.close` 2292 method can be called on the returned connection without affecting the 2293 original. Allows symmetry when using :class:`.Engine` and 2294 :class:`.Connection` objects as context managers:: 2295 2296 with conn.connect() as c: # leaves the Connection open 2297 c.execute("...") 2298 2299 with engine.connect() as c: # closes the Connection 2300 c.execute("...") 2301 2302 .. change:: 2303 :tags: engine 2304 2305 The "reflect=True" argument to :class:`~sqlalchemy.schema.MetaData` is deprecated. 2306 Please use the :meth:`.MetaData.reflect` method. 2307 2308 .. change:: 2309 :tags: sql, bug 2310 :tickets: 2603 2311 2312 Fixed bug in type_coerce() whereby typing information 2313 could be lost if the statement were used as a subquery 2314 inside of another statement, as well as other similar 2315 situations. Among other things, would cause 2316 typing information to be lost when the Oracle/mssql dialects 2317 would apply limit/offset wrappings. 2318 2319 .. change:: 2320 :tags: orm, bug 2321 :tickets: 2602 2322 2323 Fixed regression where query.update() would produce 2324 an error if an object matched by the "fetch" 2325 synchronization strategy wasn't locally present. 2326 Courtesy Scott Torborg. 2327 2328 .. change:: 2329 :tags: sql, bug 2330 :tickets: 2597 2331 2332 Fixed bug whereby the ".key" of a Column wasn't being 2333 used when producing a "proxy" of the column against 2334 a selectable. This probably didn't occur in 0.7 2335 since 0.7 doesn't respect the ".key" in a wider 2336 range of scenarios. 2337 2338 .. change:: 2339 :tags: mssql, feature 2340 :tickets: 2600 2341 2342 Support for reflection of the "name" of primary key 2343 constraints added, courtesy Dave Moore. 2344 2345 .. change:: 2346 :tags: informix 2347 2348 Some cruft regarding informix transaction handling has been 2349 removed, including a feature that would skip calling 2350 commit()/rollback() as well as some hardcoded isolation level 2351 assumptions on begin().. The status of this dialect is not 2352 well understood as we don't have any users working with it, 2353 nor any access to an Informix database. If someone with 2354 access to Informix wants to help test this dialect, please 2355 let us know. 2356 2357 .. change:: 2358 :tags: pool, feature 2359 2360 The :class:`.Pool` will now log all connection.close() 2361 operations equally, including closes which occur for 2362 invalidated connections, detached connections, and connections 2363 beyond the pool capacity. 2364 2365 .. change:: 2366 :tags: pool, feature 2367 :tickets: 2611 2368 2369 The :class:`.Pool` now consults the :class:`.Dialect` for 2370 functionality regarding how the connection should be 2371 "auto rolled back", as well as closed. This grants more 2372 control of transaction scope to the dialect, so that we 2373 will be better able to implement transactional workarounds 2374 like those potentially needed for pysqlite and cx_oracle. 2375 2376 .. change:: 2377 :tags: pool, feature 2378 2379 Added new :meth:`.PoolEvents.reset` hook to capture 2380 the event before a connection is auto-rolled back, upon 2381 return to the pool. Together with 2382 :meth:`.ConnectionEvents.rollback` this allows all rollback 2383 events to be intercepted. 2384 2385.. changelog:: 2386 :version: 0.8.0b1 2387 :released: October 30, 2012 2388 2389 .. change:: 2390 :tags: sql, bug 2391 :tickets: 2593 2392 2393 Fixed bug where keyword arguments passed to 2394 :meth:`.Compiler.process` wouldn't get propagated 2395 to the column expressions present in the columns 2396 clause of a SELECT statement. In particular this would 2397 come up when used by custom compilation schemes that 2398 relied upon special flags. 2399 2400 .. change:: 2401 :tags: sql, feature 2402 2403 Added a new method :meth:`.Engine.execution_options` 2404 to :class:`.Engine`. This method works similarly to 2405 :meth:`.Connection.execution_options` in that it creates 2406 a copy of the parent object which will refer to the new 2407 set of options. The method can be used to build 2408 sharding schemes where each engine shares the same 2409 underlying pool of connections. The method 2410 has been tested against the horizontal shard 2411 recipe in the ORM as well. 2412 2413 .. seealso:: 2414 2415 :meth:`.Engine.execution_options` 2416 2417 .. change:: 2418 :tags: sql, orm, bug 2419 :tickets: 2595 2420 2421 The auto-correlation feature of :func:`.select`, and 2422 by proxy that of :class:`.Query`, will not 2423 take effect for a SELECT statement that is being 2424 rendered directly in the FROM list of the enclosing 2425 SELECT. Correlation in SQL only applies to column 2426 expressions such as those in the WHERE, ORDER BY, 2427 columns clause. 2428 2429 .. change:: 2430 :tags: sqlite 2431 :changeset: c3addcc9ffad 2432 2433 Added :class:`.types.NCHAR`, :class:`.types.NVARCHAR` 2434 to the SQLite dialect's list of recognized type names 2435 for reflection. SQLite returns the name given 2436 to a type as the name returned. 2437 2438 .. change:: 2439 :tags: examples 2440 :tickets: 2589 2441 2442 The Beaker caching example has been converted 2443 to use `dogpile.cache <https://dogpilecache.readthedocs.io/>`_. 2444 This is a new caching library written by the same 2445 creator of Beaker's caching internals, and represents a 2446 vastly improved, simplified, and modernized system of caching. 2447 2448 .. seealso:: 2449 2450 :ref:`examples_caching` 2451 2452 .. change:: 2453 :tags: general 2454 :tickets: 2455 2456 SQLAlchemy 0.8 now targets Python 2.5 and 2457 above. Python 2.4 is no longer supported. 2458 2459 .. change:: 2460 :tags: removed, general 2461 :tickets: 2433 2462 2463 The "sqlalchemy.exceptions" 2464 synonym for "sqlalchemy.exc" is removed 2465 fully. 2466 2467 .. change:: 2468 :tags: removed, orm 2469 :tickets: 2442 2470 2471 The legacy "mutable" system of the 2472 ORM, including the MutableType class as well 2473 as the mutable=True flag on PickleType 2474 and postgresql.ARRAY has been removed. 2475 In-place mutations are detected by the ORM 2476 using the sqlalchemy.ext.mutable extension, 2477 introduced in 0.7. The removal of MutableType 2478 and associated constructs removes a great 2479 deal of complexity from SQLAlchemy's internals. 2480 The approach performed poorly as it would incur 2481 a scan of the full contents of the Session 2482 when in use. 2483 2484 .. change:: 2485 :tags: orm, moved 2486 :tickets: 2487 2488 The InstrumentationManager interface 2489 and the entire related system of alternate 2490 class implementation is now moved out 2491 to sqlalchemy.ext.instrumentation. This is 2492 a seldom used system that adds significant 2493 complexity and overhead to the mechanics of 2494 class instrumentation. The new architecture 2495 allows it to remain unused until 2496 InstrumentationManager is actually imported, 2497 at which point it is bootstrapped into 2498 the core. 2499 2500 .. change:: 2501 :tags: orm, feature 2502 :tickets: 1401 2503 2504 Major rewrite of relationship() 2505 internals now allow join conditions which 2506 include columns pointing to themselves 2507 within composite foreign keys. A new 2508 API for very specialized primaryjoin conditions 2509 is added, allowing conditions based on 2510 SQL functions, CAST, etc. to be handled 2511 by placing the annotation functions 2512 remote() and foreign() inline within the 2513 expression when necessary. Previous recipes 2514 using the semi-private _local_remote_pairs 2515 approach can be upgraded to this new 2516 approach. 2517 2518 .. seealso:: 2519 2520 :ref:`feature_relationship_08` 2521 2522 .. change:: 2523 :tags: orm, bug 2524 :tickets: 2527 2525 2526 ORM will perform extra effort to determine 2527 that an FK dependency between two tables is 2528 not significant during flush if the tables 2529 are related via joined inheritance and the FK 2530 dependency is not part of the inherit_condition, 2531 saves the user a use_alter directive. 2532 2533 .. change:: 2534 :tags: orm, feature 2535 :tickets: 2333 2536 2537 New standalone function with_polymorphic() 2538 provides the functionality of query.with_polymorphic() 2539 in a standalone form. It can be applied to any 2540 entity within a query, including as the target 2541 of a join in place of the "of_type()" modifier. 2542 2543 .. change:: 2544 :tags: orm, feature 2545 :tickets: 1106, 2438 2546 2547 The of_type() construct on attributes 2548 now accepts aliased() class constructs as well 2549 as with_polymorphic constructs, and works with 2550 query.join(), any(), has(), and also 2551 eager loaders subqueryload(), joinedload(), 2552 contains_eager() 2553 2554 .. change:: 2555 :tags: orm, feature 2556 :tickets: 2585 2557 2558 Improvements to event listening for 2559 mapped classes allows that unmapped classes 2560 can be specified for instance- and mapper-events. 2561 The established events will be automatically 2562 set up on subclasses of that class when the 2563 propagate=True flag is passed, and the 2564 events will be set up for that class itself 2565 if and when it is ultimately mapped. 2566 2567 .. change:: 2568 :tags: orm, bug 2569 :tickets: 2590 2570 2571 The instrumentation events class_instrument(), 2572 class_uninstrument(), and attribute_instrument() 2573 will now fire off only for descendant classes 2574 of the class assigned to listen(). Previously, 2575 an event listener would be assigned to listen 2576 for all classes in all cases regardless of the 2577 "target" argument passed. 2578 2579 .. change:: 2580 :tags: orm, bug 2581 :tickets: 1900 2582 2583 with_polymorphic() produces JOINs 2584 in the correct order and with correct inheriting 2585 tables in the case of sending multi-level 2586 subclasses in an arbitrary order or with 2587 intermediary classes missing. 2588 2589 .. change:: 2590 :tags: orm, feature 2591 :tickets: 2485 2592 2593 The "deferred declarative 2594 reflection" system has been moved into the 2595 declarative extension itself, using the 2596 new DeferredReflection class. This 2597 class is now tested with both single 2598 and joined table inheritance use cases. 2599 2600 .. change:: 2601 :tags: orm, feature 2602 :tickets: 2208 2603 2604 Added new core function "inspect()", 2605 which serves as a generic gateway to 2606 introspection into mappers, objects, 2607 others. The Mapper and InstanceState 2608 objects have been enhanced with a public 2609 API that allows inspection of mapped 2610 attributes, including filters for column-bound 2611 or relationship-bound properties, inspection 2612 of current object state, history of 2613 attributes, etc. 2614 2615 .. change:: 2616 :tags: orm, feature 2617 :tickets: 2452 2618 2619 Calling rollback() within a 2620 session.begin_nested() will now only expire 2621 those objects that had net changes within the 2622 scope of that transaction, that is objects which 2623 were dirty or were modified on a flush. This 2624 allows the typical use case for begin_nested(), 2625 that of altering a small subset of objects, to 2626 leave in place the data from the larger enclosing 2627 set of objects that weren't modified in 2628 that sub-transaction. 2629 2630 .. change:: 2631 :tags: orm, feature 2632 :tickets: 2372 2633 2634 Added utility feature 2635 Session.enable_relationship_loading(), 2636 supersedes relationship.load_on_pending. 2637 Both features should be avoided, however. 2638 2639 .. change:: 2640 :tags: orm, feature 2641 :tickets: 2642 2643 Added support for .info dictionary argument to 2644 column_property(), relationship(), composite(). 2645 All MapperProperty classes have an auto-creating .info 2646 dict available overall. 2647 2648 .. change:: 2649 :tags: orm, feature 2650 :tickets: 2229 2651 2652 Adding/removing None from a mapped collection 2653 now generates attribute events. Previously, a None 2654 append would be ignored in some cases. Related 2655 to. 2656 2657 .. change:: 2658 :tags: orm, feature 2659 :tickets: 2229 2660 2661 The presence of None in a mapped collection 2662 now raises an error during flush. Previously, 2663 None values in collections would be silently ignored. 2664 2665 .. change:: 2666 :tags: orm, feature 2667 :tickets: 2668 2669 The Query.update() method is now 2670 more lenient as to the table 2671 being updated. Plain Table objects are better 2672 supported now, and additional a joined-inheritance 2673 subclass may be used with update(); the subclass 2674 table will be the target of the update, 2675 and if the parent table is referenced in the 2676 WHERE clause, the compiler will call upon 2677 UPDATE..FROM syntax as allowed by the dialect 2678 to satisfy the WHERE clause. MySQL's multi-table 2679 update feature is also supported if columns 2680 are specified by object in the "values" dicitionary. 2681 PG's DELETE..USING is also not available 2682 in Core yet. 2683 2684 .. change:: 2685 :tags: orm, feature 2686 :tickets: 2687 2688 New session events after_transaction_create 2689 and after_transaction_end 2690 allows tracking of new SessionTransaction objects. 2691 If the object is inspected, can be used to determine 2692 when a session first becomes active and when 2693 it deactivates. 2694 2695 .. change:: 2696 :tags: orm, feature 2697 :tickets: 2592 2698 2699 The Query can now load entity/scalar-mixed 2700 "tuple" rows that contain 2701 types which aren't hashable, by setting the flag 2702 "hashable=False" on the corresponding TypeEngine object 2703 in use. Custom types that return unhashable types 2704 (typically lists) can set this flag to False. 2705 2706 .. change:: 2707 :tags: orm, bug 2708 :tickets: 2481 2709 2710 Improvements to joined/subquery eager 2711 loading dealing with chains of subclass entities 2712 sharing a common base, with no specific "join depth" 2713 provided. Will chain out to 2714 each subclass mapper individually before detecting 2715 a "cycle", rather than considering the base class 2716 to be the source of the "cycle". 2717 2718 .. change:: 2719 :tags: orm, bug 2720 :tickets: 2320 2721 2722 The "passive" flag on Session.is_modified() 2723 no longer has any effect. is_modified() in 2724 all cases looks only at local in-memory 2725 modified flags and will not emit any 2726 SQL or invoke loader callables/initializers. 2727 2728 .. change:: 2729 :tags: orm, bug 2730 :tickets: 2405 2731 2732 The warning emitted when using 2733 delete-orphan cascade with one-to-many 2734 or many-to-many without single-parent=True 2735 is now an error. The ORM 2736 would fail to function subsequent to this 2737 warning in any case. 2738 2739 .. change:: 2740 :tags: orm, bug 2741 :tickets: 2350 2742 2743 Lazy loads emitted within flush events 2744 such as before_flush(), before_update(), 2745 etc. will now function as they would 2746 within non-event code, regarding consideration 2747 of the PK/FK values used in the lazy-emitted 2748 query. Previously, 2749 special flags would be established that 2750 would cause lazy loads to load related items 2751 based on the "previous" value of the 2752 parent PK/FK values specifically when called 2753 upon within a flush; the signal to load 2754 in this way is now localized to where the 2755 unit of work actually needs to load that 2756 way. Note that the UOW does 2757 sometimes load these collections before 2758 the before_update() event is called, 2759 so the usage of "passive_updates" or not 2760 can affect whether or not a collection will 2761 represent the "old" or "new" data, when 2762 accessed within a flush event, based 2763 on when the lazy load was emitted. 2764 The change is backwards incompatible in 2765 the exceedingly small chance that 2766 user event code depended on the old 2767 behavior. 2768 2769 .. change:: 2770 :tags: orm, feature 2771 :tickets: 2179 2772 2773 Query now "auto correlates" by 2774 default in the same way as select() does. 2775 Previously, a Query used as a subquery 2776 in another would require the correlate() 2777 method be called explicitly in order to 2778 correlate a table on the inside to the 2779 outside. As always, correlate(None) 2780 disables correlation. 2781 2782 .. change:: 2783 :tags: orm, feature 2784 :tickets: 2464 2785 2786 The after_attach event is now 2787 emitted after the object is established 2788 in Session.new or Session.identity_map 2789 upon Session.add(), Session.merge(), 2790 etc., so that the object is represented 2791 in these collections when the event 2792 is called. Added before_attach 2793 event to accommodate use cases that 2794 need autoflush w pre-attached object. 2795 2796 .. change:: 2797 :tags: orm, feature 2798 :tickets: 2799 2800 The Session will produce warnings 2801 when unsupported methods are used inside the 2802 "execute" portion of the flush. These are 2803 the familiar methods add(), delete(), etc. 2804 as well as collection and related-object 2805 manipulations, as called within mapper-level 2806 flush events 2807 like after_insert(), after_update(), etc. 2808 It's been prominently documented for a long 2809 time that SQLAlchemy cannot guarantee 2810 results when the Session is manipulated within 2811 the execution of the flush plan, 2812 however users are still doing it, so now 2813 there's a warning. Maybe someday the Session 2814 will be enhanced to support these operations 2815 inside of the flush, but for now, results 2816 can't be guaranteed. 2817 2818 .. change:: 2819 :tags: orm, bug 2820 :tickets: 2582, 2566 2821 2822 Continuing regarding extra 2823 state post-flush due to event listeners; 2824 any states that are marked as "dirty" from an 2825 attribute perspective, usually via column-attribute 2826 set events within after_insert(), after_update(), 2827 etc., will get the "history" flag reset 2828 in all cases, instead of only those instances 2829 that were part of the flush. This has the effect 2830 that this "dirty" state doesn't carry over 2831 after the flush and won't result in UPDATE 2832 statements. A warning is emitted to this 2833 effect; the set_committed_state() 2834 method can be used to assign attributes on objects 2835 without producing history events. 2836 2837 .. change:: 2838 :tags: orm, feature 2839 :tickets: 2245 2840 2841 ORM entities can be passed 2842 to the core select() construct as well 2843 as to the select_from(), 2844 correlate(), and correlate_except() 2845 methods of select(), where they will be unwrapped 2846 into selectables. 2847 2848 .. change:: 2849 :tags: orm, feature 2850 :tickets: 2245 2851 2852 Some support for auto-rendering of a 2853 relationship join condition based on the mapped 2854 attribute, with usage of core SQL constructs. 2855 E.g. select([SomeClass]).where(SomeClass.somerelationship) 2856 would render SELECT from "someclass" and use the 2857 primaryjoin of "somerelationship" as the WHERE 2858 clause. This changes the previous meaning 2859 of "SomeClass.somerelationship" when used in a 2860 core SQL context; previously, it would "resolve" 2861 to the parent selectable, which wasn't generally 2862 useful. Also works with query.filter(). 2863 Related to. 2864 2865 .. change:: 2866 :tags: orm, feature 2867 :tickets: 2526 2868 2869 The registry of classes 2870 in declarative_base() is now a 2871 WeakValueDictionary. So subclasses of 2872 "Base" that are dereferenced will be 2873 garbage collected, *if they are not 2874 referred to by any other mappers/superclass 2875 mappers*. See the next note for this ticket. 2876 2877 .. change:: 2878 :tags: orm, feature 2879 :tickets: 2472 2880 2881 Conflicts between columns on 2882 single-inheritance declarative subclasses, 2883 with or without using a mixin, can be resolved 2884 using a new @declared_attr usage described 2885 in the documentation. 2886 2887 .. change:: 2888 :tags: orm, feature 2889 :tickets: 2472 2890 2891 declared_attr can now be used 2892 on non-mixin classes, even though this is generally 2893 only useful for single-inheritance subclass 2894 column conflict resolution. 2895 2896 .. change:: 2897 :tags: orm, feature 2898 :tickets: 2517 2899 2900 declared_attr can now be used with 2901 attributes that are not Column or MapperProperty; 2902 including any user-defined value as well 2903 as association proxy objects. 2904 2905 .. change:: 2906 :tags: orm, bug 2907 :tickets: 2565 2908 2909 Fixed a disconnect that slowly evolved 2910 between a @declared_attr Column and a 2911 directly-defined Column on a mixin. In both 2912 cases, the Column will be applied to the 2913 declared class' table, but not to that of a 2914 joined inheritance subclass. Previously, 2915 the directly-defined Column would be placed 2916 on both the base and the sub table, which isn't 2917 typically what's desired. 2918 2919 .. change:: 2920 :tags: orm, feature 2921 :tickets: 2526 2922 2923 *Very limited* support for 2924 inheriting mappers to be GC'ed when the 2925 class itself is deferenced. The mapper 2926 must not have its own table (i.e. 2927 single table inh only) without polymorphic 2928 attributes in place. 2929 This allows for the use case of 2930 creating a temporary subclass of a declarative 2931 mapped class, with no table or mapping 2932 directives of its own, to be garbage collected 2933 when dereferenced by a unit test. 2934 2935 .. change:: 2936 :tags: orm, feature 2937 :tickets: 2338 2938 2939 Declarative now maintains a registry 2940 of classes by string name as well as by full 2941 module-qualified name. Multiple classes with the 2942 same name can now be looked up based on a module-qualified 2943 string within relationship(). Simple class name 2944 lookups where more than one class shares the same 2945 name now raises an informative error message. 2946 2947 .. change:: 2948 :tags: orm, feature 2949 :tickets: 2535 2950 2951 Can now provide class-bound attributes 2952 that override columns which are of any 2953 non-ORM type, not just descriptors. 2954 2955 .. change:: 2956 :tags: orm, feature 2957 :tickets: 1729 2958 2959 Added with_labels and 2960 reduce_columns keyword arguments to 2961 Query.subquery(), to provide two alternate 2962 strategies for producing queries with uniquely- 2963 named columns. . 2964 2965 .. change:: 2966 :tags: orm, feature 2967 :tickets: 2476 2968 2969 A warning is emitted when a reference 2970 to an instrumented collection is no longer 2971 associated with the parent class due to 2972 expiration/attribute refresh/collection 2973 replacement, but an append 2974 or remove operation is received on the 2975 now-detached collection. 2976 2977 .. change:: 2978 :tags: orm, bug 2979 :tickets: 2549 2980 2981 Declarative can now propagate a column 2982 declared on a single-table inheritance subclass 2983 up to the parent class' table, when the parent 2984 class is itself mapped to a join() or select() 2985 statement, directly or via joined inheritance, 2986 and not just a Table. 2987 2988 .. change:: 2989 :tags: orm, bug 2990 :tickets: 2991 2992 An error is emitted when uselist=False 2993 is combined with a "dynamic" loader. 2994 This is a warning in 0.7.9. 2995 2996 .. change:: 2997 :tags: removed, orm 2998 :tickets: 2999 3000 Deprecated identifiers removed: 3001 3002 * allow_null_pks mapper() argument 3003 (use allow_partial_pks) 3004 3005 * _get_col_to_prop() mapper method 3006 (use get_property_by_column()) 3007 3008 * dont_load argument to Session.merge() 3009 (use load=True) 3010 3011 * sqlalchemy.orm.shard module 3012 (use sqlalchemy.ext.horizontal_shard) 3013 3014 .. change:: 3015 :tags: engine, feature 3016 :tickets: 2511 3017 3018 Connection event listeners can 3019 now be associated with individual 3020 Connection objects, not just Engine 3021 objects. 3022 3023 .. change:: 3024 :tags: engine, feature 3025 :tickets: 2459 3026 3027 The before_cursor_execute event 3028 fires off for so-called "_cursor_execute" 3029 events, which are usually special-case 3030 executions of primary-key bound sequences 3031 and default-generation SQL 3032 phrases that invoke separately when RETURNING 3033 is not used with INSERT. 3034 3035 .. change:: 3036 :tags: engine, feature 3037 :tickets: 3038 3039 The libraries used by the test suite 3040 have been moved around a bit so that they are 3041 part of the SQLAlchemy install again. In addition, 3042 a new suite of tests is present in the 3043 new sqlalchemy.testing.suite package. This is 3044 an under-development system that hopes to provide 3045 a universal testing suite for external dialects. 3046 Dialects which are maintained outside of SQLAlchemy 3047 can use the new test fixture as the framework 3048 for their own tests, and will get for free a 3049 "compliance" suite of dialect-focused tests, 3050 including an improved "requirements" system 3051 where specific capabilities and features can 3052 be enabled or disabled for testing. 3053 3054 .. change:: 3055 :tags: engine, bug 3056 :tickets: 3057 3058 The Inspector.get_table_names() 3059 order_by="foreign_key" feature now sorts 3060 tables by dependee first, to be consistent 3061 with util.sort_tables and metadata.sorted_tables. 3062 3063 .. change:: 3064 :tags: engine, bug 3065 :tickets: 2522 3066 3067 Fixed bug whereby if a database restart 3068 affected multiple connections, each 3069 connection would individually invoke a new 3070 disposal of the pool, even though only 3071 one disposal is needed. 3072 3073 .. change:: 3074 :tags: engine, feature 3075 :tickets: 2462 3076 3077 Added a new system 3078 for registration of new dialects in-process 3079 without using an entrypoint. See the 3080 docs for "Registering New Dialects". 3081 3082 .. change:: 3083 :tags: engine, feature 3084 :tickets: 2556 3085 3086 The "required" flag is set to 3087 True by default, if not passed explicitly, 3088 on bindparam() if the "value" or "callable" 3089 parameters are not passed. 3090 This will cause statement execution to check 3091 for the parameter being present in the final 3092 collection of bound parameters, rather than 3093 implicitly assigning None. 3094 3095 .. change:: 3096 :tags: engine, feature 3097 :tickets: 3098 3099 Various API tweaks to the "dialect" 3100 API to better support highly specialized 3101 systems such as the Akiban database, including 3102 more hooks to allow an execution context to 3103 access type processors. 3104 3105 .. change:: 3106 :tags: engine, bug 3107 :tickets: 2397 3108 3109 The names of the columns on the 3110 .c. attribute of a select().apply_labels() 3111 is now based on <tablename>_<colkey> instead 3112 of <tablename>_<colname>, for those columns 3113 that have a distinctly named .key. 3114 3115 .. change:: 3116 :tags: engine, feature 3117 :tickets: 2422 3118 3119 Inspector.get_primary_keys() is 3120 deprecated; use Inspector.get_pk_constraint(). 3121 Courtesy Diana Clarke. 3122 3123 .. change:: 3124 :tags: engine, bug 3125 :tickets: 3126 3127 The autoload_replace flag on Table, 3128 when False, will cause any reflected foreign key 3129 constraints which refer to already-declared 3130 columns to be skipped, assuming that the 3131 in-Python declared column will take over 3132 the task of specifying in-Python ForeignKey 3133 or ForeignKeyConstraint declarations. 3134 3135 .. change:: 3136 :tags: engine, bug 3137 :tickets: 2498 3138 3139 The ResultProxy methods inserted_primary_key, 3140 last_updated_params(), last_inserted_params(), 3141 postfetch_cols(), prefetch_cols() all 3142 assert that the given statement is a compiled 3143 construct, and is an insert() or update() 3144 statement as is appropriate, else 3145 raise InvalidRequestError. 3146 3147 .. change:: 3148 :tags: engine, feature 3149 :tickets: 3150 3151 New C extension module "utils" has 3152 been added for additional function speedups 3153 as we have time to implement. 3154 3155 .. change:: 3156 :tags: engine 3157 :tickets: 3158 3159 ResultProxy.last_inserted_ids is removed, 3160 replaced by inserted_primary_key. 3161 3162 .. change:: 3163 :tags: feature, sql 3164 :tickets: 2547 3165 3166 Major rework of operator system 3167 in Core, to allow redefinition of existing 3168 operators as well as addition of new operators 3169 at the type level. New types can be created 3170 from existing ones which add or redefine 3171 operations that are exported out to column 3172 expressions, in a similar manner to how the 3173 ORM has allowed comparator_factory. The new 3174 architecture moves this capability into the 3175 Core so that it is consistently usable in 3176 all cases, propagating cleanly using existing 3177 type propagation behavior. 3178 3179 .. change:: 3180 :tags: feature, sql 3181 :tickets: 1534, 2547 3182 3183 To complement, types 3184 can now provide "bind expressions" and 3185 "column expressions" which allow compile-time 3186 injection of SQL expressions into statements 3187 on a per-column or per-bind level. This is 3188 to suit the use case of a type which needs 3189 to augment bind- and result- behavior at the 3190 SQL level, as opposed to in the Python level. 3191 Allows for schemes like transparent encryption/ 3192 decryption, usage of PostGIS functions, etc. 3193 3194 .. change:: 3195 :tags: feature, sql 3196 :tickets: 3197 3198 The Core oeprator system now includes 3199 the `getitem` operator, i.e. the bracket 3200 operator in Python. This is used at first 3201 to provide index and slice behavior to the 3202 PostgreSQL ARRAY type, and also provides a hook 3203 for end-user definition of custom __getitem__ 3204 schemes which can be applied at the type 3205 level as well as within ORM-level custom 3206 operator schemes. `lshift` (<<) 3207 and `rshift` (>>) are also supported as 3208 optional operators. 3209 3210 Note that this change has the effect that 3211 descriptor-based __getitem__ schemes used by 3212 the ORM in conjunction with synonym() or other 3213 "descriptor-wrapped" schemes will need 3214 to start using a custom comparator in order 3215 to maintain this behavior. 3216 3217 .. change:: 3218 :tags: feature, sql 3219 :tickets: 2537 3220 3221 Revised the rules used to determine 3222 the operator precedence for the user-defined 3223 operator, i.e. that granted using the ``op()`` 3224 method. Previously, the smallest precedence 3225 was applied in all cases, now the default 3226 precedence is zero, lower than all operators 3227 except "comma" (such as, used in the argument 3228 list of a ``func`` call) and "AS", and is 3229 also customizable via the "precedence" argument 3230 on the ``op()`` method. 3231 3232 .. change:: 3233 :tags: feature, sql 3234 :tickets: 2276 3235 3236 Added "collation" parameter to all 3237 String types. When present, renders as 3238 COLLATE <collation>. This to support the 3239 COLLATE keyword now supported by several 3240 databases including MySQL, SQLite, and PostgreSQL. 3241 3242 .. change:: 3243 :tags: change, sql 3244 :tickets: 3245 3246 The Text() type renders the length 3247 given to it, if a length was specified. 3248 3249 .. change:: 3250 :tags: feature, sql 3251 :tickets: 3252 3253 Custom unary operators can now be 3254 used by combining operators.custom_op() with 3255 UnaryExpression(). 3256 3257 .. change:: 3258 :tags: bug, sql 3259 :tickets: 2564 3260 3261 A tweak to column precedence which moves the 3262 "concat" and "match" operators to be the same as 3263 that of "is", "like", and others; this helps with 3264 parenthesization rendering when used in conjunction 3265 with "IS". 3266 3267 .. change:: 3268 :tags: feature, sql 3269 :tickets: 3270 3271 Enhanced GenericFunction and func.* 3272 to allow for user-defined GenericFunction 3273 subclasses to be available via the func.* 3274 namespace automatically by classname, 3275 optionally using a package name, as well 3276 as with the ability to have the rendered 3277 name different from the identified name 3278 in func.*. 3279 3280 .. change:: 3281 :tags: feature, sql 3282 :tickets: 2562 3283 3284 The cast() and extract() constructs 3285 will now be produced via the func.* accessor 3286 as well, as users naturally try to access these 3287 names from func.* they might as well do 3288 what's expected, even though the returned 3289 object is not a FunctionElement. 3290 3291 .. change:: 3292 :tags: changed, sql 3293 :tickets: 3294 3295 Most classes in expression.sql 3296 are no longer preceded with an underscore, 3297 i.e. Label, SelectBase, Generative, CompareMixin. 3298 _BindParamClause is also renamed to 3299 BindParameter. The old underscore names for 3300 these classes will remain available as synonyms 3301 for the foreseeable future. 3302 3303 .. change:: 3304 :tags: feature, sql 3305 :tickets: 2208 3306 3307 The Inspector object can now be 3308 acquired using the new inspect() service, 3309 part of 3310 3311 .. change:: 3312 :tags: feature, sql 3313 :tickets: 2418 3314 3315 The column_reflect event now 3316 accepts the Inspector object as the first 3317 argument, preceding "table". Code which 3318 uses the 0.7 version of this very new 3319 event will need modification to add the 3320 "inspector" object as the first argument. 3321 3322 .. change:: 3323 :tags: feature, sql 3324 :tickets: 2423 3325 3326 The behavior of column targeting 3327 in result sets is now case sensitive by 3328 default. SQLAlchemy for many years would 3329 run a case-insensitive conversion on these values, 3330 probably to alleviate early case sensitivity 3331 issues with dialects like Oracle and 3332 Firebird. These issues have been more cleanly 3333 solved in more modern versions so the performance 3334 hit of calling lower() on identifiers is removed. 3335 The case insensitive comparisons can be re-enabled 3336 by setting "case_insensitive=False" on 3337 create_engine(). 3338 3339 .. change:: 3340 :tags: bug, sql 3341 :tickets: 2591 3342 3343 Applying a column expression to a select 3344 statement using a label with or without other 3345 modifying constructs will no longer "target" that 3346 expression to the underlying Column; this affects 3347 ORM operations that rely upon Column targeting 3348 in order to retrieve results. That is, a query 3349 like query(User.id, User.id.label('foo')) will now 3350 track the value of each "User.id" expression separately 3351 instead of munging them together. It is not expected 3352 that any users will be impacted by this; however, 3353 a usage that uses select() in conjunction with 3354 query.from_statement() and attempts to load fully 3355 composed ORM entities may not function as expected 3356 if the select() named Column objects with arbitrary 3357 .label() names, as these will no longer target to 3358 the Column objects mapped by that entity. 3359 3360 .. change:: 3361 :tags: feature, sql 3362 :tickets: 2415 3363 3364 The "unconsumed column names" warning emitted 3365 when keys are present in insert.values() or update.values() 3366 that aren't in the target table is now an exception. 3367 3368 .. change:: 3369 :tags: feature, sql 3370 :tickets: 2502 3371 3372 Added "MATCH" clause to ForeignKey, 3373 ForeignKeyConstraint, courtesy Ryan Kelly. 3374 3375 .. change:: 3376 :tags: feature, sql 3377 :tickets: 2507 3378 3379 Added support for DELETE and UPDATE from 3380 an alias of a table, which would assumedly 3381 be related to itself elsewhere in the query, 3382 courtesy Ryan Kelly. 3383 3384 .. change:: 3385 :tags: feature, sql 3386 :tickets: 3387 3388 select() features a correlate_except() 3389 method, auto correlates all selectables except those 3390 passed. 3391 3392 .. change:: 3393 :tags: feature, sql 3394 :tickets: 2431 3395 3396 The prefix_with() method is now available 3397 on each of select(), insert(), update(), delete(), 3398 all with the same API, accepting multiple 3399 prefix calls, as well as a "dialect name" so that 3400 the prefix can be limited to one kind of dialect. 3401 3402 .. change:: 3403 :tags: feature, sql 3404 :tickets: 1729 3405 3406 Added reduce_columns() method 3407 to select() construct, replaces columns inline 3408 using the util.reduce_columns utility function 3409 to remove equivalent columns. reduce_columns() 3410 also adds "with_only_synonyms" to limit the 3411 reduction just to those columns which have the same 3412 name. The deprecated fold_equivalents() feature is 3413 removed. 3414 3415 .. change:: 3416 :tags: feature, sql 3417 :tickets: 2470 3418 3419 Reworked the startswith(), endswith(), 3420 contains() operators to do a better job with 3421 negation (NOT LIKE), and also to assemble them 3422 at compilation time so that their rendered SQL 3423 can be altered, such as in the case for Firebird 3424 STARTING WITH 3425 3426 .. change:: 3427 :tags: feature, sql 3428 :tickets: 2463 3429 3430 Added a hook to the system of rendering 3431 CREATE TABLE that provides access to the render for each 3432 Column individually, by constructing a @compiles 3433 function against the new schema.CreateColumn 3434 construct. 3435 3436 .. change:: 3437 :tags: feature, sql 3438 :tickets: 3439 3440 "scalar" selects now have a WHERE method 3441 to help with generative building. Also slight adjustment 3442 regarding how SS "correlates" columns; the new methodology 3443 no longer applies meaning to the underlying 3444 Table column being selected. This improves 3445 some fairly esoteric situations, and the logic 3446 that was there didn't seem to have any purpose. 3447 3448 .. change:: 3449 :tags: bug, sql 3450 :tickets: 2520 3451 3452 Fixes to the interpretation of the 3453 Column "default" parameter as a callable 3454 to not pass ExecutionContext into a keyword 3455 argument parameter. 3456 3457 .. change:: 3458 :tags: bug, sql 3459 :tickets: 2410 3460 3461 All of UniqueConstraint, ForeignKeyConstraint, 3462 CheckConstraint, and PrimaryKeyConstraint will 3463 attach themselves to their parent table automatically 3464 when they refer to a Table-bound Column object directly 3465 (i.e. not just string column name), and refer to 3466 one and only one Table. Prior to 0.8 this behavior 3467 occurred for UniqueConstraint and PrimaryKeyConstraint, 3468 but not ForeignKeyConstraint or CheckConstraint. 3469 3470 .. change:: 3471 :tags: bug, sql 3472 :tickets: 2594 3473 3474 TypeDecorator now includes a generic repr() 3475 that works in terms of the "impl" type by default. 3476 This is a behavioral change for those TypeDecorator 3477 classes that specify a custom __init__ method; those 3478 types will need to re-define __repr__() if they need 3479 __repr__() to provide a faithful constructor representation. 3480 3481 .. change:: 3482 :tags: bug, sql 3483 :tickets: 2168 3484 3485 column.label(None) now produces an 3486 anonymous label, instead of returning the 3487 column object itself, consistent with the behavior 3488 of label(column, None). 3489 3490 .. change:: 3491 :tags: feature, sql 3492 :tickets: 2455 3493 3494 An explicit error is raised when 3495 a ForeignKeyConstraint() that was 3496 constructed to refer to multiple remote tables 3497 is first used. 3498 3499 .. change:: 3500 :tags: access, feature 3501 :tickets: 3502 3503 the MS Access dialect has been 3504 moved to its own project on Bitbucket, 3505 taking advantage of the new SQLAlchemy 3506 dialect compliance suite. The dialect is 3507 still in very rough shape and probably not 3508 ready for general use yet, however 3509 it does have *extremely* rudimental 3510 functionality now. 3511 https://bitbucket.org/zzzeek/sqlalchemy-access 3512 3513 .. change:: 3514 :tags: maxdb, moved 3515 :tickets: 3516 3517 The MaxDB dialect, which hasn't been 3518 functional for several years, is 3519 moved out to a pending bitbucket project, 3520 https://bitbucket.org/zzzeek/sqlalchemy-maxdb. 3521 3522 .. change:: 3523 :tags: sqlite, feature 3524 :tickets: 2363 3525 3526 the SQLite date and time types 3527 have been overhauled to support a more open 3528 ended format for input and output, using 3529 name based format strings and regexps. A 3530 new argument "microseconds" also provides 3531 the option to omit the "microseconds" 3532 portion of timestamps. Thanks to 3533 Nathan Wright for the work and tests on 3534 this. 3535 3536 .. change:: 3537 :tags: mssql, feature 3538 :tickets: 3539 3540 SQL Server dialect can be given 3541 database-qualified schema names, 3542 i.e. "schema='mydatabase.dbo'"; reflection 3543 operations will detect this, split the schema 3544 among the "." to get the owner separately, 3545 and emit a "USE mydatabase" statement before 3546 reflecting targets within the "dbo" owner; 3547 the existing database returned from 3548 DB_NAME() is then restored. 3549 3550 .. change:: 3551 :tags: mssql, bug 3552 :tickets: 2277 3553 3554 removed legacy behavior whereby 3555 a column comparison to a scalar SELECT via 3556 == would coerce to an IN with the SQL server 3557 dialect. This is implicit 3558 behavior which fails in other scenarios 3559 so is removed. Code which relies on this 3560 needs to be modified to use column.in_(select) 3561 explicitly. 3562 3563 .. change:: 3564 :tags: mssql, feature 3565 :tickets: 3566 3567 updated support for the mxodbc 3568 driver; mxodbc 3.2.1 is recommended for full 3569 compatibility. 3570 3571 .. change:: 3572 :tags: postgresql, feature 3573 :tickets: 2441 3574 3575 postgresql.ARRAY features an optional 3576 "dimension" argument, will assign a specific 3577 number of dimensions to the array which will 3578 render in DDL as ARRAY[][]..., also improves 3579 performance of bind/result processing. 3580 3581 .. change:: 3582 :tags: postgresql, feature 3583 :tickets: 3584 3585 postgresql.ARRAY now supports 3586 indexing and slicing. The Python [] operator 3587 is available on all SQL expressions that are 3588 of type ARRAY; integer or simple slices can be 3589 passed. The slices can also be used on the 3590 assignment side in the SET clause of an UPDATE 3591 statement by passing them into Update.values(); 3592 see the docs for examples. 3593 3594 .. change:: 3595 :tags: postgresql, feature 3596 :tickets: 3597 3598 Added new "array literal" construct 3599 postgresql.array(). Basically a "tuple" that 3600 renders as ARRAY[1,2,3]. 3601 3602 .. change:: 3603 :tags: postgresql, feature 3604 :tickets: 2506 3605 3606 Added support for the PostgreSQL ONLY 3607 keyword, which can appear corresponding to a 3608 table in a SELECT, UPDATE, or DELETE statement. 3609 The phrase is established using with_hint(). 3610 Courtesy Ryan Kelly 3611 3612 .. change:: 3613 :tags: postgresql, feature 3614 :tickets: 3615 3616 The "ischema_names" dictionary of the 3617 PostgreSQL dialect is "unofficially" customizable. 3618 Meaning, new types such as PostGIS types can 3619 be added into this dictionary, and the PG type 3620 reflection code should be able to handle simple 3621 types with variable numbers of arguments. 3622 The functionality here is "unofficial" for 3623 three reasons: 3624 3625 1. this is not an "official" API. Ideally 3626 an "official" API would allow custom type-handling 3627 callables at the dialect or global level 3628 in a generic way. 3629 2. This is only implemented for the PG dialect, 3630 in particular because PG has broad support 3631 for custom types vs. other database backends. 3632 A real API would be implemented at the 3633 default dialect level. 3634 3. The reflection code here is only tested against 3635 simple types and probably has issues with more 3636 compositional types. 3637 3638 patch courtesy Éric Lemoine. 3639 3640 .. change:: 3641 :tags: firebird, feature 3642 :tickets: 2470 3643 3644 The "startswith()" operator renders 3645 as "STARTING WITH", "~startswith()" renders 3646 as "NOT STARTING WITH", using FB's more efficient 3647 operator. 3648 3649 .. change:: 3650 :tags: firebird, bug 3651 :tickets: 2505 3652 3653 CompileError is raised when VARCHAR with 3654 no length is attempted to be emitted, same 3655 way as MySQL. 3656 3657 .. change:: 3658 :tags: firebird, bug 3659 :tickets: 3660 3661 Firebird now uses strict "ansi bind rules" 3662 so that bound parameters don't render in the 3663 columns clause of a statement - they render 3664 literally instead. 3665 3666 .. change:: 3667 :tags: firebird, bug 3668 :tickets: 3669 3670 Support for passing datetime as date when 3671 using the DateTime type with Firebird; other 3672 dialects support this. 3673 3674 .. change:: 3675 :tags: firebird, feature 3676 :tickets: 2504 3677 3678 An experimental dialect for the fdb 3679 driver is added, but is untested as I cannot 3680 get the fdb package to build. 3681 3682 .. change:: 3683 :tags: bug, mysql 3684 :tickets: 2404 3685 3686 Dialect no longer emits expensive server 3687 collations query, as well as server casing, 3688 on first connect. These functions are still 3689 available as semi-private. 3690 3691 .. change:: 3692 :tags: feature, mysql 3693 :tickets: 2534 3694 3695 Added TIME type to mysql dialect, 3696 accepts "fst" argument which is the new 3697 "fractional seconds" specifier for recent 3698 MySQL versions. The datatype will interpret 3699 a microseconds portion received from the driver, 3700 however note that at this time most/all MySQL 3701 DBAPIs do not support returning this value. 3702 3703 .. change:: 3704 :tags: oracle, bug 3705 :tickets: 2437 3706 3707 Quoting information is now passed along 3708 from a Column with quote=True when generating 3709 a same-named bound parameter to the bindparam() 3710 object, as is the case in generated INSERT and UPDATE 3711 statements, so that unknown reserved names can 3712 be fully supported. 3713 3714 .. change:: 3715 :tags: oracle, feature 3716 :tickets: 2561 3717 3718 The types of columns excluded from the 3719 setinputsizes() set can be customized by sending 3720 a list of string DBAPI type names to exclude, 3721 using the exclude_setinputsizes dialect parameter. 3722 This list was previously fixed. The list also 3723 now defaults to STRING, UNICODE, removing 3724 CLOB, NCLOB from the list. 3725 3726 .. change:: 3727 :tags: oracle, bug 3728 :tickets: 3729 3730 The CreateIndex construct in Oracle 3731 will now schema-qualify the name of the index 3732 to be that of the parent table. Previously this 3733 name was omitted which apparently creates the 3734 index in the default schema, rather than that 3735 of the table. 3736 3737 .. change:: 3738 :tags: sql, feature 3739 :tickets: 2580 3740 3741 Added :meth:`.ColumnOperators.notin_`, 3742 :meth:`.ColumnOperators.notlike`, 3743 :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`. 3744 3745 .. change:: 3746 :tags: sql, removed 3747 3748 The long-deprecated and non-functional ``assert_unicode`` flag on 3749 :func:`.create_engine` as well as :class:`.String` is removed. 3750