github sqlalchemy/sqlalchemy rel_1_1_0
v1.1.0

latest releases: rel_2_0_29, rel_2_0_28, rel_1_4_52...
4 years ago

1.1.0

Released: October 5, 2016

orm

  • [orm] [bug] 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.

    This change is also backported to: 1.0.16

    References: #3800

  • [orm] [bug] Fixed bug where the ArgumentError raised for an invalid bind
    sent to a Session via Session.bind_mapper(),
    Session.bind_table(),
    or the constructor would fail to be correctly raised.

    This change is also backported to: 1.0.16

    References: #3798

  • [orm] [bug] 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.

    This change is also backported to: 1.0.15

    References: #3773, #3774

  • [orm] [bug] ORM attributes can now be assigned any object that is has a
    __clause_element__() attribute, which will result in inline
    SQL the way any ClauseElement class does. This covers other
    mapped attributes not otherwise transformed by further expression
    constructs.

    References: #3802

  • [orm] [feature] Enhanced the new "raise" lazy loader strategy to also include a
    "raise_on_sql" variant, available both via orm.relationship.lazy
    as well as orm.raiseload(). This variant only raises if the
    lazy load would actually emit SQL, vs. raising if the lazy loader
    mechanism is invoked at all.

    References: #3812

  • [orm] [bug] Made an adjustment to the bug fix first introduced in [ticket:3431]
    that involves an object appearing in multiple contexts in a single
    result set, such that an eager loader that would set the related
    object value to be None will still fire off, thus satisfying the
    load of that attribute. Previously, the adjustment only honored
    a non-None value arriving for an eagerly loaded attribute in a
    secondary row.

    References: #3811

  • [orm] [bug] Fixed bug in new SessionEvents.persistent_to_deleted() event
    where the target object could be garbage collected before the event
    is fired off.

    References: #3808

  • [orm] [bug] The primaryjoin of a relationship() construct can now include
    a bindparam() object that includes a callable function to
    generate values. Previously, the lazy loader strategy would
    be incompatible with this use, and additionally would fail to correctly
    detect if the "use_get" criteria should be used if the primary key
    were involved with the bound parameter.

    References: #3767

  • [orm] [bug] An UPDATE emitted from the ORM flush process can now accommodate a
    SQL expression element for a column within the primary key of an
    object, if the target database supports RETURNING in order to provide
    the new value, or if the PK value is set "to itself" for the purposes
    of bumping some other trigger / onupdate on the column.

    References: #3801

  • [orm] [bug] Fixed bug where the "simple many-to-one" condition that allows lazy
    loading to use get() from identity map would fail to be invoked if the
    primaryjoin of the relationship had multiple clauses separated by AND
    which were not in the same order as that of the primary key columns
    being compared in each clause. This ordering
    difference occurs for a composite foreign key where the table-bound
    columns on the referencing side were not in the same order in the .c
    collection as the primary key columns on the referenced side....which
    in turn occurs a lot if one is using declarative mixins and/or
    declared_attr to set up columns.

    References: #3788

  • [orm] [bug] An exception is raised when two @validates decorators on a mapping
    make use of the same name. Only one validator of a certain name
    at a time is supported, there's no mechanism to chain these together,
    as the order of the validators at the level of function decorator
    can't be made deterministic.

    References: #3776

  • [orm] [bug] Mapper errors raised during configure_mappers() now explicitly
    include the name of the originating mapper in the exception message
    to help in those situations where the wrapped exception does not
    itself include the source mapper. Pull request courtesy
    John Perkins.

  • [orm] [change] Passing False to Query.order_by() in order to cancel
    all order by's is deprecated; there is no longer any difference
    between calling this method with False or with None.

  • [orm] [feature] The Query.group_by() method now resets the group by collection
    if an argument of None is passed, in the same way that
    Query.order_by() has worked for a long time. Pull request
    courtesy Iuri Diniz.

orm declarative

  • [change] [declarative] [orm] Constructing a declarative base class that inherits from another class
    will also inherit its docstring. This means
    ~.ext.declarative.as_declarative() acts more like a normal class
    decorator.

