版本:1.1.0b2 |发布日期:2016年7月1日

SQLAlchemy 1.1文档

0.5 Changelog

0.5.9 ¶ T0>

没有发布日期

SQL ¶ T0>

  • [sql] Fixed erroneous self_group() call in expression package.

    参考文献:#1661

0.5.8 ¶ T0>

发布时间:2010年1月16日

SQL ¶ T0>

  • [sql] The copy() method on Column now supports uninitialized, unnamed Column objects. 这样可以很容易地创建声明式的帮助器,这些帮助器可以在多个子类中放置公共列。

  • [sql] 像Sequence()这样的默认生成器可以在copy()操作中正确转换。

  • [sql] Sequence() and other DefaultGenerator objects are accepted as the value for the “default” and “onupdate” keyword arguments of Column, in addition to being accepted positionally.

  • [sql] Fixed a column arithmetic bug that affected column correspondence for cloned selectables which contain free-standing column expressions. 这个bug通常只有在0.6 via中才能使用更新的ORM行为时才会引起注意,但是在SQL表达式级别更加正确。

    参考文献:#1568#1617

的PostgreSQL ¶ T0>

  • [postgresql] The extract() function, which was slightly improved in 0.5.7, needed a lot more work to generate the correct typecast (the typecasts appear to be necessary in PG’s EXTRACT quite a lot of the time). 现在使用基于PG的日期/时间/间隔算术文档的规则字典生成类型转换。它也接受text()构造,它在0.5.7中被破坏。

    参考文献:#1647

火鸟¶ T0>

  • [firebird] 识别更多的错误为断线。

    参考文献:#1646

0.5.7 ¶ T0>

发布于:2009年12月26日

ORM ¶ T0>

  • [orm] contains_eager() now works with the automatically generated subquery that results when you say “query(Parent).join(Parent.somejoinedsubclass)”, i.e. when Parent joins to a joined-table-inheritance subclass. 以前,contains_eager()会错误地将子类表添加到查询中,分别生成笛卡尔积。一个例子是在票据描述中。

    参考文献:#1543

  • [orm] query.options() now only propagate to loaded objects for potential further sub-loads only for options where such behavior is relevant, keeping various unserializable options like those generated by contains_eager() out of individual instance states.

    参考文献:#1553

  • [orm] Session.execute() now locates table- and mapper-specific binds based on a passed in expression which is an insert()/update()/delete() construct.

    参考文献:#1054

  • 如果在要合并的给定对象中该属性也是None,则Session.merge()现在正确地覆盖多对一或uselist = False属性为None。 [orm]

  • [orm] Fixed a needless select which would occur when merging transient objects that contained a null primary key identifier.

    参考文献:#1618

  • [orm] 传递给relation(),column_property()等的“extension”属性的可变集合将不会在多个工具调用中被改变或共享,从而防止重复的扩展(如backref populator)被插入到列表中。

    参考文献:#1585

  • [orm] 修复了对CompositeProperty的get_committed_value()的调用。

    参考文献:#1504

  • [orm] Fixed bug where Query would crash if a join() with no clear “left” side were called when a non-mapped column entity appeared in the columns list.

    参考文献:#1602

  • [orm] Fixed bug whereby composite columns wouldn’t load properly when configured on a joined-table subclass, introduced in version 0.5.6 as a result of the fix for. thx to Scott Torborg。

    参考文献:#1616#1480

  • [orm] The “use get” behavior of many-to-one relations, i.e. that a lazy load will fallback to the possibly cached query.get() value, now works across join conditions where the two compared types are not exactly the same class, but share the same “affinity” - i.e. Integer and SmallInteger. 还允许反射类型和非反射类型的组合使用0.5样式类型的反射,例如PGText / Text(注意0.6反映类型作为它们的通用版本)。

    参考文献:#1556

  • [orm] Fixed bug in query.update() when passing Cls.attribute as keys in the value dict and using synchronize_session=’expire’ (‘fetch’ in 0.6).

    参考文献:#1436

SQL ¶ T0>

  • [sql] Fixed bug in two-phase transaction whereby commit() method didn’t set the full state which allows subsequent close() call to succeed.

    参考文献:#1603

  • [sql] Fixed the “numeric” paramstyle, which apparently is the default paramstyle used by Informixdb.

  • [sql] Repeat expressions in the columns clause of a select are deduped based on the identity of each clause element, not the actual string. 这允许位置元素正确地呈现,即使它们全部呈现相同,例如“qmark”样式绑定参数。

    参考文献:#1574

  • [sql] The cursor associated with connection pool connections (i.e. _CursorFairy) now proxies __iter__() to the underlying cursor correctly.

    参考文献:#1632

  • [sql] types now support an “affinity comparison” operation, i.e. that an Integer/SmallInteger are “compatible”, or a Text/String, PickleType/Binary, etc. 属于的一部分

    参考文献:#1556

  • [sql] Fixed bug preventing alias() of an alias() from being cloned or adapted (occurs frequently in ORM operations).

    参考文献:#1641

的PostgreSQL ¶ T0>

  • [postgresql] 通过新的postgres.PGDoublePrecision对象添加了对反映DOUBLE PRECISION类型的支持。这是0.6中的postgresql.DOUBLE_PRECISION。

    参考文献:#1085

  • [postgresql] 添加了对INTERVAL类型的INTERVAL YEAR TO MONTH和INTERVAL DAY TO SECOND语句的支持。

    参考文献:#460

  • [postgresql] 更正了“has_sequence”查询以考虑当前模式或显式序列模式。

    参考文献:#1576

  • [postgresql] Fixed the behavior of extract() to apply operator precedence rules to the ”::” operator when applying the “timestamp” cast - ensures proper parenthesization.

    参考文献:#1611

源码¶ T0>

  • [sqlite] sqlite dialect properly generates CREATE INDEX for a table that is in an alternate schema.

    参考文献:#1439

MSSQL ¶ T0>

  • [mssql] 在构建pyodbc连接参数时将TrustedConnection的名称更改为Trusted_Connection

    参考文献:#1561

预言¶ T0>

  • [oracle] The “table_names” dialect function, used by MetaData .reflect(), omits “index overflow tables”, a system table generated by Oracle when “index only tables” with overflow are used. 这些表格不能通过SQL访问,无法反映。

    参考文献:#1637

杂项¶ T0>

  • [ext] A column can be added to a joined-table declarative superclass after the class has been constructed (i.e. via class-level attribute assignment), and the column will be propagated down to subclasses. 这是和0.5.6相反的情况。

    参考文献:#1570#1523

  • [ext] 修正了分片示例中的一些不准确之处。比较ORM中列的等价性最好使用col1.shares_lineage(col2)。

    参考文献:#1491

  • [ext] 从ShardedQuery中移除了未使用的load()方法。

    参考文献:#1606

0.5.6 ¶ T0>

发布于:2009年9月12日

ORM ¶ T0>

  • [orm] Fixed bug whereby inheritance discriminator part of a composite primary key would fail on updates. 继续。

    参考文献:#1300

  • [orm] Fixed bug which disallowed one side of a many-to-many bidirectional reference to declare itself as “viewonly”

    参考文献:#1507

  • [orm] 添加了一个断言,用于阻止@validates函数或其他AttributeExtension加载未加载的集合,使内部状态可能被破坏。

    参考文献:#1526

  • [orm] Fixed bug which prevented two entities from mutually replacing each other’s primary key values within a single flush() for some orderings of operations.

    参考文献:#1519

  • [orm] Fixed an obscure issue whereby a joined-table subclass with a self-referential eager load on the base class would populate the related object’s “subclass” table with data from the “subclass” table of the parent.

    参考文献:#1485

  • [orm] relations() now have greater ability to be “overridden”, meaning a subclass that explicitly specifies a relation() overriding that of the parent class will be honored during a flush. 这是目前支持从具体继承设置的多对多关系。在这个用例之外,YMMV。

    参考文献:#1477

  • [orm] 从关系()中挤出更多不必要的“延迟加载”。当一个集合发生变化时,除非设置了“single_parent = True”,否则在另一侧的多对一的后退将不会触发加载“旧”值。多对一的直接分配仍会加载“旧”值,以便更新该值上的backref集合,该集合可能已存在于会话中,从而维护0.5行为契约。¶ t0 >

    参考文献:#1483

  • [orm] Fixed bug whereby a load/refresh of joined table inheritance attributes which were based on column_property() or similar would fail to evaluate.

    参考文献:#1480

  • [orm] 改进了对MapperProperty对象的支持,覆盖了非具体继承设置的继承的映射器 - 属性扩展不会相互之间发生随机冲突

    参考文献:#1488

  • [orm] UPDATE和DELETE不支持ORDER BY,LIMIT,OFFSET等在标准的SQL。如果调用了limit(),offset(),order_by(),group_by()或distinct(),则Query.update()和Query.delete()现在会引发异常。

    参考文献:#1487

  • [orm] 将AttributeExtension添加到sqlalchemy.orm .__ all __

  • [orm] Improved error message when query() is called with a non-SQL /entity expression.

    参考文献:#1476

  • [orm] 使用False或0作为多态鉴别符,现在可以在基类和子类上使用

    参考文献:#1440

  • [orm] Added enable_assertions(False) to Query which disables the usual assertions for expected state - used by Query subclasses to engineer custom state.. See http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery for an example.

    参考文献:#1424

  • [orm] Fixed recursion issue which occurred if a mapped object’s __len__() or __nonzero__() method resulted in state changes.

    参考文献:#1501

  • [orm] Fixed incorrect exception raise in Weak/StrongIdentityMap.add()

    参考文献:#1506

  • [orm] Fixed the error message for “could not find a FROM clause” in query.join() which would fail to issue correctly if the query was against a pure SQL construct.

    参考文献:#1522

  • [orm] Fixed a somewhat hypothetical issue which would result in the wrong primary key being calculated for a mapper using the old polymorphic_union function - but this is old stuff.

    参考文献:#1486

