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