sql

  • [sql] [bug] Fixed bug in Table where the internal method
    _reset_exported() 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 Table object.

    This change is also backported to: 1.0.15

    References: #3755

  • [sql] [bug] Execution options can now be propagated from within a
    statement at compile time to the outermost statement, so that
    if an embedded element wants to set "autocommit" to be True for example,
    it can propagate this to the enclosing statement. Currently, this
    feature is enabled for a DML-oriented CTE embedded inside of a SELECT
    statement, e.g. INSERT/UPDATE/DELETE inside of SELECT.

    References: #3805

  • [sql] [bug] A string sent as a column default via the
    Column.server_default parameter is now escaped for quotes.

    References: #3809

  • [sql] [bug] [postgresql] Added compiler-level flags used by PostgreSQL to place additional
    parenthesis than would normally be generated by precedence rules
    around operations involving JSON, HSTORE indexing operators as well as
    within their operands since it has been observed that PostgreSQL's
    precedence rules for at least the HSTORE indexing operator is not
    consistent between 9.4 and 9.5.

    References: #3806

  • [sql] [bug] [mysql] The BaseException exception class is now intercepted by the
    exception-handling routines of Connection, and includes
    handling by the ~.ConnectionEvents.handle_error()
    event. The Connection is now invalidated by default in
    the case of a system level exception that is not a subclass of
    Exception, including KeyboardInterrupt and the greenlet
    GreenletExit class, to prevent further operations from occurring
    upon a database connection that is in an unknown and possibly
    corrupted state. The MySQL drivers are most targeted by this change
    however the change is across all DBAPIs.

    References: #3803

  • [sql] [bug] The "eq" and "ne" operators are no longer part of the list of
    "associative" operators, while they remain considered to be
    "commutative". This allows an expression like (x == y) == z
    to be maintained at the SQL level with parenthesis. Pull request
    courtesy John Passaro.

    References: #3799

  • [sql] [bug] Stringify of expression with unnamed Column objects, as
    occurs in lots of situations including ORM error reporting,
    will now render the name in string context as ""
    rather than raising a compile error.

    References: #3789

  • [sql] [bug] Raise a more descriptive exception / message when ClauseElement
    or non-SQLAlchemy objects that are not "executable" are erroneously
    passed to .execute(); a new exception ObjectNotExecutableError
    is raised consistently in all cases.

    References: #3786

  • [sql] [bug] [mysql] [postgresql] Fixed regression in JSON datatypes where the "literal processor" for
    a JSON index value would not be invoked. The native String and Integer
    datatypes are now called upon from within the JSONIndexType
    and JSONPathType. This is applied to the generic, PostgreSQL, and
    MySQL JSON types and also has a dependency on #3766.

    References: #3765

  • [sql] [bug] Fixed bug where Index would fail to extract columns from
    compound SQL expressions if those SQL expressions were wrapped inside
    of an ORM-style __clause_element__() construct. This bug
    exists in 1.0.x as well, however in 1.1 is more noticeable as
    hybrid_property @expression now returns a wrapped element.

    References: #3763

postgresql

  • [postgresql] [bug] An adjustment to ON CONFLICT such that the "inserted_primary_key"
    logic is able to accommodate the case where there's no INSERT or
    UPDATE and there's no net change. The value comes out as None
    in this case, rather than failing on an exception.

    References: #3813

  • [postgresql] [bug] Fixed issue in new PG "on conflict" construct where columns including
    those of the "excluded" namespace would not be table-qualified
    in the WHERE clauses in the statement.

    References: #3807

mysql

  • [mysql] [bug] 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.

    This change is also backported to: 1.0.15

    References: #3787

  • [mysql] [bug] Fixed bug where the "literal_binds" flag would not be propagated
    to a CAST expression under MySQL.

    References: #3766

mssql

  • [mssql] [bug] 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.

    This change is also backported to: 1.0.16

    References: #3810

  • [mssql] [bug] 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.

    This change is also backported to: 1.0.16

    References: #3814

  • [mssql] [bug] 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.

    This change is also backported to: 1.0.16

misc

  • [bug] [orm.declarative] 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.

    This change is also backported to: 1.0.16

    References: #3797

Don't miss a new sqlalchemy release

NewReleases is sending notifications on new releases.