SQL ¶ T0>

  • [sql] Fixed column.copy() to copy defaults and onupdates.

    参考文献:#1373

  • 修正了0.5.4中extract()引入的一个bug,字符串“field”参数被视为一个ClauseElement,在更复杂的SQL转换中引发了各种错误。 [sql]

  • [sql] Unary expressions such as DISTINCT propagate their type handling to result sets, allowing conversions like unicode and such to take place.

    参考文献:#1420

  • [sql] Fixed bug in Table and Column whereby passing empty dict for “info” argument would raise an exception.

    参考文献:#1482

预言¶ T0>

  • [oracle] 针对Oracle别名的Backported 0.6修复不会被截断

    参考文献:#1309

杂项¶ T0>

  • [ext] 由associationproxy生成的集合代理现在可以被pickleable了。然而,用户定义的proxy_factory除非定义了__getstate__和__setstate __,否则仍然是不可选的。

    参考文献:#1446

  • [ext] Declarative will raise an informative exception if __table_args__ is passed as a tuple with no dict argument. 改进了文档。

    参考文献:#1468

  • [ext] Table objects declared in the MetaData can now be used in string expressions sent to primaryjoin/secondaryjoin/ secondary - the name is pulled from the MetaData of the declarative base.

    参考文献:#1527

  • [ext] 在构造类之后(即通过类级属性分配),可以将列添加到联接表子类中。该列一直被添加到底层表,但是现在映射器将重建它的“连接”来包含新列,而不是引发关于“没有这样的列”的错误,而是使用column_property()来代替“。/ T0>

    参考文献:#1523

  • [test] 在测试套件中添加了一些示例,以便定期锻炼并清除一些弃用警告。

0.5.5 ¶ T0>

发布于:2009年7月13日

一般¶ T0>

  • [general] 单元测试已经从unittest迁移到了nose。有关如何运行测试的信息,请参阅README.unittests。

    参考文献:#970

ORM ¶ T0>

  • [orm] The “foreign_keys” argument of relation() will now propagate automatically to the backref in the same way that primaryjoin and secondaryjoin do. For the extremely rare use case where the backref of a relation() has intentionally different “foreign_keys” configured, both sides now need to be configured explicitly (if they do in fact require this setting, see the next note...).

  • [orm] ...the only known (and really, really rare) use case where a different foreign_keys setting was used on the forwards/backwards side, a composite foreign key that partially points to its own columns, has been enhanced such that the fk->itself aspect of the relation won’t be used to determine relation direction.

  • [orm] Session.mapper is now deprecated.

    如果你想让一个独立的对象成为会话的一部分,请调用session.add()。否则,现在在http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper中记录了一个DIY版本的Session.mapper。该方法将在整个0.6版本中保持不推荐使用。

  • [orm] Fixed Query being able to join() from individual columns of a joined-table subclass entity, i.e. query(SubClass.foo, SubcClass.bar).join(). 在大多数情况下,将会引发错误“无法找到FROM子句”。在其他一些情况下,结果将会以基类而不是子类的形式返回 - 所以依赖这个错误结果的应用程序需要调整。

    参考文献:#1431

  • [orm] Fixed a bug involving contains_eager(), which would apply itself to a secondary (i.e. lazy) load in a particular rare case, producing cartesian products. 改善了对二级负载query.options()的整体定位。

    参考文献:#1461

  • [orm] Fixed bug introduced in 0.5.4 whereby Composite types fail when default-holding columns are flushed.

  • [orm] Fixed another 0.5.4 bug whereby mutable attributes (i.e. PickleType) wouldn’t be deserialized correctly when the whole object was serialized.

    参考文献:#1426

  • [orm] Fixed bug whereby session.is_modified() would raise an exception if any synonyms were in use.

  • [orm] Fixed potential memory leak whereby previously pickled objects placed back in a session would not be fully garbage collected unless the Session were explicitly closed out.

  • [orm] Fixed bug whereby list-based attributes, like pickletype and PGArray, failed to be merged() properly.

  • [orm] 修复了非工作属性.set_committed_value函数

  • [orm] Trimmed the pickle format for InstanceState which should further reduce the memory footprint of pickled instances. 格式应该与0.5.4和以前版本兼容。

  • [orm] sqlalchemy.orm.join and sqlalchemy.orm.outerjoin are now added to __all__ in sqlalchemy.orm. * ¶ T0>

    参考文献:#1463

  • [orm] Fixed bug where Query exception raise would fail when a too-short composite primary key value were passed to get().

    参考文献:#1458

SQL ¶ T0>

  • [sql] Removed an obscure feature of execute() (including connection, engine, Session) whereby a bindparam() construct can be sent as a key to the params dictionary. 这个用法是没有记录的,并且是一个问题的核心,由text()构造隐式创建的bindparam()对象可能与放置在params字典中的字符串具有相同的散列值,并且可能导致在计算最终绑定参数。对这种情况的内部检查会增加参数呈现的关键任务的显着延迟,因此行为将被删除。对于任何可能使用此功能的应用程序来说,这是一个向后兼容的变化,但是这个功能从未被记录过。

杂项¶ T0>

  • [engine/pool] 为StaticPool实现了recreate()。

0.5.4p2 ¶ T0>

发布时间:2009年5月26日

SQL ¶ T0>

  • [sql] Repaired the printing of SQL exceptions which are not based on parameters or are not executemany() style.

的PostgreSQL ¶ T0>

  • [postgresql] 弃用硬编码的TIMESTAMP函数,当用作func.TIMESTAMP(value)时,将呈现“TIMESTAMP值”。这在一些平台上打破了,因为PostgreSQL不允许在这个上下文中使用绑定参数。硬编码的大写也是不合适的,还有很多其他的PG我们需要支持。相反,使用文本结构即select([“timestamp '12 / 05/09'”])。

0.5.4p1 ¶ T0>

发布于:2009年5月18日

ORM ¶ T0>

  • [orm] Fixed an attribute error introduced in 0.5.4 which would occur when merge() was used with an incomplete object.

0.5.4 ¶ T0>

发布于:2009年5月17日

ORM ¶ T0>

  • [orm] Significant performance enhancements regarding Sessions/flush() in conjunction with large mapper graphs, large numbers of objects:

    • 从flush()进程中删除了所有的* O(N)扫描行为,即扫描整个会话的操作,包括一个非常昂贵的错误地假设主键值在非情况下正在改变的操作。
      • 如果现有的主键属性被修改为新的值,则会留下一个可能会调用全扫描的边缘情况。
    • The Session’s “weak referencing” behavior is now full - no strong references whatsoever are made to a mapped object or related items/collections in its __dict__. 对象中的后退处理和其他循环不再影响会话丢失对未修改对象的所有引用的能力。有未决更改的对象仍然强烈维护,直到刷新。

      通过将垃圾收集项目的“复活”过程移动到仅映射“可变”属性的映射(即PickleType,composite attrs),该实现也提高了性能。这消除了gc过程的开销,并简化了内部行为。

      如果一个“可变”属性改变是一个对象的唯一改变,然后被解除引用,当UPDATE被发布时,映射器将不能访问其他属性状态。对于某些MapperExtensions,这可能会有所不同。

      该更改还会影响内部属性API,但不影响AttributeExtension接口和任何公开记录的属性函数。

    • 工作单元不再为flush()期间的mapper完整图形生成一个“dependency”处理器的图表,而只是为那些代表具有未决更改对象的mapper创建这样的处理器。这在映射器的大型互连图的上下文中节省了大量的方法调用。
    • 缓存了先前每次刷新多次出现的浪费的“表格排序”操作,也从flush()中删除了重要的方法调用计数。
    • 其他多余的行为已经在mapper._save_obj()中简化了。

    参考文献:#1398

  • [orm] Modified query_cls on DynamicAttributeImpl to accept a full mixin version of the AppenderQuery, which allows subclassing the AppenderMixin.

  • [orm] “多态鉴别器”列可能是主键的一部分,并且会填充正确的鉴别符值

    参考文献:#1300

  • [orm] 修正了评估者无法评估IS NULL子句

  • [orm] Fixed the “set collection” function on “dynamic” relations to initiate events correctly. 以前只能将一个集合分配给一个待处理的父实例,否则修改后的事件将不会被正确触发。设置集合现在兼容merge(),修复。

    参考文献:#1352

  • [orm] Allowed pickling of PropertyOption objects constructed with instrumented descriptors; previously, pickle errors would occur when pickling an object which was loaded with a descriptor-based option, such as query.options(eagerload(MyClass.foo)).

  • [orm] Lazy loader will not use get() if the “lazy load” SQL clause matches the clause used by get(), but contains some parameters hardcoded. 以前懒惰的策略会失败与get()。理想情况下,get()将与硬编码参数一起使用,但这需要进一步的开发。

    参考文献:#1357

  • [orm] MapperOptions and other state associated with query.options() is no longer bundled within callables associated with each lazy/deferred-loading attribute during a load. 现在,选项在填充时与实例的状态对象关联一次。这在大多数情况下消除了每个实例/属性加载器对象的需要,提高了单个实例的加载速度和内存开销。

    参考文献:#1391

  • [orm] Fixed another location where autoflush was interfering with session.merge(). autoflush在merge()现在是完全禁用的。

    参考文献:#1360

  • [orm] Fixed bug which prevented “mutable primary key” dependency logic from functioning properly on a one-to-one relation().

    参考文献:#1406

  • [orm] Fixed bug in relation(), introduced in 0.5.3, whereby a self referential relation from a base class to a joined-table subclass would not configure correctly.

  • [orm] 当使用继承映射器的时候,修复了隐藏的映射器编译问题,这会导致未初始化的属性

  • [orm] Fixed documentation for session weak_identity_map - the default value is True, indicating a weak referencing map in use.

  • [orm] Fixed a unit of work issue whereby the foreign key attribute on an item contained within a collection owned by an object being deleted would not be set to None if the relation() was self-referential.

    参考文献:#1376

  • [orm] Fixed Query.update() and Query.delete() failures with eagerloaded relations.

    参考文献:#1378

  • [orm] It is now an error to specify both columns of a binary primaryjoin condition in the foreign_keys or remote_side collection. 而以前这只是荒谬的,但会以非确定性的方式获得成功。

