<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> 1.0 Changelog — SQLAlchemy 1.2 Documentation </title> <!-- begin iterate through site-imported + sphinx environment css_files --> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/docs.css" type="text/css" /> <link rel="stylesheet" href="../_static/changelog.css" type="text/css" /> <link rel="stylesheet" href="../_static/sphinx_paramlinks.css" type="text/css" /> <!-- end iterate through site-imported + sphinx environment css_files --> <!-- begin layout.mako headers --> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="top" title="SQLAlchemy 1.2 Documentation" href="../index.html" /> <link rel="up" title="Changes and Migration" href="index.html" /> <link rel="next" title="0.9 Changelog" href="changelog_09.html" /> <link rel="prev" title="1.1 Changelog" href="changelog_11.html" /> <!-- end layout.mako headers --> </head> <body> <div id="docs-container"> <div id="docs-top-navigation-container" class="body-background"> <div id="docs-header"> <div id="docs-version-header"> Release: <span class="version-num">1.2.19</span> | Release Date: April 15, 2019 </div> <h1>SQLAlchemy 1.2 Documentation</h1> </div> </div> <div id="docs-body-container"> <div id="fixed-sidebar" class="withsidebar"> <div id="docs-sidebar-popout"> <h3><a href="../index.html">SQLAlchemy 1.2 Documentation</a></h3> <p id="sidebar-topnav"> <a href="../contents.html">Contents</a> | <a href="../genindex.html">Index</a> </p> <div id="sidebar-search"> <form class="search" action="../search.html" method="get"> <label> Search terms: <input type="text" placeholder="search..." name="q" size="12" /> </label> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div id="docs-sidebar"> <div id="sidebar-banner"> </div> <div id="docs-sidebar-inner"> <h3> <a href="index.html" title="Changes and Migration">Changes and Migration</a> </h3> <ul> <li><span class="link-container"><a class="reference external" href="migration_12.html">What’s New in SQLAlchemy 1.2?</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_12.html">1.2 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_11.html">1.1 Changelog</a></span></li> <li class="selected"><span class="link-container"><strong>1.0 Changelog</strong><a class="paramlink headerlink reference internal" href="#">¶</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.19">1.0.19</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.19-oracle">oracle</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.18">1.0.18</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.18-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.18-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.17">1.0.17</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.17-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.17-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.16">1.0.16</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.16-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.16-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.16-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.15">1.0.15</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.15-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.15-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.15-mysql">mysql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.15-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.14">1.0.14</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.14-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.14-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.14-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.14-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.14-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13">1.0.13</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.13-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12">1.0.12</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.12-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.11">1.0.11</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.11-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.11-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.11-mysql">mysql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.11-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10">1.0.10</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-orm-declarative">orm declarative</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-mysql">mysql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.10-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.9">1.0.9</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.9-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.9-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.9-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.9-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.9-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.8">1.0.8</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.8-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.8-sqlite">sqlite</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.8-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.7">1.0.7</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.7-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.7-orm-declarative">orm declarative</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.7-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.7-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.7-schema">schema</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.6">1.0.6</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.6-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.6-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.6-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.6-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.6-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5">1.0.5</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.5-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.4">1.0.4</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.4-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.4-schema">schema</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.4-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.3">1.0.3</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.3-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.3-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.3-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.3-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.2">1.0.2</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.2-orm-declarative">orm declarative</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.2-sql">sql</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.1">1.0.1</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.1-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.1-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.1-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.1-sqlite">sqlite</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.1-firebird">firebird</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0">1.0.0</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0-misc">misc</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b5">1.0.0b5</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b5-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b5-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b5-postgresql">postgresql</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b4">1.0.0b4</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b4-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b4-schema">schema</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b4-mysql">mysql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b4-mssql">mssql</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b3">1.0.0b3</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b3-mysql">mysql</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b2">1.0.0b2</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b2-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b2-orm-declarative">orm declarative</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b2-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b2-mysql">mysql</a></span></li> </ul> </li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1">1.0.0b1</a></span><ul> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-general">general</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-orm">orm</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-orm-declarative">orm declarative</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-engine">engine</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-sql">sql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-schema">schema</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-postgresql">postgresql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-mysql">mysql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-sqlite">sqlite</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-mssql">mssql</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-oracle">oracle</a></span></li> <li><span class="link-container"><a class="reference external" href="#change-1.0.0b1-misc">misc</a></span></li> </ul> </li> </ul> </li> <li><span class="link-container"><a class="reference external" href="changelog_09.html">0.9 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_08.html">0.8 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_07.html">0.7 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_06.html">0.6 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_05.html">0.5 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_04.html">0.4 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_03.html">0.3 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_02.html">0.2 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="changelog_01.html">0.1 Changelog</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_11.html">What’s New in SQLAlchemy 1.1?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_10.html">What’s New in SQLAlchemy 1.0?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_09.html">What’s New in SQLAlchemy 0.9?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_08.html">What’s New in SQLAlchemy 0.8?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_07.html">What’s New in SQLAlchemy 0.7?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_06.html">What’s New in SQLAlchemy 0.6?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_05.html">What’s new in SQLAlchemy 0.5?</a></span></li> <li><span class="link-container"><a class="reference external" href="migration_04.html">What’s new in SQLAlchemy 0.4?</a></span></li> </ul> </div> </div> </div> <div id="docs-body" class="withsidebar" > <div class="section" id="changelog"> <h1>1.0 Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h1> <div class="section" id="change-1.0.19"> <h2>1.0.19<a class="headerlink" href="#change-1.0.19" title="Permalink to this headline">¶</a></h2> Released: August 3, 2017<div class="section" id="change-1.0.19-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.19-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.19-0"><span class="target" id="change-ec8fd72ca0ab2d0123169536543fb6cd"><strong>[oracle] [bug] [performance] [py2k] </strong></span><p>Fixed performance regression caused by the fix for <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3937">#3937</a> where cx_Oracle as of version 5.3 dropped the <code class="docutils literal notranslate"><span class="pre">.UNICODE</span></code> symbol from its namespace, which was interpreted as cx_Oracle’s “WITH_UNICODE” mode being turned on unconditionally, which invokes functions on the SQLAlchemy side which convert all strings to unicode unconditionally and causing a performance impact. In fact, per cx_Oracle’s author the “WITH_UNICODE” mode has been removed entirely as of 5.1, so the expensive unicode conversion functions are no longer necessary and are disabled if cx_Oracle 5.1 or greater is detected under Python 2. The warning against “WITH_UNICODE” mode that was removed under <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3937">#3937</a> is also restored.</p> <a class="changeset-link headerlink reference internal" href="#change-ec8fd72ca0ab2d0123169536543fb6cd">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/4035">#4035</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.18"> <h2>1.0.18<a class="headerlink" href="#change-1.0.18" title="Permalink to this headline">¶</a></h2> Released: July 24, 2017<div class="section" id="change-1.0.18-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.18-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.18-0"><span class="target" id="change-5788664cb192dd04ff37f4eafab0674a"><strong>[oracle] [bug] </strong></span><p>A fix to cx_Oracle’s WITH_UNICODE mode which was uncovered by the fact that cx_Oracle 5.3 now seems to hardcode this flag on in the build; an internal method that uses this mode wasn’t using the correct signature.</p> <a class="changeset-link headerlink reference internal" href="#change-5788664cb192dd04ff37f4eafab0674a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3937">#3937</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.18-misc"> <h3>misc<a class="headerlink" href="#change-1.0.18-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.18-1"><span class="target" id="change-ad43c51882849d941a4fe64b5f11cc97"><strong>[bug] [py3k] [tests] </strong></span><p>Fixed issue in testing fixtures which was incompatible with a change made as of Python 3.6.2 involving context managers.</p> <a class="changeset-link headerlink reference internal" href="#change-ad43c51882849d941a4fe64b5f11cc97">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/4034">#4034</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.17"> <h2>1.0.17<a class="headerlink" href="#change-1.0.17" title="Permalink to this headline">¶</a></h2> Released: January 17, 2017<div class="section" id="change-1.0.17-orm"> <h3>orm<a class="headerlink" href="#change-1.0.17-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.17-0"><span class="target" id="change-6f34a2a3b62c82aabf4cf6ed7ff5dbdf"><strong>[orm] [bug] </strong></span><p>Fixed bug involving joined eager loading against multiple entities when polymorphic inheritance is also in use which would throw “‘NoneType’ object has no attribute ‘isa’”. The issue was introduced by the fix for <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3611">#3611</a>.</p> <a class="changeset-link headerlink reference internal" href="#change-6f34a2a3b62c82aabf4cf6ed7ff5dbdf">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3884">#3884</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.17-misc"> <h3>misc<a class="headerlink" href="#change-1.0.17-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.17-1"><span class="target" id="change-bde53807444e2d0660bf1a332e103763"><strong>[bug] [py3k] </strong></span><p>Fixed Python 3.6 DeprecationWarnings related to escaped strings without the ‘r’ modifier, and added test coverage for Python 3.6.</p> <a class="changeset-link headerlink reference internal" href="#change-bde53807444e2d0660bf1a332e103763">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3886">#3886</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.16"> <h2>1.0.16<a class="headerlink" href="#change-1.0.16" title="Permalink to this headline">¶</a></h2> Released: November 15, 2016<div class="section" id="change-1.0.16-orm"> <h3>orm<a class="headerlink" href="#change-1.0.16-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.16-0"><span class="target" id="change-629fe5294000c17cbc3aa17f34745157"><strong>[orm] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bulk_update_mappings" title="sqlalchemy.orm.session.Session.bulk_update_mappings"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bulk_update_mappings()</span></code></a> where an alternate-named primary key attribute would not track properly into the UPDATE statement.</p> <a class="changeset-link headerlink reference internal" href="#change-629fe5294000c17cbc3aa17f34745157">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3849">#3849</a></p> </p> </li> <li><p id="change-1.0.16-1"><span class="target" id="change-c8f5ef46970ad0320f61bb3bb9b3b6e7"><strong>[orm] [bug] </strong></span><p>Fixed bug where joined eager loading would fail for a polymorphically- loaded mapper, where the polymorphic_on was set to an un-mapped expression such as a CASE expression.</p> <a class="changeset-link headerlink reference internal" href="#change-c8f5ef46970ad0320f61bb3bb9b3b6e7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3800">#3800</a></p> </p> </li> <li><p id="change-1.0.16-2"><span class="target" id="change-b27092c247dca3f03f1bd72ca0357144"><strong>[orm] [bug] </strong></span><p>Fixed bug where the ArgumentError raised for an invalid bind sent to a Session via <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bind_mapper" title="sqlalchemy.orm.session.Session.bind_mapper"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bind_mapper()</span></code></a>, <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bind_table" title="sqlalchemy.orm.session.Session.bind_table"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bind_table()</span></code></a>, or the constructor would fail to be correctly raised.</p> <a class="changeset-link headerlink reference internal" href="#change-b27092c247dca3f03f1bd72ca0357144">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3798">#3798</a></p> </p> </li> <li><p id="change-1.0.16-3"><span class="target" id="change-560f26055586a293cc4efd62ace961f2"><strong>[orm] [bug] </strong></span><p>Fixed bug in <code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bulk_save()</span></code> where an UPDATE would not function correctly in conjunction with a mapping that implements a version id counter.</p> <a class="changeset-link headerlink reference internal" href="#change-560f26055586a293cc4efd62ace961f2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3781">#3781</a></p> </p> </li> <li><p id="change-1.0.16-4"><span class="target" id="change-89b3739a62a4a6974ddd2d65d3988092"><strong>[orm] [bug] </strong></span><p>Fixed bug where the <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper.Mapper.attrs" title="sqlalchemy.orm.mapper.Mapper.attrs"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Mapper.attrs</span></code></a>, <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper.Mapper.all_orm_descriptors" title="sqlalchemy.orm.mapper.Mapper.all_orm_descriptors"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Mapper.all_orm_descriptors</span></code></a> and other derived attributes would fail to refresh when mapper properties or other ORM constructs were added to the mapper/class after these accessors were first called.</p> <a class="changeset-link headerlink reference internal" href="#change-89b3739a62a4a6974ddd2d65d3988092">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3778">#3778</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.16-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.16-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.16-5"><span class="target" id="change-299a2cf00017c13c4f6dec0bfd3c1a0b"><strong>[mssql] [bug] </strong></span><p>Changed the query used to get “default schema name”, from one that queries the database principals table to using the “schema_name()” function, as issues have been reported that the former system was unavailable on the Azure Data Warehouse edition. It is hoped that this will finally work across all SQL Server versions and authentication styles.</p> <a class="changeset-link headerlink reference internal" href="#change-299a2cf00017c13c4f6dec0bfd3c1a0b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3810">#3810</a></p> </p> </li> <li><p id="change-1.0.16-6"><span class="target" id="change-395e10f2325ce2469b8461619730f882"><strong>[mssql] [bug] </strong></span><p>Updated the server version info scheme for pyodbc to use SQL Server SERVERPROPERTY(), rather than relying upon pyodbc.SQL_DBMS_VER, which continues to be unreliable particularly with FreeTDS.</p> <a class="changeset-link headerlink reference internal" href="#change-395e10f2325ce2469b8461619730f882">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3814">#3814</a></p> </p> </li> <li><p id="change-1.0.16-7"><span class="target" id="change-f29487921285f6cb0019afd8c24ad291"><strong>[mssql] [bug] </strong></span><p>Added error code 20017 “unexpected EOF from the server” to the list of disconnect exceptions that result in a connection pool reset. Pull request courtesy Ken Robbins.</p> <a class="changeset-link headerlink reference internal" href="#change-f29487921285f6cb0019afd8c24ad291">¶</a><p></p> </p> </li> <li><p id="change-1.0.16-8"><span class="target" id="change-864c17e8ca6d8a67d6eb5906fd09a37e"><strong>[mssql] [bug] </strong></span><p>Fixed bug in pyodbc dialect (as well as in the mostly non-working adodbapi dialect) whereby a semicolon present in the password or username fields could be interpreted as a separator for another token; the values are now quoted when semicolons are present.</p> <a class="changeset-link headerlink reference internal" href="#change-864c17e8ca6d8a67d6eb5906fd09a37e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3762">#3762</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.16-misc"> <h3>misc<a class="headerlink" href="#change-1.0.16-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.16-9"><span class="target" id="change-3461be56f7b0e0e8cc427e140397ccf2"><strong>[bug] [orm.declarative] </strong></span><p>Fixed bug where setting up a single-table inh subclass of a joined-table subclass which included an extra column would corrupt the foreign keys collection of the mapped table, thereby interfering with the initialization of relationships.</p> <a class="changeset-link headerlink reference internal" href="#change-3461be56f7b0e0e8cc427e140397ccf2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3797">#3797</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.15"> <h2>1.0.15<a class="headerlink" href="#change-1.0.15" title="Permalink to this headline">¶</a></h2> Released: September 1, 2016<div class="section" id="change-1.0.15-orm"> <h3>orm<a class="headerlink" href="#change-1.0.15-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.15-0"><span class="target" id="change-de6a5e8fcc943b8f21d6d1d8163cd908"><strong>[orm] [bug] </strong></span><p>Fixed bug in subquery eager loading where a subqueryload of an “of_type()” object linked to a second subqueryload of a plain mapped class, or a longer chain of several “of_type()” attributes, would fail to link the joins correctly.</p> <a class="changeset-link headerlink reference internal" href="#change-de6a5e8fcc943b8f21d6d1d8163cd908">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3773">#3773</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3774">#3774</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.15-sql"> <h3>sql<a class="headerlink" href="#change-1.0.15-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.15-1"><span class="target" id="change-f99819f2faef8ebbab8eb597b19305f6"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> where the internal method <code class="docutils literal notranslate"><span class="pre">_reset_exported()</span></code> would corrupt the state of the object. This method is intended for selectable objects and is called by the ORM in some cases; an erroneous mapper configuration would could lead the ORM to call this on a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> object.</p> <a class="changeset-link headerlink reference internal" href="#change-f99819f2faef8ebbab8eb597b19305f6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3755">#3755</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.15-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.15-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.15-2"><span class="target" id="change-05b02e1953354cf35568201e2727c227"><strong>[mysql] [bug] </strong></span><p>Added support for parsing MySQL/Connector boolean and integer arguments within the URL query string: connection_timeout, connect_timeout, pool_size, get_warnings, raise_on_warnings, raw, consume_results, ssl_verify_cert, force_ipv6, pool_reset_session, compress, allow_local_infile, use_pure.</p> <a class="changeset-link headerlink reference internal" href="#change-05b02e1953354cf35568201e2727c227">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3787">#3787</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.15-misc"> <h3>misc<a class="headerlink" href="#change-1.0.15-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.15-3"><span class="target" id="change-350a885e0a53bcddfbe9329baf6863a9"><strong>[bug] [ext] </strong></span><p>Fixed bug in <code class="docutils literal notranslate"><span class="pre">sqlalchemy.ext.baked</span></code> where the unbaking of a subquery eager loader query would fail due to a variable scoping issue, when multiple subquery loaders were involved. Pull request courtesy Mark Hahnenberg.</p> <a class="changeset-link headerlink reference internal" href="#change-350a885e0a53bcddfbe9329baf6863a9">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3743">#3743</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.14"> <h2>1.0.14<a class="headerlink" href="#change-1.0.14" title="Permalink to this headline">¶</a></h2> Released: July 6, 2016<div class="section" id="change-1.0.14-engine"> <h3>engine<a class="headerlink" href="#change-1.0.14-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.14-0"><span class="target" id="change-4d7092660a51f02cf6ae2adb3e0a7fb6"><strong>[engine] [bug] [postgresql] </strong></span><p>Fixed bug in cross-schema foreign key reflection in conjunction with the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData.params.schema" title="sqlalchemy.schema.MetaData"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">MetaData.schema</span></code></a> argument, where a referenced table that is present in the “default” schema would fail since there would be no way to indicate a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> that has “blank” for a schema. The special symbol <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.sqlalchemy.schema.BLANK_SCHEMA" title="sqlalchemy.schema.sqlalchemy.schema.BLANK_SCHEMA"><code class="xref py py-attr docutils literal notranslate"><span class="pre">schema.BLANK_SCHEMA</span></code></a> has been added as an available value for <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.params.schema" title="sqlalchemy.schema.Table"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Table.schema</span></code></a> and <a class="reference internal" href="../core/defaults.html#sqlalchemy.schema.Sequence.params.schema" title="sqlalchemy.schema.Sequence"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Sequence.schema</span></code></a>, indicating that the schema name should be forced to be <code class="docutils literal notranslate"><span class="pre">None</span></code> even if <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData.params.schema" title="sqlalchemy.schema.MetaData"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">MetaData.schema</span></code></a> is specified.</p> <a class="changeset-link headerlink reference internal" href="#change-4d7092660a51f02cf6ae2adb3e0a7fb6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3716">#3716</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.14-sql"> <h3>sql<a class="headerlink" href="#change-1.0.14-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.14-1"><span class="target" id="change-2758e73b99ac7bb6a36bd8651bd1e56c"><strong>[sql] [bug] </strong></span><p>Fixed issue in SQL math negation operator where the type of the expression would no longer be the numeric type of the original. This would cause issues where the type determined result set behaviors.</p> <a class="changeset-link headerlink reference internal" href="#change-2758e73b99ac7bb6a36bd8651bd1e56c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3735">#3735</a></p> </p> </li> <li><p id="change-1.0.14-2"><span class="target" id="change-c7059eb3012401b413610d88be5d7bb5"><strong>[sql] [bug] </strong></span><p>Fixed bug whereby the <code class="docutils literal notranslate"><span class="pre">__getstate__</span></code> / <code class="docutils literal notranslate"><span class="pre">__setstate__</span></code> methods for sqlalchemy.util.Properties were non-working due to the transition in the 1.0 series to <code class="docutils literal notranslate"><span class="pre">__slots__</span></code>. The issue potentially impacted some third-party applications. Pull request courtesy Pieter Mulder.</p> <a class="changeset-link headerlink reference internal" href="#change-c7059eb3012401b413610d88be5d7bb5">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3728">#3728</a></p> </p> </li> <li><p id="change-1.0.14-3"><span class="target" id="change-a725e879b7b24fb36799bb76f3075d43"><strong>[sql] [bug] </strong></span><p><a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.FromClause.count" title="sqlalchemy.sql.expression.FromClause.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">FromClause.count()</span></code></a> is pending deprecation for 1.1. This function makes use of an arbitrary column in the table and is not reliable; for Core use, <code class="docutils literal notranslate"><span class="pre">func.count()</span></code> should be preferred.</p> <a class="changeset-link headerlink reference internal" href="#change-a725e879b7b24fb36799bb76f3075d43">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3724">#3724</a></p> </p> </li> <li><p id="change-1.0.14-4"><span class="target" id="change-677e6c0535709018e57bdb8c064e546b"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.CTE" title="sqlalchemy.sql.expression.CTE"><code class="xref py py-class docutils literal notranslate"><span class="pre">CTE</span></code></a> structure which would cause it to not clone properly when a union was used, as is common in a recursive CTE. The improper cloning would cause errors when the CTE is used in various ORM contexts such as that of a <a class="reference internal" href="../orm/mapping_columns.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><code class="xref py py-func docutils literal notranslate"><span class="pre">column_property()</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-677e6c0535709018e57bdb8c064e546b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3722">#3722</a></p> </p> </li> <li><p id="change-1.0.14-5"><span class="target" id="change-4bb322d1beae4370564be99c7589c055"><strong>[sql] [bug] </strong></span><p>Fixed bug whereby <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.tometadata" title="sqlalchemy.schema.Table.tometadata"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.tometadata()</span></code></a> would make a duplicate <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.UniqueConstraint" title="sqlalchemy.schema.UniqueConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">UniqueConstraint</span></code></a> for each <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> object that featured the <code class="docutils literal notranslate"><span class="pre">unique=True</span></code> parameter.</p> <a class="changeset-link headerlink reference internal" href="#change-4bb322d1beae4370564be99c7589c055">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3721">#3721</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.14-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.14-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.14-6"><span class="target" id="change-9d37c192595f4c80fd9b1f79eb4a1b85"><strong>[postgresql] [bug] </strong></span><p>Fixed bug whereby <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator" title="sqlalchemy.types.TypeDecorator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeDecorator</span></code></a> and <a class="reference internal" href="../core/type_api.html#sqlalchemy.types.Variant" title="sqlalchemy.types.Variant"><code class="xref py py-class docutils literal notranslate"><span class="pre">Variant</span></code></a> types were not deeply inspected enough by the PostgreSQL dialect to determine if SMALLSERIAL or BIGSERIAL needed to be rendered rather than SERIAL.</p> <a class="changeset-link headerlink reference internal" href="#change-9d37c192595f4c80fd9b1f79eb4a1b85">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3739">#3739</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.14-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.14-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.14-7"><span class="target" id="change-9238c3d0cf84ee1c088314125c23d4f0"><strong>[oracle] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select.with_for_update.params.of" title="sqlalchemy.sql.expression.Select.with_for_update"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Select.with_for_update.of</span></code></a>, where the Oracle “rownum” approach to LIMIT/OFFSET would fail to accommodate for the expressions inside the “OF” clause, which must be stated at the topmost level referring to expression within the subquery. The expressions are now added to the subquery if needed.</p> <a class="changeset-link headerlink reference internal" href="#change-9238c3d0cf84ee1c088314125c23d4f0">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3741">#3741</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.14-misc"> <h3>misc<a class="headerlink" href="#change-1.0.14-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.14-8"><span class="target" id="change-9c468f38b3c1e3c6dad918aec4386076"><strong>[bug] [examples] </strong></span><p>Fixed a regression that occurred in the examples/vertical/dictlike-polymorphic.py example which prevented it from running.</p> <a class="changeset-link headerlink reference internal" href="#change-9c468f38b3c1e3c6dad918aec4386076">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3704">#3704</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.13"> <h2>1.0.13<a class="headerlink" href="#change-1.0.13" title="Permalink to this headline">¶</a></h2> Released: May 16, 2016<div class="section" id="change-1.0.13-orm"> <h3>orm<a class="headerlink" href="#change-1.0.13-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-0"><span class="target" id="change-2047da33c78a202b1bd91983d30b7f8d"><strong>[orm] [bug] </strong></span><p>Fixed bug in “evaluate” strategy of <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a> and <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.delete" title="sqlalchemy.orm.query.Query.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.delete()</span></code></a> which would fail to accommodate a bound parameter with a “callable” value, as which occurs when filtering by a many-to-one equality expression along a relationship.</p> <a class="changeset-link headerlink reference internal" href="#change-2047da33c78a202b1bd91983d30b7f8d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3700">#3700</a></p> </p> </li> <li><p id="change-1.0.13-1"><span class="target" id="change-5ac1c8a6e97310c3cea38f3a2cb45f13"><strong>[orm] [bug] </strong></span><p>Fixed bug whereby the event listeners used for backrefs could be inadvertently applied multiple times, when using a deep class inheritance hierarchy in conjunction with multiple mapper configuration steps.</p> <a class="changeset-link headerlink reference internal" href="#change-5ac1c8a6e97310c3cea38f3a2cb45f13">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3710">#3710</a></p> </p> </li> <li><p id="change-1.0.13-2"><span class="target" id="change-74abd9db9f5e1dfcc111887e1e5a62d7"><strong>[orm] [bug] </strong></span><p>Fixed bug whereby passing a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> construct to the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.group_by" title="sqlalchemy.orm.query.Query.group_by"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.group_by()</span></code></a> method would raise an error, instead of interpreting the object as a SQL fragment.</p> <a class="changeset-link headerlink reference internal" href="#change-74abd9db9f5e1dfcc111887e1e5a62d7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3706">#3706</a></p> </p> </li> <li><p id="change-1.0.13-3"><span class="target" id="change-e6ed5fa4fecae4a5036905ffce1a3264"><strong>[orm] [bug] </strong></span><p>Anonymous labeling is applied to a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.Over.func" title="sqlalchemy.sql.expression.Over.func"><code class="xref py py-attr docutils literal notranslate"><span class="pre">func</span></code></a> construct that is passed to <a class="reference internal" href="../orm/mapping_columns.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><code class="xref py py-func docutils literal notranslate"><span class="pre">column_property()</span></code></a>, so that if the same attribute is referred to as a column expression twice the names are de-duped, thus avoiding “ambiguous column” errors. Previously, the <code class="docutils literal notranslate"><span class="pre">.label(None)</span></code> would need to be applied in order for the name to be de-anonymized.</p> <a class="changeset-link headerlink reference internal" href="#change-e6ed5fa4fecae4a5036905ffce1a3264">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3663">#3663</a></p> </p> </li> <li><p id="change-1.0.13-4"><span class="target" id="change-e3c6db557cf0e220505ebe362aaa2c9a"><strong>[orm] [bug] </strong></span><p>Fixed regression appearing in the 1.0 series in ORM loading where the exception raised for an expected column missing would incorrectly be a <code class="docutils literal notranslate"><span class="pre">NoneType</span></code> error, rather than the expected <a class="reference internal" href="../core/exceptions.html#sqlalchemy.exc.NoSuchColumnError" title="sqlalchemy.exc.NoSuchColumnError"><code class="xref py py-class docutils literal notranslate"><span class="pre">NoSuchColumnError</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-e3c6db557cf0e220505ebe362aaa2c9a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3658">#3658</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.13-sql"> <h3>sql<a class="headerlink" href="#change-1.0.13-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-5"><span class="target" id="change-c3f30fd4cd2f4e686a98a31afb293be4"><strong>[sql] [bug] </strong></span><p>Fixed bug where when using <code class="docutils literal notranslate"><span class="pre">case_sensitive=False</span></code> with an <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Engine" title="sqlalchemy.engine.Engine"><code class="xref py py-class docutils literal notranslate"><span class="pre">Engine</span></code></a>, the result set would fail to correctly accommodate for duplicate column names in the result set, causing an error when the statement is executed in 1.0, and preventing the “ambiguous column” exception from functioning in 1.1.</p> <a class="changeset-link headerlink reference internal" href="#change-c3f30fd4cd2f4e686a98a31afb293be4">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3690">#3690</a></p> </p> </li> <li><p id="change-1.0.13-6"><span class="target" id="change-1bce768d6b81f3ad8d7eba8903728cfd"><strong>[sql] [bug] </strong></span><p>Fixed bug where the negation of an EXISTS expression would not be properly typed as boolean in the result, and also would fail to be anonymously aliased in a SELECT list as is the case with a non-negated EXISTS construct.</p> <a class="changeset-link headerlink reference internal" href="#change-1bce768d6b81f3ad8d7eba8903728cfd">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3682">#3682</a></p> </p> </li> <li><p id="change-1.0.13-7"><span class="target" id="change-2e70457f8ab9bf40e7fc276889b3238c"><strong>[sql] [bug] </strong></span><p>Fixed bug where “unconsumed column names” exception would fail to be raised in the case where <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.values" title="sqlalchemy.sql.expression.Insert.values"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.values()</span></code></a> were called with a list of parameter mappings, instead of a single mapping of parameters. Pull request courtesy Athena Yao.</p> <a class="changeset-link headerlink reference internal" href="#change-2e70457f8ab9bf40e7fc276889b3238c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3666">#3666</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.13-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.13-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-8"><span class="target" id="change-4a61289d79705f08bb15de8e6321af41"><strong>[postgresql] [bug] </strong></span><p>Added disconnect detection support for the error string “SSL error: decryption failed or bad record mac”. Pull request courtesy Iuri de Silvio.</p> <a class="changeset-link headerlink reference internal" href="#change-4a61289d79705f08bb15de8e6321af41">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3715">#3715</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.13-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.13-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-9"><span class="target" id="change-e40583c1813139df7c799fc9928d38ae"><strong>[mssql] [bug] </strong></span><p>Fixed bug where by ROW_NUMBER OVER clause applied for OFFSET selects in SQL Server would inappropriately substitute a plain column from the local statement that overlaps with a label name used by the ORDER BY criteria of the statement.</p> <a class="changeset-link headerlink reference internal" href="#change-e40583c1813139df7c799fc9928d38ae">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3711">#3711</a></p> </p> </li> <li><p id="change-1.0.13-10"><span class="target" id="change-7b9781fe3242062ab2446367b4733bad"><strong>[mssql] [bug] [oracle] </strong></span><p>Fixed regression appearing in the 1.0 series which would cause the Oracle and SQL Server dialects to incorrectly account for result set columns when these dialects would wrap a SELECT in a subquery in order to provide LIMIT/OFFSET behavior, and the original SELECT statement referred to the same column multiple times, such as a column and a label of that same column. This issue is related to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3658">#3658</a> in that when the error occurred, it would also cause a <code class="docutils literal notranslate"><span class="pre">NoneType</span></code> error, rather than reporting that it couldn’t locate a column.</p> <a class="changeset-link headerlink reference internal" href="#change-7b9781fe3242062ab2446367b4733bad">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3657">#3657</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.13-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.13-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-11"><span class="target" id="change-3d8ee495a3a4567137de79dfb9d0f81e"><strong>[oracle] [bug] </strong></span><p>Fixed a bug in the cx_Oracle connect process that caused a TypeError when the either the user, password or dsn was empty. This prevented external authentication to Oracle databases, and prevented connecting to the default dsn. The connect string oracle:// now logs into the default dsn using the Operating System username, equivalent to connecting using ‘/’ with sqlplus.</p> <a class="changeset-link headerlink reference internal" href="#change-3d8ee495a3a4567137de79dfb9d0f81e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3705">#3705</a></p> </p> </li> <li><p id="change-1.0.13-12"><span class="target" id="change-bada3dbba27a01629133de2f2f598b63"><strong>[oracle] [bug] </strong></span><p>Fixed a bug in the result proxy used mainly by Oracle when binary and other LOB types are in play, such that when query / statement caching were used, the type-level result processors, notably that required by the binary type itself but also any other processor, would become lost after the first run of the statement due to it being removed from the cached result metadata.</p> <a class="changeset-link headerlink reference internal" href="#change-bada3dbba27a01629133de2f2f598b63">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3699">#3699</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.13-misc"> <h3>misc<a class="headerlink" href="#change-1.0.13-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.13-13"><span class="target" id="change-1a55117321e17e5d36db13e1b974446e"><strong>[bug] [examples] </strong></span><p>Changed the “directed graph” example to no longer consider integer identifiers of nodes as significant; the “higher” / “lower” references now allow mutual edges in both directions.</p> <a class="changeset-link headerlink reference internal" href="#change-1a55117321e17e5d36db13e1b974446e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3698">#3698</a></p> </p> </li> <li><p id="change-1.0.13-14"><span class="target" id="change-a14dd2e73d889d065acc07a77b1ee7cb"><strong>[bug] [py3k] </strong></span><p>Fixed bug in “to_list” conversion where a single bytes object would be turned into a list of individual characters. This would impact among other things using the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.get" title="sqlalchemy.orm.query.Query.get"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.get()</span></code></a> method on a primary key that’s a bytes object.</p> <a class="changeset-link headerlink reference internal" href="#change-a14dd2e73d889d065acc07a77b1ee7cb">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3660">#3660</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.12"> <h2>1.0.12<a class="headerlink" href="#change-1.0.12" title="Permalink to this headline">¶</a></h2> Released: February 15, 2016<div class="section" id="change-1.0.12-orm"> <h3>orm<a class="headerlink" href="#change-1.0.12-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-0"><span class="target" id="change-39c398de2662e9f45aae57c76c6444c9"><strong>[orm] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.merge" title="sqlalchemy.orm.session.Session.merge"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.merge()</span></code></a> where an object with a composite primary key that has values for some but not all of the PK fields would emit a SELECT statement leaking the internal NEVER_SET symbol into the query, rather than detecting that this object does not have a searchable primary key and no SELECT should be emitted.</p> <a class="changeset-link headerlink reference internal" href="#change-39c398de2662e9f45aae57c76c6444c9">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3647">#3647</a></p> </p> </li> <li><p id="change-1.0.12-1"><span class="target" id="change-57d791a5552fab41d8a0e788f4324f65"><strong>[orm] [bug] </strong></span><p>Fixed regression since 0.9 where the 0.9 style loader options system failed to accommodate for multiple <a class="reference internal" href="../orm/loading_columns.html#sqlalchemy.orm.undefer_group" title="sqlalchemy.orm.undefer_group"><code class="xref py py-func docutils literal notranslate"><span class="pre">undefer_group()</span></code></a> loader options in a single query. Multiple <a class="reference internal" href="../orm/loading_columns.html#sqlalchemy.orm.undefer_group" title="sqlalchemy.orm.undefer_group"><code class="xref py py-func docutils literal notranslate"><span class="pre">undefer_group()</span></code></a> options will now be taken into account even against the same entity.</p> <a class="changeset-link headerlink reference internal" href="#change-57d791a5552fab41d8a0e788f4324f65">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3623">#3623</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-engine"> <h3>engine<a class="headerlink" href="#change-1.0.12-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-2"><span class="target" id="change-7706b7fbecdb21a5157da093a88b9134"><strong>[engine] [bug] [mysql] </strong></span><p>Revisiting <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2696">#2696</a>, first released in 1.0.10, which attempts to work around Python 2’s lack of exception context reporting by emitting a warning for an exception that was interrupted by a second exception when attempting to roll back the already-failed transaction; this issue continues to occur for MySQL backends in conjunction with a savepoint that gets unexpectedly lost, which then causes a “no such savepoint” error when the rollback is attempted, obscuring what the original condition was.</p> <p>The approach has been generalized to the Core “safe reraise” function which takes place across the ORM and Core in any place that a transaction is being rolled back in response to an error which occurred trying to commit, including the context managers provided by <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> and <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a>, and taking place for operations such as a failure on “RELEASE SAVEPOINT”. Previously, the fix was only in place for a specific path within the ORM flush/commit process; it now takes place for all transactional context managers as well.</p> <a class="changeset-link headerlink reference internal" href="#change-7706b7fbecdb21a5157da093a88b9134">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2696">#2696</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-sql"> <h3>sql<a class="headerlink" href="#change-1.0.12-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-3"><span class="target" id="change-fa04be1b3106d6859abbc1ade87df175"><strong>[sql] [bug] </strong></span><p>Fixed issue where the “literal_binds” flag was not propagated for <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><code class="xref py py-func docutils literal notranslate"><span class="pre">expression.insert()</span></code></a>, <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.update" title="sqlalchemy.sql.expression.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">expression.update()</span></code></a> or <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.delete" title="sqlalchemy.sql.expression.delete"><code class="xref py py-func docutils literal notranslate"><span class="pre">expression.delete()</span></code></a> constructs when compiled to string SQL. Pull request courtesy Tim Tate.</p> <a class="changeset-link headerlink reference internal" href="#change-fa04be1b3106d6859abbc1ade87df175">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3643">#3643</a></p> </p> </li> <li><p id="change-1.0.12-4"><span class="target" id="change-6893173c723cb93efd613ae892e07abf"><strong>[sql] [bug] </strong></span><p>Fixed issue where inadvertent use of the Python <code class="docutils literal notranslate"><span class="pre">__contains__</span></code> override with a column expression (e.g. by using <code class="docutils literal notranslate"><span class="pre">'x'</span> <span class="pre">in</span> <span class="pre">col</span></code>) would cause an endless loop in the case of an ARRAY type, as Python defers this to <code class="docutils literal notranslate"><span class="pre">__getitem__</span></code> access which never raises for this type. Overall, all use of <code class="docutils literal notranslate"><span class="pre">__contains__</span></code> now raises NotImplementedError.</p> <a class="changeset-link headerlink reference internal" href="#change-6893173c723cb93efd613ae892e07abf">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3642">#3642</a></p> </p> </li> <li><p id="change-1.0.12-5"><span class="target" id="change-5c11bdb4bef5dc9140eedb095bb42a18"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> metadata construct which appeared around the 0.9 series where adding columns to a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> that was unpickled would fail to correctly establish the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> within the ‘c’ collection, leading to issues in areas such as ORM configuration. This could impact use cases such as <code class="docutils literal notranslate"><span class="pre">extend_existing</span></code> and others.</p> <a class="changeset-link headerlink reference internal" href="#change-5c11bdb4bef5dc9140eedb095bb42a18">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3632">#3632</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.12-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-6"><span class="target" id="change-5b66b429f55459d303aa6d7335f13701"><strong>[postgresql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">expression.text()</span></code></a> construct where a double-colon expression would not escape properly, e.g. <code class="docutils literal notranslate"><span class="pre">some\:\:expr</span></code>, as is most commonly required when rendering PostgreSQL-style CAST expressions.</p> <a class="changeset-link headerlink reference internal" href="#change-5b66b429f55459d303aa6d7335f13701">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3644">#3644</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.12-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-7"><span class="target" id="change-d6c62d538d019244e6eb27d263e868e8"><strong>[mssql] [bug] </strong></span><p>Fixed the syntax of the <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.extract" title="sqlalchemy.sql.expression.extract"><code class="xref py py-func docutils literal notranslate"><span class="pre">extract()</span></code></a> function when used on MSSQL against a datetime value; the quotes around the keyword are removed. Pull request courtesy Guillaume Doumenc.</p> <a class="changeset-link headerlink reference internal" href="#change-d6c62d538d019244e6eb27d263e868e8">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3624">#3624</a></p> </p> </li> <li><p id="change-1.0.12-8"><span class="target" id="change-b44f1e43ef8e623b9de9ddc5c66d716a"><strong>[mssql] [bug] [firebird] </strong></span><p>Fixed 1.0 regression where the eager fetch of cursor.rowcount was no longer called for an UPDATE or DELETE statement emitted via plain text or via the <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> construct, affecting those drivers that erase cursor.rowcount once the cursor is closed such as SQL Server ODBC and Firebird drivers.</p> <a class="changeset-link headerlink reference internal" href="#change-b44f1e43ef8e623b9de9ddc5c66d716a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3622">#3622</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.12-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-9"><span class="target" id="change-43abedf27e93fb6c494d01efb423d1af"><strong>[oracle] [bug] [jython] </strong></span><p>Fixed a small issue in the Jython Oracle compiler involving the rendering of “RETURNING” which allows this currently unsupported/untested dialect to work rudimentally with the 1.0 series. Pull request courtesy Carlos Rivas.</p> <a class="changeset-link headerlink reference internal" href="#change-43abedf27e93fb6c494d01efb423d1af">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3621">#3621</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.12-misc"> <h3>misc<a class="headerlink" href="#change-1.0.12-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.12-10"><span class="target" id="change-8aa9c8209b565aaa4251a73d5815aa70"><strong>[bug] [py3k] </strong></span><p>Fixed bug where some exception re-raise scenarios would attach the exception to itself as the “cause”; while the Python 3 interpreter is OK with this, it could cause endless loops in iPython.</p> <a class="changeset-link headerlink reference internal" href="#change-8aa9c8209b565aaa4251a73d5815aa70">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3625">#3625</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.11"> <h2>1.0.11<a class="headerlink" href="#change-1.0.11" title="Permalink to this headline">¶</a></h2> Released: December 22, 2015<div class="section" id="change-1.0.11-orm"> <h3>orm<a class="headerlink" href="#change-1.0.11-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.11-0"><span class="target" id="change-14de383393c0c9af155b092fdecf8101"><strong>[orm] [bug] </strong></span><p>Fixed regression caused in 1.0.10 by the fix for <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3593">#3593</a> where the check added for a polymorphic joinedload from a poly_subclass->class->poly_baseclass connection would fail for the scenario of class->poly_subclass->class.</p> <a class="changeset-link headerlink reference internal" href="#change-14de383393c0c9af155b092fdecf8101">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3611">#3611</a></p> </p> </li> <li><p id="change-1.0.11-1"><span class="target" id="change-02da59abe1c57d8646747495298a98c5"><strong>[orm] [bug] </strong></span><p>Fixed bug where <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bulk_update_mappings" title="sqlalchemy.orm.session.Session.bulk_update_mappings"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bulk_update_mappings()</span></code></a> and related would not bump a version id counter when in use. The experience here is still a little rough as the original version id is required in the given dictionaries and there’s not clean error reporting on that yet.</p> <a class="changeset-link headerlink reference internal" href="#change-02da59abe1c57d8646747495298a98c5">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3610">#3610</a></p> </p> </li> <li><p id="change-1.0.11-2"><span class="target" id="change-b0b97f1c028f72f272a01f842b36d622"><strong>[orm] [bug] </strong></span><p>Major fixes to the <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper.Mapper.params.eager_defaults" title="sqlalchemy.orm.mapper.Mapper"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Mapper.eager_defaults</span></code></a> flag, this flag would not be honored correctly in the case that multiple UPDATE statements were to be emitted, either as part of a flush or a bulk update operation. Additionally, RETURNING would be emitted unnecessarily within update statements.</p> <a class="changeset-link headerlink reference internal" href="#change-b0b97f1c028f72f272a01f842b36d622">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3609">#3609</a></p> </p> </li> <li><p id="change-1.0.11-3"><span class="target" id="change-b1030568ebfc6b93a82a5eba2ed64e72"><strong>[orm] [bug] </strong></span><p>Fixed bug where use of the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.select_from" title="sqlalchemy.orm.query.Query.select_from"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.select_from()</span></code></a> method would cause a subsequent call to the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.with_parent" title="sqlalchemy.orm.query.Query.with_parent"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.with_parent()</span></code></a> method to fail.</p> <a class="changeset-link headerlink reference internal" href="#change-b1030568ebfc6b93a82a5eba2ed64e72">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3606">#3606</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.11-sql"> <h3>sql<a class="headerlink" href="#change-1.0.11-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.11-4"><span class="target" id="change-e8ae984d3fe8f909f4e67567acda10e1"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Update.return_defaults" title="sqlalchemy.sql.expression.Update.return_defaults"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Update.return_defaults()</span></code></a> which would cause all insert-default holding columns not otherwise included in the SET clause (such as primary key cols) to get rendered into the RETURNING even though this is an UPDATE.</p> <a class="changeset-link headerlink reference internal" href="#change-e8ae984d3fe8f909f4e67567acda10e1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3609">#3609</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.11-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.11-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.11-5"><span class="target" id="change-c1b3ad084945fc5a7f4d711d989ebdf2"><strong>[mysql] [bug] </strong></span><p>An adjustment to the regular expression used to parse MySQL views, such that we no longer assume the “ALGORITHM” keyword is present in the reflected view source, as some users have reported this not being present in some Amazon RDS environments.</p> <a class="changeset-link headerlink reference internal" href="#change-c1b3ad084945fc5a7f4d711d989ebdf2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3613">#3613</a></p> </p> </li> <li><p id="change-1.0.11-6"><span class="target" id="change-62b28bb5936942f4483f018dacdaac57"><strong>[mysql] [bug] </strong></span><p>Added new reserved words for MySQL 5.7 to the MySQL dialect, including ‘generated’, ‘optimizer_costs’, ‘stored’, ‘virtual’. Pull request courtesy Hanno Schlichting.</p> <a class="changeset-link headerlink reference internal" href="#change-62b28bb5936942f4483f018dacdaac57">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.11-misc"> <h3>misc<a class="headerlink" href="#change-1.0.11-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.11-7"><span class="target" id="change-134a03f81d13c85951a47bd2a9b7b9a1"><strong>[bug] [ext] </strong></span><p>Further fixes to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3605">#3605</a>, pop method on <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">MutableDict</span></code></a>, where the “default” argument was not included.</p> <a class="changeset-link headerlink reference internal" href="#change-134a03f81d13c85951a47bd2a9b7b9a1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3605">#3605</a></p> </p> </li> <li><p id="change-1.0.11-8"><span class="target" id="change-9e6966523927542f8808ecf8005c6737"><strong>[bug] [ext] </strong></span><p>Fixed bug in baked loader system where the systemwide monkeypatch for setting up baked lazy loaders would interfere with other loader strategies that rely on lazy loading as a fallback, e.g. joined and subquery eager loaders, leading to <code class="docutils literal notranslate"><span class="pre">IndexError</span></code> exceptions at mapper configuration time.</p> <a class="changeset-link headerlink reference internal" href="#change-9e6966523927542f8808ecf8005c6737">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3612">#3612</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.10"> <h2>1.0.10<a class="headerlink" href="#change-1.0.10" title="Permalink to this headline">¶</a></h2> Released: December 11, 2015<div class="section" id="change-1.0.10-orm"> <h3>orm<a class="headerlink" href="#change-1.0.10-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-0"><span class="target" id="change-0fc136fefdb6fd903b2e0036636f6328"><strong>[orm] [bug] </strong></span><p>Fixed issue where post_update on a many-to-one relationship would fail to emit an UPDATE in the case where the attribute were set to None and not previously loaded.</p> <a class="changeset-link headerlink reference internal" href="#change-0fc136fefdb6fd903b2e0036636f6328">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3599">#3599</a></p> </p> </li> <li><p id="change-1.0.10-1"><span class="target" id="change-d64c29536ad61c8d456ffd6b38359a9f"><strong>[orm] [bug] </strong></span><p>Fixed bug which is actually a regression that occurred between versions 0.8.0 and 0.8.1, due <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2714">#2714</a>. The case where joined eager loading needs to join out over a subclass-bound relationship when “with_polymorphic” were also used would fail to join from the correct entity.</p> <a class="changeset-link headerlink reference internal" href="#change-d64c29536ad61c8d456ffd6b38359a9f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3593">#3593</a></p> </p> </li> <li><p id="change-1.0.10-2"><span class="target" id="change-8804e40dd20d4c09ef022fe4e8881288"><strong>[orm] [bug] </strong></span><p>Fixed joinedload bug which would occur when a. the query includes limit/offset criteria that forces a subquery b. the relationship uses “secondary” c. the primaryjoin of the relationship refers to a column that is either not part of the primary key, or is a PK col in a joined-inheritance subclass table that is under a different attribute name than the parent table’s primary key column d. the query defers the columns that are present in the primaryjoin, typically via not being included in load_only(); the necessary column(s) would not be present in the subquery and produce invalid SQL.</p> <a class="changeset-link headerlink reference internal" href="#change-8804e40dd20d4c09ef022fe4e8881288">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3592">#3592</a></p> </p> </li> <li><p id="change-1.0.10-3"><span class="target" id="change-b70e428b82707f753989ef9820a13e0d"><strong>[orm] [bug] </strong></span><p>A rare case which occurs when a <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.rollback" title="sqlalchemy.orm.session.Session.rollback"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.rollback()</span></code></a> fails in the scope of a <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.flush" title="sqlalchemy.orm.session.Session.flush"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.flush()</span></code></a> operation that’s raising an exception, as has been observed in some MySQL SAVEPOINT cases, prevents the original database exception from being observed when it was emitted during flush, but only on Py2K because Py2K does not support exception chaining; on Py3K the originating exception is chained. As a workaround, a warning is emitted in this specific case showing at least the string message of the original database error before we proceed to raise the rollback-originating exception.</p> <a class="changeset-link headerlink reference internal" href="#change-b70e428b82707f753989ef9820a13e0d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2696">#2696</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-orm-declarative"> <h3>orm declarative<a class="headerlink" href="#change-1.0.10-orm-declarative" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-4"><span class="target" id="change-9794c3c81c4b53dbb39703dcad6555dc"><strong>[bug] [declarative] [orm] </strong></span><p>Fixed bug where in Py2K a unicode literal would not be accepted as the string name of a class or other argument within declarative using <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.backref" title="sqlalchemy.orm.backref"><code class="xref py py-func docutils literal notranslate"><span class="pre">backref()</span></code></a> on <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><code class="xref py py-func docutils literal notranslate"><span class="pre">relationship()</span></code></a>. Pull request courtesy Nils Philippsen.</p> <a class="changeset-link headerlink reference internal" href="#change-9794c3c81c4b53dbb39703dcad6555dc">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-sql"> <h3>sql<a class="headerlink" href="#change-1.0.10-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-5"><span class="target" id="change-4f37b666e375903193eb70016d8146b6"><strong>[sql] [feature] </strong></span><p>Added support for parameter-ordered SET clauses in an UPDATE statement. This feature is available by passing the <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.update.params.preserve_parameter_order" title="sqlalchemy.sql.expression.update"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">preserve_parameter_order</span></code></a> flag either to the core <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Update" title="sqlalchemy.sql.expression.Update"><code class="xref py py-class docutils literal notranslate"><span class="pre">Update</span></code></a> construct or alternatively adding it to the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update.params.update_args" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Query.update.update_args</span></code></a> dictionary at the ORM-level, also passing the parameters themselves as a list of 2-tuples. Thanks to Gorka Eguileor for implementation and tests.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../core/tutorial.html#updates-order-parameters"><span class="std std-ref">Parameter-Ordered Updates</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-4f37b666e375903193eb70016d8146b6">¶</a><p></p> </p> </li> <li><p id="change-1.0.10-6"><span class="target" id="change-88ed0853e830fdd4b502a42c53f9834a"><strong>[sql] [bug] </strong></span><p>Fixed issue within the <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.from_select" title="sqlalchemy.sql.expression.Insert.from_select"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.from_select()</span></code></a> construct whereby the <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><code class="xref py py-class docutils literal notranslate"><span class="pre">Select</span></code></a> construct would have its <code class="docutils literal notranslate"><span class="pre">._raw_columns</span></code> collection mutated in-place when compiling the <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><code class="xref py py-class docutils literal notranslate"><span class="pre">Insert</span></code></a> construct, when the target <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> has Python-side defaults. The <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select" title="sqlalchemy.sql.expression.Select"><code class="xref py py-class docutils literal notranslate"><span class="pre">Select</span></code></a> construct would compile standalone with the erroneous column present subsequent to compilation of the <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><code class="xref py py-class docutils literal notranslate"><span class="pre">Insert</span></code></a>, and the <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><code class="xref py py-class docutils literal notranslate"><span class="pre">Insert</span></code></a> statement itself would fail on a second compile attempt due to duplicate bound parameters.</p> <a class="changeset-link headerlink reference internal" href="#change-88ed0853e830fdd4b502a42c53f9834a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3603">#3603</a></p> </p> </li> <li><p id="change-1.0.10-7"><span class="target" id="change-cbe154666f524c9aa07e3106e8574c65"><strong>[sql] [bug] [postgresql] </strong></span><p>Fixed bug where CREATE TABLE with a no-column table, but a constraint such as a CHECK constraint would render an erroneous comma in the definition; this scenario can occur such as with a PostgreSQL INHERITS table that has no columns of its own.</p> <a class="changeset-link headerlink reference internal" href="#change-cbe154666f524c9aa07e3106e8574c65">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3598">#3598</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.10-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-8"><span class="target" id="change-de49886659cbcb76d9579e0daf55a70d"><strong>[postgresql] [bug] </strong></span><p>Fixed issue where the “FOR UPDATE OF” PostgreSQL-specific SELECT modifier would fail if the referred table had a schema qualifier; PG needs the schema name to be omitted. Pull request courtesy Diana Clarke.</p> <a class="changeset-link headerlink reference internal" href="#change-de49886659cbcb76d9579e0daf55a70d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3573">#3573</a></p> </p> </li> <li><p id="change-1.0.10-9"><span class="target" id="change-ae0c216328001852e3c068b6bef5438b"><strong>[postgresql] [bug] </strong></span><p>Fixed bug where some varieties of SQL expression passed to the “where” clause of <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.ExcludeConstraint" title="sqlalchemy.dialects.postgresql.ExcludeConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.ExcludeConstraint</span></code></a> would fail to be accepted correctly. Pull request courtesy aisch.</p> <a class="changeset-link headerlink reference internal" href="#change-ae0c216328001852e3c068b6bef5438b">¶</a><p></p> </p> </li> <li><p id="change-1.0.10-10"><span class="target" id="change-d0267c6d6507bf37598b0250b57cd5f7"><strong>[postgresql] [bug] </strong></span><p>Fixed the <code class="docutils literal notranslate"><span class="pre">.python_type</span></code> attribute of <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.INTERVAL" title="sqlalchemy.dialects.postgresql.INTERVAL"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.INTERVAL</span></code></a> to return <code class="docutils literal notranslate"><span class="pre">datetime.timedelta</span></code> in the same way as that of <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Interval.python_type" title="sqlalchemy.types.Interval.python_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">types.Interval.python_type</span></code></a>, rather than raising <code class="docutils literal notranslate"><span class="pre">NotImplementedError</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-d0267c6d6507bf37598b0250b57cd5f7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3571">#3571</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.10-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-11"><span class="target" id="change-6974522ee331218a2318e6b0dc52bebd"><strong>[mysql] [bug] </strong></span><p>Fixed bug in MySQL reflection where the “fractional sections portion” of the <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.DATETIME" title="sqlalchemy.dialects.mysql.DATETIME"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.DATETIME</span></code></a>, <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.TIMESTAMP" title="sqlalchemy.dialects.mysql.TIMESTAMP"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.TIMESTAMP</span></code></a> and <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.TIME" title="sqlalchemy.dialects.mysql.TIME"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.TIME</span></code></a> types would be incorrectly placed into the <code class="docutils literal notranslate"><span class="pre">timezone</span></code> attribute, which is unused by MySQL, instead of the <code class="docutils literal notranslate"><span class="pre">fsp</span></code> attribute.</p> <a class="changeset-link headerlink reference internal" href="#change-6974522ee331218a2318e6b0dc52bebd">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3602">#3602</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.10-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-12"><span class="target" id="change-be7c80f619f565c72db723a14bcbeba8"><strong>[mssql] [bug] </strong></span><p>Added the error “20006: Write to the server failed” to the list of disconnect errors for the pymssql driver, as this has been observed to render a connection unusable.</p> <a class="changeset-link headerlink reference internal" href="#change-be7c80f619f565c72db723a14bcbeba8">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3585">#3585</a></p> </p> </li> <li><p id="change-1.0.10-13"><span class="target" id="change-ee5c541eb9c67a758fa50b2406d4ff75"><strong>[mssql] [bug] </strong></span><p>A descriptive ValueError is now raised in the event that SQL server returns an invalid date or time format from a DATE or TIME column, rather than failing with a NoneType error. Pull request courtesy Ed Avis.</p> <a class="changeset-link headerlink reference internal" href="#change-ee5c541eb9c67a758fa50b2406d4ff75">¶</a><p></p> </p> </li> <li><p id="change-1.0.10-14"><span class="target" id="change-da04d72c61e38ea860c327ffdd4d41e2"><strong>[mssql] [bug] </strong></span><p>Fixed issue where DDL generated for the MSSQL types DATETIME2, TIME and DATETIMEOFFSET with a precision of “zero” would not generate the precision field. Pull request courtesy Jacobo de Vera.</p> <a class="changeset-link headerlink reference internal" href="#change-da04d72c61e38ea860c327ffdd4d41e2">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.10-misc"> <h3>misc<a class="headerlink" href="#change-1.0.10-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.10-15"><span class="target" id="change-1fe7359b44816908ec7c979731f2d99f"><strong>[bug] [ext] </strong></span><p>Added support for the <code class="docutils literal notranslate"><span class="pre">dict.pop()</span></code> and <code class="docutils literal notranslate"><span class="pre">dict.popitem()</span></code> methods to the <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">mutable.MutableDict</span></code></a> class.</p> <a class="changeset-link headerlink reference internal" href="#change-1fe7359b44816908ec7c979731f2d99f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3605">#3605</a></p> </p> </li> <li><p id="change-1.0.10-16"><span class="target" id="change-19c50f7c3ae4d9fc7e580152f196f68d"><strong>[bug] [py3k] </strong></span><p>Updates to internal getargspec() calls, some py36-related fixture updates, and alterations to two iterators to “return” instead of raising StopIteration, to allow tests to pass without errors or warnings on Py3.5, Py3.6, pull requests courtesy Jacob MacDonald, Luri de Silvio, and Phil Jones.</p> <a class="changeset-link headerlink reference internal" href="#change-19c50f7c3ae4d9fc7e580152f196f68d">¶</a><p></p> </p> </li> <li><p id="change-1.0.10-17"><span class="target" id="change-8403645e6ecab28e501dbfb4d00224fd"><strong>[bug] [ext] </strong></span><p>Fixed an issue in baked queries where the .get() method, used either directly or within lazy loads, didn’t consider the mapper’s “get clause” as part of the cache key, causing bound parameter mismatches if the clause got re-generated. This clause is cached by mappers on the fly but in highly concurrent scenarios may be generated more than once when first accessed.</p> <a class="changeset-link headerlink reference internal" href="#change-8403645e6ecab28e501dbfb4d00224fd">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3597">#3597</a></p> </p> </li> <li><p id="change-1.0.10-18"><span class="target" id="change-679c9f0f8241f2d807a6d969b04062ac"><strong>[change] [tests] </strong></span><p>The ORM and Core tutorials, which have always been in doctest format, are now exercised within the normal unit test suite in both Python 2 and Python 3.</p> <a class="changeset-link headerlink reference internal" href="#change-679c9f0f8241f2d807a6d969b04062ac">¶</a><p></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.9"> <h2>1.0.9<a class="headerlink" href="#change-1.0.9" title="Permalink to this headline">¶</a></h2> Released: October 20, 2015<div class="section" id="change-1.0.9-orm"> <h3>orm<a class="headerlink" href="#change-1.0.9-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.9-0"><span class="target" id="change-036a3c5dc5a79efaf54c986efe1de824"><strong>[orm] [feature] </strong></span><p>Added new method <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.one_or_none" title="sqlalchemy.orm.query.Query.one_or_none"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.one_or_none()</span></code></a>; same as <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.one" title="sqlalchemy.orm.query.Query.one"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.one()</span></code></a> but returns None if no row found. Pull request courtesy esiegerman.</p> <a class="changeset-link headerlink reference internal" href="#change-036a3c5dc5a79efaf54c986efe1de824">¶</a><p></p> </p> </li> <li><p id="change-1.0.9-1"><span class="target" id="change-60963a199ad3f0a534b9a82b4b2fae67"><strong>[orm] [bug] [postgresql] </strong></span><p>Fixed regression in 1.0 where new feature of using “executemany” for UPDATE statements in the ORM (e.g. <a class="reference internal" href="migration_10.html#feature-updatemany"><span class="std std-ref">UPDATE statements are now batched with executemany() in a flush</span></a>) would break on PostgreSQL and other RETURNING backends when using server-side version generation schemes, as the server side value is retrieved via RETURNING which is not supported with executemany.</p> <a class="changeset-link headerlink reference internal" href="#change-60963a199ad3f0a534b9a82b4b2fae67">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3556">#3556</a></p> </p> </li> <li><p id="change-1.0.9-2"><span class="target" id="change-8afb9b23354a19cca287e476b397cd10"><strong>[orm] [bug] </strong></span><p>Fixed rare TypeError which could occur when stringifying certain kinds of internal column loader options within internal logging.</p> <a class="changeset-link headerlink reference internal" href="#change-8afb9b23354a19cca287e476b397cd10">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3539">#3539</a></p> </p> </li> <li><p id="change-1.0.9-3"><span class="target" id="change-28c1d20d00a8faa94ad7c40b4b239a48"><strong>[orm] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bulk_save_objects" title="sqlalchemy.orm.session.Session.bulk_save_objects"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bulk_save_objects()</span></code></a> where a mapped column that had some kind of “fetch on update” value and was not locally present in the given object would cause an AttributeError within the operation.</p> <a class="changeset-link headerlink reference internal" href="#change-28c1d20d00a8faa94ad7c40b4b239a48">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3525">#3525</a></p> </p> </li> <li><p id="change-1.0.9-4"><span class="target" id="change-05874c2cf9d4c41757ed8ac0c488bdec"><strong>[orm] [bug] </strong></span><p>Fixed 1.0 regression where the “noload” loader strategy would fail to function for a many-to-one relationship. The loader used an API to place “None” into the dictionary which no longer actually writes a value; this is a side effect of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a>.</p> <a class="changeset-link headerlink reference internal" href="#change-05874c2cf9d4c41757ed8ac0c488bdec">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3510">#3510</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.9-sql"> <h3>sql<a class="headerlink" href="#change-1.0.9-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.9-5"><span class="target" id="change-eb651eba6b167e1485192d8bd8f43bd6"><strong>[sql] [bug] </strong></span><p>Fixed regression in 1.0-released default-processor for multi-VALUES insert statement, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3288">#3288</a>, where the column type for the default-holding column would not be propagated to the compiled statement in the case where the default was being used, leading to bind-level type handlers not being invoked.</p> <a class="changeset-link headerlink reference internal" href="#change-eb651eba6b167e1485192d8bd8f43bd6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3520">#3520</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.9-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.9-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.9-6"><span class="target" id="change-15065953a5c2716dfecb15f47e3578f7"><strong>[postgresql] [bug] </strong></span><p>An adjustment to the new PostgreSQL feature of reflecting storage options and USING of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3455">#3455</a> released in 1.0.6, to disable the feature for PostgreSQL versions < 8.2 where the <code class="docutils literal notranslate"><span class="pre">reloptions</span></code> column is not provided; this allows Amazon Redshift to again work as it is based on an 8.0.x version of PostgreSQL. Fix courtesy Pete Hollobon.</p> <a class="changeset-link headerlink reference internal" href="#change-15065953a5c2716dfecb15f47e3578f7">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.9-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.9-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.9-7"><span class="target" id="change-e892caf5c83c911133f4fe685a6b90c9"><strong>[oracle] [bug] [py3k] </strong></span><p>Fixed support for cx_Oracle version 5.2, which was tripping up SQLAlchemy’s version detection under Python 3 and inadvertently not using the correct unicode mode for Python 3. This would cause issues such as bound variables mis-interpreted as NULL and rows silently not being returned.</p> <a class="changeset-link headerlink reference internal" href="#change-e892caf5c83c911133f4fe685a6b90c9">¶</a><p>This change is also <strong>backported</strong> to: 0.7.0b1</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3491">#3491</a></p> </p> </li> <li><p id="change-1.0.9-8"><span class="target" id="change-f35d719e83c23631bc4bce923fa7c168"><strong>[oracle] [bug] </strong></span><p>Fixed bug in Oracle dialect where reflection of tables and other symbols with names quoted to force all-lower-case would not be identified properly in reflection queries. The <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.elements.quoted_name" title="sqlalchemy.sql.elements.quoted_name"><code class="xref py py-class docutils literal notranslate"><span class="pre">quoted_name</span></code></a> construct is now applied to incoming symbol names that detect as forced into all-lower-case within the “name normalize” process.</p> <a class="changeset-link headerlink reference internal" href="#change-f35d719e83c23631bc4bce923fa7c168">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3548">#3548</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.9-misc"> <h3>misc<a class="headerlink" href="#change-1.0.9-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.9-9"><span class="target" id="change-0e6786c673e336a819a7d69ab3e4e94f"><strong>[feature] [ext] </strong></span><p>Added the <a class="reference internal" href="../orm/extensions/associationproxy.html#sqlalchemy.ext.associationproxy.AssociationProxy.params.info" title="sqlalchemy.ext.associationproxy.AssociationProxy"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">AssociationProxy.info</span></code></a> parameter to the <a class="reference internal" href="../orm/extensions/associationproxy.html#sqlalchemy.ext.associationproxy.AssociationProxy" title="sqlalchemy.ext.associationproxy.AssociationProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">AssociationProxy</span></code></a> constructor, to suit the <a class="reference internal" href="../orm/extensions/associationproxy.html#sqlalchemy.ext.associationproxy.AssociationProxy.info" title="sqlalchemy.ext.associationproxy.AssociationProxy.info"><code class="xref py py-attr docutils literal notranslate"><span class="pre">AssociationProxy.info</span></code></a> accessor that was added in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2971">#2971</a>. This is possible because <a class="reference internal" href="../orm/extensions/associationproxy.html#sqlalchemy.ext.associationproxy.AssociationProxy" title="sqlalchemy.ext.associationproxy.AssociationProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">AssociationProxy</span></code></a> is constructed explicitly, unlike a hybrid which is constructed implicitly via the decorator syntax.</p> <a class="changeset-link headerlink reference internal" href="#change-0e6786c673e336a819a7d69ab3e4e94f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3551">#3551</a></p> </p> </li> <li><p id="change-1.0.9-10"><span class="target" id="change-4d194a4a74cbfbf7fe6e942c90398724"><strong>[bug] [examples] </strong></span><p>Fixed two issues in the “history_meta” example where history tracking could encounter empty history, and where a column keyed to an alternate attribute name would fail to track properly. Fixes courtesy Alex Fraser.</p> <a class="changeset-link headerlink reference internal" href="#change-4d194a4a74cbfbf7fe6e942c90398724">¶</a><p></p> </p> </li> <li><p id="change-1.0.9-11"><span class="target" id="change-75effcc51432ea1848ea2d5f00fd9e30"><strong>[bug] [sybase] </strong></span><p>Fixed two issues regarding Sybase reflection, allowing tables without primary keys to be reflected as well as ensured that a SQL statement involved in foreign key detection is pre-fetched up front to avoid driver issues upon nested queries. Fixes here courtesy Eugene Zapolsky; note that we cannot currently test Sybase to locally verify these changes.</p> <a class="changeset-link headerlink reference internal" href="#change-75effcc51432ea1848ea2d5f00fd9e30">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3508">#3508</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3509">#3509</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.8"> <h2>1.0.8<a class="headerlink" href="#change-1.0.8" title="Permalink to this headline">¶</a></h2> Released: July 22, 2015<div class="section" id="change-1.0.8-engine"> <h3>engine<a class="headerlink" href="#change-1.0.8-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.8-0"><span class="target" id="change-05bc0d20cc8959cd096fe1065ee72b6d"><strong>[engine] [bug] </strong></span><p>Fixed critical issue whereby the pool “checkout” event handler may be called against a stale connection without the “connect” event handler having been called, in the case where the pool attempted to reconnect after being invalidated and failed; the stale connection would remain present and would be used on a subsequent attempt. This issue has a greater impact in the 1.0 series subsequent to 1.0.2, as it also delivers a blanked-out <code class="docutils literal notranslate"><span class="pre">.info</span></code> dictionary to the event handler; prior to 1.0.2 the <code class="docutils literal notranslate"><span class="pre">.info</span></code> dictionary is still the previous one.</p> <a class="changeset-link headerlink reference internal" href="#change-05bc0d20cc8959cd096fe1065ee72b6d">¶</a><p>This change is also <strong>backported</strong> to: 0.7.0b1</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3497">#3497</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.8-sqlite"> <h3>sqlite<a class="headerlink" href="#change-1.0.8-sqlite" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.8-1"><span class="target" id="change-6134cd2764da1ab4c4d3248e1286a1ea"><strong>[sqlite] [bug] </strong></span><p>Fixed bug in SQLite dialect where reflection of UNIQUE constraints that included non-alphabetic characters in the names, like dots or spaces, would not be reflected with their name.</p> <a class="changeset-link headerlink reference internal" href="#change-6134cd2764da1ab4c4d3248e1286a1ea">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3495">#3495</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.8-misc"> <h3>misc<a class="headerlink" href="#change-1.0.8-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.8-2"><span class="target" id="change-24c5326bfca21e965dae7fe158cafd8e"><strong>[misc] [bug] </strong></span><p>Fixed an issue where a particular base class within utils didn’t implement <code class="docutils literal notranslate"><span class="pre">__slots__</span></code>, and therefore meant all subclasses of that class didn’t either, negating the rationale for <code class="docutils literal notranslate"><span class="pre">__slots__</span></code> to be in use. Didn’t cause any issue except on IronPython which apparently does not implement <code class="docutils literal notranslate"><span class="pre">__slots__</span></code> behavior compatibly with cPython.</p> <a class="changeset-link headerlink reference internal" href="#change-24c5326bfca21e965dae7fe158cafd8e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3494">#3494</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.7"> <h2>1.0.7<a class="headerlink" href="#change-1.0.7" title="Permalink to this headline">¶</a></h2> Released: July 20, 2015<div class="section" id="change-1.0.7-orm"> <h3>orm<a class="headerlink" href="#change-1.0.7-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.7-0"><span class="target" id="change-d8257a12a5e639cc3b2c05a3479592cd"><strong>[orm] [bug] </strong></span><p>Fixed 1.0 regression where value objects that override <code class="docutils literal notranslate"><span class="pre">__eq__()</span></code> to return a non-boolean-capable object, such as some geoalchemy types as well as numpy types, were being tested for <code class="docutils literal notranslate"><span class="pre">bool()</span></code> during a unit of work update operation, where in 0.9 the return value of <code class="docutils literal notranslate"><span class="pre">__eq__()</span></code> was tested against “is True” to guard against this.</p> <a class="changeset-link headerlink reference internal" href="#change-d8257a12a5e639cc3b2c05a3479592cd">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3469">#3469</a></p> </p> </li> <li><p id="change-1.0.7-1"><span class="target" id="change-e746b68ee9723f9830729a8b48705cc0"><strong>[orm] [bug] </strong></span><p>Fixed 1.0 regression where a “deferred” attribute would not populate correctly if it were loaded within the “optimized inheritance load”, which is a special SELECT emitted in the case of joined table inheritance used to populate expired or unloaded attributes against a joined table without loading the base table. This is related to the fact that SQLA 1.0 no longer guesses about loading deferred columns and must be directed explicitly.</p> <a class="changeset-link headerlink reference internal" href="#change-e746b68ee9723f9830729a8b48705cc0">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3468">#3468</a></p> </p> </li> <li><p id="change-1.0.7-2"><span class="target" id="change-5fde27efe6d3b70810bf2221b87e06b2"><strong>[orm] [bug] </strong></span><p>Fixed 1.0 regression where the “parent entity” of a synonym- mapped attribute on top of an <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.aliased" title="sqlalchemy.orm.aliased"><code class="xref py py-func docutils literal notranslate"><span class="pre">aliased()</span></code></a> object would resolve to the original mapper, not the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.aliased" title="sqlalchemy.orm.aliased"><code class="xref py py-func docutils literal notranslate"><span class="pre">aliased()</span></code></a> version of it, thereby causing problems for a <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> that relies on this attribute (e.g. it’s the only representative attribute given in the constructor) to figure out the correct FROM clause for the query.</p> <a class="changeset-link headerlink reference internal" href="#change-5fde27efe6d3b70810bf2221b87e06b2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3466">#3466</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.7-orm-declarative"> <h3>orm declarative<a class="headerlink" href="#change-1.0.7-orm-declarative" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.7-3"><span class="target" id="change-14091d56b0a4b381f6ca76bf3b1c27e1"><strong>[bug] [declarative] [orm] </strong></span><p>Fixed bug in <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.AbstractConcreteBase" title="sqlalchemy.ext.declarative.AbstractConcreteBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractConcreteBase</span></code></a> extension where a column setup on the ABC base which had a different attribute name vs. column name would not be correctly mapped on the final base class. The failure on 0.9 would be silent whereas on 1.0 it raised an ArgumentError, so may not have been noticed prior to 1.0.</p> <a class="changeset-link headerlink reference internal" href="#change-14091d56b0a4b381f6ca76bf3b1c27e1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3480">#3480</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.7-engine"> <h3>engine<a class="headerlink" href="#change-1.0.7-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.7-4"><span class="target" id="change-a8f444887b4e02dd0ebb799cd316449e"><strong>[engine] [bug] </strong></span><p>Fixed regression where new methods on <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ResultProxy" title="sqlalchemy.engine.ResultProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">ResultProxy</span></code></a> used by the ORM <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> object (part of the performance enhancements of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3175">#3175</a>) would not raise the “this result does not return rows” exception in the case where the driver (typically MySQL) fails to generate cursor.description correctly; an AttributeError against NoneType would be raised instead.</p> <a class="changeset-link headerlink reference internal" href="#change-a8f444887b4e02dd0ebb799cd316449e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3481">#3481</a></p> </p> </li> <li><p id="change-1.0.7-5"><span class="target" id="change-cec9d3d58a6ea531cc16fc2bfe7cc705"><strong>[engine] [bug] </strong></span><p>Fixed regression where <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ResultProxy.keys" title="sqlalchemy.engine.ResultProxy.keys"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ResultProxy.keys()</span></code></a> would return un-adjusted internal symbol names for “anonymous” labels, which are the “foo_1” types of labels we see generated for SQL functions without labels and similar. This was a side effect of the performance enhancements implemented as part of #918.</p> <a class="changeset-link headerlink reference internal" href="#change-cec9d3d58a6ea531cc16fc2bfe7cc705">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3483">#3483</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.7-sql"> <h3>sql<a class="headerlink" href="#change-1.0.7-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.7-6"><span class="target" id="change-43b6d3363b92faa5bbb53e4513946b06"><strong>[sql] [feature] </strong></span><p>Added a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.ColumnElement.cast" title="sqlalchemy.sql.expression.ColumnElement.cast"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ColumnElement.cast()</span></code></a> method which performs the same purpose as the standalone <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.cast" title="sqlalchemy.sql.expression.cast"><code class="xref py py-func docutils literal notranslate"><span class="pre">cast()</span></code></a> function. Pull request courtesy Sebastian Bank.</p> <a class="changeset-link headerlink reference internal" href="#change-43b6d3363b92faa5bbb53e4513946b06">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3459">#3459</a></p> </p> </li> <li><p id="change-1.0.7-7"><span class="target" id="change-f23bd7810df445fe57174ff9f025b7d7"><strong>[sql] [bug] </strong></span><p>Fixed bug where coercion of literal <code class="docutils literal notranslate"><span class="pre">True</span></code> or <code class="docutils literal notranslate"><span class="pre">False</span></code> constant in conjunction with <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.and_" title="sqlalchemy.sql.expression.and_"><code class="xref py py-func docutils literal notranslate"><span class="pre">and_()</span></code></a> or <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.or_" title="sqlalchemy.sql.expression.or_"><code class="xref py py-func docutils literal notranslate"><span class="pre">or_()</span></code></a> would fail with an AttributeError.</p> <a class="changeset-link headerlink reference internal" href="#change-f23bd7810df445fe57174ff9f025b7d7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3490">#3490</a></p> </p> </li> <li><p id="change-1.0.7-8"><span class="target" id="change-b370520554bd5df73fbe6c051d269d8d"><strong>[sql] [bug] </strong></span><p>Fixed potential issue where a custom subclass of <a class="reference internal" href="../core/functions.html#sqlalchemy.sql.functions.FunctionElement" title="sqlalchemy.sql.functions.FunctionElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">FunctionElement</span></code></a> or other column element that incorrectly states ‘None’ or any other invalid object as the <code class="docutils literal notranslate"><span class="pre">.type</span></code> attribute will report this exception instead of recursion overflow.</p> <a class="changeset-link headerlink reference internal" href="#change-b370520554bd5df73fbe6c051d269d8d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3485">#3485</a></p> </p> </li> <li><p id="change-1.0.7-9"><span class="target" id="change-0987e97a44de7599027c6110b0dc7d3e"><strong>[sql] [bug] </strong></span><p>Fixed bug where the modulus SQL operator wouldn’t work in reverse due to a missing <code class="docutils literal notranslate"><span class="pre">__rmod__</span></code> method. Pull request courtesy dan-gittik.</p> <a class="changeset-link headerlink reference internal" href="#change-0987e97a44de7599027c6110b0dc7d3e">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.7-schema"> <h3>schema<a class="headerlink" href="#change-1.0.7-schema" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.7-10"><span class="target" id="change-8f1453e149271dd9f8aef4a28b9fe43b"><strong>[schema] [feature] </strong></span><p>Added support for the MINVALUE, MAXVALUE, NO MINVALUE, NO MAXVALUE, and CYCLE arguments for CREATE SEQUENCE as supported by PostgreSQL and Oracle. Pull request courtesy jakeogh.</p> <a class="changeset-link headerlink reference internal" href="#change-8f1453e149271dd9f8aef4a28b9fe43b">¶</a><p></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.6"> <h2>1.0.6<a class="headerlink" href="#change-1.0.6" title="Permalink to this headline">¶</a></h2> Released: June 25, 2015<div class="section" id="change-1.0.6-orm"> <h3>orm<a class="headerlink" href="#change-1.0.6-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.6-0"><span class="target" id="change-04e09fd9acaa6bca943798ba105b4b25"><strong>[orm] [bug] </strong></span><p>Fixed a major regression in the 1.0 series where the version_id_counter feature would cause an object’s version counter to be incremented when there was no net change to the object’s row, but instead an object related to it via relationship (e.g. typically many-to-one) were associated or de-associated with it, resulting in an UPDATE statement that updates the object’s version counter and nothing else. In the use case where the relatively recent “server side” and/or “programmatic/conditional” version counter feature were used (e.g. setting version_id_generator to False), the bug could cause an UPDATE without a valid SET clause to be emitted.</p> <a class="changeset-link headerlink reference internal" href="#change-04e09fd9acaa6bca943798ba105b4b25">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3465">#3465</a></p> </p> </li> <li><p id="change-1.0.6-1"><span class="target" id="change-a89cda0a0765a524834f1d22bae66a2c"><strong>[orm] [bug] </strong></span><p>Fixed 1.0 regression where the enhanced behavior of single-inheritance joins of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3222">#3222</a> takes place inappropriately for a JOIN along explicit join criteria with a single-inheritance subclass that does not make use of any discriminator, resulting in an additional “AND NULL” clause.</p> <a class="changeset-link headerlink reference internal" href="#change-a89cda0a0765a524834f1d22bae66a2c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3462">#3462</a></p> </p> </li> <li><p id="change-1.0.6-2"><span class="target" id="change-82e3d4362a36c994cf4680b0b62dbd96"><strong>[orm] [bug] </strong></span><p>Fixed bug in new <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.bulk_update_mappings" title="sqlalchemy.orm.session.Session.bulk_update_mappings"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.bulk_update_mappings()</span></code></a> feature where the primary key columns used in the WHERE clause to locate the row would also be included in the SET clause, setting their value to themselves unnecessarily. Pull request courtesy Patrick Hayes.</p> <a class="changeset-link headerlink reference internal" href="#change-82e3d4362a36c994cf4680b0b62dbd96">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3451">#3451</a></p> </p> </li> <li><p id="change-1.0.6-3"><span class="target" id="change-1b5aa56f5daacaf0d6b72f2a3660367b"><strong>[orm] [bug] </strong></span><p>Fixed an unexpected-use regression whereby custom <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator.Comparator" title="sqlalchemy.types.TypeDecorator.Comparator"><code class="xref py py-class docutils literal notranslate"><span class="pre">Comparator</span></code></a> objects that made use of the <code class="docutils literal notranslate"><span class="pre">__clause_element__()</span></code> method and returned an object that was an ORM-mapped <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.attributes.InstrumentedAttribute" title="sqlalchemy.orm.attributes.InstrumentedAttribute"><code class="xref py py-class docutils literal notranslate"><span class="pre">InstrumentedAttribute</span></code></a> and not explicitly a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.ColumnElement" title="sqlalchemy.sql.expression.ColumnElement"><code class="xref py py-class docutils literal notranslate"><span class="pre">ColumnElement</span></code></a> would fail to be correctly handled when passed as an expression to <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.query" title="sqlalchemy.orm.session.Session.query"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.query()</span></code></a>. The logic in 0.9 happened to succeed on this, so this use case is now supported.</p> <a class="changeset-link headerlink reference internal" href="#change-1b5aa56f5daacaf0d6b72f2a3660367b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3448">#3448</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.6-sql"> <h3>sql<a class="headerlink" href="#change-1.0.6-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.6-4"><span class="target" id="change-13ad1c4b46b46eef73ee80da9b69b7c7"><strong>[sql] [bug] </strong></span><p>Fixed a bug where clause adaption as applied to a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.Label" title="sqlalchemy.sql.expression.Label"><code class="xref py py-class docutils literal notranslate"><span class="pre">Label</span></code></a> object would fail to accommodate the labeled SQL expression in all cases, such that any SQL operation that made use of <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.Label.self_group" title="sqlalchemy.sql.expression.Label.self_group"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Label.self_group()</span></code></a> would use the original unadapted expression. One effect of this would be that an ORM <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.aliased" title="sqlalchemy.orm.aliased"><code class="xref py py-func docutils literal notranslate"><span class="pre">aliased()</span></code></a> construct would not fully accommodate attributes mapped by <a class="reference internal" href="../orm/mapping_columns.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><code class="xref py py-obj docutils literal notranslate"><span class="pre">column_property</span></code></a>, such that the un-aliased table could leak out when the property were used in some kinds of SQL comparisons.</p> <a class="changeset-link headerlink reference internal" href="#change-13ad1c4b46b46eef73ee80da9b69b7c7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3445">#3445</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.6-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.6-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.6-5"><span class="target" id="change-a1da751254775f355493a4ce8c269b31"><strong>[postgresql] [feature] </strong></span><p>Added support for storage parameters under CREATE INDEX, using a new keyword argument <code class="docutils literal notranslate"><span class="pre">postgresql_with</span></code>. Also added support for reflection to support both the <code class="docutils literal notranslate"><span class="pre">postgresql_with</span></code> flag as well as the <code class="docutils literal notranslate"><span class="pre">postgresql_using</span></code> flag, which will now be set on <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.Index" title="sqlalchemy.schema.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a> objects that are reflected, as well present in a new “dialect_options” dictionary in the result of <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_indexes" title="sqlalchemy.engine.reflection.Inspector.get_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_indexes()</span></code></a>. Pull request courtesy Pete Hollobon.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/postgresql.html#postgresql-index-storage"><span class="std std-ref">Index Storage Parameters</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-a1da751254775f355493a4ce8c269b31">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3455">#3455</a></p> </p> </li> <li><p id="change-1.0.6-6"><span class="target" id="change-dbf0b8a22c79871cbf0aa7090384697a"><strong>[postgresql] [feature] </strong></span><p>Added new execution option <code class="docutils literal notranslate"><span class="pre">max_row_buffer</span></code> which is interpreted by the psycopg2 dialect when the <code class="docutils literal notranslate"><span class="pre">stream_results</span></code> option is used, which sets a limit on the size of the row buffer that may be allocated. This value is also provided based on the integer value sent to <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.yield_per" title="sqlalchemy.orm.query.Query.yield_per"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.yield_per()</span></code></a>. Pull request courtesy mcclurem.</p> <a class="changeset-link headerlink reference internal" href="#change-dbf0b8a22c79871cbf0aa7090384697a">¶</a><p></p> </p> </li> <li><p id="change-1.0.6-7"><span class="target" id="change-b6f3e6dc6d48ee3c97373314cbf5a1d2"><strong>[postgresql] [bug] [pypy] </strong></span><p>Re-fixed this issue first released in 1.0.5 to fix psycopg2cffi JSONB support once again, as they suddenly switched on unconditional decoding of JSONB types in version 2.7.1. Version detection now specifies 2.7.1 as where we should expect the DBAPI to do json encoding for us.</p> <a class="changeset-link headerlink reference internal" href="#change-b6f3e6dc6d48ee3c97373314cbf5a1d2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3439">#3439</a></p> </p> </li> <li><p id="change-1.0.6-8"><span class="target" id="change-be2b184e44dd8cb506c1edf0abb96861"><strong>[postgresql] [bug] </strong></span><p>Repaired the <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.ExcludeConstraint" title="sqlalchemy.dialects.postgresql.ExcludeConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">ExcludeConstraint</span></code></a> construct to support common features that other objects like <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.Index" title="sqlalchemy.schema.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a> now do, that the column expression may be specified as an arbitrary SQL expression such as <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column.cast" title="sqlalchemy.schema.Column.cast"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cast</span></code></a> or <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-obj docutils literal notranslate"><span class="pre">text</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-be2b184e44dd8cb506c1edf0abb96861">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3454">#3454</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.6-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.6-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.6-9"><span class="target" id="change-c172051273efb1de12dcb17d2c004ef7"><strong>[mssql] [bug] </strong></span><p>Fixed issue when using <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.VARBINARY" title="sqlalchemy.types.VARBINARY"><code class="xref py py-class docutils literal notranslate"><span class="pre">VARBINARY</span></code></a> type in conjunction with an INSERT of NULL + pyodbc; pyodbc requires a special object be passed in order to persist NULL. As the <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.VARBINARY" title="sqlalchemy.types.VARBINARY"><code class="xref py py-class docutils literal notranslate"><span class="pre">VARBINARY</span></code></a> type is now usually the default for <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.LargeBinary" title="sqlalchemy.types.LargeBinary"><code class="xref py py-class docutils literal notranslate"><span class="pre">LargeBinary</span></code></a> due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3039">#3039</a>, this issue is partially a regression in 1.0. The pymssql driver appears to be unaffected.</p> <a class="changeset-link headerlink reference internal" href="#change-c172051273efb1de12dcb17d2c004ef7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3464">#3464</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.6-misc"> <h3>misc<a class="headerlink" href="#change-1.0.6-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.6-10"><span class="target" id="change-b866346f95d8f41069d193ae0433445a"><strong>[bug] [documentation] </strong></span><p>Fixed an internal “memoization” routine for method types such that a Python descriptor is no longer used; repairs inspectability of these methods including support for Sphinx documentation.</p> <a class="changeset-link headerlink reference internal" href="#change-b866346f95d8f41069d193ae0433445a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2077">#2077</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.5"> <h2>1.0.5<a class="headerlink" href="#change-1.0.5" title="Permalink to this headline">¶</a></h2> Released: June 7, 2015<div class="section" id="change-1.0.5-orm"> <h3>orm<a class="headerlink" href="#change-1.0.5-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-0"><span class="target" id="change-6f39fdde16df0990bd8ef09baff4f315"><strong>[orm] [feature] </strong></span><p>Added new event <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.InstanceEvents.refresh_flush" title="sqlalchemy.orm.events.InstanceEvents.refresh_flush"><code class="xref py py-meth docutils literal notranslate"><span class="pre">InstanceEvents.refresh_flush()</span></code></a>, invoked when an INSERT or UPDATE level default value fetched via RETURNING or Python-side default is invoked within the flush process. This is to provide a hook that is no longer present as a result of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3167">#3167</a>, where attribute and validation events are no longer called within the flush process.</p> <a class="changeset-link headerlink reference internal" href="#change-6f39fdde16df0990bd8ef09baff4f315">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3427">#3427</a></p> </p> </li> <li><p id="change-1.0.5-1"><span class="target" id="change-8dff32ea855329842148a57ea75d4663"><strong>[orm] [bug] </strong></span><p>The “lightweight named tuple” used when a <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> returns rows failed to implement <code class="docutils literal notranslate"><span class="pre">__slots__</span></code> correctly such that it still had a <code class="docutils literal notranslate"><span class="pre">__dict__</span></code>. This is resolved, but in the extremely unlikely case someone was assigning values to the returned tuples, that will no longer work.</p> <a class="changeset-link headerlink reference internal" href="#change-8dff32ea855329842148a57ea75d4663">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3420">#3420</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.5-engine"> <h3>engine<a class="headerlink" href="#change-1.0.5-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-2"><span class="target" id="change-8fa73745239a3c7507b7d191c9f3578e"><strong>[engine] [feature] </strong></span><p>Added new engine event <a class="reference internal" href="../core/events.html#sqlalchemy.events.ConnectionEvents.engine_disposed" title="sqlalchemy.events.ConnectionEvents.engine_disposed"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ConnectionEvents.engine_disposed()</span></code></a>. Called after the <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Engine.dispose" title="sqlalchemy.engine.Engine.dispose"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Engine.dispose()</span></code></a> method is called.</p> <a class="changeset-link headerlink reference internal" href="#change-8fa73745239a3c7507b7d191c9f3578e">¶</a><p></p> </p> </li> <li><p id="change-1.0.5-3"><span class="target" id="change-7cad7183efd71f8b53336f756c01bd4d"><strong>[engine] [feature] </strong></span><p>Adjustments to the engine plugin hook, such that the <a class="reference internal" href="../core/engines.html#sqlalchemy.engine.url.URL.get_dialect" title="sqlalchemy.engine.url.URL.get_dialect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">URL.get_dialect()</span></code></a> method will continue to return the ultimate <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.interfaces.Dialect" title="sqlalchemy.engine.interfaces.Dialect"><code class="xref py py-class docutils literal notranslate"><span class="pre">Dialect</span></code></a> object when a dialect plugin is used, without the need for the caller to be aware of the <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.interfaces.Dialect.get_dialect_cls" title="sqlalchemy.engine.interfaces.Dialect.get_dialect_cls"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Dialect.get_dialect_cls()</span></code></a> method.</p> <a class="changeset-link headerlink reference internal" href="#change-7cad7183efd71f8b53336f756c01bd4d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3379">#3379</a></p> </p> </li> <li><p id="change-1.0.5-4"><span class="target" id="change-5aaf85c9f6df16c1044c4ad2c76bb2c2"><strong>[engine] [bug] </strong></span><p>Fixed bug where known boolean values used by <a class="reference internal" href="../core/engines.html#sqlalchemy.engine_from_config" title="sqlalchemy.engine_from_config"><code class="xref py py-func docutils literal notranslate"><span class="pre">engine_from_config()</span></code></a> were not being parsed correctly; these included <code class="docutils literal notranslate"><span class="pre">pool_threadlocal</span></code> and the psycopg2 argument <code class="docutils literal notranslate"><span class="pre">use_native_unicode</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-5aaf85c9f6df16c1044c4ad2c76bb2c2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3435">#3435</a></p> </p> </li> <li><p id="change-1.0.5-5"><span class="target" id="change-cb20239967e5596291f1b8c8d0932231"><strong>[engine] [bug] </strong></span><p>Added support for the case of the misbehaving DBAPI that has pep-249 exception names linked to exception classes of an entirely different name, preventing SQLAlchemy’s own exception wrapping from wrapping the error appropriately. The SQLAlchemy dialect in use needs to implement a new accessor <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.default.DefaultDialect.dbapi_exception_translation_map" title="sqlalchemy.engine.default.DefaultDialect.dbapi_exception_translation_map"><code class="xref py py-attr docutils literal notranslate"><span class="pre">DefaultDialect.dbapi_exception_translation_map</span></code></a> to support this feature; this is implemented now for the py-postgresql dialect.</p> <a class="changeset-link headerlink reference internal" href="#change-cb20239967e5596291f1b8c8d0932231">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3421">#3421</a></p> </p> </li> <li><p id="change-1.0.5-6"><span class="target" id="change-82a9e2855bd62701c659a0acd3b49568"><strong>[engine] [bug] </strong></span><p>Fixed bug involving the case when pool checkout event handlers are used and connection attempts are made in the handler itself which fail, the owning connection record would not be freed until the stack trace of the connect error itself were freed. For the case where a test pool of only a single connection were used, this means the pool would be fully checked out until that stack trace were freed. This mostly impacts very specific debugging scenarios and is unlikely to have been noticeable in any production application. The fix applies an explicit checkin of the record before re-raising the caught exception.</p> <a class="changeset-link headerlink reference internal" href="#change-82a9e2855bd62701c659a0acd3b49568">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3419">#3419</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.5-sql"> <h3>sql<a class="headerlink" href="#change-1.0.5-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-7"><span class="target" id="change-6a7bcfa66a36b1ded7b8cf68cab71db2"><strong>[sql] [feature] </strong></span><p>Added official support for a CTE used by the SELECT present inside of <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.from_select" title="sqlalchemy.sql.expression.Insert.from_select"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.from_select()</span></code></a>. This behavior worked accidentally up until 0.9.9, when it no longer worked due to unrelated changes as part of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3248">#3248</a>. Note that this is the rendering of the WITH clause after the INSERT, before the SELECT; the full functionality of CTEs rendered at the top level of INSERT, UPDATE, DELETE is a new feature targeted for a later release.</p> <a class="changeset-link headerlink reference internal" href="#change-6a7bcfa66a36b1ded7b8cf68cab71db2">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3418">#3418</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.5-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.5-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-8"><span class="target" id="change-5e1e9b8242becfeda0232f1306c98782"><strong>[postgresql] [bug] [pypy] </strong></span><p>Repaired some typing and test issues related to the pypy psycopg2cffi dialect, in particular that the current 2.7.0 version does not have native support for the JSONB type. The version detection for psycopg2 features has been tuned into a specific sub-version for psycopg2cffi. Additionally, test coverage has been enabled for the full series of psycopg2 features under psycopg2cffi.</p> <a class="changeset-link headerlink reference internal" href="#change-5e1e9b8242becfeda0232f1306c98782">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3439">#3439</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.5-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.5-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-9"><span class="target" id="change-2f1eef92d4aa9867a4dd243e49dee047"><strong>[mssql] [bug] </strong></span><p>Added a new dialect flag to the MSSQL dialect <code class="docutils literal notranslate"><span class="pre">legacy_schema_aliasing</span></code> which when set to False will disable a very old and obsolete behavior, that of the compiler’s attempt to turn all schema-qualified table names into alias names, to work around old and no longer locatable issues where SQL server could not parse a multi-part identifier name in all circumstances. The behavior prevented more sophisticated statements from working correctly, including those which use hints, as well as CRUD statements that embed correlated SELECT statements. Rather than continue to repair the feature to work with more complex statements, it’s better to just disable it as it should no longer be needed for any modern SQL server version. The flag defaults to True for the 1.0.x series, leaving current behavior unchanged for this version series. In the 1.1 series, it will default to False. For the 1.0 series, when not set to either value explicitly, a warning is emitted when a schema-qualified table is first used in a statement, which suggests that the flag be set to False for all modern SQL Server versions.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/mssql.html#legacy-schema-rendering"><span class="std std-ref">Legacy Schema Mode</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-2f1eef92d4aa9867a4dd243e49dee047">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3424">#3424</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3430">#3430</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.5-misc"> <h3>misc<a class="headerlink" href="#change-1.0.5-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.5-10"><span class="target" id="change-86d91bf49f3ad357db03bf080fc3f56a"><strong>[feature] [ext] </strong></span><p>Added support for <code class="docutils literal notranslate"><span class="pre">*args</span></code> to be passed to the baked query initial callable, in the same way that <code class="docutils literal notranslate"><span class="pre">*args</span></code> are supported for the <a class="reference internal" href="../orm/extensions/baked.html#sqlalchemy.ext.baked.BakedQuery.add_criteria" title="sqlalchemy.ext.baked.BakedQuery.add_criteria"><code class="xref py py-meth docutils literal notranslate"><span class="pre">BakedQuery.add_criteria()</span></code></a> and <a class="reference internal" href="../orm/extensions/baked.html#sqlalchemy.ext.baked.BakedQuery.with_criteria" title="sqlalchemy.ext.baked.BakedQuery.with_criteria"><code class="xref py py-meth docutils literal notranslate"><span class="pre">BakedQuery.with_criteria()</span></code></a> methods. Initial PR courtesy Naoki INADA.</p> <a class="changeset-link headerlink reference internal" href="#change-86d91bf49f3ad357db03bf080fc3f56a">¶</a><p></p> </p> </li> <li><p id="change-1.0.5-11"><span class="target" id="change-45b215195b147f63665e4cc884206096"><strong>[feature] [ext] </strong></span><p>Added a new semi-public method to <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableBase" title="sqlalchemy.ext.mutable.MutableBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">MutableBase</span></code></a> <code class="xref py py-meth docutils literal notranslate"><span class="pre">MutableBase._get_listen_keys()</span></code>. Overriding this method is needed in the case where a <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableBase" title="sqlalchemy.ext.mutable.MutableBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">MutableBase</span></code></a> subclass needs events to propagate for attribute keys other than the key to which the mutable type is associated with, when intercepting the <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.InstanceEvents.refresh" title="sqlalchemy.orm.events.InstanceEvents.refresh"><code class="xref py py-meth docutils literal notranslate"><span class="pre">InstanceEvents.refresh()</span></code></a> or <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.InstanceEvents.refresh_flush" title="sqlalchemy.orm.events.InstanceEvents.refresh_flush"><code class="xref py py-meth docutils literal notranslate"><span class="pre">InstanceEvents.refresh_flush()</span></code></a> events. The current example of this is composites using <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableComposite" title="sqlalchemy.ext.mutable.MutableComposite"><code class="xref py py-class docutils literal notranslate"><span class="pre">MutableComposite</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-45b215195b147f63665e4cc884206096">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3427">#3427</a></p> </p> </li> <li><p id="change-1.0.5-12"><span class="target" id="change-f20e8c1e79cd741af716e380224f1b6b"><strong>[bug] [ext] </strong></span><p>Fixed regression in the <a class="reference internal" href="../orm/extensions/mutable.html#module-sqlalchemy.ext.mutable" title="sqlalchemy.ext.mutable"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlalchemy.ext.mutable</span></code></a> extension as a result of the bugfix for <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3167">#3167</a>, where attribute and validation events are no longer called within the flush process. The mutable extension was relying upon this behavior in the case where a column level Python-side default were responsible for generating the new value on INSERT or UPDATE, or when a value were fetched from the RETURNING clause for “eager defaults” mode. The new value would not be subject to any event when populated and the mutable extension could not establish proper coercion or history listening. A new event <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.InstanceEvents.refresh_flush" title="sqlalchemy.orm.events.InstanceEvents.refresh_flush"><code class="xref py py-meth docutils literal notranslate"><span class="pre">InstanceEvents.refresh_flush()</span></code></a> is added which the mutable extension now makes use of for this use case.</p> <a class="changeset-link headerlink reference internal" href="#change-f20e8c1e79cd741af716e380224f1b6b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3427">#3427</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.4"> <h2>1.0.4<a class="headerlink" href="#change-1.0.4" title="Permalink to this headline">¶</a></h2> Released: May 7, 2015<div class="section" id="change-1.0.4-orm"> <h3>orm<a class="headerlink" href="#change-1.0.4-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.4-0"><span class="target" id="change-66020c540100c79f6234033e002fbaeb"><strong>[orm] [bug] </strong></span><p>Fixed unexpected-use regression where in the odd case that the primaryjoin of a relationship involved comparison to an unhashable type such as an HSTORE, lazy loads would fail due to a hash-oriented check on the statement parameters, modified in 1.0 as a result of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a> to use hashing and modified in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3368">#3368</a> to occur in cases more common than “load on pending”. The values are now checked for the <code class="docutils literal notranslate"><span class="pre">__hash__</span></code> attribute beforehand.</p> <a class="changeset-link headerlink reference internal" href="#change-66020c540100c79f6234033e002fbaeb">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3416">#3416</a></p> </p> </li> <li><p id="change-1.0.4-1"><span class="target" id="change-ea65721f797c6d148bc5fc07146b2cb4"><strong>[orm] [bug] </strong></span><p>Liberalized an assertion that was added as part of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3347">#3347</a> to protect against unknown conditions when splicing inner joins together within joined eager loads with <code class="docutils literal notranslate"><span class="pre">innerjoin=True</span></code>; if some of the joins use a “secondary” table, the assertion needs to unwrap further joins in order to pass.</p> <a class="changeset-link headerlink reference internal" href="#change-ea65721f797c6d148bc5fc07146b2cb4">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3347">#3347</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3412">#3412</a></p> </p> </li> <li><p id="change-1.0.4-2"><span class="target" id="change-20137d7b96aff19d996aa7342e06ff37"><strong>[orm] [bug] </strong></span><p>Repaired / added to tests yet more expressions that were reported as failing with the new ‘entity’ key value added to <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.column_descriptions" title="sqlalchemy.orm.query.Query.column_descriptions"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Query.column_descriptions</span></code></a>, the logic to discover the “from” clause is again reworked to accommodate columns from aliased classes, as well as to report the correct value for the “aliased” flag in these cases.</p> <a class="changeset-link headerlink reference internal" href="#change-20137d7b96aff19d996aa7342e06ff37">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3320">#3320</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3409">#3409</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.4-schema"> <h3>schema<a class="headerlink" href="#change-1.0.4-schema" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.4-3"><span class="target" id="change-b46fad3ee45e73a10c8ae452bcd560ff"><strong>[schema] [bug] </strong></span><p>Fixed bug in enhanced constraint-attachment logic introduced in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3341">#3341</a> where in the unusual case of a constraint that refers to a mixture of <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> objects and string column names at the same time, the auto-attach-on-column-attach logic will be skipped; for the constraint to be auto-attached in this case, all columns must be assembled on the target table up front. Added a new section to the migration document regarding the original feature as well as this change.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3341"><span class="std std-ref">Constraints referring to unattached Columns can auto-attach to the Table when their referred columns are attached</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-b46fad3ee45e73a10c8ae452bcd560ff">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3411">#3411</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.4-misc"> <h3>misc<a class="headerlink" href="#change-1.0.4-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.4-4"><span class="target" id="change-241707a9f4ceecb1f1f621bdd850aee5"><strong>[bug] [ext] </strong></span><p>Fixed bug where when using extended attribute instrumentation system, the correct exception would not be raised when <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.class_mapper" title="sqlalchemy.orm.class_mapper"><code class="xref py py-func docutils literal notranslate"><span class="pre">class_mapper()</span></code></a> were called with an invalid input that also happened to not be weak referencable, such as an integer.</p> <a class="changeset-link headerlink reference internal" href="#change-241707a9f4ceecb1f1f621bdd850aee5">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3408">#3408</a></p> </p> </li> <li><p id="change-1.0.4-5"><span class="target" id="change-059d5e52209320ca09099434293d4ddd"><strong>[bug] [pypy] [tests] </strong></span><p>Fixed an import that prevented “pypy setup.py test” from working correctly.</p> <a class="changeset-link headerlink reference internal" href="#change-059d5e52209320ca09099434293d4ddd">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3406">#3406</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.3"> <h2>1.0.3<a class="headerlink" href="#change-1.0.3" title="Permalink to this headline">¶</a></h2> Released: April 30, 2015<div class="section" id="change-1.0.3-orm"> <h3>orm<a class="headerlink" href="#change-1.0.3-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.3-0"><span class="target" id="change-2bd0d3b1393f8f24f850225969757976"><strong>[orm] [bug] [pypy] </strong></span><p>Fixed regression from 0.9.10 prior to release due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3349">#3349</a> where the check for query state on <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a> or <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.delete" title="sqlalchemy.orm.query.Query.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.delete()</span></code></a> compared the empty tuple to itself using <code class="docutils literal notranslate"><span class="pre">is</span></code>, which fails on PyPy to produce <code class="docutils literal notranslate"><span class="pre">True</span></code> in this case; this would erronously emit a warning in 0.9 and raise an exception in 1.0.</p> <a class="changeset-link headerlink reference internal" href="#change-2bd0d3b1393f8f24f850225969757976">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3405">#3405</a></p> </p> </li> <li><p id="change-1.0.3-1"><span class="target" id="change-8fc631d0b34377b720c0895b56608e6a"><strong>[orm] [bug] </strong></span><p>Fixed regression from 0.9.10 prior to release where the new addition of <code class="docutils literal notranslate"><span class="pre">entity</span></code> to the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.column_descriptions" title="sqlalchemy.orm.query.Query.column_descriptions"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Query.column_descriptions</span></code></a> accessor would fail if the target entity was produced from a core selectable such as a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> or <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.CTE" title="sqlalchemy.sql.expression.CTE"><code class="xref py py-class docutils literal notranslate"><span class="pre">CTE</span></code></a> object.</p> <a class="changeset-link headerlink reference internal" href="#change-8fc631d0b34377b720c0895b56608e6a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3320">#3320</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3403">#3403</a></p> </p> </li> <li><p id="change-1.0.3-2"><span class="target" id="change-734ee8c88ef7db37b98e8e9bfc172c15"><strong>[orm] [bug] </strong></span><p>Fixed regression within the flush process when an attribute were set to a SQL expression for an UPDATE, and the SQL expression when compared to the previous value of the attribute would produce a SQL comparison other than <code class="docutils literal notranslate"><span class="pre">==</span></code> or <code class="docutils literal notranslate"><span class="pre">!=</span></code>, the exception “Boolean value of this clause is not defined” would raise. The fix ensures that the unit of work will not interpret the SQL expression in this way.</p> <a class="changeset-link headerlink reference internal" href="#change-734ee8c88ef7db37b98e8e9bfc172c15">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3402">#3402</a></p> </p> </li> <li><p id="change-1.0.3-3"><span class="target" id="change-3edda67f000658f898770488bd7887ae"><strong>[orm] [bug] </strong></span><p>Fixed unexpected use regression due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a> where textual elements placed into the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.order_by" title="sqlalchemy.orm.query.Query.order_by"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.order_by()</span></code></a> clause in conjunction with joined eager loading would be added to the columns clause of the inner query in such a way that they were assumed to be table-bound column names, in the case where the joined eager load needs to wrap the query in a subquery to accommodate for a limit/offset.</p> <p>Originally, the behavior here was intentional, in that a query such as <code class="docutils literal notranslate"><span class="pre">query(User).order_by('name').limit(1)</span></code> would order by <code class="docutils literal notranslate"><span class="pre">user.name</span></code> even if the query was modified by joined eager loading to be within a subquery, as <code class="docutils literal notranslate"><span class="pre">'name'</span></code> would be interpreted as a symbol to be located within the FROM clauses, in this case <code class="docutils literal notranslate"><span class="pre">User.name</span></code>, which would then be copied into the columns clause to ensure it were present for ORDER BY. However, the feature fails to anticipate the case where <code class="docutils literal notranslate"><span class="pre">order_by("name")</span></code> refers to a specific label name present in the local columns clause already and not a name bound to a selectable in the FROM clause.</p> <p>Beyond that, the feature also fails for deprecated cases such as <code class="docutils literal notranslate"><span class="pre">order_by("name</span> <span class="pre">desc")</span></code>, which, while it emits a warning that <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> should be used here (note that the issue does not impact cases where <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> is used explicitly), still produces a different query than previously where the “name desc” expression is copied into the columns clause inappropriately. The resolution is such that the “joined eager loading” aspect of the feature will skip over these so-called “label reference” expressions when augmenting the inner columns clause, as though they were <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> constructs already.</p> <a class="changeset-link headerlink reference internal" href="#change-3edda67f000658f898770488bd7887ae">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3392">#3392</a></p> </p> </li> <li><p id="change-1.0.3-4"><span class="target" id="change-57ac0f1083635c3e249664704f5f8681"><strong>[orm] [bug] </strong></span><p>Fixed a regression regarding the <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.MapperEvents.instrument_class" title="sqlalchemy.orm.events.MapperEvents.instrument_class"><code class="xref py py-meth docutils literal notranslate"><span class="pre">MapperEvents.instrument_class()</span></code></a> event where its invocation was moved to be after the class manager’s instrumentation of the class, which is the opposite of what the documentation for the event explicitly states. The rationale for the switch was due to Declarative taking the step of setting up the full “instrumentation manager” for a class before it was mapped for the purpose of the new <code class="docutils literal notranslate"><span class="pre">@declared_attr</span></code> features described in <a class="reference internal" href="migration_10.html#feature-3150"><span class="std std-ref">Improvements to declarative mixins, @declared_attr and related features</span></a>, but the change was also made against the classical use of <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper" title="sqlalchemy.orm.mapper"><code class="xref py py-func docutils literal notranslate"><span class="pre">mapper()</span></code></a> for consistency. However, SQLSoup relies upon the instrumentation event happening before any instrumentation under classical mapping. The behavior is reverted in the case of classical and declarative mapping, the latter implemented by using a simple memoization without using class manager.</p> <a class="changeset-link headerlink reference internal" href="#change-57ac0f1083635c3e249664704f5f8681">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3388">#3388</a></p> </p> </li> <li><p id="change-1.0.3-5"><span class="target" id="change-f030dd13b152b403de3872b0d7fc16be"><strong>[orm] [bug] </strong></span><p>Fixed issue in new <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.QueryEvents.before_compile" title="sqlalchemy.orm.events.QueryEvents.before_compile"><code class="xref py py-meth docutils literal notranslate"><span class="pre">QueryEvents.before_compile()</span></code></a> event where changes made to the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> object’s collection of entities to load within the event would render in the SQL, but would not be reflected during the loading process.</p> <a class="changeset-link headerlink reference internal" href="#change-f030dd13b152b403de3872b0d7fc16be">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3387">#3387</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.3-engine"> <h3>engine<a class="headerlink" href="#change-1.0.3-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.3-6"><span class="target" id="change-76cdcabbfea8e248bd78644174c5517b"><strong>[engine] [feature] </strong></span><p>New features added to support engine/pool plugins with advanced functionality. Added a new “soft invalidate” feature to the connection pool at the level of the checked out connection wrapper as well as the <a class="reference internal" href="../core/pooling.html#sqlalchemy.pool._ConnectionRecord" title="sqlalchemy.pool._ConnectionRecord"><code class="xref py py-class docutils literal notranslate"><span class="pre">_ConnectionRecord</span></code></a>. This works similarly to a modern pool invalidation in that connections aren’t actively closed, but are recycled only on next checkout; this is essentially a per-connection version of that feature. A new event <code class="xref py py-class docutils literal notranslate"><span class="pre">PoolEvents.soft_invalidate</span></code> is added to complement it.</p> <p>Also added new flag <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ExceptionContext.invalidate_pool_on_disconnect" title="sqlalchemy.engine.ExceptionContext.invalidate_pool_on_disconnect"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ExceptionContext.invalidate_pool_on_disconnect</span></code></a>. Allows an error handler within <a class="reference internal" href="../core/events.html#sqlalchemy.events.ConnectionEvents.handle_error" title="sqlalchemy.events.ConnectionEvents.handle_error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ConnectionEvents.handle_error()</span></code></a> to maintain a “disconnect” condition, but to handle calling invalidate on individual connections in a specific manner within the event.</p> <a class="changeset-link headerlink reference internal" href="#change-76cdcabbfea8e248bd78644174c5517b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3379">#3379</a></p> </p> </li> <li><p id="change-1.0.3-7"><span class="target" id="change-817fff0e7254e8e5723cbbeea9baa552"><strong>[engine] [feature] </strong></span><p>Added new event <code class="xref py py-class docutils literal notranslate"><span class="pre">DialectEvents.do_connect</span></code>, which allows interception / replacement of when the <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.interfaces.Dialect.connect" title="sqlalchemy.engine.interfaces.Dialect.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Dialect.connect()</span></code></a> hook is called to create a DBAPI connection. Also added dialect plugin hooks <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.interfaces.Dialect.get_dialect_cls" title="sqlalchemy.engine.interfaces.Dialect.get_dialect_cls"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Dialect.get_dialect_cls()</span></code></a> and <a class="reference internal" href="../core/internals.html#sqlalchemy.engine.interfaces.Dialect.engine_created" title="sqlalchemy.engine.interfaces.Dialect.engine_created"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Dialect.engine_created()</span></code></a> which allow external plugins to add events to existing dialects using entry points.</p> <a class="changeset-link headerlink reference internal" href="#change-817fff0e7254e8e5723cbbeea9baa552">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3355">#3355</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.3-sql"> <h3>sql<a class="headerlink" href="#change-1.0.3-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.3-8"><span class="target" id="change-6bec4ab076ee2fa285da1e7c5209da3b"><strong>[sql] [feature] </strong></span><p>Added a placeholder method <a class="reference internal" href="../core/type_api.html#sqlalchemy.types.TypeEngine.compare_against_backend" title="sqlalchemy.types.TypeEngine.compare_against_backend"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TypeEngine.compare_against_backend()</span></code></a> which is now consumed by Alembic migrations as of 0.7.6. User-defined types can implement this method to assist in the comparison of a type against one reflected from the database.</p> <a class="changeset-link headerlink reference internal" href="#change-6bec4ab076ee2fa285da1e7c5209da3b">¶</a><p></p> </p> </li> <li><p id="change-1.0.3-9"><span class="target" id="change-c5574f4752ab5cec2695a9af0c8f84b2"><strong>[sql] [bug] </strong></span><p>Fixed bug where the truncation of long labels in SQL could produce a label that overlapped another label that is not truncated; this because the length threshold for truncation was greater than the portion of the label that remains after truncation. These two values have now been made the same; label_length - 6. The effect here is that shorter column labels will be “truncated” where they would not have been truncated before.</p> <a class="changeset-link headerlink reference internal" href="#change-c5574f4752ab5cec2695a9af0c8f84b2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3396">#3396</a></p> </p> </li> <li><p id="change-1.0.3-10"><span class="target" id="change-556a9afc8de654667f5ab9b749086dff"><strong>[sql] [bug] </strong></span><p>Fixed regression due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3282">#3282</a> where the <code class="docutils literal notranslate"><span class="pre">tables</span></code> collection passed as a keyword argument to the <a class="reference internal" href="../core/events.html#sqlalchemy.events.DDLEvents.before_create" title="sqlalchemy.events.DDLEvents.before_create"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DDLEvents.before_create()</span></code></a>, <a class="reference internal" href="../core/events.html#sqlalchemy.events.DDLEvents.after_create" title="sqlalchemy.events.DDLEvents.after_create"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DDLEvents.after_create()</span></code></a>, <a class="reference internal" href="../core/events.html#sqlalchemy.events.DDLEvents.before_drop" title="sqlalchemy.events.DDLEvents.before_drop"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DDLEvents.before_drop()</span></code></a>, and <a class="reference internal" href="../core/events.html#sqlalchemy.events.DDLEvents.after_drop" title="sqlalchemy.events.DDLEvents.after_drop"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DDLEvents.after_drop()</span></code></a> events would no longer be a list of tables, but instead a list of tuples which contained a second entry with foreign keys to be added or dropped. As the <code class="docutils literal notranslate"><span class="pre">tables</span></code> collection, while documented as not necessarily stable, has come to be relied upon, this change is considered a regression. Additionally, in some cases for “drop”, this collection would be an iterator that would cause the operation to fail if prematurely iterated. The collection is now a list of table objects in all cases and test coverage for the format of this collection is now added.</p> <a class="changeset-link headerlink reference internal" href="#change-556a9afc8de654667f5ab9b749086dff">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3391">#3391</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.3-misc"> <h3>misc<a class="headerlink" href="#change-1.0.3-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.3-11"><span class="target" id="change-deb397d6ec2ff20a860f9f9d05ea50bf"><strong>[bug] [ext] </strong></span><p>Fixed bug in association proxy where an any()/has() on an relationship->scalar non-object attribute comparison would fail, e.g. <code class="docutils literal notranslate"><span class="pre">filter(Parent.some_collection_to_attribute.any(Child.attr</span> <span class="pre">==</span> <span class="pre">'foo'))</span></code></p> <a class="changeset-link headerlink reference internal" href="#change-deb397d6ec2ff20a860f9f9d05ea50bf">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3397">#3397</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.2"> <h2>1.0.2<a class="headerlink" href="#change-1.0.2" title="Permalink to this headline">¶</a></h2> Released: April 24, 2015<div class="section" id="change-1.0.2-orm-declarative"> <h3>orm declarative<a class="headerlink" href="#change-1.0.2-orm-declarative" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.2-0"><span class="target" id="change-fb796750b45072da56370dc233b06603"><strong>[bug] [declarative] [orm] </strong></span><p>Fixed unexpected use regression regarding the declarative <code class="docutils literal notranslate"><span class="pre">__declare_first__</span></code> and <code class="docutils literal notranslate"><span class="pre">__declare_last__</span></code> accessors where these would no longer be called on the superclass of the declarative base.</p> <a class="changeset-link headerlink reference internal" href="#change-fb796750b45072da56370dc233b06603">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3383">#3383</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.2-sql"> <h3>sql<a class="headerlink" href="#change-1.0.2-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.2-1"><span class="target" id="change-728ce9fb29e31d643429b92816fa188c"><strong>[sql] [bug] </strong></span><p>Fixed a regression that was incorrectly fixed in 1.0.0b4 (hence becoming two regressions); reports that SELECT statements would GROUP BY a label name and fail was misconstrued that certain backends such as SQL Server should not be emitting ORDER BY or GROUP BY on a simple label name at all; when in fact, we had forgotten that 0.9 was already emitting ORDER BY on a simple label name for all backends, as described in <a class="reference internal" href="migration_09.html#migration-1068"><span class="std std-ref">Label constructs can now render as their name alone in an ORDER BY</span></a>, even though 1.0 includes a rewrite of this logic as part of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a>. As far as emitting GROUP BY against a simple label, even PostgreSQL has cases where it will raise an error even though the label to group on should be apparent, so it is clear that GROUP BY should never be rendered in this way automatically.</p> <p>In 1.0.2, SQL Server, Firebird and others will again emit ORDER BY on a simple label name when passed a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.Label" title="sqlalchemy.sql.expression.Label"><code class="xref py py-class docutils literal notranslate"><span class="pre">Label</span></code></a> construct that is also present in the columns clause. Additionally, no backend will emit GROUP BY against the simple label name only when passed a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.Label" title="sqlalchemy.sql.expression.Label"><code class="xref py py-class docutils literal notranslate"><span class="pre">Label</span></code></a> construct.</p> <a class="changeset-link headerlink reference internal" href="#change-728ce9fb29e31d643429b92816fa188c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3338">#3338</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3385">#3385</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.1"> <h2>1.0.1<a class="headerlink" href="#change-1.0.1" title="Permalink to this headline">¶</a></h2> Released: April 23, 2015<div class="section" id="change-1.0.1-orm"> <h3>orm<a class="headerlink" href="#change-1.0.1-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.1-0"><span class="target" id="change-c3046cef1c62baa499a720ee4f37dc00"><strong>[orm] [bug] </strong></span><p>Fixed issue where a query of the form <code class="docutils literal notranslate"><span class="pre">query(B).filter(B.a</span> <span class="pre">!=</span> <span class="pre">A(id=7))</span></code> would render the <code class="docutils literal notranslate"><span class="pre">NEVER_SET</span></code> symbol, when given a transient object. For a persistent object, it would always use the persisted database value and not the currently set value. Assuming autoflush is turned on, this usually would not be apparent for persistent values, as any pending changes would be flushed first in any case. However, this is inconsistent vs. the logic used for the non-negated comparison, <code class="docutils literal notranslate"><span class="pre">query(B).filter(B.a</span> <span class="pre">==</span> <span class="pre">A(id=7))</span></code>, which does use the current value and additionally allows comparisons to transient objects. The comparison now uses the current value and not the database-persisted value.</p> <p>Unlike the other <code class="docutils literal notranslate"><span class="pre">NEVER_SET</span></code> issues that are repaired as regressions caused by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a> in this release, this particular issue is present at least as far back as 0.8 and possibly earlier, however it was discovered as a result of repairing the related <code class="docutils literal notranslate"><span class="pre">NEVER_SET</span></code> issues.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3374"><span class="std std-ref">A “negated contains or equals” relationship comparison will use the current value of attributes, not the database value</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-c3046cef1c62baa499a720ee4f37dc00">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3374">#3374</a></p> </p> </li> <li><p id="change-1.0.1-1"><span class="target" id="change-367bfbbb798543fcd661f5a7f129f5d6"><strong>[orm] [bug] </strong></span><p>Fixed unexpected use regression cause by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a> where the NEVER_SET symbol could leak into relationship-oriented queries, including <code class="docutils literal notranslate"><span class="pre">filter()</span></code> and <code class="docutils literal notranslate"><span class="pre">with_parent()</span></code> queries. The <code class="docutils literal notranslate"><span class="pre">None</span></code> symbol is returned in all cases, however many of these queries have never been correctly supported in any case, and produce comparisons to NULL without using the IS operator. For this reason, a warning is also added to that subset of relationship queries that don’t currently provide for <code class="docutils literal notranslate"><span class="pre">IS</span> <span class="pre">NULL</span></code>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3371"><span class="std std-ref">Warnings emitted when comparing objects with None values to relationships</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-367bfbbb798543fcd661f5a7f129f5d6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3371">#3371</a></p> </p> </li> <li><p id="change-1.0.1-2"><span class="target" id="change-16c7878b69c66a7b45e984cf7ddea43b"><strong>[orm] [bug] </strong></span><p>Fixed a regression caused by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a> where the NEVER_SET symbol could leak into a lazyload query, subsequent to the flush of a pending object. This would occur typically for a many-to-one relationship that does not use a simple “get” strategy. The good news is that the fix improves efficiency vs. 0.9, because we can now skip the SELECT statement entirely when we detect NEVER_SET symbols present in the parameters; prior to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a>, we couldn’t discern if the None here were set or not.</p> <a class="changeset-link headerlink reference internal" href="#change-16c7878b69c66a7b45e984cf7ddea43b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3368">#3368</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.1-engine"> <h3>engine<a class="headerlink" href="#change-1.0.1-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.1-3"><span class="target" id="change-64a5444055f49209fa585e76ac99afdf"><strong>[engine] [bug] </strong></span><p>Added the string value <code class="docutils literal notranslate"><span class="pre">"none"</span></code> to those accepted by the <a class="reference internal" href="../core/pooling.html#sqlalchemy.pool.Pool.params.reset_on_return" title="sqlalchemy.pool.Pool"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Pool.reset_on_return</span></code></a> parameter as a synonym for <code class="docutils literal notranslate"><span class="pre">None</span></code>, so that string values can be used for all settings, allowing utilities like <a class="reference internal" href="../core/engines.html#sqlalchemy.engine_from_config" title="sqlalchemy.engine_from_config"><code class="xref py py-func docutils literal notranslate"><span class="pre">engine_from_config()</span></code></a> to be usable without issue.</p> <a class="changeset-link headerlink reference internal" href="#change-64a5444055f49209fa585e76ac99afdf">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3375">#3375</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.1-sql"> <h3>sql<a class="headerlink" href="#change-1.0.1-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.1-4"><span class="target" id="change-c38b9512685589dea5443f525d104643"><strong>[sql] [bug] </strong></span><p>Fixed issue where a straight SELECT EXISTS query would fail to assign the proper result type of Boolean to the result mapping, and instead would leak column types from within the query into the result map. This issue exists in 0.9 and earlier as well, however has less of an impact in those versions. In 1.0, due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/918">#918</a> this becomes a regression in that we now rely upon the result mapping to be very accurate, else we can assign result-type processors to the wrong column. In all versions, this issue also has the effect that a simple EXISTS will not apply the Boolean type handler, leading to simple 1/0 values for backends without native boolean instead of True/False. The fix includes that an EXISTS columns argument will be anon-labeled like other column expressions; a similar fix is implemented for pure-boolean expressions like <code class="docutils literal notranslate"><span class="pre">not_(True())</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-c38b9512685589dea5443f525d104643">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3372">#3372</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.1-sqlite"> <h3>sqlite<a class="headerlink" href="#change-1.0.1-sqlite" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.1-5"><span class="target" id="change-3bf8faa066b4a78884ef6bf04b5ebc2b"><strong>[sqlite] [bug] </strong></span><p>Fixed a regression due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3282">#3282</a>, where due to the fact that we attempt to assume the availability of ALTER when creating/dropping schemas, in the case of SQLite we simply said to not worry about foreign keys at all, since ALTER is not available, when creating and dropping tables. This meant that the sorting of tables was basically skipped in the case of SQLite, and for the vast majority of SQLite use cases, this is not an issue.</p> <p>However, users who were doing DROPs on SQLite with tables that contained data and with referential integrity turned on would then experience errors, as the dependency sorting <em>does</em> matter in the case of DROP with enforced constraints, when those tables have data (SQLite will still happily let you create foreign keys to nonexistent tables and drop tables referring to existing ones with constraints enabled, as long as there’s no data being referenced).</p> <p>In order to maintain the new feature of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3282">#3282</a> while still allowing a SQLite DROP operation to maintain ordering, we now do the sort with full FKs taken under consideration, and if we encounter an unresolvable cycle, only <em>then</em> do we forego attempting to sort the tables; we instead emit a warning and go with the unsorted list. If an environment needs both ordered DROPs <em>and</em> has foreign key cycles, then the warning notes they will need to restore the <code class="docutils literal notranslate"><span class="pre">use_alter</span></code> flag to their <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKey" title="sqlalchemy.schema.ForeignKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForeignKey</span></code></a> and <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint" title="sqlalchemy.schema.ForeignKeyConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForeignKeyConstraint</span></code></a> objects so that just those objects will be omitted from the dependency sort.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3282"><span class="std std-ref">The use_alter flag on ForeignKeyConstraint is (usually) no longer needed</span></a> - contains an updated note about SQLite.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-3bf8faa066b4a78884ef6bf04b5ebc2b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3378">#3378</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.1-firebird"> <h3>firebird<a class="headerlink" href="#change-1.0.1-firebird" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.1-6"><span class="target" id="change-dba16e624daeccaf8cb85b4704fadcf9"><strong>[firebird] [bug] </strong></span><p>Fixed a regression due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3034">#3034</a> where limit/offset clauses were not properly interpreted by the Firebird dialect. Pull request courtesy effem-git.</p> <a class="changeset-link headerlink reference internal" href="#change-dba16e624daeccaf8cb85b4704fadcf9">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3380">#3380</a></p> </p> </li> <li><p id="change-1.0.1-7"><span class="target" id="change-454ec28afe6a7226f901467602c5e493"><strong>[firebird] [bug] </strong></span><p>Fixed support for “literal_binds” mode when using limit/offset with Firebird, so that the values are again rendered inline when this is selected. Related to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3034">#3034</a>.</p> <a class="changeset-link headerlink reference internal" href="#change-454ec28afe6a7226f901467602c5e493">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3381">#3381</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0"> <h2>1.0.0<a class="headerlink" href="#change-1.0.0" title="Permalink to this headline">¶</a></h2> Released: April 16, 2015<div class="section" id="change-1.0.0-orm"> <h3>orm<a class="headerlink" href="#change-1.0.0-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0-0"><span class="target" id="change-d6a9012ea02989676f613aa443e77cfc"><strong>[orm] [feature] </strong></span><p>Added new argument <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update.params.update_args" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Query.update.update_args</span></code></a> which allows kw arguments such as <code class="docutils literal notranslate"><span class="pre">mysql_limit</span></code> to be passed to the underlying <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Update" title="sqlalchemy.sql.expression.Update"><code class="xref py py-class docutils literal notranslate"><span class="pre">Update</span></code></a> construct. Pull request courtesy Amir Sadoughi.</p> <a class="changeset-link headerlink reference internal" href="#change-d6a9012ea02989676f613aa443e77cfc">¶</a><p></p> </p> </li> <li><p id="change-1.0.0-1"><span class="target" id="change-f7fa40f7d0ccb7891bd8c505b5445a0e"><strong>[orm] [bug] </strong></span><p>Identified an inconsistency when handling <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a> to the same target more than once; it implicitly dedupes only in the case of a relationship join, and due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3233">#3233</a>, in 1.0 a join to the same table twice behaves differently than 0.9 in that it no longer erroneously aliases. To help document this change, the verbiage regarding <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3233">#3233</a> in the migration notes has been generalized, and a warning has been added when <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a> is called against the same target relationship more than once.</p> <a class="changeset-link headerlink reference internal" href="#change-f7fa40f7d0ccb7891bd8c505b5445a0e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3367">#3367</a></p> </p> </li> <li><p id="change-1.0.0-2"><span class="target" id="change-f24cfb05e58edcba962d50d47c745bf1"><strong>[orm] [bug] </strong></span><p>Made a small improvement to the heuristics of relationship when determining remote side with semi-self-referential (e.g. two joined inh subclasses referring to each other), non-simple join conditions such that the parententity is taken into account and can reduce the need for using the <code class="docutils literal notranslate"><span class="pre">remote()</span></code> annotation; this can restore some cases that might have worked without the annotation prior to 0.9.4 via <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2948">#2948</a>.</p> <a class="changeset-link headerlink reference internal" href="#change-f24cfb05e58edcba962d50d47c745bf1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3364">#3364</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0-sql"> <h3>sql<a class="headerlink" href="#change-1.0.0-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0-3"><span class="target" id="change-aab332eedafc8e090f42b89ac7a67e6c"><strong>[sql] [feature] </strong></span><p>The topological sorting used to sort <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> objects and available via the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData.sorted_tables" title="sqlalchemy.schema.MetaData.sorted_tables"><code class="xref py py-attr docutils literal notranslate"><span class="pre">MetaData.sorted_tables</span></code></a> collection will now produce a <strong>deterministic</strong> ordering; that is, the same ordering each time given a set of tables with particular names and dependencies. This is to help with comparison of DDL scripts and other use cases. The tables are sent to the topological sort sorted by name, and the topological sort itself will process the incoming data in an ordered fashion. Pull request courtesy Sebastian Bank.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3084"><span class="std std-ref">MetaData.sorted_tables accessor is “deterministic”</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-aab332eedafc8e090f42b89ac7a67e6c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3084">#3084</a></p> </p> </li> <li><p id="change-1.0.0-4"><span class="target" id="change-41cee2035e8cd5037366cfcb88fe424c"><strong>[sql] [bug] </strong></span><p>Fixed issue where a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> object that used a naming convention would not properly work with pickle. The attribute was skipped leading to inconsistencies and failures if the unpickled <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> object were used to base additional tables from.</p> <a class="changeset-link headerlink reference internal" href="#change-41cee2035e8cd5037366cfcb88fe424c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3362">#3362</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.0-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0-5"><span class="target" id="change-863813ed9984daf0fde8f4a84fcaf02a"><strong>[postgresql] [bug] </strong></span><p>Fixed a long-standing bug where the <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a> type as used with the psycopg2 dialect in conjunction with non-ascii values and <code class="docutils literal notranslate"><span class="pre">native_enum=False</span></code> would fail to decode return results properly. This stemmed from when the PG <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.ENUM" title="sqlalchemy.dialects.postgresql.ENUM"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.ENUM</span></code></a> type used to be a standalone type without a “non native” option.</p> <a class="changeset-link headerlink reference internal" href="#change-863813ed9984daf0fde8f4a84fcaf02a">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3354">#3354</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.0-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0-6"><span class="target" id="change-af05e4dd4a311a3d1bfb497d1d748f61"><strong>[mssql] [bug] </strong></span><p>Fixed a regression where the “last inserted id” mechanics would fail to store the correct value for MSSQL on an INSERT where the primary key value was present in the insert params before execution, as well as in the case where an INSERT from SELECT would state the target columns as column objects, instead of string keys.</p> <a class="changeset-link headerlink reference internal" href="#change-af05e4dd4a311a3d1bfb497d1d748f61">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3360">#3360</a></p> </p> </li> <li><p id="change-1.0.0-7"><span class="target" id="change-e184664c46b2999f9724d1e3c1efc30a"><strong>[mssql] [bug] </strong></span><p>Using the <code class="docutils literal notranslate"><span class="pre">Binary</span></code> constructor now present in pymssql rather than patching one in. Pull request courtesy Ramiro Morales.</p> <a class="changeset-link headerlink reference internal" href="#change-e184664c46b2999f9724d1e3c1efc30a">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0-misc"> <h3>misc<a class="headerlink" href="#change-1.0.0-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0-8"><span class="target" id="change-767cbbf7a16d3556b45934d148b75590"><strong>[bug] [tests] </strong></span><p>Fixed the pathing used when tests run; for sqla_nose.py and py.test, the “./lib” prefix is again inserted at the head of sys.path but only if sys.flags.no_user_site isn’t set; this makes it act just like the way Python puts “.” in the current path by default. For tox, we are setting the PYTHONNOUSERSITE flag now.</p> <a class="changeset-link headerlink reference internal" href="#change-767cbbf7a16d3556b45934d148b75590">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3356">#3356</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0b5"> <h2>1.0.0b5<a class="headerlink" href="#change-1.0.0b5" title="Permalink to this headline">¶</a></h2> Released: April 3, 2015<div class="section" id="change-1.0.0b5-orm"> <h3>orm<a class="headerlink" href="#change-1.0.0b5-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b5-0"><span class="target" id="change-4dc519d63b37a4f457ef287d947f10a8"><strong>[orm] [bug] </strong></span><p>Fixed bug where the state tracking within multiple, nested <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.begin_nested" title="sqlalchemy.orm.session.Session.begin_nested"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.begin_nested()</span></code></a> operations would fail to propagate the “dirty” flag for an object that had been updated within the inner savepoint, such that if the enclosing savepoint were rolled back, the object would not be part of the state that was expired and therefore reverted to its database state.</p> <a class="changeset-link headerlink reference internal" href="#change-4dc519d63b37a4f457ef287d947f10a8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3352">#3352</a></p> </p> </li> <li><p id="change-1.0.0b5-1"><span class="target" id="change-13d3f0158003a7617db3b63ddcf497d1"><strong>[orm] [bug] </strong></span><p><a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> doesn’t support joins, subselects, or special FROM clauses when using the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a> or <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.delete" title="sqlalchemy.orm.query.Query.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.delete()</span></code></a> methods; instead of silently ignoring these fields if methods like <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a> or <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.select_from" title="sqlalchemy.orm.query.Query.select_from"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.select_from()</span></code></a> has been called, an error is raised. In 0.9.10 this only emits a warning.</p> <a class="changeset-link headerlink reference internal" href="#change-13d3f0158003a7617db3b63ddcf497d1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3349">#3349</a></p> </p> </li> <li><p id="change-1.0.0b5-2"><span class="target" id="change-f3cfafae76ecf50510e353cf7dddeca5"><strong>[orm] [bug] </strong></span><p>Added a list() call around a weak dictionary used within the commit phase of the session, which without it could cause a “dictionary changed size during iter” error if garbage collection interacted within the process. Change was introduced by #3139.</p> <a class="changeset-link headerlink reference internal" href="#change-f3cfafae76ecf50510e353cf7dddeca5">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b5-3"><span class="target" id="change-d2fc894ca158a0ac1ac0bd16c128a42c"><strong>[orm] [bug] </strong></span><p>Fixed a bug related to “nested” inner join eager loading, which exists in 0.9 as well but is more of a regression in 1.0 due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3008">#3008</a> which turns on “nested” by default, such that a joined eager load that travels across sibling paths from a common ancestor using innerjoin=True will correctly splice each “innerjoin” sibling into the appropriate part of the join, when a series of inner/outer joins are mixed together.</p> <a class="changeset-link headerlink reference internal" href="#change-d2fc894ca158a0ac1ac0bd16c128a42c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3347">#3347</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b5-sql"> <h3>sql<a class="headerlink" href="#change-1.0.0b5-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b5-4"><span class="target" id="change-985d8b07c9b5d0ce36d2ac39ed07d053"><strong>[sql] [bug] </strong></span><p>The warning emitted by the unicode type for a non-unicode type has been liberalized to warn for values that aren’t even string values, such as integers; previously, the updated warning system of 1.0 made use of string formatting operations which would raise an internal TypeError. While these cases should ideally raise totally, some backends like SQLite and MySQL do accept them and are potentially in use by legacy code, not to mention that they will always pass through if unicode conversion is turned off for the target backend.</p> <a class="changeset-link headerlink reference internal" href="#change-985d8b07c9b5d0ce36d2ac39ed07d053">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3346">#3346</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b5-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.0b5-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b5-5"><span class="target" id="change-ea6acf6124c25077db337001ff4dd2cb"><strong>[postgresql] [bug] </strong></span><p>Fixed bug where updated PG index reflection as a result of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3184">#3184</a> would cause index operations to fail on PostgreSQL versions 8.4 and earlier. The enhancements are now disabled when using an older version of PostgreSQL.</p> <a class="changeset-link headerlink reference internal" href="#change-ea6acf6124c25077db337001ff4dd2cb">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3343">#3343</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0b4"> <h2>1.0.0b4<a class="headerlink" href="#change-1.0.0b4" title="Permalink to this headline">¶</a></h2> Released: March 29, 2015<div class="section" id="change-1.0.0b4-sql"> <h3>sql<a class="headerlink" href="#change-1.0.0b4-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b4-0"><span class="target" id="change-aa46baa3af25851e9a3b23c4cf081182"><strong>[sql] [bug] </strong></span><p>Fixed bug in new “label resolution” feature of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a> where a label that was anonymous, then labeled again with a name, would fail to be locatable via a textual label. This situation occurs naturally when a mapped <a class="reference internal" href="../orm/mapping_columns.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><code class="xref py py-func docutils literal notranslate"><span class="pre">column_property()</span></code></a> is given an explicit label in a query.</p> <a class="changeset-link headerlink reference internal" href="#change-aa46baa3af25851e9a3b23c4cf081182">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3340">#3340</a></p> </p> </li> <li><p id="change-1.0.0b4-1"><span class="target" id="change-842ea77e51f1517d3e1d9d918929b5a6"><strong>[sql] [bug] </strong></span><p>Fixed bug in new “label resolution” feature of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a> where the string label placed in the order_by() or group_by() of a statement would place higher priority on the name as found inside the FROM clause instead of a more locally available name inside the columns clause.</p> <a class="changeset-link headerlink reference internal" href="#change-842ea77e51f1517d3e1d9d918929b5a6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3335">#3335</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b4-schema"> <h3>schema<a class="headerlink" href="#change-1.0.0b4-schema" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b4-2"><span class="target" id="change-6995af73c8bb8ff0a94424837ca173bf"><strong>[schema] [feature] </strong></span><p>The “auto-attach” feature of constraints such as <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.UniqueConstraint" title="sqlalchemy.schema.UniqueConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">UniqueConstraint</span></code></a> and <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.CheckConstraint" title="sqlalchemy.schema.CheckConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">CheckConstraint</span></code></a> has been further enhanced such that when the constraint is associated with non-table-bound <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> objects, the constraint will set up event listeners with the columns themselves such that the constraint auto attaches at the same time the columns are associated with the table. This in particular helps in some edge cases in declarative but is also of general use.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3341"><span class="std std-ref">Constraints referring to unattached Columns can auto-attach to the Table when their referred columns are attached</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-6995af73c8bb8ff0a94424837ca173bf">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3341">#3341</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b4-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.0b4-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b4-3"><span class="target" id="change-266a2c933324f8199da8adcbe84e6365"><strong>[mysql] [bug] [pymysql] </strong></span><p>Fixed unicode support for PyMySQL when using an “executemany” operation with unicode parameters. SQLAlchemy now passes both the statement as well as the bound parameters as unicode objects, as PyMySQL generally uses string interpolation internally to produce the final statement, and in the case of executemany does the “encode” step only on the final statement.</p> <a class="changeset-link headerlink reference internal" href="#change-266a2c933324f8199da8adcbe84e6365">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3337">#3337</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b4-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.0b4-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b4-4"><span class="target" id="change-dcda11a97947dd7e426511bc4af55102"><strong>[mssql] [bug] [firebird] [oracle] [sybase] </strong></span><p>Turned off the “simple order by” flag on the MSSQL, Oracle dialects; this is the flag that per <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a> causes an order by or group by an expression that’s also in the columns clause to be copied by label, even if referenced as the expression object. The behavior for MSSQL is now the old behavior that copies the whole expression in by default, as MSSQL can be picky on these particularly in GROUP BY expressions. The flag is also turned off defensively for the Firebird and Sybase dialects.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>this resolution was incorrect, please see version 1.0.2 for a rework of this resolution.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-dcda11a97947dd7e426511bc4af55102">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3338">#3338</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0b3"> <h2>1.0.0b3<a class="headerlink" href="#change-1.0.0b3" title="Permalink to this headline">¶</a></h2> Released: March 20, 2015<div class="section" id="change-1.0.0b3-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.0b3-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b3-0"><span class="target" id="change-618be62c1ace7b1a9c3d132a7b410c7c"><strong>[mysql] [bug] </strong></span><p>Repaired the commit for issue #2771 which was inadvertently commented out.</p> <a class="changeset-link headerlink reference internal" href="#change-618be62c1ace7b1a9c3d132a7b410c7c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2771">#2771</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0b2"> <h2>1.0.0b2<a class="headerlink" href="#change-1.0.0b2" title="Permalink to this headline">¶</a></h2> Released: March 20, 2015<div class="section" id="change-1.0.0b2-orm"> <h3>orm<a class="headerlink" href="#change-1.0.0b2-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b2-0"><span class="target" id="change-4c044b2c0a16bca90a751e90c5071191"><strong>[orm] [bug] </strong></span><p>Fixed unexpected use regression from pullreq github:137 where Py2K unicode literals (e.g. <code class="docutils literal notranslate"><span class="pre">u""</span></code>) would not be accepted by the <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.relationship.params.cascade" title="sqlalchemy.orm.relationship"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">relationship.cascade</span></code></a> option. Pull request courtesy Julien Castets.</p> <a class="changeset-link headerlink reference internal" href="#change-4c044b2c0a16bca90a751e90c5071191">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3327">#3327</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b2-orm-declarative"> <h3>orm declarative<a class="headerlink" href="#change-1.0.0b2-orm-declarative" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b2-1"><span class="target" id="change-a790c86836f12d50614920b63573998a"><strong>[change] [declarative] [orm] </strong></span><p>Loosened some restrictions that were added to <code class="docutils literal notranslate"><span class="pre">@declared_attr</span></code> objects, such that they were prevented from being called outside of the declarative process; this is related to the enhancements of #3150 which allow <code class="docutils literal notranslate"><span class="pre">@declared_attr</span></code> to return a value that is cached based on the current class as it’s being configured. The exception raise has been removed, and the behavior changed so that outside of the declarative process, the function decorated by <code class="docutils literal notranslate"><span class="pre">@declared_attr</span></code> is called every time just like a regular <code class="docutils literal notranslate"><span class="pre">@property</span></code>, without using any caching, as none is available at this stage.</p> <a class="changeset-link headerlink reference internal" href="#change-a790c86836f12d50614920b63573998a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3331">#3331</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b2-engine"> <h3>engine<a class="headerlink" href="#change-1.0.0b2-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b2-2"><span class="target" id="change-e6ded2e526a99f15d2401b2b4bb3dd98"><strong>[engine] [bug] </strong></span><p>The “auto close” for <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ResultProxy" title="sqlalchemy.engine.ResultProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">ResultProxy</span></code></a> is now a “soft” close. That is, after exhausting all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ResultProxy.close" title="sqlalchemy.engine.ResultProxy.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ResultProxy.close()</span></code></a> is called explicitly will these methods raise the “result is closed” error.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3330"><span class="std std-ref">ResultProxy “auto close” is now a “soft” close</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-e6ded2e526a99f15d2401b2b4bb3dd98">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3329">#3329</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3330">#3330</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b2-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.0b2-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b2-3"><span class="target" id="change-d5a00477ae396554230dc380ca9cff6c"><strong>[mysql] [bug] [py3k] </strong></span><p>Fixed the <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.BIT" title="sqlalchemy.dialects.mysql.BIT"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.BIT</span></code></a> type on Py3K which was not using the <code class="docutils literal notranslate"><span class="pre">ord()</span></code> function correctly. Pull request courtesy David Marin.</p> <a class="changeset-link headerlink reference internal" href="#change-d5a00477ae396554230dc380ca9cff6c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3333">#3333</a></p> </p> </li> <li><p id="change-1.0.0b2-4"><span class="target" id="change-d371fa3b0a2b4808035e7e50eac2a491"><strong>[mysql] [bug] </strong></span><p>Fixes to fully support using the <code class="docutils literal notranslate"><span class="pre">'utf8mb4'</span></code> MySQL-specific charset with MySQL dialects, in particular MySQL-Python and PyMySQL. In addition, MySQL databases that report more unusual charsets such as ‘koi8u’ or ‘eucjpms’ will also work correctly. Pull request courtesy Thomas Grainger.</p> <a class="changeset-link headerlink reference internal" href="#change-d371fa3b0a2b4808035e7e50eac2a491">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2771">#2771</a></p> </p> </li> </ul> </div> </div> <div class="section" id="change-1.0.0b1"> <h2>1.0.0b1<a class="headerlink" href="#change-1.0.0b1" title="Permalink to this headline">¶</a></h2> Released: March 13, 2015<p><p>Version 1.0.0b1 is the first release of the 1.0 series. Many changes described here are also present in the 0.9 and sometimes the 0.8 series as well. For changes that are specific to 1.0 with an emphasis on compatibility concerns, see <a class="reference internal" href="migration_10.html"><span class="doc">What’s New in SQLAlchemy 1.0?</span></a>.</p> </p> <div class="section" id="change-1.0.0b1-general"> <h3>general<a class="headerlink" href="#change-1.0.0b1-general" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-0"><span class="target" id="change-2f14e668cc239752997ac9b41f224ec6"><strong>[general] [feature] </strong></span><p>Structural memory use has been improved via much more significant use of <code class="docutils literal notranslate"><span class="pre">__slots__</span></code> for many internal objects. This optimization is particularly geared towards the base memory size of large applications that have lots of tables and columns, and greatly reduces memory size for a variety of high-volume objects including event listening internals, comparator objects and parts of the ORM attribute and loader strategy system.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-slots"><span class="std std-ref">Significant Improvements in Structural Memory Use</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-2f14e668cc239752997ac9b41f224ec6">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-1"><span class="target" id="change-be87e00250d24db1082e7f44ee07d44e"><strong>[general] [bug] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">__module__</span></code> attribute is now set for all those SQL and ORM functions that are derived as “public factory” symbols, which should assist with documentation tools being able to report on the target module.</p> <a class="changeset-link headerlink reference internal" href="#change-be87e00250d24db1082e7f44ee07d44e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3218">#3218</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-orm"> <h3>orm<a class="headerlink" href="#change-1.0.0b1-orm" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-2"><span class="target" id="change-616a1ffdd35a65e93fd791c48eee3e2a"><strong>[orm] [feature] </strong></span><p>Added a new entry <code class="docutils literal notranslate"><span class="pre">"entity"</span></code> to the dictionaries returned by <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.column_descriptions" title="sqlalchemy.orm.query.Query.column_descriptions"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Query.column_descriptions</span></code></a>. This refers to the primary ORM mapped class or aliased class that is referred to by the expression. Compared to the existing entry for <code class="docutils literal notranslate"><span class="pre">"type"</span></code>, it will always be a mapped entity, even if extracted from a column expression, or None if the given expression is a pure core expression. See also <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3403">#3403</a> which repaired a regression in this feature which was unreleased in 0.9.10 but was released in the 1.0 version.</p> <a class="changeset-link headerlink reference internal" href="#change-616a1ffdd35a65e93fd791c48eee3e2a">¶</a><p>This change is also <strong>backported</strong> to: 0.9.10</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3320">#3320</a></p> </p> </li> <li><p id="change-1.0.0b1-3"><span class="target" id="change-3acdcfd8019bdf552158d7f199e9d4a7"><strong>[orm] [feature] </strong></span><p>Added new parameter <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.connection.params.execution_options" title="sqlalchemy.orm.session.Session.connection"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Session.connection.execution_options</span></code></a> which may be used to set up execution options on a <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/session_transaction.html#session-transaction-isolation"><span class="std std-ref">Setting Transaction Isolation Levels</span></a> - new documentation section detailing best practices for setting transaction isolation with sessions.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-3acdcfd8019bdf552158d7f199e9d4a7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3296">#3296</a></p> </p> </li> <li><p id="change-1.0.0b1-4"><span class="target" id="change-9a67336d5098be7fa6d5d1712e13abf7"><strong>[orm] [feature] </strong></span><p>Added new method <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.invalidate" title="sqlalchemy.orm.session.Session.invalidate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.invalidate()</span></code></a>, functions similarly to <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.close" title="sqlalchemy.orm.session.Session.close"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.close()</span></code></a>, except also calls <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.invalidate" title="sqlalchemy.engine.Connection.invalidate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.invalidate()</span></code></a> on all connections, guaranteeing that they will not be returned to the connection pool. This is useful in situations e.g. dealing with gevent timeouts when it is not safe to use the connection further, even for rollbacks.</p> <a class="changeset-link headerlink reference internal" href="#change-9a67336d5098be7fa6d5d1712e13abf7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-5"><span class="target" id="change-bc2f57a8dd0b3e0854cf5c5fe90779ae"><strong>[orm] [feature] </strong></span><p>The “primaryjoin” model has been stretched a bit further to allow a join condition that is strictly from a single column to itself, translated through some kind of SQL function or expression. This is kind of experimental, but the first proof of concept is a “materialized path” join condition where a path string is compared to itself using “like”. The <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.like" title="sqlalchemy.sql.operators.ColumnOperators.like"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ColumnOperators.like()</span></code></a> operator has also been added to the list of valid operators to use in a primaryjoin condition.</p> <a class="changeset-link headerlink reference internal" href="#change-bc2f57a8dd0b3e0854cf5c5fe90779ae">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3029">#3029</a></p> </p> </li> <li><p id="change-1.0.0b1-6"><span class="target" id="change-ad1b3230bf3a35c539d3800bd7eaa906"><strong>[orm] [feature] </strong></span><p>Added new utility function <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.make_transient_to_detached" title="sqlalchemy.orm.session.make_transient_to_detached"><code class="xref py py-func docutils literal notranslate"><span class="pre">make_transient_to_detached()</span></code></a> which can be used to manufacture objects that behave as though they were loaded from a session, then detached. Attributes that aren’t present are marked as expired, and the object can be added to a Session where it will act like a persistent one.</p> <a class="changeset-link headerlink reference internal" href="#change-ad1b3230bf3a35c539d3800bd7eaa906">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3017">#3017</a></p> </p> </li> <li><p id="change-1.0.0b1-7"><span class="target" id="change-224c208adb8b17c4d5402a6d062f720b"><strong>[orm] [feature] </strong></span><p>Added a new event suite <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.QueryEvents" title="sqlalchemy.orm.events.QueryEvents"><code class="xref py py-class docutils literal notranslate"><span class="pre">QueryEvents</span></code></a>. The <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.QueryEvents.before_compile" title="sqlalchemy.orm.events.QueryEvents.before_compile"><code class="xref py py-meth docutils literal notranslate"><span class="pre">QueryEvents.before_compile()</span></code></a> event allows the creation of functions which may place additional modifications to <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> objects before the construction of the SELECT statement. It is hoped that this event be made much more useful via the advent of a new inspection system that will allow for detailed modifications to be made against <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> objects in an automated fashion.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.QueryEvents" title="sqlalchemy.orm.events.QueryEvents"><code class="xref py py-class docutils literal notranslate"><span class="pre">QueryEvents</span></code></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-224c208adb8b17c4d5402a6d062f720b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3317">#3317</a></p> </p> </li> <li><p id="change-1.0.0b1-8"><span class="target" id="change-4ffb78c7f1d4662a75b3c14e8865497b"><strong>[orm] [feature] </strong></span><p>The subquery wrapping which occurs when joined eager loading is used with a one-to-many query that also features LIMIT, OFFSET, or DISTINCT has been disabled in the case of a one-to-one relationship, that is a one-to-many with <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.relationship.params.uselist" title="sqlalchemy.orm.relationship"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">relationship.uselist</span></code></a> set to False. This will produce more efficient queries in these cases.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3249"><span class="std std-ref">Subqueries no longer applied to uselist=False joined eager loads</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-4ffb78c7f1d4662a75b3c14e8865497b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3249">#3249</a></p> </p> </li> <li><p id="change-1.0.0b1-9"><span class="target" id="change-ba2e12d237fd1b8dd5b88441ad712dd5"><strong>[orm] [feature] </strong></span><p>Mapped state internals have been reworked to allow for a 50% reduction in callcounts specific to the “expiration” of objects, as in the “auto expire” feature of <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.commit" title="sqlalchemy.orm.session.Session.commit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.commit()</span></code></a> and for <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.expire_all" title="sqlalchemy.orm.session.Session.expire_all"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.expire_all()</span></code></a>, as well as in the “cleanup” step which occurs when object states are garbage collected.</p> <a class="changeset-link headerlink reference internal" href="#change-ba2e12d237fd1b8dd5b88441ad712dd5">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3307">#3307</a></p> </p> </li> <li><p id="change-1.0.0b1-10"><span class="target" id="change-06fec19f82dae0028e9f912dc0a37eaf"><strong>[orm] [feature] </strong></span><p>A warning is emitted when the same polymorphic identity is assigned to two different mappers in the same hierarchy. This is typically a user error and means that the two different mapping types cannot be correctly distinguished at load time. Pull request courtesy Sebastian Bank.</p> <a class="changeset-link headerlink reference internal" href="#change-06fec19f82dae0028e9f912dc0a37eaf">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3262">#3262</a></p> </p> </li> <li><p id="change-1.0.0b1-11"><span class="target" id="change-e101a9e2bfc2d51486dfbb485d2a7d97"><strong>[orm] [feature] </strong></span><p>A new series of <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> methods which provide hooks directly into the unit of work’s facility for emitting INSERT and UPDATE statements has been created. When used correctly, this expert-oriented system can allow ORM-mappings to be used to generate bulk insert and update statements batched into executemany groups, allowing the statements to proceed at speeds that rival direct use of the Core.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/persistence_techniques.html#bulk-operations"><span class="std std-ref">Bulk Operations</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-e101a9e2bfc2d51486dfbb485d2a7d97">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3100">#3100</a></p> </p> </li> <li><p id="change-1.0.0b1-12"><span class="target" id="change-2144e6087f689d4bdb021d19044edc77"><strong>[orm] [feature] </strong></span><p>Added a parameter <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join.params.isouter" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Query.join.isouter</span></code></a> which is synonymous with calling <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.outerjoin" title="sqlalchemy.orm.query.Query.outerjoin"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.outerjoin()</span></code></a>; this flag is to provide a more consistent interface compared to Core <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.FromClause.join" title="sqlalchemy.sql.expression.FromClause.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">FromClause.join()</span></code></a>. Pull request courtesy Jonathan Vanasco.</p> <a class="changeset-link headerlink reference internal" href="#change-2144e6087f689d4bdb021d19044edc77">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3217">#3217</a></p> </p> </li> <li><p id="change-1.0.0b1-13"><span class="target" id="change-0e828b26dd65117f3478db52f1f0e546"><strong>[orm] [feature] </strong></span><p>Added new event handlers <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.AttributeEvents.init_collection" title="sqlalchemy.orm.events.AttributeEvents.init_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AttributeEvents.init_collection()</span></code></a> and <a class="reference internal" href="../orm/events.html#sqlalchemy.orm.events.AttributeEvents.dispose_collection" title="sqlalchemy.orm.events.AttributeEvents.dispose_collection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AttributeEvents.dispose_collection()</span></code></a>, which track when a collection is first associated with an instance and when it is replaced. These handlers supersede the <a class="reference internal" href="../orm/collections.html#sqlalchemy.orm.collections.collection.linker" title="sqlalchemy.orm.collections.collection.linker"><code class="xref py py-meth docutils literal notranslate"><span class="pre">collection.linker()</span></code></a> annotation. The old hook remains supported through an event adapter.</p> <a class="changeset-link headerlink reference internal" href="#change-0e828b26dd65117f3478db52f1f0e546">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-14"><span class="target" id="change-b616294de6debb7de491e4493f524c6b"><strong>[orm] [feature] </strong></span><p>The <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> will raise an exception when <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.yield_per" title="sqlalchemy.orm.query.Query.yield_per"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.yield_per()</span></code></a> is used with mappings or options where either subquery eager loading, or joined eager loading with collections, would take place. These loading strategies are not currently compatible with yield_per, so by raising this error, the method is safer to use. Eager loads can be disabled with the <code class="docutils literal notranslate"><span class="pre">lazyload('*')</span></code> option or <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.enable_eagerloads" title="sqlalchemy.orm.query.Query.enable_eagerloads"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.enable_eagerloads()</span></code></a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-yield-per-eager-loading"><span class="std std-ref">Joined/Subquery eager loading explicitly disallowed with yield_per</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-b616294de6debb7de491e4493f524c6b">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-15"><span class="target" id="change-8965eb2566f786710793ef1a6281b74d"><strong>[orm] [feature] </strong></span><p>A new implementation for <a class="reference internal" href="../orm/query.html#sqlalchemy.util.KeyedTuple" title="sqlalchemy.util.KeyedTuple"><code class="xref py py-class docutils literal notranslate"><span class="pre">KeyedTuple</span></code></a> used by the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> object offers dramatic speed improvements when fetching large numbers of column-oriented rows.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3176"><span class="std std-ref">New KeyedTuple implementation dramatically faster</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-8965eb2566f786710793ef1a6281b74d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3176">#3176</a></p> </p> </li> <li><p id="change-1.0.0b1-16"><span class="target" id="change-b3169a2d87d3780499be2e7f2821729b"><strong>[orm] [feature] </strong></span><p>The behavior of <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.strategy_options.Load.joinedload.params.innerjoin" title="sqlalchemy.orm.strategy_options.Load.joinedload"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">joinedload.innerjoin</span></code></a> as well as <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.relationship.params.innerjoin" title="sqlalchemy.orm.relationship"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">relationship.innerjoin</span></code></a> is now to use “nested” inner joins, that is, right-nested, as the default behavior when an inner join joined eager load is chained to an outer join eager load.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-3008"><span class="std std-ref">Right inner join nesting now the default for joinedload with innerjoin=True</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-b3169a2d87d3780499be2e7f2821729b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3008">#3008</a></p> </p> </li> <li><p id="change-1.0.0b1-17"><span class="target" id="change-c2a7ce636a44564eadf2a903567d4605"><strong>[orm] [feature] </strong></span><p>UPDATE statements can now be batched within an ORM flush into more performant executemany() call, similarly to how INSERT statements can be batched; this will be invoked within flush to the degree that subsequent UPDATE statements for the same mapping and table involve the identical columns within the VALUES clause, that no SET-level SQL expressions are embedded, and that the versioning requirements for the mapping are compatible with the backend dialect’s ability to return a correct rowcount for an executemany operation.</p> <a class="changeset-link headerlink reference internal" href="#change-c2a7ce636a44564eadf2a903567d4605">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-18"><span class="target" id="change-f11e5a48b55d152ba27006a0c7a50f69"><strong>[orm] [feature] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">info</span></code> parameter has been added to the constructor for <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.descriptor_props.SynonymProperty" title="sqlalchemy.orm.descriptor_props.SynonymProperty"><code class="xref py py-class docutils literal notranslate"><span class="pre">SynonymProperty</span></code></a> and <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.properties.ComparableProperty" title="sqlalchemy.orm.properties.ComparableProperty"><code class="xref py py-class docutils literal notranslate"><span class="pre">ComparableProperty</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-f11e5a48b55d152ba27006a0c7a50f69">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2963">#2963</a></p> </p> </li> <li><p id="change-1.0.0b1-19"><span class="target" id="change-dc2eac33191482c15be6aab0b79ac2ee"><strong>[orm] [feature] </strong></span><p>The <code class="xref py py-attr docutils literal notranslate"><span class="pre">InspectionAttr.info</span></code> collection is now moved down to <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.base.InspectionAttr" title="sqlalchemy.orm.base.InspectionAttr"><code class="xref py py-class docutils literal notranslate"><span class="pre">InspectionAttr</span></code></a>, where in addition to being available on all <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.interfaces.MapperProperty" title="sqlalchemy.orm.interfaces.MapperProperty"><code class="xref py py-class docutils literal notranslate"><span class="pre">MapperProperty</span></code></a> objects, it is also now available on hybrid properties, association proxies, when accessed via <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper.Mapper.all_orm_descriptors" title="sqlalchemy.orm.mapper.Mapper.all_orm_descriptors"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Mapper.all_orm_descriptors</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-dc2eac33191482c15be6aab0b79ac2ee">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2971">#2971</a></p> </p> </li> <li><p id="change-1.0.0b1-20"><span class="target" id="change-95474fb930794e4ecf37bfbc1331505e"><strong>[orm] [changed] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">proc()</span></code> callable passed to the <code class="docutils literal notranslate"><span class="pre">create_row_processor()</span></code> method of custom <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Bundle" title="sqlalchemy.orm.query.Bundle"><code class="xref py py-class docutils literal notranslate"><span class="pre">Bundle</span></code></a> classes now accepts only a single “row” argument.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bundle-api-change"><span class="std std-ref">API Change for new Bundle feature when custom row loaders are used</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-95474fb930794e4ecf37bfbc1331505e">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-21"><span class="target" id="change-560ef9d31daf212e20d665eb2eec3570"><strong>[orm] [changed] </strong></span><p>Deprecated event hooks removed: <code class="docutils literal notranslate"><span class="pre">populate_instance</span></code>, <code class="docutils literal notranslate"><span class="pre">create_instance</span></code>, <code class="docutils literal notranslate"><span class="pre">translate_row</span></code>, <code class="docutils literal notranslate"><span class="pre">append_result</span></code></p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-deprecated-orm-events"><span class="std std-ref">Deprecated ORM Event Hooks Removed</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-560ef9d31daf212e20d665eb2eec3570">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-22"><span class="target" id="change-15fc39532a23156ee7c64b1f7fc460b1"><strong>[orm] [bug] </strong></span><p>Fixed bug in subquery eager loading where a long chain of eager loads across a polymorphic-subclass boundary in conjunction with polymorphic loading would fail to locate the subclass-link in the chain, erroring out with a missing property name on an <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.util.AliasedClass" title="sqlalchemy.orm.util.AliasedClass"><code class="xref py py-class docutils literal notranslate"><span class="pre">AliasedClass</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-15fc39532a23156ee7c64b1f7fc460b1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3055">#3055</a></p> </p> </li> <li><p id="change-1.0.0b1-23"><span class="target" id="change-a0449e3beb0c1ac9e913ca55add64fd5"><strong>[orm] [bug] </strong></span><p>Fixed ORM bug where the <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.class_mapper" title="sqlalchemy.orm.class_mapper"><code class="xref py py-func docutils literal notranslate"><span class="pre">class_mapper()</span></code></a> function would mask AttributeErrors or KeyErrors that should raise during mapper configuration due to user errors. The catch for attribute/keyerror has been made more specific to not include the configuration step.</p> <a class="changeset-link headerlink reference internal" href="#change-a0449e3beb0c1ac9e913ca55add64fd5">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3047">#3047</a></p> </p> </li> <li><p id="change-1.0.0b1-24"><span class="target" id="change-6f298ded8801c07d3257fd19d0ec9d86"><strong>[orm] [bug] </strong></span><p>Fixed bugs in ORM object comparisons where comparison of many-to-one <code class="docutils literal notranslate"><span class="pre">!=</span> <span class="pre">None</span></code> would fail if the source were an aliased class, or if the query needed to apply special aliasing to the expression due to aliased joins or polymorphic querying; also fixed bug in the case where comparing a many-to-one to an object state would fail if the query needed to apply special aliasing due to aliased joins or polymorphic querying.</p> <a class="changeset-link headerlink reference internal" href="#change-6f298ded8801c07d3257fd19d0ec9d86">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3310">#3310</a></p> </p> </li> <li><p id="change-1.0.0b1-25"><span class="target" id="change-04a3bda01df00148ba3b83fbf9bbe294"><strong>[orm] [bug] </strong></span><p>Fixed bug where internal assertion would fail in the case where an <code class="docutils literal notranslate"><span class="pre">after_rollback()</span></code> handler for a <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> incorrectly adds state to that <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> within the handler, and the task to warn and remove this state (established by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2389">#2389</a>) attempts to proceed.</p> <a class="changeset-link headerlink reference internal" href="#change-04a3bda01df00148ba3b83fbf9bbe294">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3309">#3309</a></p> </p> </li> <li><p id="change-1.0.0b1-26"><span class="target" id="change-376e2904e02255469c634ee04c021623"><strong>[orm] [bug] </strong></span><p>Fixed bug where TypeError raised when <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a> called with unknown kw arguments would raise its own TypeError due to broken formatting. Pull request courtesy Malthe Borch.</p> <a class="changeset-link headerlink reference internal" href="#change-376e2904e02255469c634ee04c021623">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-27"><span class="target" id="change-2986f6b48420a5a13faf87400ceb4a0f"><strong>[orm] [bug] </strong></span><p>Fixed bug in lazy loading SQL construction whereby a complex primaryjoin that referred to the same “local” column multiple times in the “column that points to itself” style of self-referential join would not be substituted in all cases. The logic to determine substitutions here has been reworked to be more open-ended.</p> <a class="changeset-link headerlink reference internal" href="#change-2986f6b48420a5a13faf87400ceb4a0f">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3300">#3300</a></p> </p> </li> <li><p id="change-1.0.0b1-28"><span class="target" id="change-70b361455e80b62dcaf98a303f010d7b"><strong>[orm] [bug] </strong></span><p>The “wildcard” loader options, in particular the one set up by the <a class="reference internal" href="../orm/loading_columns.html#sqlalchemy.orm.load_only" title="sqlalchemy.orm.load_only"><code class="xref py py-func docutils literal notranslate"><span class="pre">orm.load_only()</span></code></a> option to cover all attributes not explicitly mentioned, now takes into account the superclasses of a given entity, if that entity is mapped with inheritance mapping, so that attribute names within the superclasses are also omitted from the load. Additionally, the polymorphic discriminator column is unconditionally included in the list, just in the same way that primary key columns are, so that even with load_only() set up, polymorphic loading of subtypes continues to function correctly.</p> <a class="changeset-link headerlink reference internal" href="#change-70b361455e80b62dcaf98a303f010d7b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3287">#3287</a></p> </p> </li> <li><p id="change-1.0.0b1-29"><span class="target" id="change-16483765b5b469f2aeb8abd7abfc6035"><strong>[orm] [bug] [pypy] </strong></span><p>Fixed bug where if an exception were thrown at the start of a <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> before it fetched results, particularly when row processors can’t be formed, the cursor would stay open with results pending and not actually be closed. This is typically only an issue on an interpreter like PyPy where the cursor isn’t immediately GC’ed, and can in some circumstances lead to transactions/ locks being open longer than is desirable.</p> <a class="changeset-link headerlink reference internal" href="#change-16483765b5b469f2aeb8abd7abfc6035">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3285">#3285</a></p> </p> </li> <li><p id="change-1.0.0b1-30"><span class="target" id="change-2e12bc9781aa2298691dc48360ef2c6e"><strong>[orm] [bug] </strong></span><p>Fixed a leak which would occur in the unsupported and highly non-recommended use case of replacing a relationship on a fixed mapped class many times, referring to an arbitrarily growing number of target mappers. A warning is emitted when the old relationship is replaced, however if the mapping were already used for querying, the old relationship would still be referenced within some registries.</p> <a class="changeset-link headerlink reference internal" href="#change-2e12bc9781aa2298691dc48360ef2c6e">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3251">#3251</a></p> </p> </li> <li><p id="change-1.0.0b1-31"><span class="target" id="change-57a644cbb8d635a77fa5615f0d5e72a1"><strong>[orm] [bug] [sqlite] </strong></span><p>Fixed bug regarding expression mutations which could express itself as a “Could not locate column” error when using <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> to select from multiple, anonymous column entities when querying against SQLite, as a side effect of the “join rewriting” feature used by the SQLite dialect.</p> <a class="changeset-link headerlink reference internal" href="#change-57a644cbb8d635a77fa5615f0d5e72a1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3241">#3241</a></p> </p> </li> <li><p id="change-1.0.0b1-32"><span class="target" id="change-ece99f4e425237d28766bafcb908f9c8"><strong>[orm] [bug] </strong></span><p>Fixed bug where the ON clause for <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a>, and <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.outerjoin" title="sqlalchemy.orm.query.Query.outerjoin"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.outerjoin()</span></code></a> to a single-inheritance subclass using <code class="docutils literal notranslate"><span class="pre">of_type()</span></code> would not render the “single table criteria” in the ON clause if the <code class="docutils literal notranslate"><span class="pre">from_joinpoint=True</span></code> flag were set.</p> <a class="changeset-link headerlink reference internal" href="#change-ece99f4e425237d28766bafcb908f9c8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3232">#3232</a></p> </p> </li> <li><p id="change-1.0.0b1-33"><span class="target" id="change-5f4ad543840a3c34916641cc4f26dfd7"><strong>[orm] [bug] [engine] </strong></span><p>Fixed bug that affected generally the same classes of event as that of <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3199">#3199</a>, when the <code class="docutils literal notranslate"><span class="pre">named=True</span></code> parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was “wrapped” for adaption in some other way. The “named” mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions.</p> <a class="changeset-link headerlink reference internal" href="#change-5f4ad543840a3c34916641cc4f26dfd7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3197">#3197</a></p> </p> </li> <li><p id="change-1.0.0b1-34"><span class="target" id="change-13967322d0db184e4ffb1c9b2b8391a2"><strong>[orm] [bug] </strong></span><p>Fixed bug that affected many classes of event, particularly ORM events but also engine events, where the usual logic of “de duplicating” a redundant call to <a class="reference internal" href="../core/event.html#sqlalchemy.event.listen" title="sqlalchemy.event.listen"><code class="xref py py-func docutils literal notranslate"><span class="pre">event.listen()</span></code></a> with the same arguments would fail, for those events where the listener function is wrapped. An assertion would be hit within registry.py. This assertion has now been integrated into the deduplication check, with the added bonus of a simpler means of checking deduplication across the board.</p> <a class="changeset-link headerlink reference internal" href="#change-13967322d0db184e4ffb1c9b2b8391a2">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3199">#3199</a></p> </p> </li> <li><p id="change-1.0.0b1-35"><span class="target" id="change-75a312cfcc6e096469f40858cff9a1c6"><strong>[orm] [bug] </strong></span><p>Fixed warning that would emit when a complex self-referential primaryjoin contained functions, while at the same time remote_side was specified; the warning would suggest setting “remote side”. It now only emits if remote_side isn’t present.</p> <a class="changeset-link headerlink reference internal" href="#change-75a312cfcc6e096469f40858cff9a1c6">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3194">#3194</a></p> </p> </li> <li><p id="change-1.0.0b1-36"><span class="target" id="change-011e2d22662edc5f79a8c6b840409cd7"><strong>[orm] [bug] [eagerloading] </strong></span><p>Fixed a regression caused by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2976">#2976</a> released in 0.9.4 where the “outer join” propagation along a chain of joined eager loads would incorrectly convert an “inner join” along a sibling join path into an outer join as well, when only descendant paths should be receiving the “outer join” propagation; additionally, fixed related issue where “nested” join propagation would take place inappropriately between two sibling join paths.</p> <a class="changeset-link headerlink reference internal" href="#change-011e2d22662edc5f79a8c6b840409cd7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3131">#3131</a></p> </p> </li> <li><p id="change-1.0.0b1-37"><span class="target" id="change-c8c83da8d054bbd7ec8173da1ea832f7"><strong>[orm] [bug] </strong></span><p>Fixed a regression from 0.9.0 due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2736">#2736</a> where the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.select_from" title="sqlalchemy.orm.query.Query.select_from"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.select_from()</span></code></a> method no longer set up the “from entity” of the <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> object correctly, so that subsequent <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.filter_by" title="sqlalchemy.orm.query.Query.filter_by"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.filter_by()</span></code></a> or <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a> calls would fail to check the appropriate “from” entity when searching for attributes by string name.</p> <a class="changeset-link headerlink reference internal" href="#change-c8c83da8d054bbd7ec8173da1ea832f7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2736">#2736</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3083">#3083</a></p> </p> </li> <li><p id="change-1.0.0b1-38"><span class="target" id="change-09e0b3775e3126481bf907cdd3c8a22c"><strong>[orm] [bug] </strong></span><p>Fixed bug where items that were persisted, deleted, or had a primary key change within a savepoint block would not participate in being restored to their former state (not in session, in session, previous PK) after the outer transaction were rolled back.</p> <a class="changeset-link headerlink reference internal" href="#change-09e0b3775e3126481bf907cdd3c8a22c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3108">#3108</a></p> </p> </li> <li><p id="change-1.0.0b1-39"><span class="target" id="change-09c6751d1497c418a77af762659e38ef"><strong>[orm] [bug] </strong></span><p>Fixed bug in subquery eager loading in conjunction with <a class="reference internal" href="../orm/inheritance_loading.html#sqlalchemy.orm.with_polymorphic" title="sqlalchemy.orm.with_polymorphic"><code class="xref py py-func docutils literal notranslate"><span class="pre">with_polymorphic()</span></code></a>, the targeting of entities and columns in the subquery load has been made more accurate with respect to this type of entity and others.</p> <a class="changeset-link headerlink reference internal" href="#change-09c6751d1497c418a77af762659e38ef">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3106">#3106</a></p> </p> </li> <li><p id="change-1.0.0b1-40"><span class="target" id="change-57fece0f852794967517d0a22cbe10e7"><strong>[orm] [bug] </strong></span><p>Additional checks have been added for the case where an inheriting mapper is implicitly combining one of its column-based attributes with that of the parent, where those columns normally don’t necessarily share the same value. This is an extension of an existing check that was added via <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/1892">#1892</a>; however this new check emits only a warning, instead of an exception, to allow for applications that may be relying upon the existing behavior.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../faq/ormconfiguration.html#faq-combining-columns"><span class="std std-ref">I’m getting a warning or error about “Implicitly combining column X under attribute Y”</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-57fece0f852794967517d0a22cbe10e7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3042">#3042</a></p> </p> </li> <li><p id="change-1.0.0b1-41"><span class="target" id="change-33b5e0cd5517f6c4fc5131ce5e6124cc"><strong>[orm] [bug] </strong></span><p>Modified the behavior of <a class="reference internal" href="../orm/loading_columns.html#sqlalchemy.orm.load_only" title="sqlalchemy.orm.load_only"><code class="xref py py-func docutils literal notranslate"><span class="pre">orm.load_only()</span></code></a> such that primary key columns are always added to the list of columns to be “undeferred”; otherwise, the ORM can’t load the row’s identity. Apparently, one can defer the mapped primary keys and the ORM will fail, that hasn’t been changed. But as load_only is essentially saying “defer all but X”, it’s more critical that PK cols not be part of this deferral.</p> <a class="changeset-link headerlink reference internal" href="#change-33b5e0cd5517f6c4fc5131ce5e6124cc">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3080">#3080</a></p> </p> </li> <li><p id="change-1.0.0b1-42"><span class="target" id="change-c9f980a739ab915284d71db0b46f1cff"><strong>[orm] [bug] </strong></span><p>Fixed a few edge cases which arise in the so-called “row switch” scenario, where an INSERT/DELETE can be turned into an UPDATE. In this situation, a many-to-one relationship set to None, or in some cases a scalar attribute set to None, may not be detected as a net change in value, and therefore the UPDATE would not reset what was on the previous row. This is due to some as-yet unresolved side effects of the way attribute history works in terms of implicitly assuming None isn’t really a “change” for a previously un-set attribute. See also <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a>.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>This change has been <strong>REVERTED</strong> in 0.9.6. The full fix will be in version 1.0 of SQLAlchemy.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-c9f980a739ab915284d71db0b46f1cff">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3060">#3060</a></p> </p> </li> <li><p id="change-1.0.0b1-43"><span class="target" id="change-50f44a6d5929b19a0805c7112c0d27ad"><strong>[orm] [bug] </strong></span><p>Related to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3060">#3060</a>, an adjustment has been made to the unit of work such that loading for related many-to-one objects is slightly more aggressive, in the case of a graph of self-referential objects that are to be deleted; the load of related objects is to help determine the correct order for deletion if passive_deletes is not set.</p> <a class="changeset-link headerlink reference internal" href="#change-50f44a6d5929b19a0805c7112c0d27ad">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-44"><span class="target" id="change-16b352ed9b306320c6e8315ed89d5a2b"><strong>[orm] [bug] </strong></span><p>Fixed bug in SQLite join rewriting where anonymized column names due to repeats would not correctly be rewritten in subqueries. This would affect SELECT queries with any kind of subquery + join.</p> <a class="changeset-link headerlink reference internal" href="#change-16b352ed9b306320c6e8315ed89d5a2b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3057">#3057</a></p> </p> </li> <li><p id="change-1.0.0b1-45"><span class="target" id="change-aecdd4c095256f1086a037c2ef111fdc"><strong>[orm] [bug] [sql] </strong></span><p>Fixes to the newly enhanced boolean coercion in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2804">#2804</a> where the new rules for “where” and “having” woudn’t take effect for the “whereclause” and “having” kw arguments of the <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><code class="xref py py-func docutils literal notranslate"><span class="pre">select()</span></code></a> construct, which is also what <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> uses so wasn’t working in the ORM either.</p> <a class="changeset-link headerlink reference internal" href="#change-aecdd4c095256f1086a037c2ef111fdc">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3013">#3013</a></p> </p> </li> <li><p id="change-1.0.0b1-46"><span class="target" id="change-7025ea4b0c6347ad5a8b4ec049fb17e7"><strong>[orm] [bug] </strong></span><p>Fixed bug where the session attachment error “object is already attached to session X” would fail to prevent the object from also being attached to the new session, in the case that execution continued after the error raise occurred.</p> <a class="changeset-link headerlink reference internal" href="#change-7025ea4b0c6347ad5a8b4ec049fb17e7">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3301">#3301</a></p> </p> </li> <li><p id="change-1.0.0b1-47"><span class="target" id="change-536752c99cbc5490b91573baaeb7d5f4"><strong>[orm] [bug] </strong></span><p>The primary <a class="reference internal" href="../orm/mapping_api.html#sqlalchemy.orm.mapper.Mapper" title="sqlalchemy.orm.mapper.Mapper"><code class="xref py py-class docutils literal notranslate"><span class="pre">Mapper</span></code></a> of a <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> is now passed to the <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.get_bind" title="sqlalchemy.orm.session.Session.get_bind"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.get_bind()</span></code></a> method when calling upon <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.count" title="sqlalchemy.orm.query.Query.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.count()</span></code></a>, <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a>, <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.delete" title="sqlalchemy.orm.query.Query.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.delete()</span></code></a>, as well as queries against mapped columns, <a class="reference internal" href="../orm/mapping_columns.html#sqlalchemy.orm.column_property" title="sqlalchemy.orm.column_property"><code class="xref py py-obj docutils literal notranslate"><span class="pre">column_property</span></code></a> objects, and SQL functions and expressions derived from mapped columns. This allows sessions that rely upon either customized <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.get_bind" title="sqlalchemy.orm.session.Session.get_bind"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.get_bind()</span></code></a> schemes or “bound” metadata to work in all relevant cases.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3227"><span class="std std-ref">Session.get_bind() will receive the Mapper in all relevant Query cases</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-536752c99cbc5490b91573baaeb7d5f4">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/1326">#1326</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3227">#3227</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3242">#3242</a></p> </p> </li> <li><p id="change-1.0.0b1-48"><span class="target" id="change-ea41da3074acd0052766bd3df13f9711"><strong>[orm] [bug] </strong></span><p>The <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.interfaces.PropComparator.of_type" title="sqlalchemy.orm.interfaces.PropComparator.of_type"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PropComparator.of_type()</span></code></a> modifier has been improved in conjunction with loader directives such as <a class="reference internal" href="../orm/loading_relationships.html#sqlalchemy.orm.joinedload" title="sqlalchemy.orm.joinedload"><code class="xref py py-func docutils literal notranslate"><span class="pre">joinedload()</span></code></a> and <a class="reference internal" href="../orm/loading_relationships.html#sqlalchemy.orm.contains_eager" title="sqlalchemy.orm.contains_eager"><code class="xref py py-func docutils literal notranslate"><span class="pre">contains_eager()</span></code></a> such that if two <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.interfaces.PropComparator.of_type" title="sqlalchemy.orm.interfaces.PropComparator.of_type"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PropComparator.of_type()</span></code></a> modifiers of the same base type/path are encountered, they will be joined together into a single “polymorphic” entity, rather than replacing the entity of type A with the one of type B. E.g. a joinedload of <code class="docutils literal notranslate"><span class="pre">A.b.of_type(BSub1)->BSub1.c</span></code> combined with joinedload of <code class="docutils literal notranslate"><span class="pre">A.b.of_type(BSub2)->BSub2.c</span></code> will create a single joinedload of <code class="docutils literal notranslate"><span class="pre">A.b.of_type((BSub1,</span> <span class="pre">BSub2))</span> <span class="pre">-></span> <span class="pre">BSub1.c,</span> <span class="pre">BSub2.c</span></code>, without the need for the <code class="docutils literal notranslate"><span class="pre">with_polymorphic</span></code> to be explicit in the query.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/inheritance_loading.html#eagerloading-polymorphic-subtypes"><span class="std std-ref">Eager Loading of Specific or Polymorphic Subtypes</span></a> - contains an updated example illustrating the new format.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-ea41da3074acd0052766bd3df13f9711">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3256">#3256</a></p> </p> </li> <li><p id="change-1.0.0b1-49"><span class="target" id="change-48bcac0d4325cf6d45c78e2b87c7bc18"><strong>[orm] [bug] </strong></span><p>Repaired support of the <code class="docutils literal notranslate"><span class="pre">copy.deepcopy()</span></code> call when used by the <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.util.CascadeOptions" title="sqlalchemy.orm.util.CascadeOptions"><code class="xref py py-class docutils literal notranslate"><span class="pre">orm.util.CascadeOptions</span></code></a> argument, which occurs if <code class="docutils literal notranslate"><span class="pre">copy.deepcopy()</span></code> is being used with <a class="reference internal" href="../orm/relationship_api.html#sqlalchemy.orm.relationship" title="sqlalchemy.orm.relationship"><code class="xref py py-func docutils literal notranslate"><span class="pre">relationship()</span></code></a> (not an officially supported use case). Pull request courtesy duesenfranz.</p> <a class="changeset-link headerlink reference internal" href="#change-48bcac0d4325cf6d45c78e2b87c7bc18">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-50"><span class="target" id="change-59caee694a457e7e0024d37366ccc4af"><strong>[orm] [bug] </strong></span><p>Fixed bug where <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.expunge" title="sqlalchemy.orm.session.Session.expunge"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.expunge()</span></code></a> would not fully detach the given object if the object had been subject to a delete operation that was flushed, but not committed. This would also affect related operations like <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.make_transient" title="sqlalchemy.orm.session.make_transient"><code class="xref py py-func docutils literal notranslate"><span class="pre">make_transient()</span></code></a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3139"><span class="std std-ref">session.expunge() will fully detach an object that’s been deleted</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-59caee694a457e7e0024d37366ccc4af">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3139">#3139</a></p> </p> </li> <li><p id="change-1.0.0b1-51"><span class="target" id="change-242697352354ba812f1570b0e04e2b68"><strong>[orm] [bug] </strong></span><p>A warning is emitted in the case of multiple relationships that ultimately will populate a foreign key column in conflict with another, where the relationships are attempting to copy values from different source columns. This occurs in the case where composite foreign keys with overlapping columns are mapped to relationships that each refer to a different referenced column. A new documentation section illustrates the example as well as how to overcome the issue by specifying “foreign” columns specifically on a per-relationship basis.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/join_conditions.html#relationship-overlapping-foreignkeys"><span class="std std-ref">Overlapping Foreign Keys</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-242697352354ba812f1570b0e04e2b68">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3230">#3230</a></p> </p> </li> <li><p id="change-1.0.0b1-52"><span class="target" id="change-04f95fecb0cc472b5f37e7ad801ce005"><strong>[orm] [bug] </strong></span><p>The <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a> method will now convert string key names in the given dictionary of values into mapped attribute names against the mapped class being updated. Previously, string names were taken in directly and passed to the core update statement without any means to resolve against the mapped entity. Support for synonyms and hybrid attributes as the subject attributes of <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.update" title="sqlalchemy.orm.query.Query.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.update()</span></code></a> are also supported.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3228"><span class="std std-ref">query.update() now resolves string names into mapped attribute names</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-04f95fecb0cc472b5f37e7ad801ce005">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3228">#3228</a></p> </p> </li> <li><p id="change-1.0.0b1-53"><span class="target" id="change-1503884aa0f4847e8b48adc09e62f9fe"><strong>[orm] [bug] </strong></span><p>Improvements to the mechanism used by <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session" title="sqlalchemy.orm.session.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a> to locate “binds” (e.g. engines to use), such engines can be associated with mixin classes, concrete subclasses, as well as a wider variety of table metadata such as joined inheritance tables.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3035"><span class="std std-ref">Session.get_bind() handles a wider variety of inheritance scenarios</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-1503884aa0f4847e8b48adc09e62f9fe">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3035">#3035</a></p> </p> </li> <li><p id="change-1.0.0b1-54"><span class="target" id="change-d320a6f7b1d2612830586f2eff0be2ed"><strong>[orm] [bug] </strong></span><p>Fixed bug in single table inheritance where a chain of joins that included the same single inh entity more than once (normally this should raise an error) could, in some cases depending on what was being joined “from”, implicitly alias the second case of the single inh entity, producing a query that “worked”. But as this implicit aliasing is not intended in the case of single table inheritance, it didn’t really “work” fully and was very misleading, since it wouldn’t always appear.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3233"><span class="std std-ref">Changes and fixes in handling of duplicate join targets</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-d320a6f7b1d2612830586f2eff0be2ed">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3233">#3233</a></p> </p> </li> <li><p id="change-1.0.0b1-55"><span class="target" id="change-99003d65e049410824e42ce9dab0c51b"><strong>[orm] [bug] </strong></span><p>The ON clause rendered when using <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.join" title="sqlalchemy.orm.query.Query.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.join()</span></code></a>, <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.outerjoin" title="sqlalchemy.orm.query.Query.outerjoin"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.outerjoin()</span></code></a>, or the standalone <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.join" title="sqlalchemy.orm.join"><code class="xref py py-func docutils literal notranslate"><span class="pre">orm.join()</span></code></a> / <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.outerjoin" title="sqlalchemy.orm.outerjoin"><code class="xref py py-func docutils literal notranslate"><span class="pre">orm.outerjoin()</span></code></a> functions to a single-inheritance subclass will now include the “single table criteria” in the ON clause even if the ON clause is otherwise hand-rolled; it is now added to the criteria using AND, the same way as if joining to a single-table target using relationship or similar.</p> <p>This is sort of in-between feature and bug.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-3222"><span class="std std-ref">single-table-inheritance criteria added to all ON clauses unconditionally</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-99003d65e049410824e42ce9dab0c51b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3222">#3222</a></p> </p> </li> <li><p id="change-1.0.0b1-56"><span class="target" id="change-4dc82827da24b55f91128a02f9b3f695"><strong>[orm] [bug] </strong></span><p>A major rework to the behavior of expression labels, most specifically when used with ColumnProperty constructs with custom SQL expressions and in conjunction with the “order by labels” logic first introduced in 0.9. Fixes include that an <code class="docutils literal notranslate"><span class="pre">order_by(Entity.some_col_prop)</span></code> will now make use of “order by label” rules even if Entity has been subject to aliasing, either via inheritance rendering or via the use of the <code class="docutils literal notranslate"><span class="pre">aliased()</span></code> construct; rendering of the same column property multiple times with aliasing (e.g. <code class="docutils literal notranslate"><span class="pre">query(Entity.some_prop,</span> <span class="pre">entity_alias.some_prop)</span></code>) will label each occurrence of the entity with a distinct label, and additionally “order by label” rules will work for both (e.g. <code class="docutils literal notranslate"><span class="pre">order_by(Entity.some_prop,</span> <span class="pre">entity_alias.some_prop)</span></code>). Additional issues that could prevent the “order by label” logic from working in 0.9, most notably that the state of a Label could change such that “order by label” would stop working depending on how things were called, has been fixed.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3188"><span class="std std-ref">ColumnProperty constructs work a lot better with aliases, order_by</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-4dc82827da24b55f91128a02f9b3f695">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3148">#3148</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3188">#3188</a></p> </p> </li> <li><p id="change-1.0.0b1-57"><span class="target" id="change-e1840eaa8736367b7f48e48d04d2d7d2"><strong>[orm] [bug] </strong></span><p>Changed the approach by which the “single inheritance criterion” is applied, when using <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.from_self" title="sqlalchemy.orm.query.Query.from_self"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.from_self()</span></code></a>, or its common user <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.count" title="sqlalchemy.orm.query.Query.count"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.count()</span></code></a>. The criteria to limit rows to those with a certain type is now indicated on the inside subquery, not the outside one, so that even if the “type” column is not available in the columns clause, we can filter on it on the “inner” query.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-3177"><span class="std std-ref">Change to single-table-inheritance criteria when using from_self(), count()</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-e1840eaa8736367b7f48e48d04d2d7d2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3177">#3177</a></p> </p> </li> <li><p id="change-1.0.0b1-58"><span class="target" id="change-c17ae9c4ebca0e74f469b58a3f8ac5a1"><strong>[orm] [bug] </strong></span><p>Made a small adjustment to the mechanics of lazy loading, such that it has less chance of interfering with a joinload() in the very rare circumstance that an object points to itself; in this scenario, the object refers to itself while loading its attributes which can cause a mixup between loaders. The use case of “object points to itself” is not fully supported, but the fix also removes some overhead so for now is part of testing.</p> <a class="changeset-link headerlink reference internal" href="#change-c17ae9c4ebca0e74f469b58a3f8ac5a1">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3145">#3145</a></p> </p> </li> <li><p id="change-1.0.0b1-59"><span class="target" id="change-ee661e992971bab23524715b4fd7af05"><strong>[orm] [bug] </strong></span><p>The “resurrect” ORM event has been removed. This event hook had no purpose since the old “mutable attribute” system was removed in 0.8.</p> <a class="changeset-link headerlink reference internal" href="#change-ee661e992971bab23524715b4fd7af05">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3171">#3171</a></p> </p> </li> <li><p id="change-1.0.0b1-60"><span class="target" id="change-b5c339b9efafb2a17766bcb8e791ab2b"><strong>[orm] [bug] </strong></span><p>Fixed bug where attribute “set” events or columns with <code class="docutils literal notranslate"><span class="pre">@validates</span></code> would have events triggered within the flush process, when those columns were the targets of a “fetch and populate” operation, such as an autoincremented primary key, a Python side default, or a server-side default “eagerly” fetched via RETURNING.</p> <a class="changeset-link headerlink reference internal" href="#change-b5c339b9efafb2a17766bcb8e791ab2b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3167">#3167</a></p> </p> </li> <li><p id="change-1.0.0b1-61"><span class="target" id="change-21c5bfbd3c59afd9373dca8d8606a34e"><strong>[orm] [bug] [py3k] </strong></span><p>The <a class="reference internal" href="../orm/internals.html#sqlalchemy.orm.identity.IdentityMap" title="sqlalchemy.orm.identity.IdentityMap"><code class="xref py py-class docutils literal notranslate"><span class="pre">IdentityMap</span></code></a> exposed from <a class="reference internal" href="../orm/session_api.html#sqlalchemy.orm.session.Session.identity_map" title="sqlalchemy.orm.session.Session.identity_map"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Session.identity_map</span></code></a> now returns lists for <code class="docutils literal notranslate"><span class="pre">items()</span></code> and <code class="docutils literal notranslate"><span class="pre">values()</span></code> in Py3K. Early porting to Py3K here had these returning iterators, when they technically should be “iterable views”..for now, lists are OK.</p> <a class="changeset-link headerlink reference internal" href="#change-21c5bfbd3c59afd9373dca8d8606a34e">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-62"><span class="target" id="change-9f773e193791199cf150187e1e900de3"><strong>[orm] [bug] </strong></span><p>The “evaluator” for query.update()/delete() won’t work with multi-table updates, and needs to be set to <cite>synchronize_session=False</cite> or <cite>synchronize_session=’fetch’</cite>; this now raises an exception, with a message to change the synchronize setting. This is upgraded from a warning emitted as of 0.9.7.</p> <a class="changeset-link headerlink reference internal" href="#change-9f773e193791199cf150187e1e900de3">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3117">#3117</a></p> </p> </li> <li><p id="change-1.0.0b1-63"><span class="target" id="change-0b4a0dfd1c62dd4c3d1b1194d31a4ca3"><strong>[orm] [change] </strong></span><p>Mapped attributes marked as deferred without explicit undeferral will now remain “deferred” even if their column is otherwise present in the result set in some way. This is a performance enhancement in that an ORM load no longer spends time searching for each deferred column when the result set is obtained. However, for an application that has been relying upon this, an explicit <a class="reference internal" href="../orm/loading_columns.html#sqlalchemy.orm.undefer" title="sqlalchemy.orm.undefer"><code class="xref py py-func docutils literal notranslate"><span class="pre">undefer()</span></code></a> or similar option should now be used.</p> <a class="changeset-link headerlink reference internal" href="#change-0b4a0dfd1c62dd4c3d1b1194d31a4ca3">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-64"><span class="target" id="change-adcdeaea46191497621f88dc5dc2e323"><strong>[orm] [enhancement] </strong></span><p>Adjustment to attribute mechanics concerning when a value is implicitly initialized to None via first access; this action, which has always resulted in a population of the attribute, no longer does so; the None value is returned but the underlying attribute receives no set event. This is consistent with how collections work and allows attribute mechanics to behave more consistently; in particular, getting an attribute with no value does not squash the event that should proceed if the value is actually set to None.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-3061"><span class="std std-ref">Changes to attribute events and other operations regarding attributes that have no pre-existing value</span></a></p> </div> <p>where bound parameters are rendered inline as strings based on a compile-time option. Work on this feature is courtesy of Dobes Vandermeer.</p> <blockquote> <div><div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3034"><span class="std std-ref">Select/Query LIMIT / OFFSET may be specified as an arbitrary SQL expression</span></a>.</p> </div> </div></blockquote> <a class="changeset-link headerlink reference internal" href="#change-adcdeaea46191497621f88dc5dc2e323">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3061">#3061</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-orm-declarative"> <h3>orm declarative<a class="headerlink" href="#change-1.0.0b1-orm-declarative" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-65"><span class="target" id="change-4705f0764e48b2f5eb3aab8ef41313f3"><strong>[feature] [declarative] [orm] </strong></span><p>The <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.declared_attr" title="sqlalchemy.ext.declarative.declared_attr"><code class="xref py py-class docutils literal notranslate"><span class="pre">declared_attr</span></code></a> construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.declared_attr.cascading" title="sqlalchemy.ext.declarative.declared_attr.cascading"><code class="xref py py-attr docutils literal notranslate"><span class="pre">declared_attr.cascading</span></code></a> is added as well.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3150"><span class="std std-ref">Improvements to declarative mixins, @declared_attr and related features</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-4705f0764e48b2f5eb3aab8ef41313f3">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3150">#3150</a></p> </p> </li> <li><p id="change-1.0.0b1-66"><span class="target" id="change-35f8b8e11566fd75025e1d45a0b5bb5f"><strong>[bug] [declarative] [orm] </strong></span><p>Fixed “‘NoneType’ object has no attribute ‘concrete’” error when using <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.AbstractConcreteBase" title="sqlalchemy.ext.declarative.AbstractConcreteBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractConcreteBase</span></code></a> in conjunction with a subclass that declares <code class="docutils literal notranslate"><span class="pre">__abstract__</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-35f8b8e11566fd75025e1d45a0b5bb5f">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3185">#3185</a></p> </p> </li> <li><p id="change-1.0.0b1-67"><span class="target" id="change-c38f0b260fc330da3a825c0062499246"><strong>[bug] [declarative] [orm] </strong></span><p>Fixed bug where using an <code class="docutils literal notranslate"><span class="pre">__abstract__</span></code> mixin in the middle of a declarative inheritance hierarchy would prevent attributes and configuration being correctly propagated from the base class to the inheriting class.</p> <a class="changeset-link headerlink reference internal" href="#change-c38f0b260fc330da3a825c0062499246">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3219">#3219</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3240">#3240</a></p> </p> </li> <li><p id="change-1.0.0b1-68"><span class="target" id="change-51f59e6c6a8a87ad61d8e37d86ecd144"><strong>[bug] [declarative] [orm] </strong></span><p>A relationship set up with <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.declared_attr" title="sqlalchemy.ext.declarative.declared_attr"><code class="xref py py-class docutils literal notranslate"><span class="pre">declared_attr</span></code></a> on a <a class="reference internal" href="../orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.AbstractConcreteBase" title="sqlalchemy.ext.declarative.AbstractConcreteBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractConcreteBase</span></code></a> base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3150"><span class="std std-ref">Improvements to declarative mixins, @declared_attr and related features</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-51f59e6c6a8a87ad61d8e37d86ecd144">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2670">#2670</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-engine"> <h3>engine<a class="headerlink" href="#change-1.0.0b1-engine" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-69"><span class="target" id="change-c5f37fab842327e43b9fdbd6c63bb80c"><strong>[engine] [feature] </strong></span><p>Added new user-space accessors for viewing transaction isolation levels; <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.get_isolation_level" title="sqlalchemy.engine.Connection.get_isolation_level"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.get_isolation_level()</span></code></a>, <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.default_isolation_level" title="sqlalchemy.engine.Connection.default_isolation_level"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Connection.default_isolation_level</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-c5f37fab842327e43b9fdbd6c63bb80c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-70"><span class="target" id="change-ce4694f9946ff09e6367694b4c41ac6f"><strong>[engine] [feature] </strong></span><p>Added new event <a class="reference internal" href="../core/events.html#sqlalchemy.events.ConnectionEvents.handle_error" title="sqlalchemy.events.ConnectionEvents.handle_error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ConnectionEvents.handle_error()</span></code></a>, a more fully featured and comprehensive replacement for <a class="reference internal" href="../core/events.html#sqlalchemy.events.ConnectionEvents.dbapi_error" title="sqlalchemy.events.ConnectionEvents.dbapi_error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ConnectionEvents.dbapi_error()</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-ce4694f9946ff09e6367694b4c41ac6f">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3076">#3076</a></p> </p> </li> <li><p id="change-1.0.0b1-71"><span class="target" id="change-bec11487773ec538543ddd3dac610199"><strong>[engine] [feature] </strong></span><p>A new style of warning can be emitted which will “filter” up to N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python’s warning registries.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3178"><span class="std std-ref">Session.get_bind() handles a wider variety of inheritance scenarios</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-bec11487773ec538543ddd3dac610199">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3178">#3178</a></p> </p> </li> <li><p id="change-1.0.0b1-72"><span class="target" id="change-1cbe7376cc9712fd0fa0633c798b04b5"><strong>[engine] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> and pool where the <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.invalidate" title="sqlalchemy.engine.Connection.invalidate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.invalidate()</span></code></a> method, or an invalidation due to a database disconnect, would fail if the <code class="docutils literal notranslate"><span class="pre">isolation_level</span></code> parameter had been used with <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.execution_options" title="sqlalchemy.engine.Connection.execution_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.execution_options()</span></code></a>; the “finalizer” that resets the isolation level would be called on the no longer opened connection.</p> <a class="changeset-link headerlink reference internal" href="#change-1cbe7376cc9712fd0fa0633c798b04b5">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3302">#3302</a></p> </p> </li> <li><p id="change-1.0.0b1-73"><span class="target" id="change-35e91e4cf37ed9f5f5338f624ccfac94"><strong>[engine] [bug] </strong></span><p>A warning is emitted if the <code class="docutils literal notranslate"><span class="pre">isolation_level</span></code> parameter is used with <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.execution_options" title="sqlalchemy.engine.Connection.execution_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.execution_options()</span></code></a> when a <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Transaction" title="sqlalchemy.engine.Transaction"><code class="xref py py-class docutils literal notranslate"><span class="pre">Transaction</span></code></a> is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe.</p> <a class="changeset-link headerlink reference internal" href="#change-35e91e4cf37ed9f5f5338f624ccfac94">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3296">#3296</a></p> </p> </li> <li><p id="change-1.0.0b1-74"><span class="target" id="change-d3615ec97e4cb3d677b23aae37c5f9a1"><strong>[engine] [bug] </strong></span><p>The execution options passed to an <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Engine" title="sqlalchemy.engine.Engine"><code class="xref py py-class docutils literal notranslate"><span class="pre">Engine</span></code></a> either via <a class="reference internal" href="../core/engines.html#sqlalchemy.create_engine.params.execution_options" title="sqlalchemy.create_engine"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">create_engine.execution_options</span></code></a> or <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Engine.update_execution_options" title="sqlalchemy.engine.Engine.update_execution_options"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Engine.update_execution_options()</span></code></a> are not passed to the special <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> used to initialize the dialect within the “first connect” event; dialects will usually perform their own queries in this phase, and none of the current available options should be applied here. In particular, the “autocommit” option was causing an attempt to autocommit within this initial connect which would fail with an AttributeError due to the non-standard state of the <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-d3615ec97e4cb3d677b23aae37c5f9a1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3200">#3200</a></p> </p> </li> <li><p id="change-1.0.0b1-75"><span class="target" id="change-17ea7031c46ba798ed90caf31a4ec215"><strong>[engine] [bug] </strong></span><p>The string keys that are used to determine the columns impacted for an INSERT or UPDATE are now sorted when they contribute towards the “compiled cache” cache key. These keys were previously not deterministically ordered, meaning the same statement could be cached multiple times on equivalent keys, costing both in terms of memory as well as performance.</p> <a class="changeset-link headerlink reference internal" href="#change-17ea7031c46ba798ed90caf31a4ec215">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3165">#3165</a></p> </p> </li> <li><p id="change-1.0.0b1-76"><span class="target" id="change-61f8e288cabf0d93da08c5bf8b0da4f5"><strong>[engine] [bug] </strong></span><p>Fixed bug which would occur if a DBAPI exception occurs when the engine first connects and does its initial checks, and the exception is not a disconnect exception, yet the cursor raises an error when we try to close it. In this case the real exception would be quashed as we tried to log the cursor close exception via the connection pool and failed, as we were trying to access the pool’s logger in a way that is inappropriate in this very specific scenario.</p> <a class="changeset-link headerlink reference internal" href="#change-61f8e288cabf0d93da08c5bf8b0da4f5">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3063">#3063</a></p> </p> </li> <li><p id="change-1.0.0b1-77"><span class="target" id="change-b3e19fc9b61e48ed28a2d41b53aa789b"><strong>[engine] [bug] </strong></span><p>Fixed some “double invalidate” situations were detected where a connection invalidation could occur within an already critical section like a connection.close(); ultimately, these conditions are caused by the change in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2907">#2907</a>, in that the “reset on return” feature calls out to the Connection/Transaction in order to handle it, where “disconnect detection” might be caught. However, it’s possible that the more recent change in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2985">#2985</a> made it more likely for this to be seen as the “connection invalidate” operation is much quicker, as the issue is more reproducible on 0.9.4 than 0.9.3.</p> <p>Checks are now added within any section that an invalidate might occur to halt further disallowed operations on the invalidated connection. This includes two fixes both at the engine level and at the pool level. While the issue was observed with highly concurrent gevent cases, it could in theory occur in any kind of scenario where a disconnect occurs within the connection close operation.</p> <a class="changeset-link headerlink reference internal" href="#change-b3e19fc9b61e48ed28a2d41b53aa789b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3043">#3043</a></p> </p> </li> <li><p id="change-1.0.0b1-78"><span class="target" id="change-305888802341ee5b5704384fe2d5d5df"><strong>[engine] [bug] </strong></span><p>The engine-level error handling and wrapping routines will now take effect in all engine connection use cases, including when user-custom connect routines are used via the <a class="reference internal" href="../core/engines.html#sqlalchemy.create_engine.params.creator" title="sqlalchemy.create_engine"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">create_engine.creator</span></code></a> parameter, as well as when the <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection" title="sqlalchemy.engine.Connection"><code class="xref py py-class docutils literal notranslate"><span class="pre">Connection</span></code></a> encounters a connection error on revalidation.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3266"><span class="std std-ref">DBAPI exception wrapping and handle_error() event improvements</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-305888802341ee5b5704384fe2d5d5df">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3266">#3266</a></p> </p> </li> <li><p id="change-1.0.0b1-79"><span class="target" id="change-f9df77c38b48404825304dd1b5099cbc"><strong>[engine] [bug] </strong></span><p>Removing (or adding) an event listener at the same time that the event is being run itself, either from inside the listener or from a concurrent thread, now raises a RuntimeError, as the collection used is now an instance of <code class="docutils literal notranslate"><span class="pre">colletions.deque()</span></code> and does not support changes while being iterated. Previously, a plain Python list was used where removal from inside the event itself would produce silent failures.</p> <a class="changeset-link headerlink reference internal" href="#change-f9df77c38b48404825304dd1b5099cbc">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3163">#3163</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-sql"> <h3>sql<a class="headerlink" href="#change-1.0.0b1-sql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-80"><span class="target" id="change-553972af1791bce62b6e70a2b4b58c62"><strong>[sql] [feature] </strong></span><p>Liberalized the contract for <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.Index" title="sqlalchemy.schema.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a> a bit in that you can specify a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> expression as the target; the index no longer needs to have a table-bound column present if the index is to be manually added to the table, either via inline declaration or via <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.append_constraint" title="sqlalchemy.schema.Table.append_constraint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.append_constraint()</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-553972af1791bce62b6e70a2b4b58c62">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3028">#3028</a></p> </p> </li> <li><p id="change-1.0.0b1-81"><span class="target" id="change-02c788316ab5dac725919f22d513af61"><strong>[sql] [feature] </strong></span><p>Added new flag <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.between.params.symmetric" title="sqlalchemy.sql.expression.between"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">expression.between.symmetric</span></code></a>, when set to True renders “BETWEEN SYMMETRIC”. Also added a new negation operator “notbetween_op”, which now allows an expression like <code class="docutils literal notranslate"><span class="pre">~col.between(x,</span> <span class="pre">y)</span></code> to render as “col NOT BETWEEN x AND y”, rather than a parenthesized NOT string.</p> <a class="changeset-link headerlink reference internal" href="#change-02c788316ab5dac725919f22d513af61">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2990">#2990</a></p> </p> </li> <li><p id="change-1.0.0b1-82"><span class="target" id="change-8f6d04c8049c045718d8b2c153efd641"><strong>[sql] [feature] </strong></span><p>The SQL compiler now generates the mapping of expected columns such that they are matched to the received result set positionally, rather than by name. Originally, this was seen as a way to handle cases where we had columns returned with difficult-to-predict names, though in modern use that issue has been overcome by anonymous labeling. In this version, the approach basically reduces function call count per-result by a few dozen calls, or more for larger sets of result columns. The approach still degrades into a modern version of the old approach if any discrepancy in size exists between the compiled set of columns versus what was received, so there’s no issue for partially or fully textual compilation scenarios where these lists might not line up.</p> <a class="changeset-link headerlink reference internal" href="#change-8f6d04c8049c045718d8b2c153efd641">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/918">#918</a></p> </p> </li> <li><p id="change-1.0.0b1-83"><span class="target" id="change-70c132d171b14712cef0e03b38e36176"><strong>[sql] [feature] </strong></span><p>Literal values within a <a class="reference internal" href="../core/defaults.html#sqlalchemy.schema.DefaultClause" title="sqlalchemy.schema.DefaultClause"><code class="xref py py-class docutils literal notranslate"><span class="pre">DefaultClause</span></code></a>, which is invoked when using the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column.params.server_default" title="sqlalchemy.schema.Column"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Column.server_default</span></code></a> parameter, will now be rendered using the “inline” compiler, so that they are rendered as-is, rather than as bound parameters.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3087"><span class="std std-ref">Column server defaults now render literal values</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-70c132d171b14712cef0e03b38e36176">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3087">#3087</a></p> </p> </li> <li><p id="change-1.0.0b1-84"><span class="target" id="change-0d5ede096a0fc28dba2ae3cc966f7ce4"><strong>[sql] [feature] </strong></span><p>The type of expression is reported when an object passed to a SQL expression unit can’t be interpreted as a SQL fragment; pull request courtesy Ryan P. Kelly.</p> <a class="changeset-link headerlink reference internal" href="#change-0d5ede096a0fc28dba2ae3cc966f7ce4">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-85"><span class="target" id="change-ec77f5fb7c2ec01c645e9f8d9b4832b8"><strong>[sql] [feature] </strong></span><p>Added a new parameter <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.tometadata.params.name" title="sqlalchemy.schema.Table.tometadata"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Table.tometadata.name</span></code></a> to the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.tometadata" title="sqlalchemy.schema.Table.tometadata"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.tometadata()</span></code></a> method. Similar to <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.tometadata.params.schema" title="sqlalchemy.schema.Table.tometadata"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Table.tometadata.schema</span></code></a>, this argument causes the newly copied <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> to take on the new name instead of the existing one. An interesting capability this adds is that of copying a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> object to the <em>same</em> <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> target with a new name. Pull request courtesy n.d. parker.</p> <a class="changeset-link headerlink reference internal" href="#change-ec77f5fb7c2ec01c645e9f8d9b4832b8">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-86"><span class="target" id="change-38450c605d2df954cca91dfb84d0b5de"><strong>[sql] [feature] </strong></span><p>Exception messages have been spiffed up a bit. The SQL statement and parameters are not displayed if None, reducing confusion for error messages that weren’t related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other.</p> <a class="changeset-link headerlink reference internal" href="#change-38450c605d2df954cca91dfb84d0b5de">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3172">#3172</a></p> </p> </li> <li><p id="change-1.0.0b1-87"><span class="target" id="change-b54916ee4be6c995b86450e0be4f551a"><strong>[sql] [feature] </strong></span><p><a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.from_select" title="sqlalchemy.sql.expression.Insert.from_select"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.from_select()</span></code></a> now includes Python and SQL-expression defaults if otherwise unspecified; the limitation where non- server column defaults aren’t included in an INSERT FROM SELECT is now lifted and these expressions are rendered as constants into the SELECT statement.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-insert-from-select-defaults"><span class="std std-ref">INSERT FROM SELECT now includes Python and SQL-expression defaults</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-b54916ee4be6c995b86450e0be4f551a">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-88"><span class="target" id="change-79b21344c66473f22ca547a5bd1db39a"><strong>[sql] [feature] </strong></span><p>The <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.UniqueConstraint" title="sqlalchemy.schema.UniqueConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">UniqueConstraint</span></code></a> construct is now included when reflecting a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> object, for databases where this is applicable. In order to achieve this with sufficient accuracy, MySQL and PostgreSQL now contain features that correct for the duplication of indexes and unique constraints when reflecting tables, indexes, and constraints. In the case of MySQL, there is not actually a “unique constraint” concept independent of a “unique index”, so for this backend <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.UniqueConstraint" title="sqlalchemy.schema.UniqueConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">UniqueConstraint</span></code></a> continues to remain non-present for a reflected <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a>. For PostgreSQL, the query used to detect indexes against <code class="docutils literal notranslate"><span class="pre">pg_index</span></code> has been improved to check for the same construct in <code class="docutils literal notranslate"><span class="pre">pg_constraint</span></code>, and the implicitly constructed unique index is not included with a reflected <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a>.</p> <p>In both cases, the <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_indexes" title="sqlalchemy.engine.reflection.Inspector.get_indexes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_indexes()</span></code></a> and the <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_unique_constraints" title="sqlalchemy.engine.reflection.Inspector.get_unique_constraints"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_unique_constraints()</span></code></a> methods return both constructs individually, but include a new token <code class="docutils literal notranslate"><span class="pre">duplicates_constraint</span></code> in the case of PostgreSQL or <code class="docutils literal notranslate"><span class="pre">duplicates_index</span></code> in the case of MySQL to indicate when this condition is detected. Pull request courtesy Johannes Erdfelt.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3184"><span class="std std-ref">UniqueConstraint is now part of the Table reflection process</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-79b21344c66473f22ca547a5bd1db39a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3184">#3184</a></p> </p> </li> <li><p id="change-1.0.0b1-89"><span class="target" id="change-828e90507d9e510ed8982e8e4765b3c4"><strong>[sql] [feature] </strong></span><p>Added new method <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select.with_statement_hint" title="sqlalchemy.sql.expression.Select.with_statement_hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Select.with_statement_hint()</span></code></a> and ORM method <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query.with_statement_hint" title="sqlalchemy.orm.query.Query.with_statement_hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Query.with_statement_hint()</span></code></a> to support statement-level hints that are not specific to a table.</p> <a class="changeset-link headerlink reference internal" href="#change-828e90507d9e510ed8982e8e4765b3c4">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3206">#3206</a></p> </p> </li> <li><p id="change-1.0.0b1-90"><span class="target" id="change-29a46a76843336a7bb96c5eb8e10d349"><strong>[sql] [feature] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">info</span></code> parameter has been added as a constructor argument to all schema constructs including <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.Index" title="sqlalchemy.schema.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKey" title="sqlalchemy.schema.ForeignKey"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForeignKey</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint" title="sqlalchemy.schema.ForeignKeyConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForeignKeyConstraint</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.UniqueConstraint" title="sqlalchemy.schema.UniqueConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">UniqueConstraint</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.PrimaryKeyConstraint" title="sqlalchemy.schema.PrimaryKeyConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">PrimaryKeyConstraint</span></code></a>, <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.CheckConstraint" title="sqlalchemy.schema.CheckConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">CheckConstraint</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-29a46a76843336a7bb96c5eb8e10d349">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2963">#2963</a></p> </p> </li> <li><p id="change-1.0.0b1-91"><span class="target" id="change-8c119ef8352a4ded12f21ceeb8206401"><strong>[sql] [feature] </strong></span><p>The <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.params.autoload_with" title="sqlalchemy.schema.Table"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Table.autoload_with</span></code></a> flag now implies that <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.params.autoload" title="sqlalchemy.schema.Table"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Table.autoload</span></code></a> should be <code class="docutils literal notranslate"><span class="pre">True</span></code>. Pull request courtesy Malik Diarra.</p> <a class="changeset-link headerlink reference internal" href="#change-8c119ef8352a4ded12f21ceeb8206401">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3027">#3027</a></p> </p> </li> <li><p id="change-1.0.0b1-92"><span class="target" id="change-11ea70249f3dd8a1cbfa008dfd6b3b7d"><strong>[sql] [feature] </strong></span><p>The <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select.limit" title="sqlalchemy.sql.expression.Select.limit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Select.limit()</span></code></a> and <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select.offset" title="sqlalchemy.sql.expression.Select.offset"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Select.offset()</span></code></a> methods now accept any SQL expression, in addition to integer values, as arguments. Typically this is used to allow a bound parameter to be passed, which can be substituted with a value later thus allowing Python-side caching of the SQL query. The implementation here is fully backwards compatible with existing third party dialects, however those dialects which implement special LIMIT/OFFSET systems will need modification in order to take advantage of the new capabilities. Limit and offset also support “literal_binds” mode,</p> <a class="changeset-link headerlink reference internal" href="#change-11ea70249f3dd8a1cbfa008dfd6b3b7d">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3034">#3034</a></p> </p> </li> <li><p id="change-1.0.0b1-93"><span class="target" id="change-47e8252f60bddcee7241fffca1f31f22"><strong>[sql] [changed] </strong></span><p>The <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.column" title="sqlalchemy.sql.expression.column"><code class="xref py py-func docutils literal notranslate"><span class="pre">column()</span></code></a> and <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.table" title="sqlalchemy.sql.expression.table"><code class="xref py py-func docutils literal notranslate"><span class="pre">table()</span></code></a> constructs are now importable from the “from sqlalchemy” namespace, just like every other Core construct.</p> <a class="changeset-link headerlink reference internal" href="#change-47e8252f60bddcee7241fffca1f31f22">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-94"><span class="target" id="change-684a942e0874832475bc4b2d6b3ecbd9"><strong>[sql] [changed] </strong></span><p>The implicit conversion of strings to <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> constructs when passed to most builder methods of <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><code class="xref py py-func docutils literal notranslate"><span class="pre">select()</span></code></a> as well as <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the “label reference” methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#migration-2992"><span class="std std-ref">Warnings emitted when coercing full SQL fragments into text()</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-684a942e0874832475bc4b2d6b3ecbd9">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2992">#2992</a></p> </p> </li> <li><p id="change-1.0.0b1-95"><span class="target" id="change-39ff64c9a38a07a10351e5eac319e215"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a> and other <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.SchemaType" title="sqlalchemy.types.SchemaType"><code class="xref py py-class docutils literal notranslate"><span class="pre">SchemaType</span></code></a> subclasses where direct association of the type with a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> would lead to a hang when events (like create events) were emitted on the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-39ff64c9a38a07a10351e5eac319e215">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3124">#3124</a></p> </p> </li> <li><p id="change-1.0.0b1-96"><span class="target" id="change-3f0858c763a82a38425a4f5cd06df17b"><strong>[sql] [bug] </strong></span><p>Fixed a bug within the custom operator plus <a class="reference internal" href="../core/type_api.html#sqlalchemy.types.TypeEngine.with_variant" title="sqlalchemy.types.TypeEngine.with_variant"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TypeEngine.with_variant()</span></code></a> system, whereby using a <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator" title="sqlalchemy.types.TypeDecorator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeDecorator</span></code></a> in conjunction with variant would fail with an MRO error when a comparison operator was used.</p> <a class="changeset-link headerlink reference internal" href="#change-3f0858c763a82a38425a4f5cd06df17b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3102">#3102</a></p> </p> </li> <li><p id="change-1.0.0b1-97"><span class="target" id="change-7d8d4c6b958b8f1189653efea4b7b3d8"><strong>[sql] [bug] </strong></span><p>Fixed bug in INSERT..FROM SELECT construct where selecting from a UNION would wrap the union in an anonymous (e.g. unlabeled) subquery.</p> <a class="changeset-link headerlink reference internal" href="#change-7d8d4c6b958b8f1189653efea4b7b3d8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3044">#3044</a></p> </p> </li> <li><p id="change-1.0.0b1-98"><span class="target" id="change-49df72c237a28d2aed4a95b52c723c1e"><strong>[sql] [bug] </strong></span><p>Fixed bug where <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.update" title="sqlalchemy.schema.Table.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.update()</span></code></a> and <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.delete" title="sqlalchemy.schema.Table.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.delete()</span></code></a> would produce an empty WHERE clause when an empty <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.and_" title="sqlalchemy.sql.expression.and_"><code class="xref py py-func docutils literal notranslate"><span class="pre">and_()</span></code></a> or <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.or_" title="sqlalchemy.sql.expression.or_"><code class="xref py py-func docutils literal notranslate"><span class="pre">or_()</span></code></a> or other blank expression were applied. This is now consistent with that of <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.select" title="sqlalchemy.sql.expression.select"><code class="xref py py-func docutils literal notranslate"><span class="pre">select()</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-49df72c237a28d2aed4a95b52c723c1e">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3045">#3045</a></p> </p> </li> <li><p id="change-1.0.0b1-99"><span class="target" id="change-9ae9e60a64156ef8b01aa18d9ab79582"><strong>[sql] [bug] </strong></span><p>Added the <code class="docutils literal notranslate"><span class="pre">native_enum</span></code> flag to the <code class="docutils literal notranslate"><span class="pre">__repr__()</span></code> output of <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a>, which is mostly important when using it with Alembic autogenerate. Pull request courtesy Dimitris Theodorou.</p> <a class="changeset-link headerlink reference internal" href="#change-9ae9e60a64156ef8b01aa18d9ab79582">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-100"><span class="target" id="change-c4ca12ab497a943945db5eadb8afdcb1"><strong>[sql] [bug] </strong></span><p>Fixed bug where using a <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator" title="sqlalchemy.types.TypeDecorator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeDecorator</span></code></a> that implemented a type that was also a <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator" title="sqlalchemy.types.TypeDecorator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeDecorator</span></code></a> would fail with Python’s “Cannot create a consistent method resolution order (MRO)” error, when any kind of SQL comparison expression were used against an object using this type.</p> <a class="changeset-link headerlink reference internal" href="#change-c4ca12ab497a943945db5eadb8afdcb1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3278">#3278</a></p> </p> </li> <li><p id="change-1.0.0b1-101"><span class="target" id="change-0fa65101409965b00ae87e09df2deccd"><strong>[sql] [bug] </strong></span><p>Fixed issue where the columns from a SELECT embedded in an INSERT, either through the values clause or as a “from select”, would pollute the column types used in the result set produced by the RETURNING clause when columns from both statements shared the same name, leading to potential errors or mis-adaptation when retrieving the returning rows.</p> <a class="changeset-link headerlink reference internal" href="#change-0fa65101409965b00ae87e09df2deccd">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3248">#3248</a></p> </p> </li> <li><p id="change-1.0.0b1-102"><span class="target" id="change-c518fd751f15c7bd9ca6846998ca1123"><strong>[sql] [bug] </strong></span><p>Fixed bug where a fair number of SQL elements within the sql package would fail to <code class="docutils literal notranslate"><span class="pre">__repr__()</span></code> successfully, due to a missing <code class="docutils literal notranslate"><span class="pre">description</span></code> attribute that would then invoke a recursion overflow when an internal AttributeError would then re-invoke <code class="docutils literal notranslate"><span class="pre">__repr__()</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-c518fd751f15c7bd9ca6846998ca1123">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3195">#3195</a></p> </p> </li> <li><p id="change-1.0.0b1-103"><span class="target" id="change-3dda9c816b245a162ae7caa498e557ca"><strong>[sql] [bug] </strong></span><p>An adjustment to table/index reflection such that if an index reports a column that isn’t found to be present in the table, a warning is emitted and the column is skipped. This can occur for some special system column situations as has been observed with Oracle.</p> <a class="changeset-link headerlink reference internal" href="#change-3dda9c816b245a162ae7caa498e557ca">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3180">#3180</a></p> </p> </li> <li><p id="change-1.0.0b1-104"><span class="target" id="change-4f0c952d23b07cabacb2f2b5506144a0"><strong>[sql] [bug] </strong></span><p>Fixed bug in CTE where <code class="docutils literal notranslate"><span class="pre">literal_binds</span></code> compiler argument would not be always be correctly propagated when one CTE referred to another aliased CTE in a statement.</p> <a class="changeset-link headerlink reference internal" href="#change-4f0c952d23b07cabacb2f2b5506144a0">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3154">#3154</a></p> </p> </li> <li><p id="change-1.0.0b1-105"><span class="target" id="change-c84995f2c63b6054e2cace46281a86e2"><strong>[sql] [bug] </strong></span><p>Fixed 0.9.7 regression caused by <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3067">#3067</a> in conjunction with a mis-named unit test such that so-called “schema” types like <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Boolean" title="sqlalchemy.types.Boolean"><code class="xref py py-class docutils literal notranslate"><span class="pre">Boolean</span></code></a> and <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a> could no longer be pickled.</p> <a class="changeset-link headerlink reference internal" href="#change-c84995f2c63b6054e2cace46281a86e2">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3067">#3067</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3144">#3144</a></p> </p> </li> <li><p id="change-1.0.0b1-106"><span class="target" id="change-0b7554df5bbc7c044d69d2b40ba9ba35"><strong>[sql] [bug] </strong></span><p>Fix bug in naming convention feature where using a check constraint convention that includes <code class="docutils literal notranslate"><span class="pre">constraint_name</span></code> would then force all <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Boolean" title="sqlalchemy.types.Boolean"><code class="xref py py-class docutils literal notranslate"><span class="pre">Boolean</span></code></a> and <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a> types to require names as well, as these implicitly create a constraint, even if the ultimate target backend were one that does not require generation of the constraint such as PostgreSQL. The mechanics of naming conventions for these particular constraints has been reorganized such that the naming determination is done at DDL compile time, rather than at constraint/table construction time.</p> <a class="changeset-link headerlink reference internal" href="#change-0b7554df5bbc7c044d69d2b40ba9ba35">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3067">#3067</a></p> </p> </li> <li><p id="change-1.0.0b1-107"><span class="target" id="change-9881397eb449cc15f8ace6fbcbd4eb09"><strong>[sql] [bug] </strong></span><p>Fixed bug in common table expressions whereby positional bound parameters could be expressed in the wrong final order when CTEs were nested in certain ways.</p> <a class="changeset-link headerlink reference internal" href="#change-9881397eb449cc15f8ace6fbcbd4eb09">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3090">#3090</a></p> </p> </li> <li><p id="change-1.0.0b1-108"><span class="target" id="change-c9422f7c699644c36a03c9721b9e9960"><strong>[sql] [bug] </strong></span><p>Fixed bug where multi-valued <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert" title="sqlalchemy.sql.expression.Insert"><code class="xref py py-class docutils literal notranslate"><span class="pre">Insert</span></code></a> construct would fail to check subsequent values entries beyond the first one given for literal SQL expressions.</p> <a class="changeset-link headerlink reference internal" href="#change-c9422f7c699644c36a03c9721b9e9960">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3069">#3069</a></p> </p> </li> <li><p id="change-1.0.0b1-109"><span class="target" id="change-dc34d2e11cf4b685da7ca74198a77500"><strong>[sql] [bug] </strong></span><p>Added a “str()” step to the dialect_kwargs iteration for Python version < 2.6.5, working around the “no unicode keyword arg” bug as these args are passed along as keyword args within some reflection processes.</p> <a class="changeset-link headerlink reference internal" href="#change-dc34d2e11cf4b685da7ca74198a77500">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3123">#3123</a></p> </p> </li> <li><p id="change-1.0.0b1-110"><span class="target" id="change-e5ef7cae58e33445c054718ec2361f1d"><strong>[sql] [bug] </strong></span><p>The <a class="reference internal" href="../core/type_api.html#sqlalchemy.types.TypeEngine.with_variant" title="sqlalchemy.types.TypeEngine.with_variant"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TypeEngine.with_variant()</span></code></a> method will now accept a type class as an argument which is internally converted to an instance, using the same convention long established by other constructs such as <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-e5ef7cae58e33445c054718ec2361f1d">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3122">#3122</a></p> </p> </li> <li><p id="change-1.0.0b1-111"><span class="target" id="change-281f7135707711426544c956bad3dc76"><strong>[sql] [bug] </strong></span><p>The <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column.params.nullable" title="sqlalchemy.schema.Column"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Column.nullable</span></code></a> flag is implicitly set to <code class="docutils literal notranslate"><span class="pre">False</span></code> when that <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> is referred to in an explicit <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.PrimaryKeyConstraint" title="sqlalchemy.schema.PrimaryKeyConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">PrimaryKeyConstraint</span></code></a> for that table. This behavior now matches that of when the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column" title="sqlalchemy.schema.Column"><code class="xref py py-class docutils literal notranslate"><span class="pre">Column</span></code></a> itself has the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Column.params.primary_key" title="sqlalchemy.schema.Column"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">Column.primary_key</span></code></a> flag set to <code class="docutils literal notranslate"><span class="pre">True</span></code>, which is intended to be an exactly equivalent case.</p> <a class="changeset-link headerlink reference internal" href="#change-281f7135707711426544c956bad3dc76">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3023">#3023</a></p> </p> </li> <li><p id="change-1.0.0b1-112"><span class="target" id="change-3ea444f027c5e125d738d7c910e350ea"><strong>[sql] [bug] </strong></span><p>Fixed bug where the <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.__and__" title="sqlalchemy.sql.operators.Operators.__and__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Operators.__and__()</span></code></a>, <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.__or__" title="sqlalchemy.sql.operators.Operators.__or__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Operators.__or__()</span></code></a> and <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.Operators.__invert__" title="sqlalchemy.sql.operators.Operators.__invert__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Operators.__invert__()</span></code></a> operator overload methods could not be overridden within a custom <a class="reference internal" href="../core/type_api.html#sqlalchemy.types.TypeEngine.Comparator" title="sqlalchemy.types.TypeEngine.Comparator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeEngine.Comparator</span></code></a> implementation.</p> <a class="changeset-link headerlink reference internal" href="#change-3ea444f027c5e125d738d7c910e350ea">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3012">#3012</a></p> </p> </li> <li><p id="change-1.0.0b1-113"><span class="target" id="change-0d2c9fb4311c501e2c7be559308fe61d"><strong>[sql] [bug] </strong></span><p>Fixed bug in new <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.base.DialectKWArgs.argument_for" title="sqlalchemy.sql.base.DialectKWArgs.argument_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DialectKWArgs.argument_for()</span></code></a> method where adding an argument for a construct not previously included for any special arguments would fail.</p> <a class="changeset-link headerlink reference internal" href="#change-0d2c9fb4311c501e2c7be559308fe61d">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3024">#3024</a></p> </p> </li> <li><p id="change-1.0.0b1-114"><span class="target" id="change-1e6a69139b4a3648c3a1ccc79e3e9fbb"><strong>[sql] [bug] </strong></span><p>Fixed regression introduced in 0.9 where new “ORDER BY <labelname>” feature from <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/1068">#1068</a> would not apply quoting rules to the label name as rendered in the ORDER BY.</p> <a class="changeset-link headerlink reference internal" href="#change-1e6a69139b4a3648c3a1ccc79e3e9fbb">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/1068">#1068</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3020">#3020</a></p> </p> </li> <li><p id="change-1.0.0b1-115"><span class="target" id="change-7023fa6f794789bffac1141bc7ecf86b"><strong>[sql] [bug] </strong></span><p>Restored the import for <a class="reference internal" href="../core/functions.html#sqlalchemy.sql.functions.Function" title="sqlalchemy.sql.functions.Function"><code class="xref py py-class docutils literal notranslate"><span class="pre">Function</span></code></a> to the <code class="docutils literal notranslate"><span class="pre">sqlalchemy.sql.expression</span></code> import namespace, which was removed at the beginning of 0.9.</p> <a class="changeset-link headerlink reference internal" href="#change-7023fa6f794789bffac1141bc7ecf86b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-116"><span class="target" id="change-122f0ef022ba2c5e0c4793bc923c28e2"><strong>[sql] [bug] </strong></span><p>The multi-values version of <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.values" title="sqlalchemy.sql.expression.Insert.values"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.values()</span></code></a> has been repaired to work more usefully with tables that have Python- side default values and/or functions, as well as server-side defaults. The feature will now work with a dialect that uses “positional” parameters; a Python callable will also be invoked individually for each row just as is the case with an “executemany” style invocation; a server- side default column will no longer implicitly receive the value explicitly specified for the first row, instead refusing to invoke without an explicit value.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3288"><span class="std std-ref">Python-side defaults invoked for each row individually when using a multivalued insert</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-122f0ef022ba2c5e0c4793bc923c28e2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3288">#3288</a></p> </p> </li> <li><p id="change-1.0.0b1-117"><span class="target" id="change-deb48f32e1bed24bf1ca698f249edd8b"><strong>[sql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.tometadata" title="sqlalchemy.schema.Table.tometadata"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Table.tometadata()</span></code></a> method where the <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.CheckConstraint" title="sqlalchemy.schema.CheckConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">CheckConstraint</span></code></a> associated with a <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Boolean" title="sqlalchemy.types.Boolean"><code class="xref py py-class docutils literal notranslate"><span class="pre">Boolean</span></code></a> or <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a> type object would be doubled in the target table. The copy process now tracks the production of this constraint object as local to a type object.</p> <a class="changeset-link headerlink reference internal" href="#change-deb48f32e1bed24bf1ca698f249edd8b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3260">#3260</a></p> </p> </li> <li><p id="change-1.0.0b1-118"><span class="target" id="change-2c2325d005f45286712184e3593a548f"><strong>[sql] [bug] </strong></span><p>The behavioral contract of the <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint.columns" title="sqlalchemy.schema.ForeignKeyConstraint.columns"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ForeignKeyConstraint.columns</span></code></a> collection has been made consistent; this attribute is now a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.ColumnCollection" title="sqlalchemy.sql.expression.ColumnCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">ColumnCollection</span></code></a> like that of all other constraints and is initialized at the point when the constraint is associated with a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3243"><span class="std std-ref">ForeignKeyConstraint.columns is now a ColumnCollection</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-2c2325d005f45286712184e3593a548f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3243">#3243</a></p> </p> </li> <li><p id="change-1.0.0b1-119"><span class="target" id="change-31200a6951c38906d011838b19760a18"><strong>[sql] [bug] </strong></span><p>The <code class="xref py py-attr docutils literal notranslate"><span class="pre">Column.key</span></code> attribute is now used as the source of anonymous bound parameter names within expressions, to match the existing use of this value as the key when rendered in an INSERT or UPDATE statement. This allows <code class="xref py py-attr docutils literal notranslate"><span class="pre">Column.key</span></code> to be used as a “substitute” string to work around a difficult column name that doesn’t translate well into a bound parameter name. Note that the paramstyle is configurable on <a class="reference internal" href="../core/engines.html#sqlalchemy.create_engine" title="sqlalchemy.create_engine"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_engine()</span></code></a> in any case, and most DBAPIs today support a named and positional style.</p> <a class="changeset-link headerlink reference internal" href="#change-31200a6951c38906d011838b19760a18">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3245">#3245</a></p> </p> </li> <li><p id="change-1.0.0b1-120"><span class="target" id="change-45c6243938b8d4ee1e742945f0bb54a6"><strong>[sql] [bug] </strong></span><p>Fixed the name of the <a class="reference internal" href="../core/events.html#sqlalchemy.events.PoolEvents.reset.params.dbapi_connection" title="sqlalchemy.events.PoolEvents.reset"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">PoolEvents.reset.dbapi_connection</span></code></a> parameter as passed to this event; in particular this affects usage of the “named” argument style for this event. Pull request courtesy Jason Goldberger.</p> <a class="changeset-link headerlink reference internal" href="#change-45c6243938b8d4ee1e742945f0bb54a6">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-121"><span class="target" id="change-df1b227cf2b11212ed7273639ee8494a"><strong>[sql] [bug] </strong></span><p>Reversing a change that was made in 0.9, the “singleton” nature of the “constants” <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.null" title="sqlalchemy.sql.expression.null"><code class="xref py py-func docutils literal notranslate"><span class="pre">null()</span></code></a>, <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.true" title="sqlalchemy.sql.expression.true"><code class="xref py py-func docutils literal notranslate"><span class="pre">true()</span></code></a>, and <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.false" title="sqlalchemy.sql.expression.false"><code class="xref py py-func docutils literal notranslate"><span class="pre">false()</span></code></a> has been reverted. These functions returning a “singleton” object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3170"><span class="std std-ref">null(), false() and true() constants are no longer singletons</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-df1b227cf2b11212ed7273639ee8494a">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3170">#3170</a></p> </p> </li> <li><p id="change-1.0.0b1-122"><span class="target" id="change-d95f6dd7c7d56fb5b50397f3c1355b6c"><strong>[sql] [bug] [engine] </strong></span><p>Fixed bug where a “branched” connection, that is the kind you get when you call <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.connect" title="sqlalchemy.engine.Connection.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.connect()</span></code></a>, would not share invalidation status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all invalidation status and operations.</p> <a class="changeset-link headerlink reference internal" href="#change-d95f6dd7c7d56fb5b50397f3c1355b6c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3215">#3215</a></p> </p> </li> <li><p id="change-1.0.0b1-123"><span class="target" id="change-65d68f5b8481db16ce132eedd3b8d459"><strong>[sql] [bug] [engine] </strong></span><p>Fixed bug where a “branched” connection, that is the kind you get when you call <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.Connection.connect" title="sqlalchemy.engine.Connection.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Connection.connect()</span></code></a>, would not share transaction status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all transactional status and operations.</p> <a class="changeset-link headerlink reference internal" href="#change-65d68f5b8481db16ce132eedd3b8d459">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3190">#3190</a></p> </p> </li> <li><p id="change-1.0.0b1-124"><span class="target" id="change-18b10ba82954d47ea8c64416cf12bb27"><strong>[sql] [bug] </strong></span><p>Using <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.from_select" title="sqlalchemy.sql.expression.Insert.from_select"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.from_select()</span></code></a> now implies <code class="docutils literal notranslate"><span class="pre">inline=True</span></code> on <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.insert" title="sqlalchemy.sql.expression.insert"><code class="xref py py-func docutils literal notranslate"><span class="pre">insert()</span></code></a>. This helps to fix a bug where an INSERT…FROM SELECT construct would inadvertently be compiled as “implicit returning” on supporting backends, which would cause breakage in the case of an INSERT that inserts zero rows (as implicit returning expects a row), as well as arbitrary return data in the case of an INSERT that inserts multiple rows (e.g. only the first row of many). A similar change is also applied to an INSERT..VALUES with multiple parameter sets; implicit RETURNING will no longer emit for this statement either. As both of these constructs deal with variable numbers of rows, the <a class="reference internal" href="../core/connections.html#sqlalchemy.engine.ResultProxy.inserted_primary_key" title="sqlalchemy.engine.ResultProxy.inserted_primary_key"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ResultProxy.inserted_primary_key</span></code></a> accessor does not apply. Previously, there was a documentation note that one may prefer <code class="docutils literal notranslate"><span class="pre">inline=True</span></code> with INSERT..FROM SELECT as some databases don’t support returning and therefore can’t do “implicit” returning, but there’s no reason an INSERT…FROM SELECT needs implicit returning in any case. Regular explicit <a class="reference internal" href="../core/dml.html#sqlalchemy.sql.expression.Insert.returning" title="sqlalchemy.sql.expression.Insert.returning"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Insert.returning()</span></code></a> should be used to return variable numbers of result rows if inserted data is needed.</p> <a class="changeset-link headerlink reference internal" href="#change-18b10ba82954d47ea8c64416cf12bb27">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3169">#3169</a></p> </p> </li> <li><p id="change-1.0.0b1-125"><span class="target" id="change-464e59fa2bf92cf803edfc0088f713da"><strong>[sql] [enhancement] </strong></span><p>Custom dialects that implement <code class="xref py py-class docutils literal notranslate"><span class="pre">GenericTypeCompiler</span></code> can now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. <code class="docutils literal notranslate"><span class="pre">**kw</span></code>) will in most cases receive a keyword argument <code class="docutils literal notranslate"><span class="pre">type_expression</span></code>, referring to the expression object that the type is contained within. For columns in DDL, the dialect’s compiler class may need to alter its <code class="docutils literal notranslate"><span class="pre">get_column_specification()</span></code> method to support this as well. The <code class="docutils literal notranslate"><span class="pre">UserDefinedType.get_col_spec()</span></code> method will also receive <code class="docutils literal notranslate"><span class="pre">type_expression</span></code> if it provides <code class="docutils literal notranslate"><span class="pre">**kw</span></code> in its argument signature.</p> <a class="changeset-link headerlink reference internal" href="#change-464e59fa2bf92cf803edfc0088f713da">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3074">#3074</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-schema"> <h3>schema<a class="headerlink" href="#change-1.0.0b1-schema" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-126"><span class="target" id="change-1029cbed41420ead46a2b77d52f42920"><strong>[schema] [feature] </strong></span><p>The DDL generation system of <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData.create_all" title="sqlalchemy.schema.MetaData.create_all"><code class="xref py py-meth docutils literal notranslate"><span class="pre">MetaData.create_all()</span></code></a> and <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData.drop_all" title="sqlalchemy.schema.MetaData.drop_all"><code class="xref py py-meth docutils literal notranslate"><span class="pre">MetaData.drop_all()</span></code></a> has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint.params.use_alter" title="sqlalchemy.schema.ForeignKeyConstraint"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">ForeignKeyConstraint.use_alter</span></code></a> flag is greatly reduced. The system also works for constraints which aren’t given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-3282"><span class="std std-ref">The use_alter flag on ForeignKeyConstraint is (usually) no longer needed</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-1029cbed41420ead46a2b77d52f42920">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3282">#3282</a></p> </p> </li> <li><p id="change-1.0.0b1-127"><span class="target" id="change-7288ebf25551a199d61be187d6926a8b"><strong>[schema] [feature] </strong></span><p>Added a new accessor <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.foreign_key_constraints" title="sqlalchemy.schema.Table.foreign_key_constraints"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Table.foreign_key_constraints</span></code></a> to complement the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table.foreign_keys" title="sqlalchemy.schema.Table.foreign_keys"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Table.foreign_keys</span></code></a> collection, as well as <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint.referred_table" title="sqlalchemy.schema.ForeignKeyConstraint.referred_table"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ForeignKeyConstraint.referred_table</span></code></a>.</p> <a class="changeset-link headerlink reference internal" href="#change-7288ebf25551a199d61be187d6926a8b">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-128"><span class="target" id="change-5851c2f9630e7aeed059ec8faeab5fc6"><strong>[schema] [bug] </strong></span><p>The <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.CheckConstraint" title="sqlalchemy.schema.CheckConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">CheckConstraint</span></code></a> construct now supports naming conventions that include the token <code class="docutils literal notranslate"><span class="pre">%(column_0_name)s</span></code>; the constraint expression is scanned for columns. Additionally, naming conventions for check constraints that don’t include the <code class="docutils literal notranslate"><span class="pre">%(constraint_name)s</span></code> token will now work for <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.SchemaType" title="sqlalchemy.types.SchemaType"><code class="xref py py-class docutils literal notranslate"><span class="pre">SchemaType</span></code></a>- generated constraints, such as those of <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Boolean" title="sqlalchemy.types.Boolean"><code class="xref py py-class docutils literal notranslate"><span class="pre">Boolean</span></code></a> and <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Enum" title="sqlalchemy.types.Enum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Enum</span></code></a>; this stopped working in 0.9.7 due to <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3067">#3067</a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../core/constraints.html#naming-check-constraints"><span class="std std-ref">Naming CHECK Constraints</span></a></p> <p><a class="reference internal" href="../core/constraints.html#naming-schematypes"><span class="std std-ref">Configuring Naming for Boolean, Enum, and other schema types</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-5851c2f9630e7aeed059ec8faeab5fc6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3067">#3067</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3299">#3299</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-postgresql"> <h3>postgresql<a class="headerlink" href="#change-1.0.0b1-postgresql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-129"><span class="target" id="change-7b0e4232e43b96ef59fd488ab557b59c"><strong>[postgresql] [feature] </strong></span><p>Added support for the <code class="docutils literal notranslate"><span class="pre">CONCURRENTLY</span></code> keyword with PostgreSQL indexes, established using <code class="docutils literal notranslate"><span class="pre">postgresql_concurrently</span></code>. Pull request courtesy Iuri de Silvio.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/postgresql.html#postgresql-index-concurrently"><span class="std std-ref">Indexes with CONCURRENTLY</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-7b0e4232e43b96ef59fd488ab557b59c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-130"><span class="target" id="change-c8679f38da94085f949f3f8fdec71306"><strong>[postgresql] [feature] [pg8000] </strong></span><p>Support is added for “sane multi row count” with the pg8000 driver, which applies mostly to when using versioning with the ORM. The feature is version-detected based on pg8000 1.9.14 or greater in use. Pull request courtesy Tony Locke.</p> <a class="changeset-link headerlink reference internal" href="#change-c8679f38da94085f949f3f8fdec71306">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-131"><span class="target" id="change-a11821d7d20015d6d83485a50f48aa6d"><strong>[postgresql] [feature] </strong></span><p>Added kw argument <code class="docutils literal notranslate"><span class="pre">postgresql_regconfig</span></code> to the <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ColumnOperators.match()</span></code></a> operator, allows the “reg config” argument to be specified to the <code class="docutils literal notranslate"><span class="pre">to_tsquery()</span></code> function emitted. Pull request courtesy Jonathan Vanasco.</p> <a class="changeset-link headerlink reference internal" href="#change-a11821d7d20015d6d83485a50f48aa6d">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3078">#3078</a></p> </p> </li> <li><p id="change-1.0.0b1-132"><span class="target" id="change-b54617fa0304fa014b9095716790157e"><strong>[postgresql] [feature] </strong></span><p>Added support for PostgreSQL JSONB via <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.JSONB" title="sqlalchemy.dialects.postgresql.JSONB"><code class="xref py py-class docutils literal notranslate"><span class="pre">JSONB</span></code></a>. Pull request courtesy Damian Dimmich.</p> <a class="changeset-link headerlink reference internal" href="#change-b54617fa0304fa014b9095716790157e">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-133"><span class="target" id="change-185ea3fa8da27b13fd310a783ad58be2"><strong>[postgresql] [feature] </strong></span><p>Added support for AUTOCOMMIT isolation level when using the pg8000 DBAPI. Pull request courtesy Tony Locke.</p> <a class="changeset-link headerlink reference internal" href="#change-185ea3fa8da27b13fd310a783ad58be2">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-134"><span class="target" id="change-1913c9e7f562d4d58c83764477aaefb2"><strong>[postgresql] [feature] </strong></span><p>Added a new flag <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.ARRAY.params.zero_indexes" title="sqlalchemy.types.ARRAY"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">ARRAY.zero_indexes</span></code></a> to the PostgreSQL <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.ARRAY" title="sqlalchemy.types.ARRAY"><code class="xref py py-class docutils literal notranslate"><span class="pre">ARRAY</span></code></a> type. When set to <code class="docutils literal notranslate"><span class="pre">True</span></code>, a value of one will be added to all array index values before passing to the database, allowing better interoperability between Python style zero-based indexes and PostgreSQL one-based indexes. Pull request courtesy Alexey Terentev.</p> <a class="changeset-link headerlink reference internal" href="#change-1913c9e7f562d4d58c83764477aaefb2">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2785">#2785</a></p> </p> </li> <li><p id="change-1.0.0b1-135"><span class="target" id="change-d52ca2e8075eaaf7fae1903092cfedfe"><strong>[postgresql] [feature] </strong></span><p>The PG8000 dialect now supports the <a class="reference internal" href="../core/engines.html#sqlalchemy.create_engine.params.encoding" title="sqlalchemy.create_engine"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">create_engine.encoding</span></code></a> parameter, by setting up the client encoding on the connection which is then intercepted by pg8000. Pull request courtesy Tony Locke.</p> <a class="changeset-link headerlink reference internal" href="#change-d52ca2e8075eaaf7fae1903092cfedfe">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-136"><span class="target" id="change-7e075e5c447c03086a2a0f17646240a1"><strong>[postgresql] [feature] </strong></span><p>Added support for PG8000’s native JSONB feature. Pull request courtesy Tony Locke.</p> <a class="changeset-link headerlink reference internal" href="#change-7e075e5c447c03086a2a0f17646240a1">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-137"><span class="target" id="change-64734b17d3eb6c3fd68a94871b4d52fb"><strong>[postgresql] [feature] [pypy] </strong></span><p>Added support for the psycopg2cffi DBAPI on pypy. Pull request courtesy shauns.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/postgresql.html#module-sqlalchemy.dialects.postgresql.psycopg2cffi" title="sqlalchemy.dialects.postgresql.psycopg2cffi"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlalchemy.dialects.postgresql.psycopg2cffi</span></code></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-64734b17d3eb6c3fd68a94871b4d52fb">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3052">#3052</a></p> </p> </li> <li><p id="change-1.0.0b1-138"><span class="target" id="change-718b1d0af278862a953b7b6c47f6081a"><strong>[postgresql] [feature] </strong></span><p>Added support for the FILTER keyword as applied to aggregate functions, supported by PostgreSQL 9.4. Pull request courtesy Ilja Everilä.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-gh134"><span class="std std-ref">PostgreSQL FILTER keyword</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-718b1d0af278862a953b7b6c47f6081a">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-139"><span class="target" id="change-ebab99a9425c3e47b7dc731718ef33ff"><strong>[postgresql] [feature] </strong></span><p>Support has been added for reflection of materialized views and foreign tables, as well as support for materialized views within <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_view_names" title="sqlalchemy.engine.reflection.Inspector.get_view_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_view_names()</span></code></a>, and a new method <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.base.PGInspector.get_foreign_table_names" title="sqlalchemy.dialects.postgresql.base.PGInspector.get_foreign_table_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PGInspector.get_foreign_table_names()</span></code></a> available on the PostgreSQL version of <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector" title="sqlalchemy.engine.reflection.Inspector"><code class="xref py py-class docutils literal notranslate"><span class="pre">Inspector</span></code></a>. Pull request courtesy Rodrigo Menezes.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#feature-2891"><span class="std std-ref">PostgreSQL Dialect reflects Materialized Views, Foreign Tables</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-ebab99a9425c3e47b7dc731718ef33ff">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2891">#2891</a></p> </p> </li> <li><p id="change-1.0.0b1-140"><span class="target" id="change-c2d997de0574a24ee1406fba275c153b"><strong>[postgresql] [feature] </strong></span><p>Added support for PG table options TABLESPACE, ON COMMIT, WITH(OUT) OIDS, and INHERITS, when rendering DDL via the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.Table" title="sqlalchemy.schema.Table"><code class="xref py py-class docutils literal notranslate"><span class="pre">Table</span></code></a> construct. Pull request courtesy malikdiarra.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/postgresql.html#postgresql-table-options"><span class="std std-ref">PostgreSQL Table Options</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-c2d997de0574a24ee1406fba275c153b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2051">#2051</a></p> </p> </li> <li><p id="change-1.0.0b1-141"><span class="target" id="change-9425ae767a9ba53fd21d083fc8ddfc93"><strong>[postgresql] [feature] </strong></span><p>Added new method <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.base.PGInspector.get_enums" title="sqlalchemy.dialects.postgresql.base.PGInspector.get_enums"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PGInspector.get_enums()</span></code></a>, when using the inspector for PostgreSQL will provide a list of ENUM types. Pull request courtesy Ilya Pekelny.</p> <a class="changeset-link headerlink reference internal" href="#change-9425ae767a9ba53fd21d083fc8ddfc93">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-142"><span class="target" id="change-841cb0d0b58c849de0668c465b375c91"><strong>[postgresql] [bug] </strong></span><p>Added the <code class="docutils literal notranslate"><span class="pre">hashable=False</span></code> flag to the PG <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.HSTORE" title="sqlalchemy.dialects.postgresql.HSTORE"><code class="xref py py-class docutils literal notranslate"><span class="pre">HSTORE</span></code></a> type, which is needed to allow the ORM to skip over trying to “hash” an ORM-mapped HSTORE column when requesting it in a mixed column/entity list. Patch courtesy Gunnlaugur Þór Briem.</p> <a class="changeset-link headerlink reference internal" href="#change-841cb0d0b58c849de0668c465b375c91">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3053">#3053</a></p> </p> </li> <li><p id="change-1.0.0b1-143"><span class="target" id="change-391e08a06b2dda8bd1502d285f7fa3ec"><strong>[postgresql] [bug] </strong></span><p>Added a new “disconnect” message “connection has been closed unexpectedly”. This appears to be related to newer versions of SSL. Pull request courtesy Antti Haapala.</p> <a class="changeset-link headerlink reference internal" href="#change-391e08a06b2dda8bd1502d285f7fa3ec">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-144"><span class="target" id="change-be4eac3111ffd70bffd61874a2139ac8"><strong>[postgresql] [bug] </strong></span><p>Repaired support for PostgreSQL UUID types in conjunction with the ARRAY type when using psycopg2. The psycopg2 dialect now employs use of the psycopg2.extras.register_uuid() hook so that UUID values are always passed to/from the DBAPI as UUID() objects. The <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.UUID.params.as_uuid" title="sqlalchemy.dialects.postgresql.UUID"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">UUID.as_uuid</span></code></a> flag is still honored, except with psycopg2 we need to convert returned UUID objects back into strings when this is disabled.</p> <a class="changeset-link headerlink reference internal" href="#change-be4eac3111ffd70bffd61874a2139ac8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2940">#2940</a></p> </p> </li> <li><p id="change-1.0.0b1-145"><span class="target" id="change-17f696f8363a81871bbc9c3d2ed800b8"><strong>[postgresql] [bug] </strong></span><p>Added support for the <code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.JSONB</span></code> datatype when using psycopg2 2.5.4 or greater, which features native conversion of JSONB data so that SQLAlchemy’s converters must be disabled; additionally, the newly added psycopg2 extension <code class="docutils literal notranslate"><span class="pre">extras.register_default_jsonb</span></code> is used to establish a JSON deserializer passed to the dialect via the <code class="docutils literal notranslate"><span class="pre">json_deserializer</span></code> argument. Also repaired the PostgreSQL integration tests which weren’t actually round-tripping the JSONB type as opposed to the JSON type. Pull request courtesy Mateusz Susik.</p> <a class="changeset-link headerlink reference internal" href="#change-17f696f8363a81871bbc9c3d2ed800b8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-146"><span class="target" id="change-18280aca8fea699cc94cfd0f8b561703"><strong>[postgresql] [bug] </strong></span><p>Repaired the use of the “array_oid” flag when registering the HSTORE type with older psycopg2 versions < 2.4.3, which does not support this flag, as well as use of the native json serializer hook “register_default_json” with user-defined <code class="docutils literal notranslate"><span class="pre">json_deserializer</span></code> on psycopg2 versions < 2.5, which does not include native json.</p> <a class="changeset-link headerlink reference internal" href="#change-18280aca8fea699cc94cfd0f8b561703">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-147"><span class="target" id="change-a14326647c26b4c1568b70bd82a1108b"><strong>[postgresql] [bug] </strong></span><p>Fixed bug where PostgreSQL dialect would fail to render an expression in an <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.Index" title="sqlalchemy.schema.Index"><code class="xref py py-class docutils literal notranslate"><span class="pre">Index</span></code></a> that did not correspond directly to a table-bound column; typically when a <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.text" title="sqlalchemy.sql.expression.text"><code class="xref py py-func docutils literal notranslate"><span class="pre">text()</span></code></a> construct was one of the expressions within the index; or could misinterpret the list of expressions if one or more of them were such an expression.</p> <a class="changeset-link headerlink reference internal" href="#change-a14326647c26b4c1568b70bd82a1108b">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3174">#3174</a></p> </p> </li> <li><p id="change-1.0.0b1-148"><span class="target" id="change-678bda6dc87cf119880054c9592d5a53"><strong>[postgresql] [bug] </strong></span><p>A revisit to this issue first patched in 0.9.5, apparently psycopg2’s <code class="docutils literal notranslate"><span class="pre">.closed</span></code> accessor is not as reliable as we assumed, so we have added an explicit check for the exception messages “SSL SYSCALL error: Bad file descriptor” and “SSL SYSCALL error: EOF detected” when detecting an is-disconnect scenario. We will continue to consult psycopg2’s connection.closed as a first check.</p> <a class="changeset-link headerlink reference internal" href="#change-678bda6dc87cf119880054c9592d5a53">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3021">#3021</a></p> </p> </li> <li><p id="change-1.0.0b1-149"><span class="target" id="change-bbf33565308e0273fa7039651dce6101"><strong>[postgresql] [bug] </strong></span><p>Fixed bug where PostgreSQL JSON type was not able to persist or otherwise render a SQL NULL column value, rather than a JSON-encoded <code class="docutils literal notranslate"><span class="pre">'null'</span></code>. To support this case, changes are as follows:</p> <ul> <li><p>The value <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.null" title="sqlalchemy.sql.expression.null"><code class="xref py py-func docutils literal notranslate"><span class="pre">null()</span></code></a> can now be specified, which will always result in a NULL value resulting in the statement.</p></li> <li><p>A new parameter <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.JSON.params.none_as_null" title="sqlalchemy.types.JSON"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">JSON.none_as_null</span></code></a> is added, which when True indicates that the Python <code class="docutils literal notranslate"><span class="pre">None</span></code> value should be persisted as SQL NULL, rather than JSON-encoded <code class="docutils literal notranslate"><span class="pre">'null'</span></code>.</p></li> </ul> <p>Retrival of NULL as None is also repaired for DBAPIs other than psycopg2, namely pg8000.</p> <a class="changeset-link headerlink reference internal" href="#change-bbf33565308e0273fa7039651dce6101">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3159">#3159</a></p> </p> </li> <li><p id="change-1.0.0b1-150"><span class="target" id="change-2a6df9779f9af4407c9c4efce9190458"><strong>[postgresql] [bug] </strong></span><p>The exception wrapping system for DBAPI errors can now accommodate non-standard DBAPI exceptions, such as the psycopg2 TransactionRollbackError. These exceptions will now be raised using the closest available subclass in <code class="docutils literal notranslate"><span class="pre">sqlalchemy.exc</span></code>, in the case of TransactionRollbackError, <code class="docutils literal notranslate"><span class="pre">sqlalchemy.exc.OperationalError</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-2a6df9779f9af4407c9c4efce9190458">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3075">#3075</a></p> </p> </li> <li><p id="change-1.0.0b1-151"><span class="target" id="change-947dc4e5d0e46e59a1fec0630c63cfd8"><strong>[postgresql] [bug] </strong></span><p>Fixed bug in <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.array" title="sqlalchemy.dialects.postgresql.array"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.array</span></code></a> object where comparison to a plain Python list would fail to use the correct array constructor. Pull request courtesy Andrew.</p> <a class="changeset-link headerlink reference internal" href="#change-947dc4e5d0e46e59a1fec0630c63cfd8">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3141">#3141</a></p> </p> </li> <li><p id="change-1.0.0b1-152"><span class="target" id="change-085435079f7139f16f13675776d31727"><strong>[postgresql] [bug] </strong></span><p>Added a supported <a class="reference internal" href="../core/functions.html#sqlalchemy.sql.functions.FunctionElement.alias" title="sqlalchemy.sql.functions.FunctionElement.alias"><code class="xref py py-meth docutils literal notranslate"><span class="pre">FunctionElement.alias()</span></code></a> method to functions, e.g. the <code class="docutils literal notranslate"><span class="pre">func</span></code> construct. Previously, behavior for this method was undefined. The current behavior mimics that of pre-0.9.4, which is that the function is turned into a single-column FROM clause with the given alias name, where the column itself is anonymously named.</p> <a class="changeset-link headerlink reference internal" href="#change-085435079f7139f16f13675776d31727">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3137">#3137</a></p> </p> </li> <li><p id="change-1.0.0b1-153"><span class="target" id="change-fd59b588a71617bcbc79e1d3af27e0fb"><strong>[postgresql] [bug] [pg8000] </strong></span><p>Fixed bug introduced in 0.9.5 by new pg8000 isolation level feature where engine-level isolation level parameter would raise an error on connect.</p> <a class="changeset-link headerlink reference internal" href="#change-fd59b588a71617bcbc79e1d3af27e0fb">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3134">#3134</a></p> </p> </li> <li><p id="change-1.0.0b1-154"><span class="target" id="change-817ce246e076efdc67696a7e59f8a604"><strong>[postgresql] [bug] </strong></span><p>The psycopg2 <code class="docutils literal notranslate"><span class="pre">.closed</span></code> accessor is now consulted when determining if an exception is a “disconnect” error; ideally, this should remove the need for any other inspection of the exception message to detect disconnect, however we will leave those existing messages in place as a fallback. This should be able to handle newer cases like “SSL EOF” conditions. Pull request courtesy Dirk Mueller.</p> <a class="changeset-link headerlink reference internal" href="#change-817ce246e076efdc67696a7e59f8a604">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3021">#3021</a></p> </p> </li> <li><p id="change-1.0.0b1-155"><span class="target" id="change-57f144525f35cc557711d61a06fba405"><strong>[postgresql] [bug] </strong></span><p>The PostgreSQL <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.ENUM" title="sqlalchemy.dialects.postgresql.ENUM"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.ENUM</span></code></a> type will emit a DROP TYPE instruction when a plain <code class="docutils literal notranslate"><span class="pre">table.drop()</span></code> is called, assuming the object is not associated directly with a <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> object. In order to accommodate the use case of an enumerated type shared between multiple tables, the type should be associated directly with the <a class="reference internal" href="../core/metadata.html#sqlalchemy.schema.MetaData" title="sqlalchemy.schema.MetaData"><code class="xref py py-class docutils literal notranslate"><span class="pre">MetaData</span></code></a> object; in this case the type will only be created at the metadata level, or if created directly. The rules for create/drop of PostgreSQL enumerated types have been highly reworked in general.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3319"><span class="std std-ref">Overhaul of ENUM type create/drop rules</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-57f144525f35cc557711d61a06fba405">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3319">#3319</a></p> </p> </li> <li><p id="change-1.0.0b1-156"><span class="target" id="change-1fc9593e4484eb96e7d37ce3877329e6"><strong>[postgresql] [bug] </strong></span><p>The <code class="xref py py-meth docutils literal notranslate"><span class="pre">PGDialect.has_table()</span></code> method will now query against <code class="docutils literal notranslate"><span class="pre">pg_catalog.pg_table_is_visible(c.oid)</span></code>, rather than testing for an exact schema match, when the schema name is None; this so that the method will also illustrate that temporary tables are present. Note that this is a behavioral change, as PostgreSQL allows a non-temporary table to silently overwrite an existing temporary table of the same name, so this changes the behavior of <code class="docutils literal notranslate"><span class="pre">checkfirst</span></code> in that unusual scenario.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3264"><span class="std std-ref">PostgreSQL has_table() now works for temporary tables</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-1fc9593e4484eb96e7d37ce3877329e6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3264">#3264</a></p> </p> </li> <li><p id="change-1.0.0b1-157"><span class="target" id="change-9ee706ecb52f01eb66438dc3135ff3ab"><strong>[postgresql] [enhancement] </strong></span><p>Added a new type <a class="reference internal" href="../dialects/postgresql.html#sqlalchemy.dialects.postgresql.OID" title="sqlalchemy.dialects.postgresql.OID"><code class="xref py py-class docutils literal notranslate"><span class="pre">postgresql.OID</span></code></a> to the PostgreSQL dialect. While “oid” is generally a private type within PG that is not exposed in modern versions, there are some PG use cases such as large object support where these types might be exposed, as well as within some user-reported schema reflection use cases.</p> <a class="changeset-link headerlink reference internal" href="#change-9ee706ecb52f01eb66438dc3135ff3ab">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3002">#3002</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-mysql"> <h3>mysql<a class="headerlink" href="#change-1.0.0b1-mysql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-158"><span class="target" id="change-888c2e0789c5c34cc840a4b8462d9b9f"><strong>[mysql] [feature] </strong></span><p>The MySQL dialect now renders TIMESTAMP with NULL / NOT NULL in all cases, so that MySQL 5.6.6 with the <code class="docutils literal notranslate"><span class="pre">explicit_defaults_for_timestamp</span></code> flag enabled will will allow TIMESTAMP to continue to work as expected when <code class="docutils literal notranslate"><span class="pre">nullable=False</span></code>. Existing applications are unaffected as SQLAlchemy has always emitted NULL for a TIMESTAMP column that is <code class="docutils literal notranslate"><span class="pre">nullable=True</span></code>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3155"><span class="std std-ref">MySQL TIMESTAMP Type now renders NULL / NOT NULL in all cases</span></a></p> <p><a class="reference internal" href="../dialects/mysql.html#mysql-timestamp-null"><span class="std std-ref">TIMESTAMP Columns and NULL</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-888c2e0789c5c34cc840a4b8462d9b9f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3155">#3155</a></p> </p> </li> <li><p id="change-1.0.0b1-159"><span class="target" id="change-4a9ddc227788a62f6b733bcdef159f74"><strong>[mysql] [feature] </strong></span><p>Updated the “supports_unicode_statements” flag to True for MySQLdb and Pymysql under Python 2. This refers to the SQL statements themselves, not the parameters, and affects issues such as table and column names using non-ASCII characters. These drivers both appear to support Python 2 Unicode objects without issue in modern versions.</p> <a class="changeset-link headerlink reference internal" href="#change-4a9ddc227788a62f6b733bcdef159f74">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3121">#3121</a></p> </p> </li> <li><p id="change-1.0.0b1-160"><span class="target" id="change-cc47f2dadf913e8df10f13d8f6369b8a"><strong>[mysql] [bug] </strong></span><p>MySQL error 2014 “commands out of sync” appears to be raised as a ProgrammingError, not OperationalError, in modern MySQL-Python versions; all MySQL error codes that are tested for “is disconnect” are now checked within OperationalError and ProgrammingError regardless.</p> <a class="changeset-link headerlink reference internal" href="#change-cc47f2dadf913e8df10f13d8f6369b8a">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3101">#3101</a></p> </p> </li> <li><p id="change-1.0.0b1-161"><span class="target" id="change-aeee11434848543451def6bb5409fee7"><strong>[mysql] [bug] </strong></span><p>Fixed bug where column names added to <code class="docutils literal notranslate"><span class="pre">mysql_length</span></code> parameter on an index needed to have the same quoting for quoted names in order to be recognized. The fix makes the quotes optional but also provides the old behavior for backwards compatibility with those using the workaround.</p> <a class="changeset-link headerlink reference internal" href="#change-aeee11434848543451def6bb5409fee7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3085">#3085</a></p> </p> </li> <li><p id="change-1.0.0b1-162"><span class="target" id="change-028aac30fa34b4cac9c150baf9952dc3"><strong>[mysql] [bug] </strong></span><p>Added support for reflecting tables where an index includes KEY_BLOCK_SIZE using an equal sign. Pull request courtesy Sean McGivern.</p> <a class="changeset-link headerlink reference internal" href="#change-028aac30fa34b4cac9c150baf9952dc3">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-163"><span class="target" id="change-e9507a4fa2966caf6fbdf8f3d92b30a6"><strong>[mysql] [bug] </strong></span><p>Added a version check to the MySQLdb dialect surrounding the check for ‘utf8_bin’ collation, as this fails on MySQL server < 5.0.</p> <a class="changeset-link headerlink reference internal" href="#change-e9507a4fa2966caf6fbdf8f3d92b30a6">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3274">#3274</a></p> </p> </li> <li><p id="change-1.0.0b1-164"><span class="target" id="change-82e5f7ede904a4dfc77f0ed73d7d6de6"><strong>[mysql] [bug] [mysqlconnector] </strong></span><p>Mysqlconnector as of version 2.0, probably as a side effect of the python 3 merge, now does not expect percent signs (e.g. as used as the modulus operator and others) to be doubled, even when using the “pyformat” bound parameter format (this change is not documented by Mysqlconnector). The dialect now checks for py2k and for mysqlconnector less than version 2.0 when detecting if the modulus operator should be rendered as <code class="docutils literal notranslate"><span class="pre">%%</span></code> or <code class="docutils literal notranslate"><span class="pre">%</span></code>.</p> <a class="changeset-link headerlink reference internal" href="#change-82e5f7ede904a4dfc77f0ed73d7d6de6">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-165"><span class="target" id="change-b1e1955593b6611049d3537fca258c4a"><strong>[mysql] [bug] [mysqlconnector] </strong></span><p>Unicode SQL is now passed for MySQLconnector version 2.0 and above; for Py2k and MySQL < 2.0, strings are encoded.</p> <a class="changeset-link headerlink reference internal" href="#change-b1e1955593b6611049d3537fca258c4a">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-166"><span class="target" id="change-d248e6e466f184e254344213a59553d3"><strong>[mysql] [bug] </strong></span><p>The MySQL dialect now supports CAST on types that are constructed as <a class="reference internal" href="../core/custom_types.html#sqlalchemy.types.TypeDecorator" title="sqlalchemy.types.TypeDecorator"><code class="xref py py-class docutils literal notranslate"><span class="pre">TypeDecorator</span></code></a> objects.</p> <a class="changeset-link headerlink reference internal" href="#change-d248e6e466f184e254344213a59553d3">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-167"><span class="target" id="change-e06b558414bac3be5aee54ce4035def2"><strong>[mysql] [bug] </strong></span><p>A warning is emitted when <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.cast" title="sqlalchemy.sql.expression.cast"><code class="xref py py-func docutils literal notranslate"><span class="pre">cast()</span></code></a> is used with the MySQL dialect on a type where MySQL does not support CAST; MySQL only supports CAST on a subset of datatypes. SQLAlchemy has for a long time just omitted the CAST for unsupported types in the case of MySQL. While we don’t want to change this now, we emit a warning to show that it’s taken place. A warning is also emitted when a CAST is used with an older MySQL version (< 4) that doesn’t support CAST at all, it’s skipped in this case as well.</p> <a class="changeset-link headerlink reference internal" href="#change-e06b558414bac3be5aee54ce4035def2">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3237">#3237</a></p> </p> </li> <li><p id="change-1.0.0b1-168"><span class="target" id="change-220ee8533c248292fd2a189f6855742c"><strong>[mysql] [bug] </strong></span><p>The <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.SET" title="sqlalchemy.dialects.mysql.SET"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.SET</span></code></a> type has been overhauled to no longer assume that the empty string, or a set with a single empty string value, is in fact a set with a single empty string; instead, this is by default treated as the empty set. In order to handle persistence of a <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.SET" title="sqlalchemy.dialects.mysql.SET"><code class="xref py py-class docutils literal notranslate"><span class="pre">mysql.SET</span></code></a> that actually wants to include the blank value <code class="docutils literal notranslate"><span class="pre">''</span></code> as a legitimate value, a new bitwise operational mode is added which is enabled by the <a class="reference internal" href="../dialects/mysql.html#sqlalchemy.dialects.mysql.SET.params.retrieve_as_bitwise" title="sqlalchemy.dialects.mysql.SET"><code class="xref py py-paramref docutils literal notranslate"><span class="pre">mysql.SET.retrieve_as_bitwise</span></code></a> flag, which will persist and retrieve values unambiguously using their bitflag positioning. Storage and retrieval of unicode values for driver configurations that aren’t converting unicode natively is also repaired.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3283"><span class="std std-ref">MySQL SET Type Overhauled to support empty sets, unicode, blank value handling</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-220ee8533c248292fd2a189f6855742c">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3283">#3283</a></p> </p> </li> <li><p id="change-1.0.0b1-169"><span class="target" id="change-d684884bc2ec500da77ede3801a695af"><strong>[mysql] [bug] </strong></span><p>The <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.operators.ColumnOperators.match" title="sqlalchemy.sql.operators.ColumnOperators.match"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ColumnOperators.match()</span></code></a> operator is now handled such that the return type is not strictly assumed to be boolean; it now returns a <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Boolean" title="sqlalchemy.types.Boolean"><code class="xref py py-class docutils literal notranslate"><span class="pre">Boolean</span></code></a> subclass called <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.MatchType" title="sqlalchemy.types.MatchType"><code class="xref py py-class docutils literal notranslate"><span class="pre">MatchType</span></code></a>. The type will still produce boolean behavior when used in Python expressions, however the dialect can override its behavior at result time. In the case of MySQL, while the MATCH operator is typically used in a boolean context within an expression, if one actually queries for the value of a match expression, a floating point value is returned; this value is not compatible with SQLAlchemy’s C-based boolean processor, so MySQL’s result-set behavior now follows that of the <a class="reference internal" href="../core/type_basics.html#sqlalchemy.types.Float" title="sqlalchemy.types.Float"><code class="xref py py-class docutils literal notranslate"><span class="pre">Float</span></code></a> type. A new operator object <code class="docutils literal notranslate"><span class="pre">notmatch_op</span></code> is also added to better allow dialects to define the negation of a match operation.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3263"><span class="std std-ref">The match() operator now returns an agnostic MatchType compatible with MySQL’s floating point return value</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-d684884bc2ec500da77ede3801a695af">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3263">#3263</a></p> </p> </li> <li><p id="change-1.0.0b1-170"><span class="target" id="change-9787cfb315047779532af296d86e52c8"><strong>[mysql] [bug] </strong></span><p>MySQL boolean symbols “true”, “false” work again. 0.9’s change in <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2682">#2682</a> disallowed the MySQL dialect from making use of the “true” and “false” symbols in the context of “IS” / “IS NOT”, but MySQL supports this syntax even though it has no boolean type. MySQL remains “non native boolean”, but the <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.true" title="sqlalchemy.sql.expression.true"><code class="xref py py-func docutils literal notranslate"><span class="pre">true()</span></code></a> and <a class="reference internal" href="../core/sqlelement.html#sqlalchemy.sql.expression.false" title="sqlalchemy.sql.expression.false"><code class="xref py py-func docutils literal notranslate"><span class="pre">false()</span></code></a> symbols again produce the keywords “true” and “false”, so that an expression like <code class="docutils literal notranslate"><span class="pre">column.is_(true())</span></code> again works on MySQL.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#bug-3186"><span class="std std-ref">MySQL boolean symbols “true”, “false” work again</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-9787cfb315047779532af296d86e52c8">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3186">#3186</a></p> </p> </li> <li><p id="change-1.0.0b1-171"><span class="target" id="change-828372b575d2aa0994e92d6186465a3d"><strong>[mysql] [bug] </strong></span><p>The MySQL dialect will now disable <a class="reference internal" href="../core/events.html#sqlalchemy.events.ConnectionEvents.handle_error" title="sqlalchemy.events.ConnectionEvents.handle_error"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ConnectionEvents.handle_error()</span></code></a> events from firing for those statements which it uses internally to detect if a table exists or not. This is achieved using an execution option <code class="docutils literal notranslate"><span class="pre">skip_user_error_events</span></code> that disables the handle error event for the scope of that execution. In this way, user code that rewrites exceptions doesn’t need to worry about the MySQL dialect or other dialects that occasionally need to catch SQLAlchemy specific exceptions.</p> <a class="changeset-link headerlink reference internal" href="#change-828372b575d2aa0994e92d6186465a3d">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-172"><span class="target" id="change-c99bdbe39a0aae424a21593e9240e9f3"><strong>[mysql] [bug] </strong></span><p>Changed the default value of “raise_on_warnings” to False for MySQLconnector. This was set at True for some reason. The “buffered” flag unfortunately must stay at True as MySQLconnector does not allow a cursor to be closed unless all results are fully fetched.</p> <a class="changeset-link headerlink reference internal" href="#change-c99bdbe39a0aae424a21593e9240e9f3">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2515">#2515</a></p> </p> </li> <li><p id="change-1.0.0b1-173"><span class="target" id="change-88c8bf1c005b1ba08a675f1c4fc922b3"><strong>[mysql] [change] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">gaerdbms</span></code> dialect is no longer necessary, and emits a deprecation warning. Google now recommends using the MySQLdb dialect directly.</p> <a class="changeset-link headerlink reference internal" href="#change-88c8bf1c005b1ba08a675f1c4fc922b3">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3275">#3275</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-sqlite"> <h3>sqlite<a class="headerlink" href="#change-1.0.0b1-sqlite" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-174"><span class="target" id="change-3d9fb6341c517aafb29dced236fb59d6"><strong>[sqlite] [feature] </strong></span><p>Added support for partial indexes (e.g. with a WHERE clause) on SQLite. Pull request courtesy Kai Groner.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/sqlite.html#sqlite-partial-index"><span class="std std-ref">Partial Indexes</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-3d9fb6341c517aafb29dced236fb59d6">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-175"><span class="target" id="change-7e6346bf1aeb5ee43f7e365c475c7b57"><strong>[sqlite] [feature] </strong></span><p>Added a new SQLite backend for the SQLCipher backend. This backend provides for encrypted SQLite databases using the pysqlcipher Python driver, which is very similar to the pysqlite driver.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/sqlite.html#module-sqlalchemy.dialects.sqlite.pysqlcipher" title="sqlalchemy.dialects.sqlite.pysqlcipher"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pysqlcipher</span></code></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-7e6346bf1aeb5ee43f7e365c475c7b57">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-176"><span class="target" id="change-946017d06b93655ea05ced1c50d7c010"><strong>[sqlite] [bug] </strong></span><p>When selecting from a UNION using an attached database file, the pysqlite driver reports column names in cursor.description as ‘dbname.tablename.colname’, instead of ‘tablename.colname’ as it normally does for a UNION (note that it’s supposed to just be ‘colname’ for both, but we work around it). The column translation logic here has been adjusted to retrieve the rightmost token, rather than the second token, so it works in both cases. Workaround courtesy Tony Roberts.</p> <a class="changeset-link headerlink reference internal" href="#change-946017d06b93655ea05ced1c50d7c010">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3211">#3211</a></p> </p> </li> <li><p id="change-1.0.0b1-177"><span class="target" id="change-dbba9e2ad3a065a1eb84d3b38b6d347d"><strong>[sqlite] [bug] </strong></span><p>Fixed a SQLite join rewriting issue where a subquery that is embedded as a scalar subquery such as within an IN would receive inappropriate substitutions from the enclosing query, if the same table were present inside the subquery as were in the enclosing query such as in a joined inheritance scenario.</p> <a class="changeset-link headerlink reference internal" href="#change-dbba9e2ad3a065a1eb84d3b38b6d347d">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3130">#3130</a></p> </p> </li> <li><p id="change-1.0.0b1-178"><span class="target" id="change-792dfcd8b60e9bb55f168dcccc0fd113"><strong>[sqlite] [bug] </strong></span><p>UNIQUE and FOREIGN KEY constraints are now fully reflected on SQLite both with and without names. Previously, foreign key names were ignored and unnamed unique constraints were skipped. Thanks to Jon Nelson for assistance with this.</p> <a class="changeset-link headerlink reference internal" href="#change-792dfcd8b60e9bb55f168dcccc0fd113">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3244">#3244</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3261">#3261</a></p> </p> </li> <li><p id="change-1.0.0b1-179"><span class="target" id="change-239acc44616f1d843f4adf9a759d3a7b"><strong>[sqlite] [bug] </strong></span><p>The SQLite dialect, when using the <a class="reference internal" href="../dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATE" title="sqlalchemy.dialects.sqlite.DATE"><code class="xref py py-class docutils literal notranslate"><span class="pre">sqlite.DATE</span></code></a>, <a class="reference internal" href="../dialects/sqlite.html#sqlalchemy.dialects.sqlite.TIME" title="sqlalchemy.dialects.sqlite.TIME"><code class="xref py py-class docutils literal notranslate"><span class="pre">sqlite.TIME</span></code></a>, or <a class="reference internal" href="../dialects/sqlite.html#sqlalchemy.dialects.sqlite.DATETIME" title="sqlalchemy.dialects.sqlite.DATETIME"><code class="xref py py-class docutils literal notranslate"><span class="pre">sqlite.DATETIME</span></code></a> types, and given a <code class="docutils literal notranslate"><span class="pre">storage_format</span></code> that only renders numbers, will render the types in DDL as <code class="docutils literal notranslate"><span class="pre">DATE_CHAR</span></code>, <code class="docutils literal notranslate"><span class="pre">TIME_CHAR</span></code>, and <code class="docutils literal notranslate"><span class="pre">DATETIME_CHAR</span></code>, so that despite the lack of alpha characters in the values, the column will still deliver the “text affinity”. Normally this is not needed, as the textual values within the default storage formats already imply text.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/sqlite.html#sqlite-datetime"><span class="std std-ref">Date and Time Types</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-239acc44616f1d843f4adf9a759d3a7b">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3257">#3257</a></p> </p> </li> <li><p id="change-1.0.0b1-180"><span class="target" id="change-143526c69a00507711235150baad7656"><strong>[sqlite] [bug] </strong></span><p>SQLite now supports reflection of unique constraints from temp tables; previously, this would fail with a TypeError. Pull request courtesy Johannes Erdfelt.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3204"><span class="std std-ref">SQLite/Oracle have distinct methods for temporary table/view name reporting</span></a> - changes regarding SQLite temporary table and view reflection.</p> </div> <a class="changeset-link headerlink reference internal" href="#change-143526c69a00507711235150baad7656">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3203">#3203</a></p> </p> </li> <li><p id="change-1.0.0b1-181"><span class="target" id="change-dc3cc23baa14088445f40787bfb225c9"><strong>[sqlite] [bug] </strong></span><p>Added <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_temp_table_names" title="sqlalchemy.engine.reflection.Inspector.get_temp_table_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_temp_table_names()</span></code></a> and <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_temp_view_names" title="sqlalchemy.engine.reflection.Inspector.get_temp_view_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_temp_view_names()</span></code></a>; currently, only the SQLite and Oracle dialects support these methods. The return of temporary table and view names has been <strong>removed</strong> from SQLite and Oracle’s version of <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_table_names" title="sqlalchemy.engine.reflection.Inspector.get_table_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_table_names()</span></code></a> and <a class="reference internal" href="../core/reflection.html#sqlalchemy.engine.reflection.Inspector.get_view_names" title="sqlalchemy.engine.reflection.Inspector.get_view_names"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Inspector.get_view_names()</span></code></a>; other database backends cannot support this information (such as MySQL), and the scope of operation is different in that the tables can be local to a session and typically aren’t supported in remote schemas.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3204"><span class="std std-ref">SQLite/Oracle have distinct methods for temporary table/view name reporting</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-dc3cc23baa14088445f40787bfb225c9">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3204">#3204</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-mssql"> <h3>mssql<a class="headerlink" href="#change-1.0.0b1-mssql" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-182"><span class="target" id="change-20559f663839ceee7e14634eafedb5be"><strong>[mssql] [feature] </strong></span><p>Enabled “multivalues insert” for SQL Server 2008. Pull request courtesy Albert Cervin. Also expanded the checks for “IDENTITY INSERT” mode to include when the identity key is present in the VALUEs clause of the statement.</p> <a class="changeset-link headerlink reference internal" href="#change-20559f663839ceee7e14634eafedb5be">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-183"><span class="target" id="change-f520106ec3455eaa056110c048aa4862"><strong>[mssql] [feature] </strong></span><p>SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max), VARBINARY(max) for large text/binary types. The MSSQL dialect will now respect this based on version detection, as well as the new <code class="docutils literal notranslate"><span class="pre">deprecate_large_types</span></code> flag.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../dialects/mssql.html#mssql-large-type-deprecation"><span class="std std-ref">Large Text/Binary Type Deprecation</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-f520106ec3455eaa056110c048aa4862">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3039">#3039</a></p> </p> </li> <li><p id="change-1.0.0b1-184"><span class="target" id="change-216a4d0059a5b9c4689bd6f999ba2f1e"><strong>[mssql] [changed] </strong></span><p>The hostname-based connection format for SQL Server when using pyodbc will no longer specify a default “driver name”, and a warning is emitted if this is missing. The optimal driver name for SQL Server changes frequently and is per-platform, so hostname based connections need to specify this. DSN-based connections are preferred.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3182"><span class="std std-ref">PyODBC driver name is required with hostname-based SQL Server connections</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-216a4d0059a5b9c4689bd6f999ba2f1e">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3182">#3182</a></p> </p> </li> <li><p id="change-1.0.0b1-185"><span class="target" id="change-1f87a0341490182683860e3d896e5d83"><strong>[mssql] [bug] </strong></span><p>Added statement encoding to the “SET IDENTITY_INSERT” statements which operate when an explicit INSERT is being interjected into an IDENTITY column, to support non-ascii table identifiers on drivers such as pyodbc + unix + py2k that don’t support unicode statements.</p> <a class="changeset-link headerlink reference internal" href="#change-1f87a0341490182683860e3d896e5d83">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7, 0.8.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-186"><span class="target" id="change-8540c30a01328c69626ed15f9d38ae35"><strong>[mssql] [bug] </strong></span><p>In the SQL Server pyodbc dialect, repaired the implementation for the <code class="docutils literal notranslate"><span class="pre">description_encoding</span></code> dialect parameter, which when not explicitly set was preventing cursor.description from being parsed correctly in the case of result sets that contained names in alternate encodings. This parameter shouldn’t be needed going forward.</p> <a class="changeset-link headerlink reference internal" href="#change-8540c30a01328c69626ed15f9d38ae35">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3091">#3091</a></p> </p> </li> <li><p id="change-1.0.0b1-187"><span class="target" id="change-1ac1ebc454b99a8106f36414704b4f13"><strong>[mssql] [bug] </strong></span><p>Fixed the version string detection in the pymssql dialect to work with Microsoft SQL Azure, which changes the word “SQL Server” to “SQL Azure”.</p> <a class="changeset-link headerlink reference internal" href="#change-1ac1ebc454b99a8106f36414704b4f13">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3151">#3151</a></p> </p> </li> <li><p id="change-1.0.0b1-188"><span class="target" id="change-bbd51d56a17c9f56dbfba67a40873a90"><strong>[mssql] [bug] </strong></span><p>Revised the query used to determine the current default schema name to use the <code class="docutils literal notranslate"><span class="pre">database_principal_id()</span></code> function in conjunction with the <code class="docutils literal notranslate"><span class="pre">sys.database_principals</span></code> view so that we can determine the default schema independently of the type of login in progress (e.g., SQL Server, Windows, etc).</p> <a class="changeset-link headerlink reference internal" href="#change-bbd51d56a17c9f56dbfba67a40873a90">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3025">#3025</a></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-oracle"> <h3>oracle<a class="headerlink" href="#change-1.0.0b1-oracle" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-189"><span class="target" id="change-f1f07fe9ae58e5e7549f76959816986a"><strong>[oracle] [feature] </strong></span><p>Added support for cx_oracle connections to a specific service name, as opposed to a tns name, by passing <code class="docutils literal notranslate"><span class="pre">?service_name=<name></span></code> to the URL. Pull request courtesy Sławomir Ehlert.</p> <a class="changeset-link headerlink reference internal" href="#change-f1f07fe9ae58e5e7549f76959816986a">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-190"><span class="target" id="change-d721c0561d8a2b535f97670c2d8ef966"><strong>[oracle] [feature] </strong></span><p>New Oracle DDL features for tables, indexes: COMPRESS, BITMAP. Patch courtesy Gabor Gombas.</p> <a class="changeset-link headerlink reference internal" href="#change-d721c0561d8a2b535f97670c2d8ef966">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-191"><span class="target" id="change-d9d92d75a7435eeb5a6b5bc6eb1f7f1f"><strong>[oracle] [feature] </strong></span><p>Added support for CTEs under Oracle. This includes some tweaks to the aliasing syntax, as well as a new CTE feature <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.CTE.suffix_with" title="sqlalchemy.sql.expression.CTE.suffix_with"><code class="xref py py-meth docutils literal notranslate"><span class="pre">CTE.suffix_with()</span></code></a>, which is useful for adding in special Oracle-specific directives to the CTE.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-3220"><span class="std std-ref">Improved support for CTEs in Oracle</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-d9d92d75a7435eeb5a6b5bc6eb1f7f1f">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3220">#3220</a></p> </p> </li> <li><p id="change-1.0.0b1-192"><span class="target" id="change-833d0958c15092ca207886692b5894b6"><strong>[oracle] [feature] </strong></span><p>Added support for the Oracle table option ON COMMIT.</p> <a class="changeset-link headerlink reference internal" href="#change-833d0958c15092ca207886692b5894b6">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-193"><span class="target" id="change-8cb6529185a476446f028d78bada53c7"><strong>[oracle] [bug] </strong></span><p>Fixed long-standing bug in Oracle dialect where bound parameter names that started with numbers would not be quoted, as Oracle doesn’t like numerics in bound parameter names.</p> <a class="changeset-link headerlink reference internal" href="#change-8cb6529185a476446f028d78bada53c7">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2138">#2138</a></p> </p> </li> <li><p id="change-1.0.0b1-194"><span class="target" id="change-a07180efec1ae8c8de5daffb374ea261"><strong>[oracle] [bug] [tests] </strong></span><p>Fixed bug in oracle dialect test suite where in one test, ‘username’ was assumed to be in the database URL, even though this might not be the case.</p> <a class="changeset-link headerlink reference internal" href="#change-a07180efec1ae8c8de5daffb374ea261">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3128">#3128</a></p> </p> </li> <li><p id="change-1.0.0b1-195"><span class="target" id="change-b22f2a6c7705c972bdd48542da13e9e1"><strong>[oracle] [bug] </strong></span><p>An alias name will be properly quoted when referred to using the <code class="docutils literal notranslate"><span class="pre">%(name)s</span></code> token inside the <a class="reference internal" href="../core/selectable.html#sqlalchemy.sql.expression.Select.with_hint" title="sqlalchemy.sql.expression.Select.with_hint"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Select.with_hint()</span></code></a> method. Previously, the Oracle backend hadn’t implemented this quoting.</p> <a class="changeset-link headerlink reference internal" href="#change-b22f2a6c7705c972bdd48542da13e9e1">¶</a><p></p> </p> </li> </ul> </div> <div class="section" id="change-1.0.0b1-misc"> <h3>misc<a class="headerlink" href="#change-1.0.0b1-misc" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li><p id="change-1.0.0b1-196"><span class="target" id="change-34bed682b188b0328e558a3338cd3564"><strong>[feature] [examples] </strong></span><p>Added a new example illustrating materialized paths, using the latest relationship features. Example courtesy Jack Zhou.</p> <a class="changeset-link headerlink reference internal" href="#change-34bed682b188b0328e558a3338cd3564">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-197"><span class="target" id="change-fabfc534f4d8cf8fe39e10413fb7d5e6"><strong>[feature] [ext] </strong></span><p>Added a new extension suite <a class="reference internal" href="../orm/extensions/baked.html#module-sqlalchemy.ext.baked" title="sqlalchemy.ext.baked"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlalchemy.ext.baked</span></code></a>. This simple but unusual system allows for a dramatic savings in Python overhead for the construction and processing of orm <a class="reference internal" href="../orm/query.html#sqlalchemy.orm.query.Query" title="sqlalchemy.orm.query.Query"><code class="xref py py-class docutils literal notranslate"><span class="pre">Query</span></code></a> objects, from query construction up through rendering of a string SQL statement.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/extensions/baked.html"><span class="std std-ref">Baked Queries</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-fabfc534f4d8cf8fe39e10413fb7d5e6">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3054">#3054</a></p> </p> </li> <li><p id="change-1.0.0b1-198"><span class="target" id="change-c3e04c4306f45aebbbd32a56d0f13d47"><strong>[feature] [examples] </strong></span><p>A new suite of examples dedicated to providing a detailed study into performance of SQLAlchemy ORM and Core, as well as the DBAPI, from multiple perspectives. The suite runs within a container that provides built in profiling displays both through console output as well as graphically via the RunSnake tool.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../orm/examples.html#examples-performance"><span class="std std-ref">Performance</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-c3e04c4306f45aebbbd32a56d0f13d47">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-199"><span class="target" id="change-748a15a873fc07b67bd7ddfe221fbff3"><strong>[feature] [ext] </strong></span><p>The <a class="reference internal" href="../orm/extensions/automap.html#module-sqlalchemy.ext.automap" title="sqlalchemy.ext.automap"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlalchemy.ext.automap</span></code></a> extension will now set <code class="docutils literal notranslate"><span class="pre">cascade="all,</span> <span class="pre">delete-orphan"</span></code> automatically on a one-to-many relationship/backref where the foreign key is detected as containing one or more non-nullable columns. This argument is present in the keywords passed to <a class="reference internal" href="../orm/extensions/automap.html#sqlalchemy.ext.automap.generate_relationship" title="sqlalchemy.ext.automap.generate_relationship"><code class="xref py py-func docutils literal notranslate"><span class="pre">automap.generate_relationship()</span></code></a> in this case and can still be overridden. Additionally, if the <a class="reference internal" href="../core/constraints.html#sqlalchemy.schema.ForeignKeyConstraint" title="sqlalchemy.schema.ForeignKeyConstraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForeignKeyConstraint</span></code></a> specifies <code class="docutils literal notranslate"><span class="pre">ondelete="CASCADE"</span></code> for a non-nullable or <code class="docutils literal notranslate"><span class="pre">ondelete="SET</span> <span class="pre">NULL"</span></code> for a nullable set of columns, the argument <code class="docutils literal notranslate"><span class="pre">passive_deletes=True</span></code> is also added to the relationship. Note that not all backends support reflection of ondelete, but backends that do include PostgreSQL and MySQL.</p> <a class="changeset-link headerlink reference internal" href="#change-748a15a873fc07b67bd7ddfe221fbff3">¶</a><p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3210">#3210</a></p> </p> </li> <li><p id="change-1.0.0b1-200"><span class="target" id="change-4b74183b867c026c18e2cd7db8eeb462"><strong>[removed] </strong></span><p>The Drizzle dialect has been removed from the Core; it is now available as <a class="reference external" href="https://bitbucket.org/zzzeek/sqlalchemy-drizzle">sqlalchemy-drizzle</a>, an independent, third party dialect. The dialect is still based almost entirely off of the MySQL dialect present in SQLAlchemy.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="migration_10.html#change-2984"><span class="std std-ref">Drizzle Dialect is now an External Dialect</span></a></p> </div> <a class="changeset-link headerlink reference internal" href="#change-4b74183b867c026c18e2cd7db8eeb462">¶</a><p></p> </p> </li> <li><p id="change-1.0.0b1-201"><span class="target" id="change-7190c4c8e7853dc246b3c4c738478edb"><strong>[bug] [declarative] </strong></span><p>The <code class="docutils literal notranslate"><span class="pre">__mapper_args__</span></code> dictionary is copied from a declarative mixin or abstract class when accessed, so that modifications made to this dictionary by declarative itself won’t conflict with that of other mappings. The dictionary is modified regarding the <code class="docutils literal notranslate"><span class="pre">version_id_col</span></code> and <code class="docutils literal notranslate"><span class="pre">polymorphic_on</span></code> arguments, replacing the column within with the one that is officially mapped to the local class/table.</p> <a class="changeset-link headerlink reference internal" href="#change-7190c4c8e7853dc246b3c4c738478edb">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3062">#3062</a></p> </p> </li> <li><p id="change-1.0.0b1-202"><span class="target" id="change-eae3f266c75c4ae69fc34c7668edf3d1"><strong>[bug] [ext] </strong></span><p>Fixed bug in mutable extension where <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">MutableDict</span></code></a> did not report change events for the <code class="docutils literal notranslate"><span class="pre">setdefault()</span></code> dictionary operation.</p> <a class="changeset-link headerlink reference internal" href="#change-eae3f266c75c4ae69fc34c7668edf3d1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3051">#3051</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3093">#3093</a></p> </p> </li> <li><p id="change-1.0.0b1-203"><span class="target" id="change-97ce2c718bb55b40569d4c50e584b2fc"><strong>[bug] [ext] </strong></span><p>Fixed bug where <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict.setdefault" title="sqlalchemy.ext.mutable.MutableDict.setdefault"><code class="xref py py-meth docutils literal notranslate"><span class="pre">MutableDict.setdefault()</span></code></a> didn’t return the existing or new value (this bug was not released in any 0.8 version). Pull request courtesy Thomas Hervé.</p> <a class="changeset-link headerlink reference internal" href="#change-97ce2c718bb55b40569d4c50e584b2fc">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5, 0.8.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3051">#3051</a>, <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3093">#3093</a></p> </p> </li> <li><p id="change-1.0.0b1-204"><span class="target" id="change-065233e8c2777e0d68ba556dd655c2f9"><strong>[bug] [ext] [py3k] </strong></span><p>Fixed bug where the association proxy list class would not interpret slices correctly under Py3K. Pull request courtesy Gilles Dartiguelongue.</p> <a class="changeset-link headerlink reference internal" href="#change-065233e8c2777e0d68ba556dd655c2f9">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-205"><span class="target" id="change-fa2a2b92fa766fc863eb7235e9fb3d03"><strong>[bug] [examples] </strong></span><p>Updated the <a class="reference internal" href="../orm/examples.html#examples-versioned-history"><span class="std std-ref">Versioning with a History Table</span></a> example such that mapped columns are re-mapped to match column names as well as grouping of columns; in particular, this allows columns that are explicitly grouped in a same-column-named joined inheritance scenario to be mapped in the same way in the history mappings, avoiding warnings added in the 0.9 series regarding this pattern and allowing the same view of attribute keys.</p> <a class="changeset-link headerlink reference internal" href="#change-fa2a2b92fa766fc863eb7235e9fb3d03">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-206"><span class="target" id="change-80c24af8d3114a95be384c5eb4a5bd39"><strong>[bug] [examples] </strong></span><p>Fixed a bug in the examples/generic_associations/discriminator_on_association.py example, where the subclasses of AddressAssociation were not being mapped as “single table inheritance”, leading to problems when trying to use the mappings further.</p> <a class="changeset-link headerlink reference internal" href="#change-80c24af8d3114a95be384c5eb4a5bd39">¶</a><p>This change is also <strong>backported</strong> to: 0.9.9</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-207"><span class="target" id="change-42c47d9c9a02c97b7a2be9901e2a9645"><strong>[bug] [declarative] </strong></span><p>Fixed an unlikely race condition observed in some exotic end-user setups, where the attempt to check for “duplicate class name” in declarative would hit upon a not-totally-cleaned-up weak reference related to some other class being removed; the check here now ensures the weakref still references an object before calling upon it further.</p> <a class="changeset-link headerlink reference internal" href="#change-42c47d9c9a02c97b7a2be9901e2a9645">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3208">#3208</a></p> </p> </li> <li><p id="change-1.0.0b1-208"><span class="target" id="change-0c1e3c4d921376b5c6e8063fc8ce0569"><strong>[bug] [ext] </strong></span><p>Fixed bug in ordering list where the order of items would be thrown off during a collection replace event, if the reorder_on_append flag were set to True. The fix ensures that the ordering list only impacts the list that is explicitly associated with the object.</p> <a class="changeset-link headerlink reference internal" href="#change-0c1e3c4d921376b5c6e8063fc8ce0569">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3191">#3191</a></p> </p> </li> <li><p id="change-1.0.0b1-209"><span class="target" id="change-294bea028af9c9afef0f3f0e1704cdcb"><strong>[bug] [ext] </strong></span><p>Fixed bug where <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">ext.mutable.MutableDict</span></code></a> failed to implement the <code class="docutils literal notranslate"><span class="pre">update()</span></code> dictionary method, thus not catching changes. Pull request courtesy Matt Chisholm.</p> <a class="changeset-link headerlink reference internal" href="#change-294bea028af9c9afef0f3f0e1704cdcb">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-210"><span class="target" id="change-8d145545ac65b225cab55e7ddd8b87c1"><strong>[bug] [ext] </strong></span><p>Fixed bug where a custom subclass of <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">ext.mutable.MutableDict</span></code></a> would not show up in a “coerce” operation, and would instead return a plain <a class="reference internal" href="../orm/extensions/mutable.html#sqlalchemy.ext.mutable.MutableDict" title="sqlalchemy.ext.mutable.MutableDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">ext.mutable.MutableDict</span></code></a>. Pull request courtesy Matt Chisholm.</p> <a class="changeset-link headerlink reference internal" href="#change-8d145545ac65b225cab55e7ddd8b87c1">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-211"><span class="target" id="change-40ab208d891571a2d6aaa91d50bc86b4"><strong>[bug] [pool] </strong></span><p>Fixed bug in connection pool logging where the “connection checked out” debug logging message would not emit if the logging were set up using <code class="docutils literal notranslate"><span class="pre">logging.setLevel()</span></code>, rather than using the <code class="docutils literal notranslate"><span class="pre">echo_pool</span></code> flag. Tests to assert this logging have been added. This is a regression that was introduced in 0.9.0.</p> <a class="changeset-link headerlink reference internal" href="#change-40ab208d891571a2d6aaa91d50bc86b4">¶</a><p>This change is also <strong>backported</strong> to: 0.9.8</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3168">#3168</a></p> </p> </li> <li><p id="change-1.0.0b1-212"><span class="target" id="change-b4849c03234d67784392c98314d97728"><strong>[bug] [tests] </strong></span><p>Fixed bug where “python setup.py test” wasn’t calling into distutils appropriately, and errors would be emitted at the end of the test suite.</p> <a class="changeset-link headerlink reference internal" href="#change-b4849c03234d67784392c98314d97728">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-213"><span class="target" id="change-b4c1be63379dda62c10d4726c27c8beb"><strong>[bug] [declarative] </strong></span><p>Fixed bug when the declarative <code class="docutils literal notranslate"><span class="pre">__abstract__</span></code> flag was not being distinguished for when it was actually the value <code class="docutils literal notranslate"><span class="pre">False</span></code>. The <code class="docutils literal notranslate"><span class="pre">__abstract__</span></code> flag needs to actually evaluate to a True value at the level being tested.</p> <a class="changeset-link headerlink reference internal" href="#change-b4c1be63379dda62c10d4726c27c8beb">¶</a><p>This change is also <strong>backported</strong> to: 0.9.7</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/3097">#3097</a></p> </p> </li> <li><p id="change-1.0.0b1-214"><span class="target" id="change-3cdae2ba3d5b9ed9634abbdc5d76d52c"><strong>[bug] [testsuite] </strong></span><p>In public test suite, changed to use of <code class="docutils literal notranslate"><span class="pre">String(40)</span></code> from less-supported <code class="docutils literal notranslate"><span class="pre">Text</span></code> in <code class="docutils literal notranslate"><span class="pre">StringTest.test_literal_backslashes</span></code>. Pullreq courtesy Jan.</p> <a class="changeset-link headerlink reference internal" href="#change-3cdae2ba3d5b9ed9634abbdc5d76d52c">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p></p> </p> </li> <li><p id="change-1.0.0b1-215"><span class="target" id="change-2792c57b68ceebf75c4999473088cba4"><strong>[bug] [py3k] [tests] </strong></span><p>Corrected for some deprecation warnings involving the <code class="docutils literal notranslate"><span class="pre">imp</span></code> module and Python 3.3 or greater, when running tests. Pull request courtesy Matt Chisholm.</p> <a class="changeset-link headerlink reference internal" href="#change-2792c57b68ceebf75c4999473088cba4">¶</a><p>This change is also <strong>backported</strong> to: 0.9.5</p> <p>References: <a class="reference external" href="http://www.sqlalchemy.org/trac/ticket/2830">#2830</a></p> </p> </li> </ul> </div> </div> </div> </div> </div> <div id="docs-bottom-navigation" class="docs-navigation-links, withsidebar"> Previous: <a href="changelog_11.html" title="previous chapter">1.1 Changelog</a> Next: <a href="changelog_09.html" title="next chapter">0.9 Changelog</a> <div id="docs-copyright"> © <a href="../copyright.html">Copyright</a> 2007-2019, the SQLAlchemy authors and contributors. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.0.1. </div> </div> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.2.19', COLLAPSE_MODINDEX: false, FILE_SUFFIX: '.html' }; </script> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <!-- begin iterate through sphinx environment script_files --> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <!-- end iterate through sphinx environment script_files --> <script type="text/javascript" src="../_static/detectmobile.js"></script> <script type="text/javascript" src="../_static/init.js"></script> </body> </html>