github sqlalchemy/sqlalchemy rel_1_4_45
1.4.45

latest releases: rel_2_0_35, rel_1_4_54, rel_2_0_34...
21 months ago

1.4.45

Released: December 10, 2022

orm

  • [orm] [bug] Fixed bug where _orm.Session.merge() would fail to preserve the
    current loaded contents of relationship attributes that were indicated with
    the _orm.relationship.viewonly parameter, thus defeating
    strategies that use _orm.Session.merge() to pull fully loaded objects
    from caches and other similar techniques. In a related change, fixed issue
    where an object that contains a loaded relationship that was nonetheless
    configured as lazy='raise' on the mapping would fail when passed to
    _orm.Session.merge(); checks for "raise" are now suspended within
    the merge process assuming the _orm.Session.merge.load
    parameter remains at its default of True.

    Overall, this is a behavioral adjustment to a change introduced in the 1.4
    series as of #4994, which took "merge" out of the set of cascades
    applied by default to "viewonly" relationships. As "viewonly" relationships
    aren't persisted under any circumstances, allowing their contents to
    transfer during "merge" does not impact the persistence behavior of the
    target object. This allows _orm.Session.merge() to correctly suit one
    of its use cases, that of adding objects to a Session that were
    loaded elsewhere, often for the purposes of restoring from a cache.

    References: #8862

  • [orm] [bug] Fixed issues in _orm.with_expression() where expressions that were
    composed of columns that were referenced from the enclosing SELECT would
    not render correct SQL in some contexts, in the case where the expression
    had a label name that matched the attribute which used
    _orm.query_expression(), even when _orm.query_expression() had
    no default expression. For the moment, if the _orm.query_expression()
    does have a default expression, that label name is still used for that
    default, and an additional label with the same name will continue to be
    ignored. Overall, this case is pretty thorny so further adjustments might
    be warranted.

    References: #8881

engine

  • [engine] [bug] Fixed issue where _engine.Result.freeze() method would not work for
    textual SQL using either _sql.text() or
    _engine.Connection.exec_driver_sql().

    References: #8963

sql

  • [sql] [usecase] An informative re-raise is now thrown in the case where any "literal
    bindparam" render operation fails, indicating the value itself and
    the datatype in use, to assist in debugging when literal params
    are being rendered in a statement.

    References: #8800

  • [sql] [bug] Fixed a series of issues regarding the position and sometimes the identity
    of rendered bound parameters, such as those used for SQLite, asyncpg,
    MySQL, Oracle and others. Some compiled forms would not maintain the order
    of parameters correctly, such as the PostgreSQL regexp_replace()
    function, the "nesting" feature of the CTE construct first
    introduced in #4123, and selectable tables formed by using the
    FunctionElement.column_valued() method with Oracle.

    References: #8827

asyncio

  • [asyncio] [bug] Removed non-functional merge() method from
    _asyncio.AsyncResult. This method has never worked and was
    included with _asyncio.AsyncResult in error.

    References: #8952

postgresql

  • [postgresql] [bug] Made an adjustment to how the PostgreSQL dialect considers column types
    when it reflects columns from a table, to accommodate for alternative
    backends which may return NULL from the PG format_type() function.

    References: #8748

sqlite

  • [sqlite] [usecase] Added support for the SQLite backend to reflect the "DEFERRABLE" and
    "INITIALLY" keywords which may be present on a foreign key construct. Pull
    request courtesy Michael Gorven.

    References: #8903

  • [sqlite] [usecase] Added support for reflection of expression-oriented WHERE criteria included
    in indexes on the SQLite dialect, in a manner similar to that of the
    PostgreSQL dialect. Pull request courtesy Tobias Pfeiffer.

    References: #8804

  • [sqlite] [bug] Backported a fix for SQLite reflection of unique constraints in attached
    schemas, released in 2.0 as a small part of #4379. Previously,
    unique constraints in attached schemas would be ignored by SQLite
    reflection. Pull request courtesy Michael Gorven.

    References: #8866

oracle

  • [oracle] [bug] Continued fixes for Oracle fix #8708 released in 1.4.43 where
    bound parameter names that start with underscores, which are disallowed by
    Oracle, were still not being properly escaped in all circumstances.

    References: #8708

  • [oracle] [bug] Fixed issue in Oracle compiler where the syntax for
    FunctionElement.column_valued() was incorrect, rendering the name
    COLUMN_VALUE without qualifying the source table correctly.

    References: #8945

Don't miss a new sqlalchemy release

NewReleases is sending notifications on new releases.