SQL ¶ T0>

  • [sql] Back-ported the “compiler” extension from SQLA 0.6. 这是一个标准化的接口,允许创建自定义的ClauseElement子类和编译器。特别是当你想要构建一个具有数据库特定编译的构造时,它可以作为text()的替代方法。有关详细信息,请参见扩展文档。

  • [sql] Exception messages are truncated when the list of bound parameters is larger than 10, preventing enormous multi-page exceptions from filling up screens and logfiles for large executemany() statements.

    参考文献:#1413

  • [sql] sqlalchemy.extract() is now dialect sensitive and can extract components of timestamps idiomatically across the supported databases, including SQLite.

  • [sql] Fixed __repr__() and other _get_colspec() methods on ForeignKey constructed from __clause_element__() style construct (i.e. declarative columns).

    参考文献:#1353

架构¶ T0>

  • [schema] [1341] [ticket: 594] Added a quote_schema() method to the IdentifierPreparer class so that dialects can override how schemas get handled. 这使MSSQL方言可以将模式视为多部分标识符,例如“database.owner”。

MySQL的¶ T0>

  • [mysql] 如果外键引用远程模式中的表,则反映FOREIGN KEY结构将考虑虚线schema.tablename组合。

    参考文献:#1405

源码¶ T0>

  • [sqlite] 修正了SLBoolean类型,以便它只将1作为True。

    参考文献:#1402

  • [sqlite] 更正浮点类型,以便在反射时正确映射到SLFloat类型。

    参考文献:#1273

MSSQL ¶ T0>

  • [mssql] Modified how savepoint logic works to prevent it from stepping on non-savepoint oriented routines. 保存点支持仍然是非常实验性的。

  • [mssql] 添加MSSQL的保留字,涵盖版本2008和以前的所有版本。

    参考文献:#1310

  • [mssql] 更正的信息模式问题不适用于基于二进制排序规则的数据库。清理信息模式,因为它现在只被mssql使用。

    参考文献:#1343

杂项¶ T0>

  • [extensions] 修正了声明式类的延迟或其他列属性的增加。

    参考文献:#1379

0.5.3 ¶ T0>

发布时间:2009年3月24日

ORM ¶ T0>

  • [orm] 不推荐使用session.flush()的“objects”参数。表示父对象和子对象之间的链接的状态不支持链接一侧而不是另一侧的“刷新”状态,所以支持这种操作会导致误导结果。

    参考文献:#1315

  • [orm] Query now implements __clause_element__() which produces its selectable, which means a Query instance can be accepted in many SQL expressions, including col.in_(query), union(query1, query2), select([foo]).select_from(query), etc.

  • [orm] Query.join() can now construct multiple FROM clauses, if needed. 如查询(A,B).join(A.x).join(B.y)可能会说SELECT A.*,B*从一个JOIN X,B JOIN Y.急切的加载也可以加入到多个FROM子句中。

    参考文献:#1337

  • [orm] Fixed bug in dynamic_loader() where append/remove events after construction time were not being propagated to the UOW to pick up on flush().

    参考文献:#1347

  • [orm] Fixed bug where column_prefix wasn’t being checked before not mapping an attribute that already had class-level name present.

  • [orm] a session.expire() on a particular collection attribute will clear any pending backref additions as well, so that the next access correctly returns only what was present in the database. 尽管我们正在考虑彻底删除flush([objects])特性,但是提供了一定程度的解决方法。

    参考文献:#1315

  • [orm] Session.scalar() now converts raw SQL strings to text() the same way Session.execute() does and accepts same alternative **kw args.

  • [orm] improvements to the “determine direction” logic of relation() such that the direction of tricky situations like mapper(A.join(B)) -> relation-> mapper(B) can be determined.

  • [orm] When flushing partial sets of objects using session.flush([somelist]), pending objects which remain pending after the operation won’t inadvertently be added as persistent.

    参考文献:#1306

  • [orm] 添加了“post_configure_attribute”方法给InstrumentationManager,这样“listen_for_events.py”的例子再次运行。

    参考文献:#1314

  • [orm] a forward and complementing backwards reference which are both of the same direction, i.e. ONETOMANY or MANYTOONE, is now detected, and an error message is raised. 稍后保存疯狂的CircularDependencyErrors。

  • [orm] Fixed bugs in Query regarding simultaneous selection of multiple joined-table inheritance entities with common base classes:

    • 先前在“A JOIN B”上应用于“B”的适配将错误地部分应用于“A”。
    • 比较关系(即A.related == someb)没有得到适应时,他们应该。
    • 其他过滤器,如查询(A).join(A.bs).filter(B.foo =='bar'),错误地将“B.foo”改写为“A”。

  • [orm] Fixed adaptation of EXISTS clauses via any(), has(), etc. 结合左侧的别名对象和右侧的of_type()。

    参考文献:#1325

  • [orm] Added an attribute helper method set_committed_value in sqlalchemy.orm.attributes. 给定一个对象,属性名称和值,将把对象上的值设置为其“已提交”状态的一部分,即可以理解为已经从数据库加载的状态。帮助建立自产的收集装载机等。

  • [orm] 通过非映射器/类检测描述符时,查询不会失败,并出现weakref错误,引发“无效的列经验”。

  • [orm] Query.group_by() properly takes into account aliasing applied to the FROM clause, such as with select_from(), using with_polymorphic(), or using from_self().

SQL ¶ T0>

  • [sql] An alias() of a select() will convert to a “scalar subquery” when used in an unambiguously scalar context, i.e. it’s used in a comparison operation. 这同样适用于使用query.subquery()的ORM。

  • [sql] Fixed missing _label attribute on Function object, others when used in a select() with use_labels (such as when used in an ORM column_property()).

    参考文献:#1302

  • [sql] anonymous alias names now truncate down to the max length allowed by the dialect. 对于像Oracle这样的DB,对字符的限制非常小,这一点更为重要。

    参考文献:#1309

  • [sql] the __selectable__() interface has been replaced entirely by __clause_element__().

  • [sql] The per-dialect cache used by TypeEngine to cache dialect-specific types is now a WeakKeyDictionary. 这样可以防止方言对象永远被引用到创建任意数量的引擎或方言的应用程序中。有一个小的性能损失,将在0.6. 中解决

    参考文献:#1299

的PostgreSQL ¶ T0>

  • [postgresql] 遇到有多个表达式的索引时,索引反射不会失败

  • [postgresql] 将PGUuid和PGBit类型添加到sqlalchemy.databases.postgres。

    参考文献:#1327

  • [postgresql] 在域中指定这些类型时,未知PG类型的反应不会崩溃。

    参考文献:#1327

源码¶ T0>

  • [sqlite] Fixed SQLite reflection methods so that non-present cursor.description, which triggers an auto-cursor close, will be detected so that no results doesn’t fail on recent versions of pysqlite which raise an error when fetchone() called with no rows present.

MSSQL ¶ T0>

  • [mssql] 初步支持pymssql 1.0.1

  • [mssql] 更正了mssql中max_identifier_length不受尊重的问题

杂项¶ T0>

  • [extensions] 修正了序列化程序中的一个递归酸洗问题,由EXISTS或其他嵌入的FROM结构触发。

  • [extensions] Declarative locates the “inherits” class using a search through __bases__, to skip over mixins that are local to subclasses.

  • [extensions] 即使明确给出了“继承”映射器参数,声明式数字也不能连接表继承主连接条件

  • [extensions] Declarative will properly interpret the “foreign_keys” argument on a backref() if it’s a string.

  • [extensions] Declarative will accept a table-bound column as a property when used in conjunction with __table__, if the column is already present in __table__. 该列将被重新映射到给定的键,就像添加到mapper()属性字典一样。

0.5.2 ¶ T0>

发布日期:2009年1月24日

ORM ¶ T0>

  • [orm] 进一步改进了0.5.1关于放置在多对多关系上的删除孤立级联的警告。首先,坏消息是:这个警告既适用于多对多关系,也适用于多对一关系。这是必要的,因为在这两种情况下,SQLA在确定“孤立”状态时都不会扫描全部潜在父项 - 对于持久对象,它只检测到一个在python中的去关联事件来将该对象建立为“孤立”。接下来,好消息是:通过外键或关联表来支持一对一,或者通过关联表来支持一对多,可以设置一个新的标志single_parent = True来指示链接到该关系的对象只是意味着有一个单亲。如果在Python中发生多个父关联事件,该关系将引发错误。

  • [orm] 从0.5.1调整了属性检测的更改,以便在超类已经完全检测完毕后创建映射器的子类的完整检测。

    参考文献:#1292

  • [orm] Fixed bug in delete-orphan cascade whereby two one-to-one relations from two different parent classes to the same target class would prematurely expunge the instance.

  • [orm] Fixed an eager loading bug whereby self-referential eager loading would prevent other eager loads, self referential or not, from joining to the parent JOIN properly. 感谢Alex K创建了一个伟大的测试案例。

  • [orm] session.expire() and related methods will not expire() unloaded deferred attributes. 这样可以防止在刷新实例时不必要地加载它们。

  • [orm] query.join()/outerjoin() will now properly join an aliased() construct to the existing left side, even if query.from_self() or query.select_from(someselectable) has been called.

    参考文献:#1293

SQL ¶ T0>

  • [sql]

    进一步修复“列/表中百分号和空格”
    名称“功能。

    参考文献:#1284

MSSQL ¶ T0>

  • [mssql] 恢复了convert_unicode处理。结果正在传递,而没有转换。

    参考文献:#1291

  • [mssql] 这次真正修复了十进制处理。

    参考文献:#1282

  • [mssql] [Ticket:1289] 修改表反射代码,在构造表时只使用kwargs

0.5.1 ¶ T0>

发布时间:2009年1月17日

ORM ¶ T0>

  • [orm] 删除了一个内部连接缓存,当重复发送query.join()到ad-hoc selectable时,这个缓存可能会泄漏内存。

  • [orm] The “clear()”, “save()”, “update()”, “save_or_update()” Session methods have been deprecated, replaced by “expunge_all()” and “add()”. “expunge_all()”也被添加到ScopedSession。

  • [orm] Modernized the “no mapped table” exception and added a more explicit __table__/__tablename__ exception to declarative.

  • [orm] Concrete inheriting mappers now instrument attributes which are inherited from the superclass, but are not defined for the concrete mapper itself, with an InstrumentedAttribute that issues a descriptive error when accessed.

    参考文献:#1237

  • [orm] 添加了一个新的relation()关键字back_populates这允许使用显式关系来配置反向引用。创建具体映射器层次结构与其他类之间的双向关系时,这是必需的。

    参考文献:#1237#781

  • [orm] 为具体映射器上指定的relation()对象添加的测试覆盖率

    参考文献:#1237

  • [orm] Query.from_self() as well as query.subquery() both disable the rendering of eager joins inside the subquery produced. 通过一个新的query.enable_eagerloads()生成,“禁用所有渴望的连接”功能可以公开使用。

    参考文献:#1276

  • [orm] Added a rudimental series of set operations to Query that receive Query objects as arguments, including union(), union_all(), intersect(), except_(), insertsect_all(), except_all(). 有关示例,请参阅Query.union()的API文档。

  • [orm] Fixed bug that prevented Query.join() and eagerloads from attaching to a query that selected from a union or aliased union.

  • [orm] 为在具体映射器上指定的双向关系添加一个简短文档示例。

    参考文献:#1237

  • [orm] Mappers now instrument class attributes upon construction with the final InstrumentedAttribute object which remains persistent. _CompileOnAttr / __ getattribute __()方法已被删除。最终结果是,基于列的映射类属性现在可以在类级完全使用,而无需调用映射器编译操作,从而大大简化了声明中的典型使用模式。

    参考文献:#1269

  • [orm] ColumnProperty (and front-end helpers such as deferred) no longer ignores unknown **keyword arguments.

  • [orm] Fixed a bug with the unitofwork’s “row switch” mechanism, i.e. the conversion of INSERT/DELETE into an UPDATE, when combined with joined-table inheritance and an object which contained no defined values for the child table where an UPDATE with no SET clause would be rendered.

  • [orm] 不推荐使用多对多关系中的delete-orphan。这会产生误导或错误的结果,因为SQLA不检索m2m的“父母”的完整列表。要使用m2m表获得删除孤立行为,请使用explcit关联类,以便将各个关联行视为父级。

    参考文献:#1281

  • [orm] delete-orphan cascade always requires delete cascade. 现在指定delete-orphan而不删除现在会引发弃用警告。

    参考文献:#1281

SQL ¶ T0>

  • [sql] 改进了处理列名中百分号的方法。增加了更多测试。MySQL和PostgreSQL方言仍然不会为包含百分号的标识符发出正确的CREATE TABLE语句。

    参考文献:#1256

架构¶ T0>

  • [schema] 索引现在接受列导向的InstrumentedAttributes(即基于列的映射类属性)作为列参数。

    参考文献:#1214

  • [schema] 没有名称的列(如在声明中)不会在请求字符串输出时(例如在堆栈跟踪中)引发NoneType错误。

  • [schema] Fixed bug when overriding a Column with a ForeignKey on a reflected table, where derived columns (i.e. the “virtual” columns of a select, etc.) 会无意中调用仅用于原始列的模式级清理逻辑。

    参考文献:#1278

MySQL的¶ T0>

  • [mysql] 从MySQL 4.1中添加缺少的关键字,以便正确转义

MSSQL ¶ T0>

  • [mssql] 通过更强大的测试更正了对大十进制值的处理。删除了浮动的字符串操作。

    参考文献:#1280

  • [mssql] 修改了mssql中的do_begin处理,使用Cursor而不是Connection,所以它是DBAPI兼容的。

  • [mssql] 通过更改mssql上不支持的savepoint_release的处理,更正了adodbapi上的SAVEPOINT支持。

杂项¶ T0>

  • [declarative] 现在可以在没有自己的表的子类上指定Column对象(即使用单个表继承)。这些列将被追加到基表中,但只能被子类映射。

  • [declarative] 对于连接和单个继承子类,子类只映射已经映射到超类的那些列和那些在子类上显式映射的列。中存在的其他列将从映射中排除,默认情况下,可以通过向__ mapper_args __传递空的exclude_properties >。这是因为定义它们自己的列的单继承类是映射这些列的唯一类。除了显式地设置exclude_properties参数之外,其效果实际上是比通常使用显式mapper()调用更有组织的映射。¶ t2 >

  • [declarative] 使用__table __将新的Column对象添加到指定现有表的声明类中是错误的。

0.5.0 ¶ T0>

发布时间:2009年1月6日

一般¶ T0>

  • [general] 文档已被转换为Sphinx。特别是,生成的API文档已经被构建成一个完整的“API参考”部分,该部分组织编辑文档以及生成的文档字符串。部分和API文档之间的交叉链接得到了极大的改进,提供了一个基于javascript的搜索功能,并提供了所有类,函数和成员的完整索引。

  • [general] setup.py现在只能选择性地导入setuptools。如果不存在,则使用distutils。在easy_install上建议使用新的“pip”安装程序,因为它以更简化的方式进行安装。

  • [general] 在示例文件夹中添加了PostGIS集成的一个非常基本的插图。

ORM ¶ T0>

  • [orm] Query.with_polymorphic() now accepts a third argument “discriminator” which will replace the value of mapper.polymorphic_on for that query. 映射器本身不再需要设置polymorphic_on,即使映射器具有polymorphic_identity也是如此。未设置时,映射器将默认加载非多态。在一起,这两个特性允许非多态的具体继承设置在每个查询的基础上使用多态加载,因为在所有情况下使用多态时,具体的设置很容易出现很多问题。

  • [orm] dynamic_loader accepts a query_class= to customize the Query classes used for both the dynamic collection and the queries built from it.

  • [orm] query.order_by() accepts None which will remove any pending order_by state from the query, as well as cancel out any mapper/relation configured ordering. 这对于重写在dynamic_loader()中指定的顺序是非常有用的。

    参考文献:#1079

  • [orm] Exceptions raised during compile_mappers() are now preserved to provide “sticky behavior” - if a hasattr() call on a pre-compiled mapped attribute triggers a failing compile and suppresses the exception, subsequent compilation is blocked and the exception will be reiterated on the next compile() call. 这个问题在使用声明时经常发生。

  • [orm] property.of_type() is now recognized on a single-table inheriting target, when used in the context of prop.of_type(..).any()/has(), as well as query.join(prop.of_type(...)).

  • [orm] query.join() raises an error when the target of the join doesn’t match the property-based attribute - while it’s unlikely anyone is doing this, the SQLAlchemy author was guilty of this particular loosey-goosey behavior.

  • [orm] Fixed bug when using weak_instance_map=False where modified events would not be intercepted for a flush().

    参考文献:#1272

  • [orm] Fixed some deep “column correspondence” issues which could impact a Query made against a selectable containing multiple versions of the same table, as well as unions and similar which contained the same table columns in different column positions at different levels.

    参考文献:#1268

  • [orm] Custom comparator classes used in conjunction with column_property(), relation() etc. 可以在比较器上定义新的比较方法,该方法将通过InstrumentedAttribute上的__getattr __()变为可用。在同义词()或可比较属性()的情况下,首先在用户定义的描述符上解析属性,然后在用户定义的比较器上解析属性。

  • [orm] 添加了ScopedSession.is_active访问者

    参考文献:#976

  • [orm] 可以将映射的属性和列对象作为关键字传递给query.update({})。

    参考文献:#1262

  • 传递给表达式级别insert()或update()的values()的映射属性将使用映射列的键,而不是映射属性的键。 [orm]

  • [orm] 更正了Query.delete()和Query.update()与bind参数无法正常工作的问题

    参考文献:#1242

  • [orm] Query.select_from(), from_statement() ensure that the given argument is a FromClause, or Text/Select/Union, respectively.

  • [orm] Query() can be passed a “composite” attribute as a column expression and it will be expanded. 有点和。有关

    参考文献:#1253

  • [orm] Query() is a little more robust when passed various column expressions such as strings, clauselists, text() constructs (which may mean it just raises an error more nicely).

  • [orm] first() works as expected with Query.from_statement().

  • [orm] Fixed bug introduced in 0.5rc4 involving eager loading not functioning for properties which were added to a mapper post-compile using add_property() or equivalent.

  • [orm] Fixed bug where many-to-many relation() with viewonly=True would not correctly reference the link between secondary->remote.

  • [orm] Duplicate items in a list-based collection will be maintained when issuing INSERTs to a “secondary” table in a many-to-many relation. 假设m2m表有一个唯一的或主键约束,这将引发预期的约束冲突,而不是悄悄地删除重复的条目。请注意,旧的行为仍然是一对多的关系,因为在这种情况下,收集条目不会导致INSERT语句,而SQLA也不会手动管理集合。

    参考文献:#1232

  • [orm] Query.add_column() can accept FromClause objects in the same manner as session.query() can.

  • [orm] 与NULL的多对一关系的比较根据不是_()。正确地转换为IS NOT NULL。

  • [orm] Extra checks added to ensure explicit primaryjoin/secondaryjoin are ClauseElement instances, to prevent more confusing errors later on.

    参考文献:#1087

  • [orm] 改进了mapper()检查非类的类。

    参考文献:#1236

  • [orm] comparator_factory argument is now documented and supported by all MapperProperty types, including column_property(), relation(), backref(), and synonym().

    参考文献:#5051

  • [orm] 将PropertyLoader的名称更改为RelationProperty,以与所有其他名称保持一致。PropertyLoader仍然是一个同义词。

  • [orm] fixed “double iter()” call causing bus errors in shard API, removed errant result.close() left over from the 0.4 version.

    参考文献:#1099#1228

  • [orm] made Session.merge cascades not trigger autoflush. 修复了过早插入缺少值的合并实例。

  • [orm] Two fixes to help prevent out-of-band columns from being rendered in polymorphic_union inheritance scenarios (which then causes extra tables to be rendered in the FROM clause causing cartesian products):

    • 对a-> b-> c继承情况的“列自适应”的改进可以更好地定位通过多个间接级别而彼此相关的列,而不是渲染未经修改的列。
    • “多态鉴别器”列仅针对正在查询的实际映射器呈现。由于不需要该列,因此该列不会从子类或超类映射器“拉入”。

  • [orm] Fixed shard_id argument on ShardedSession.execute().

    参考文献:#1072

SQL ¶ T0>

  • [sql] RowProxy objects can be used in place of dictionary arguments sent to connection.execute() and friends.

    参考文献:#935

  • [sql] 列可以在其名称中再次包含百分号。

    参考文献:#1256

  • [sql] sqlalchemy.sql.expression.Function is now a public class. 它可以被分类为以强制风格提供用户定义的SQL函数,包括预先建立的行为。postgis.py例子说明了这个用法。

  • [sql] PickleType now favors == comparison by default, if the incoming object (such as a dict) implements __eq__(). 如果对象没有实现__eq __()和mutable = True,则会引发弃用警告。

  • [sql] Fixed the import weirdness in sqlalchemy.sql to not export __names__.

    参考文献:#1215

  • [sql] 重复使用同一个ForeignKey对象会引发一个错误,而不是稍后失败。

    参考文献:#1238

  • [sql] Added NotImplementedError for params() method on Insert/Update/Delete constructs. 这些项目目前不支持这个功能,与values()相比也有点误导。

  • [sql] Reflected foreign keys will properly locate their referenced column, even if the column was given a “key” attribute different from the reflected name. 这是通过一个名为“link_to_name”的ForeignKey / ForeignKeyConstraint上的新标志来实现的,如果True表示给定的名字是引用列的名字,而不是它指定的键。

    参考文献:#650

  • [sql] select() can accept a ClauseList as a column in the same way as a Table or other selectable and the interior expressions will be used as column elements.

    参考文献:#1253

  • [sql] the “passive” flag on session.is_modified() is correctly propagated to the attribute manager.

  • [sql] union() and union_all() will not whack any order_by() that has been applied to the select()s inside. 如果你union()一个select()和order_by()(大概支持LIMIT / OFFSET),你也应该调用self_group()来应用括号。

MySQL的¶ T0>

  • [mysql] text()构造中的“%”符号自动转义为“%%”。由于这种变化的后向不兼容性,如果在字符串中检测到'%%',则会发出警告。

  • [mysql] 修正了在反射期间FK列不存在的情况下引发异常的问题

    参考文献:#1241

  • [mysql] Fixed bug involving reflection of a remote-schema table with a foreign key ref to another table in that schema.

源码¶ T0>

  • [sqlite] 表反射现在存储列的实际DefaultClause值

    参考文献:#1266

  • [sqlite] 错误修正,行为改变

MSSQL ¶ T0>

  • [mssql] 在新的MSGenericBinary类型中添加。这映射到二进制类型,因此它可以实现将长度指定类型视为固定宽度二进制类型和非长度类型作为未绑定变量长度二进制类型的特殊行为。

  • [mssql] 添加新类型:MSVarBinary和MSImage

    参考文献:#1249

  • [mssql] Added in the MSReal, MSNText, MSSmallDateTime, MSTime, MSDateTimeOffset, and MSDateTime2 types

  • [mssql] 重构日期/时间类型。The smalldatetime data type no longer truncates to a date only, and will now be mapped to the MSSmallDateTime type.

    参考文献:#1254

  • [mssql] 更正了Numerics接受int的问题。

  • [mssql] Mapped char_length to the LEN() function.

  • [mssql] If an INSERT includes a subselect the INSERT is converted from an INSERT INTO VALUES construct to a INSERT INTO SELECT construct.

  • [mssql] If the column is part of a primary_key it will be NOT NULL since MSSQL doesn’t allow NULL in primary_key columns.

  • [mssql] MSBinary now returns a BINARY instead of an IMAGE. 这是一个向后不兼容的变化,即BINARY是一个固定长度的数据类型,而IMAGE是一个可变长度的数据类型

    参考文献:#1249

  • [mssql] get_default_schema_name is now reflected from the database based on the user’s default schema. 这只适用于MSSQL 2005及更高版本。

    参考文献:#1258

  • [mssql] 通过使用新的排序规则参数增加排序规则支持。这在以下类型中被支持:char,nchar,varchar,nvarchar,text,ntext。

    参考文献:#1248

  • [mssql] 对连接字符串参数的更改有利于DSN作为pyodbc的默认规范。有关详细的使用说明,请参阅mssql.py docstring。

  • [mssql] Added experimental support of savepoints. 它目前不能完全使用会话。

  • [mssql] 支持三级列可空性:NULL,NOT NULL和数据库配置的默认值。默认的Column配置(nullable = True)现在将在DDL中生成NULL。以前没有发布规范,数据库默认会生效(通常是NULL,但不总是)。要显式请求数据库缺省值,请配置nullable = None的列,并且不会在DDL中发出规范。这是向后不兼容的行为。

    参考文献:#1243

预言¶ T0>

  • [oracle] Adjusted the format of create_xid() to repair two-phase commit. 我们现在有Oracle两阶段提交的实地报告,正确地处理这个变化。

  • [oracle] 添加了OracleNVarchar类型,产生了NVARCHAR2,还有Unicode的子类,以便默认情况下convert_unicode = True。NVARCHAR2会自动反映到这种类型,所以这些列在unicode上传递unicode,没有显式的convert_unicode = True标志。

    参考文献:#1233

  • [oracle] Fixed bug which was preventing out params of certain types from being received; thanks a ton to huddlej at wwu.edu !

    参考文献:#1265

杂项¶ T0>

  • [dialect] 在处理元数据时用于编码列名称的方言中添加了新的description_encoding属性。这通常默认为utf-8.

  • [engine/pool] Connection.invalidate() checks for closed status to avoid attribute errors.

    参考文献:#1246

  • [engine/pool] NullPool支持重新连接失败行为。

    参考文献:#1094

  • [engine/pool] 使用pool.manage(dbapi)时,为初始池创建添加了互斥锁。这可以防止一个轻微的情况下的“dogpile”行为,否则会在重载启动时发生。

    参考文献:#799

  • [engine/pool] _execute_clauseelement() goes back to being a private method. 如果ConnectionProxy可用,则不需要子类Connection。

  • [documentation] Tickets。

    参考文献:#1149#1200

  • [documentation] 添加关于create_session()的注释默认值。

  • [documentation] 添加了有关metadata.reflect()的部分。

  • [documentation] 已更新TypeDecorator部分

  • [documentation] 由于最近对此功能的混淆,重写了文档的“threadlocal”策略部分。

  • [documentation] 从继承中删除了过期的'polymorphic_fetch'和'select_table'文档,重写了“连接表继承”的后半部分。

  • [documentation] 记录了comparator_factory kwarg,增加了新的doc部分“Custom Comparators”。

  • [postgres] text()构造中的“%”符号会自动转义为“%%”。由于这种变化的后向不兼容性,如果在字符串中检测到'%%',则会发出警告。

    参考文献:#1267

  • [postgres] 与server_side_cursors一起调用alias.execute()不会引发AttributeError

  • [postgres] 增加了对PostgreSQL的索引反射支持,使用Ken Kuhlman提交的一个我们长期忽略的很好的补丁。

    参考文献:#714

  • [associationproxy] 关联代理属性可以在课堂级别上使用,例如, MyClass.aproxy。以前这被评估为None。

  • [declarative] 由backref()接受的参数的完整列表包括'primaryjoin','secondaryjoin','secondary','foreign_keys','remote_side','order_by'。¶ T2>

0.5.0rc4 ¶ T0>

发布时间:2008年11月14日

一般¶ T0>

  • [general] 全局“propigate” - >“传播”改变

ORM ¶ T0>

  • [orm] Query.count() has been enhanced to do the “right thing” in a wider variety of cases. 现在它可以计算多个实体查询以及基于列的查询。请注意,这意味着如果您查询(A,B).count()没有任何加入标准,它将计算A * B的笛卡尔乘积。任何针对基于列的实体的查询都将自动发出“SELECT count(1)FROM(SELECT ...)”,以便返回真实的rowcount,即查询(func.count(A.name))等查询.count()将返回一个值,因为该查询会返回一行。

  • [orm] 大量的性能调整。对各种ORM操作的粗略猜测使其比0.5.0rc3快10%,比0.4.8高25-30%。

  • [orm] 错误修正和行为改变

  • [orm] 调整InstanceState上增强的垃圾收集,以更好地防止由于丢失状态导致的错误。

  • [orm] Query.get() returns a more informative error message when executed against multiple entities.

    参考文献:#1220

  • [orm] 在Cls.relation.in中恢复NotImplementedError _()

    参考文献:#1140#1221

  • [orm] Fixed PendingDeprecationWarning involving order_by parameter on relation().

    参考文献:#1226

SQL ¶ T0>

  • [sql] 删除Connection对象的'properties'属性,应该使用Connection.info

  • [sql] Restored “active rowcount” fetch before ResultProxy autocloses the cursor. 这在0.5rc3中被删除。

  • [sql] Rearranged the load_dialect_impl() method in TypeDecorator such that it will take effect even if the user-defined TypeDecorator uses another TypeDecorator as its impl.

MSSQL ¶ T0>

  • [mssql] 大量的清理和修复来纠正极限和偏移问题

  • [mssql] Correct situation where subqueries as part of a binary expression need to be translated to use the IN and NOT IN syntax.

  • [mssql] Fixed E Notation issue that prevented the ability to insert decimal values less than 1E-6.

    参考文献:#1216

  • [mssql] 更正了处理模式时的反射问题,特别是当这些模式是默认模式时

    参考文献:#1217

  • [mssql] 纠正了将零长度项目投射到varchar的问题。现在正确调整CAST。

杂项¶ T0>

  • [access] 增加对Currency类型的支持。

  • [access] 函数没有返回结果。

    参考文献:#1017

  • [access] 更正了连接问题。Access只支持LEFT OUTER或INNER,不只是自己加入。

    参考文献:#1017

  • [ext] 现在,在使用声明式时,可以在__mapper_args__中使用自定义的“inherit_condition”。

  • [ext] fixed string-based “remote_side”, “order_by” and others not propagating correctly when used in backref().

0.5.0rc3 ¶ T0>

发布:2008年11月07日

ORM ¶ T0>

  • [orm] 为SessionExtension添加了两个新的挂钩:after_bulk_delete()和after_bulk_update()。对查询执行批量delete()操作后调用after_bulk_delete()。对查询进行批量更新()操作后调用after_bulk_update()。

  • [orm] “不等于”与实例的简单多对一关系的比较不会落入EXISTS子句中,而是会比较外键列。

  • [orm] 删除了将一个集合与一个迭代进行比较的不真实的用例。使用contains()来测试集合成员资格。

  • [orm] Improved the behavior of aliased() objects such that they more accurately adapt the expressions generated, which helps particularly with self-referential comparisons.

    参考文献:#1171

  • [orm] Fixed bug involving primaryjoin/secondaryjoin conditions constructed from class-bound attributes (as often occurs when using declarative), which later would be inappropriately aliased by Query, particularly with the various EXISTS based comparators.

  • [orm] Fixed bug when using multiple query.join() with an aliased-bound descriptor which would lose the left alias.

  • [orm] 改进了weakref标识映射的内存管理,不再需要mutexing,为具有挂起更改的InstanceState在惰性基础上重新生成垃圾回收实例。

  • [orm] InstanceState object now removes circular references to itself upon disposal to keep it outside of cyclic garbage collection.

  • [orm] relation() won’t hide unrelated ForeignKey errors inside of the “please specify primaryjoin” message when determining join condition.

  • [orm] Fixed bug in Query involving order_by() in conjunction with multiple aliases of the same class (will add tests in)

    参考文献:#1218

  • [orm] When using Query.join() with an explicit clause for the ON clause, the clause will be aliased in terms of the left side of the join, allowing scenarios like query(Source). from_self()。join((Dest,Source.id == Dest.source_id))正常工作。

  • [orm] polymorphic_union() function respects the “key” of each Column if they differ from the column’s name.

  • [orm] Repaired support for “passive-deletes” on a many-to-one relation() with “delete” cascade.

    参考文献:#1183

  • [orm] Fixed bug in composite types which prevented a primary-key composite type from being mutated.

    参考文献:#1213

  • [orm] Added more granularity to internal attribute access, such that cascade and flush operations will not initialize unloaded attributes and collections, leaving them intact for a lazy-load later on. Backref事件仍然初始化待决实例的属性和集合。

    参考文献:#1202

SQL ¶ T0>

  • [sql] SQL compiler optimizations and complexity reduction. The call count for compiling a typical select() construct is 20% less versus 0.5.0rc2.

  • [sql] Dialects can now generate label names of adjustable length. 将参数“label_length = ”传递给create_engine(),以调整动态生成的列标签中最多有多少个字符,即“somecolumn AS somelabel”。 T0>任何小于6的值都会产生一个最小尺寸的标签,由一个下划线和一个数字计数器组成。编译器使用dialect.max_identifier_length的值作为默认值。

    参考文献:#1211

  • [sql] Simplified the check for ResultProxy “autoclose without results” to be based solely on presence of cursor.description. 所有关于返回行的语句的基于正则表达式的猜测已被删除。

    参考文献:#1212

  • [sql] Direct execution of a union() construct will properly set up result-row processing.

    参考文献:#1194

  • [sql] “OID”或“ROWID”列的内部概念已被删除。它基本上没有被任何方言使用,而且现在可以使用INSERT..RETURNING,所以使用psycopg2的cursor.lastrowid的可能性已经基本消失了。

  • [sql] 删除所有FromClause对象上的“default_order_by()”方法。

  • [sql] Repaired the table.tometadata() method so that a passed-in schema argument is propagated to ForeignKey constructs.

  • [sql] 稍微改变了IN运算符的行为,以便与空集合进行比较。现在导致与自我不平等的比较。更便携,但打破了非纯函数的存储过程。

MySQL的¶ T0>

  • [mysql] Fixed foreign key reflection in the edge case where a Table’s explicit schema= is the same as the schema (database) the connection is attached to.

  • [mysql] 不再需要表反射中的include_columns为小写

预言¶ T0>

  • [oracle] 为Oracle语言写了一个文档字符串。显然,Ohloh“少数源代码注释”标签开始刺痛:)。

  • [oracle] Removed FIRST_ROWS() optimize flag when using LIMIT/OFFSET, can be reenabled with optimize_limits=True create_engine() flag.

    参考文献:#536

  • [oracle] 错误修正和行为改变

  • [oracle] Setting the auto_convert_lobs to False on create_engine() will also instruct the OracleBinary type to return the cx_oracle LOB object unchanged.

杂项¶ T0>

  • [ext] 添加了一个新的扩展sqlalchemy.ext.serializer。提供镜像Pickle / Unpickle,以及dump()和load()的Serializer / Deserializer“classes”。这个序列化器实现了一个“外部对象”pickler,它在pickle流的外面保存关键的上下文敏感对象,包括引擎,会话,元数据,表/列和映射器,并且可以使用任何引擎/元数据/会话供应商。这不是用于酸洗常规的对象实例,这些对象实例可以在没有任何特殊逻辑的情况下进行选择,而是用于酸洗表达式对象和完整的查询对象,以便在不用特殊的时间恢复所有的映射器/引擎/会话依赖关系。 T0>

  • [ext] Fixed bug preventing declarative-bound “column” objects from being used in column_mapped_collection().

    参考文献:#1174

  • [misc] util.flatten_iterator() func doesn’t interpret strings with __iter__() methods as iterators, such as in pypy.

    参考文献:#1077

0.5.0rc2 ¶ T0>

发布日期:2008年10月12日

ORM ¶ T0>

  • [orm] Fixed bug involving read/write relation()s that contain literal or other non-column expressions within their primaryjoin condition equated to a foreign key column.

  • [orm] “non-batch” mode in mapper(), a feature which allows mapper extension methods to be called as each instance is updated/inserted, now honors the insert order of the objects given.

  • [orm] 修正了映射器中与RLock有关的bug,这个bug在重入映射器编译()调用时可能会死锁,这是在ForeignKey对象内部使用声明性构造时发生的事情

  • [orm] ScopedSession.query_property now accepts a query_cls factory, overriding the session’s configured query_cls.

  • [orm] Fixed shared state bug interfering with ScopedSession.mapper’s ability to apply default __init__ implementations on object subclasses.

  • [orm] Fixed up slices on Query (i.e. query[x:y]) to work properly for zero length slices, slices with None on either end.

    参考文献:#1177

  • [orm] 添加了一个说明Celko的“嵌套集”作为SQLA映射的例子。

  • [orm] contains_eager() with an alias argument works even when the alias is embedded in a SELECT, as when sent to the Query via query.select_from().

  • [orm] contains_eager() usage is now compatible with a Query that also contains a regular eager load and limit/offset, in that the columns are added to the Query-generated subquery.

    参考文献:#1180

  • [orm] session.execute() will execute a Sequence object passed to it (regression from 0.4).

  • [orm] 从object_mapper()和class_mapper()中删除了“raiseerror”关键字参数。如果给定的类/实例没有映射,这些函数在所有情况下都会引发。

  • [orm] Fixed session.transaction.commit() on a autocommit=False session not starting a new transaction.

  • [orm] Some adjustments to Session.identity_map’s weak referencing behavior to reduce asynchronous GC side effects.

  • [orm] 调整会话对新“干净”对象的刷新后记帐,以便更好地防止在对象上进行异步操作。

    参考文献:#1182

SQL ¶ T0>

  • [sql] column.in_(someselect) can now be used as a columns-clause expression without the subquery bleeding into the FROM clause

    参考文献:#1074

MySQL的¶ T0>

  • [mysql] 临时表现在可以反映

源码¶ T0>

  • [sqlite] Overhauled SQLite date/time bind/result processing to use regular expressions and format strings, rather than strptime/strftime, to generically support pre-1900 dates, dates with microseconds.

    参考文献:#968

  • [sqlite] 字符串(和Unicode的,UnicodeText的等)在sqlite方言中禁用convert_unicode逻辑,调整pysqlite 2.5.0的新要求,即只接受Python unicode对象; http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html T0> ¶ T1>

预言¶ T0>

  • [oracle] Oracle will detect string-based statements which contain comments at the front before a SELECT as SELECT statements.

    参考文献:#1187

0.5.0rc1 ¶ T0>

发布日期:2008年9月11日

ORM ¶ T0>

  • [orm] Query now has delete() and update(values) methods. 这允许使用Query对象执行批量删除/更新。

  • [orm] The RowTuple object returned by Query(*cols) now features keynames which prefer mapped attribute names over column keys, column keys over column names, i.e. Query(Class.foo, Class.bar) will have names “foo” and “bar” even if those are not the names of the underlying Column objects. Query(table.c.col)等直接的Column对象将返回Column的“key”属性。

  • [orm] 向Query添加了标量()和value()方法,每个方法都返回一个标量值。scalar()不接受任何参数,大致等同于first()[0],value()接受一个列表达式,大致等价于(expr).next()[0]。¶ t0 >

  • [orm] Improved the determination of the FROM clause when placing SQL expressions in the query() list of entities. 特别是标量子查询不应该将其内部的FROM对象“泄漏”到包含的查询中。

  • [orm] Joins along a relation() from a mapped class to a mapped subclass, where the mapped subclass is configured with single table inheritance, will include an IN clause which limits the subtypes of the joined class to those requested, within the ON clause of the join. 这对于热切加载连接以及query.join()都有效。请注意,在某些情况下,IN子句也会出现在查询的WHERE子句中,因为这种区分有多个触发点。

  • [orm] AttributeExtension has been refined such that the event is fired before the mutation actually occurs. 此外,append()和set()方法现在必须返回给定值,该值用作在变异操作中使用的值。这允许创建在动作实际发生之前引发的验证AttributeListener,并且可以在使用之前将给定的值改变为别的东西。

  • [orm] column_property(), composite_property(), and relation() now accept a single or list of AttributeExtensions using the “extension” keyword argument.

  • [orm] query.order_by().get() silently drops the “ORDER BY” from the query issued by GET but does not raise an exception.

  • [orm] Added a Validator AttributeExtension, as well as a @validates decorator which is used in a similar fashion as @reconstructor, and marks a method as validating one or more mapped attributes.

  • [orm] class.someprop.in_() raises NotImplementedError pending the implementation of “in_” for relation

    参考文献:#1140

  • [orm] 修正了集合尚未加载的多对多集合的主键更新

    参考文献:#1127

  • [orm] Fixed bug whereby deferred() columns with a group in conjunction with an otherwise unrelated synonym() would produce an AttributeError during deferred load.

  • [orm] The before_flush() hook on SessionExtension takes place before the list of new/dirty/deleted is calculated for the final time, allowing routines within before_flush() to further change the state of the Session before the flush proceeds.

    参考文献:#1128

  • [orm] The “extension” argument to Session and others can now optionally be a list, supporting events sent to multiple SessionExtension instances. Session在Session.extensions中放置SessionExtensions。

  • [orm] 重新调用flush()会引发错误。这也是一个初步的,但不是万无一失的检查Session.flush()的并发调用。

  • [orm] 使用显式连接标准(即不在关系上)改进了连接到连接表继承子类时query.join()的行为。

  • [orm] @orm.attributes.reconstitute and MapperExtension.reconstitute have been renamed to @orm.reconstructor and MapperExtension.reconstruct_instance

  • [orm] Fixed @reconstructor hook for subclasses which inherit from a base class.

    参考文献:#1129

  • [orm] The composite() property type now supports a __set_composite_values__() method on the composite class which is required if the class represents state using attribute names other than the column’s keynames; default-generated values now get populated properly upon flush. 此外,属性设置为None的组合比较正确。

    参考文献:#1132

  • [orm] 由attributes.get_history()返回的可迭代元素的三元组现在可以是列表和元组的混合。(以前成员总是列表。)

  • [orm] Fixed bug whereby changing a primary key attribute on an entity where the attribute’s previous value had been expired would produce an error upon flush().

    参考文献:#1151

  • [orm] Fixed custom instrumentation bug whereby get_instance_dict() was not called for newly constructed instances not loaded by the ORM.

  • [orm] Session.delete() adds the given object to the session if not already present. 这是一个从0.4开始的回归错误。

    参考文献:#1150

  • [orm] The echo_uow flag on Session is deprecated, and unit-of-work logging is now application-level only, not per-session level.

  • [orm] Removed conflicting contains() operator from InstrumentedAttribute which didn’t accept escape kwaarg.

    参考文献:#1153

SQL ¶ T0>

  • [sql] 暂时回滚了“ORDER BY”增强功能。此功能处于暂停状态,需要进一步开发。

    参考文献:#1068

  • [sql] The exists() construct won’t “export” its contained list of elements as FROM clauses, allowing them to be used more effectively in the columns clause of a SELECT.

  • [sql] and_() and or_() now generate a ColumnElement, allowing boolean expressions as result columns, i.e. select([and_(1, 0)]).

    参考文献:#798

  • [sql] Bind params now subclass ColumnElement which allows them to be selectable by orm.query (they already had most ColumnElement semantics).

  • [sql] Added select_from() method to exists() construct, which becomes more and more compatible with a regular select().

  • [sql] Added func.min(), func.max(), func.sum() as “generic functions”, which basically allows for their return type to be determined automatically. 帮助SQLite,十进制类型,其他日期。

    参考文献:#1160

  • [sql] added decimal.Decimal as an “auto-detect” type; bind parameters and generic functions will set their type to Numeric when a Decimal is used.

架构¶ T0>

  • [schema] Added “sorted_tables” accessor to MetaData, which returns Table objects sorted in order of dependency as a list. 这弃用了MetaData.table_iterator()方法。“reverse = False”关键字参数也已从util.sort_tables()中移除。使用Python“反转”函数来反转结果。

    参考文献:#1033

  • [schema] 所有数字类型的“length”参数已重命名为“scale”。“长度”被弃用,仍然被警告接受。

  • [schema] 对用户定义的类型(convert_result_value,convert_bind_param)降低了0.3兼容性。

MySQL的¶ T0>

  • [mysql] The ‘length’ argument to MSInteger, MSBigInteger, MSTinyInteger, MSSmallInteger and MSYear has been renamed to ‘display_width’.

  • [mysql] 新增MSMediumInteger类型

    参考文献:#1146

  • [mysql] the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without the parenthesis, which seem to get in the way when using in conjunction with executemany().

预言¶ T0>

  • [oracle] limit/offset no longer uses ROW NUMBER OVER to limit rows, and instead uses subqueries in conjunction with a special Oracle optimization comment. 允许LIMIT / OFFSET与DISTINCT配合使用。

    参考文献:#536

  • [oracle] has_sequence()现在将当前的“模式”参数考虑在内

    参考文献:#1155

  • [oracle] 将BFILE添加到反射类型名称

    参考文献:#1121

杂项¶ T0>

  • [declarative] Fixed bug whereby mapper couldn’t initialize if a composite primary key referenced another table that was not defined yet.

    参考文献:#1161

  • [declarative] Fixed exception throw which would occur when string-based primaryjoin condition was used in conjunction with backref.

0.5.0beta3 ¶ T0>

发布日期:2008年8月4日

ORM ¶ T0>

  • [orm] SQLAlchemy映射器的“entity_name”功能已被删除。有关基本原理,请参阅http://tinyurl.com/6nm2ne

  • [orm] the “autoexpire” flag on Session, sessionmaker(), and scoped_session() has been renamed to “expire_on_commit”. 它不影响rollback()的到期行为。

  • [orm] fixed endless loop bug which could occur within a mapper’s deferred load of inherited attributes.

  • [orm] a legacy-support flag “_enable_transaction_accounting” flag added to Session which when False, disables all transaction-level object accounting, including expire on rollback, expire on commit, new/deleted list maintenance, and autoflush on begin.

  • [orm] The ‘cascade’ parameter to relation() accepts None as a value, which is equivalent to no cascades.

  • [orm] A critical fix to dynamic relations allows the “modified” history to be properly cleared after a flush().

  • [orm] user-defined @properties on a class are detected and left in place during mapper initialization. 这意味着如果一个@property的方式(而且这个列没有被重新映射到一个不同的名称),同名的表绑定列将不会被映射,也不会被应用到一个继承类。相同的规则适用于使用include_properties / exclude_properties集合排除的名称。

  • [orm] 新增了一个叫做after_attach()的SessionExtension钩子。这通过add(),add_all(),delete()和merge()在对象的附着点处被调用。

  • [orm] A mapper which inherits from another, when inheriting the columns of its inherited mapper, will use any reassigned property names specified in that inheriting mapper. 此前,如果“Base”已将“base_id”重新分配给名称“id”,则“SubBase(Base)”仍将获得名为“base_id”的属性。这可以通过在每个子映射中明确指定列来解决,但是这在使用声明时是不可行的,也是不可能的。

    参考文献:#1111

  • [orm] Fixed a series of potential race conditions in Session whereby asynchronous GC could remove unmodified, no longer referenced items from the session as they were present in a list of items to be processed, typically during session.expunge_all() and dependent methods.

  • [orm] Some improvements to the _CompileOnAttr mechanism which should reduce the probability of “Attribute x was not replaced during compile” warnings. (这通常适用于SQLA黑客,如Elixir开发人员)。

  • [orm] Fixed bug whereby the “unsaved, pending instance” FlushError raised for a pending orphan would not take superclass mappers into account when generating the list of relations responsible for the error.

SQL ¶ T0>

  • [sql] func.count() with no arguments renders as COUNT(*), equivalent to func.count(text(‘*’)).

  • [sql] simple label names in ORDER BY expressions render as themselves, and not as a re-statement of their corresponding expression. 此功能目前仅适用于SQLite,MySQL和PostgreSQL。它可以在其他方言上启用,因为每个方言都支持这种行为。

    参考文献:#1068

MySQL的¶ T0>

  • [mysql] 在CREATE TABLE中使用的MSEnum值的引用现在是可选的,将根据需要按需引用。(对于现有的表格,引用总是可选的。)

    参考文献:#1110

杂项¶ T0>

  • [ext] Class-bound attributes sent as arguments to relation()’s remote_side and foreign_keys parameters are now accepted, allowing them to be used with declarative. 此外修复了涉及order_by的错误,并将其指定为类加载属性,并与加载加载相关联。

  • [ext] 调整列的声明性初始化,以便非重命名列以与非声明性映射器相同的方式初始化。这允许继承映射器特别设置其相同名称的“id”列,使得父“id”列在子列上更受欢迎,从而减少了在请求该值时的数据库往返行程¶ t0 >

0.5.0beta2 ¶ T0>

发布日期:2008年7月14日

ORM ¶ T0>

  • [orm] 除了过期的属性外,如果它们的数据出现在结果集中,延迟属性也会加载。

    参考文献:#870

  • [orm] session.refresh() raises an informative error message if the list of attributes does not include any column-based attributes.

  • [orm] query() raises an informative error message if no columns or mappers are specified.

  • [orm] lazy loaders now trigger autoflush before proceeding. 这允许集合或标量关系的expire()在autoflush的上下文中正常工作。

  • [orm] column_property() attributes which represent SQL expressions or columns that are not present in the mapped tables (such as those from views) are automatically expired after an INSERT or UPDATE, assuming they have not been locally modified, so that they are refreshed with the most recent data upon access.

    参考文献:#887

  • [orm] Fixed explicit, self-referential joins between two joined-table inheritance mappers when using query.join(cls, aliased=True).

    参考文献:#1082

  • [orm] 固定query.join()在连接中与column-only子句和SQL表达式ON子句结合使用时。

  • [orm] mapper()中的“allow_column_override”标志已被删除。这个标志实际上总是被误解。它的具体功能可以通过include_properties / exclude_properties映射器参数来获得。

  • [orm] Repaired __str__() method on Query.

    参考文献:#1066

  • [orm] Session.bind gets used as a default even when table/mapper specific binds are defined.

SQL ¶ T0>

  • [sql] 添加了新的match()运算符,用于执行全文搜索。支持PostgreSQL,SQLite,MySQL,MS-SQL和Oracle后端。

架构¶ T0>

  • [schema] 添加了前缀选项,该选项接受在CREATE TABLE语句中的CREATE之后插入的字符串列表。

    参考文献:#1075

  • [schema] 默认情况下,Unicode,UnicodeText类型现在设置了“assert_unicode”和“convert_unicode”,但是接受这些值的重载** kwargs

源码¶ T0>

  • [sqlite] Modified SQLite’s representation of “microseconds” to match the output of str(somedatetime), i.e. in that the microseconds are represented as fractional seconds in string format. 这使SQLA的SQLite日期类型与直接使用Pysqlite(它只是调用str())保存的日期时间兼容。请注意,这与SQLA 0.4生成的SQLite数据库文件中的现有微秒值不兼容。

    要在全球范围内取得旧的行为:

    from sqlalchemy.databases.sqlite import DateTimeMixin DateTimeMixin .__ legacy_microseconds__ = True

    要获取单个DateTime类型的行为:

    t = sqlite.SLDateTime()t .__ legacy_microseconds__ = True

    然后使用“t”作为列上的类型。

    参考文献:#1090

  • [sqlite] SQLite Date, DateTime, and Time types only accept Python datetime objects now, not strings. 如果您想使用SQLite将日期格式化为字符串,请使用字符串类型。如果你希望他们尽管接受字符串作为输入,仍然可以返回datetime对象,那么在String的周围做一个TypeDecorator - SQLA不鼓励这种模式。

杂项¶ T0>

  • [extensions] Declarative supports a __table_args__ class variable, which is either a dictionary, or tuple of the form (arg1, arg2, ..., {kwarg1:value, ...}) which contains positional + kw arguments to be passed to the Table constructor.

    参考文献:#1096

0.5.0beta1 ¶ T0>

发行日期:2008年6月12日

一般¶ T0>

  • [general] 全局“propigate” - >“传播”改变

ORM ¶ T0>

  • [orm] polymorphic_union() function respects the “key” of each Column if they differ from the column’s name.

  • [orm] Fixed 0.4-only bug preventing composite columns from working properly with inheriting mappers

    参考文献:#1199

  • [orm] Fixed RLock-related bug in mapper which could deadlock upon reentrant mapper compile() calls, something that occurs when using declarative constructs inside of ForeignKey objects. 从0.5移到

  • [orm] Fixed bug in composite types which prevented a primary-key composite type from being mutated.

    参考文献:#1213

  • [orm] 添加了ScopedSession.is_active访问者

    参考文献:#976

  • [orm] Class-bound accessor can be used as the argument to relation() order_by.

    参考文献:#939

  • [orm] Fixed shard_id argument on ShardedSession.execute().

    参考文献:#1072

SQL ¶ T0>

  • [sql] Connection.invalidate() checks for closed status to avoid attribute errors.

    参考文献:#1246

  • [sql] NullPool支持在失败行为上重新连接。

    参考文献:#1094

  • [sql] The per-dialect cache used by TypeEngine to cache dialect-specific types is now a WeakKeyDictionary. 这样可以防止方言对象永远被引用到创建任意数量的引擎或方言的应用程序中。有一个小的性能损失,将在0.6. 中解决

    参考文献:#1299

  • [sql] Fixed SQLite reflection methods so that non-present cursor.description, which triggers an auto-cursor close, will be detected so that no results doesn’t fail on recent versions of pysqlite which raise an error when fetchone() called with no rows present.

MySQL的¶ T0>

  • [mysql] 修正了在反射期间FK列不存在的情况下引发异常的问题

    参考文献:#1241

预言¶ T0>

  • [oracle] Fixed bug which was preventing out params of certain types from being received; thanks a ton to huddlej at wwu.edu !

    参考文献:#1265

火鸟¶ T0>

  • [firebird] 新增了对插入(仅2.0+),更新和删除(仅限2.1+)返回值的支持。

杂项¶ T0>

  • The “__init__” trigger/decorator added by mapper now attempts to exactly mirror the argument signature of the original __init__. “_sa_session”的传递不再是隐式的 - 你必须在你的构造函数中允许这个关键字参数。

  • ClassState is renamed to ClassManager.

  • 类可以通过提供__sa_instrumentation_manager__属性来提供他们自己的InstrumentationManager

  • Custom instrumentation may use any mechanism to associate a ClassManager with a class and an InstanceState with an instance. 这些对象的属性仍然是SQLAlchemy的本地检测使用的默认关联机制。

  • 将实例对象中的entity_name,_sa_session_id和_instance_key移至实例状态。这些值仍旧以旧的方式可用,现在已经废弃,使用附加到类的描述符。访问时会发出弃用警告。

  • prepare_instrumentation的_prepare_instrumentation别名已被移除。

  • sqlalchemy.exceptions has been renamed to sqlalchemy.exc. 这个模块可以用任何名称导入。

  • ORM-related exceptions are now defined in sqlalchemy.orm.exc. 在导入sqlalchemy.orm期间,ConcurrentModificationError,FlushError和UnmappedColumnError兼容性别名安装在sqlalchemy.exc中。

  • sqlalchemy.logging已重命名为sqlalchemy.log。

  • sqlalchemy.exc中警告定义的过渡性sqlalchemy.log.SADeprecationWarning别名已被删除。

  • exc.AssertionError has been removed and usage replaced with Python’s built-in AssertionError.

  • The behavior of MapperExtensions attached to multiple, entity_name= primary mappers for a single class has been altered. 为类定义的第一个mapper()是符合MapperExtension'instrument_class','init_instance'和'init_failed'事件的唯一映射器。这是倒退不相容的;之前定义的最后一个映射器的扩展将会接收这些事件。

  • [postgres] 增加了对Postgres的索引反射支持,使用Ken Kuhlman提交的一个我们长期忽略的很好的补丁。

    参考文献:#714