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

SQLAlchemy 1.1文档

0.5 Changelog

0.5.9 ¶ T0>

没有发布日期

SQL ¶ T0>

  • [sql] 修复表达式包中的错误self_group()调用。

    参考文献:#1661

0.5.8 ¶ T0>

发布时间:2010年1月16日

SQL ¶ T0>

  • [sql] Column上的copy()方法现在支持未初始化的未命名的Column对象。这样可以方便地创建声明式助手,这些助手可以在多个子类中放置公共列。

  • [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] 这个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

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

  • [orm] 修复了合并包含空主键标识符的临时对象时发生的不必要的选择。

    参考文献:#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] 与连接池连接关联的游标(即_CursorFairy)现在正确地将__ iter __()代理到底层游标。

    参考文献:#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] 修正了extract()在应用“timestamp”转换时将运算符优先级规则应用于“::”运算符 - 确保正确的括号。

    参考文献:#1611

源码¶ T0>

  • [sqlite] sqlite方言正确地为处于备用模式中的表生成CREATE INDEX。

    参考文献:#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] 在构造类之后(即通过类级属性分配),可以将列添加到联合表声明式超类中,并且该列将向下传播到子类。这是相反的情况,固定在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] 修正复合主键的继承鉴别器部分在更新时失败的问题。继续。

    参考文献:#1300

  • [orm] 修正了一个不允许多对多双向引用的一边声明自己为“viewonly”的bug

    参考文献:#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] 添加了enable_assertions(False)以查询哪些功能会禁用预期状态的常用断言 - 查询子类用于设计自定义状态。请参阅http://www.sqlalchemy.org/ trac / wiki / UsageRecipes / PreFilteredQuery为例。

    参考文献:#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] 修复了一个有点假设的问题,它会导致使用旧的polymorphic_union函数计算映射器的错误主键 - 但这是旧东西。

    参考文献:#1486

SQL ¶ T0>

  • [sql] 修复了column.copy()来复制默认值和onupdates。

    参考文献:#1373

  • [sql] Fixed a bug in extract() introduced in 0.5.4 whereby the string “field” argument was getting treated as a ClauseElement, causing various errors within more complex SQL transformations.

  • [sql] 一元表达式(如DISTINCT)将其类型处理传播到结果集,从而允许像unicode之类的转换发生。

    参考文献:#1420

  • [sql] 修正了Table和Column中的错误,传递“info”参数的空字典会引发异常。

    参考文献:#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] relation()的“foreign_keys”参数现在将以与primaryjoin和secondaryjoin相同的方式自动传播到backref。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] ...唯一已知的(实际上非​​常罕见的)用例,其中在向前/向后侧使用不同的foreign_keys设置,部分指向其自己的列的组合外键,已被增强,使得关系的fk->自身方面不会用于确定关系方向。

  • [orm] Session.mapper现在已弃用

    如果你想让一个独立的对象成为会话的一部分,请调用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] 修正了在0.5.4中引入的缺陷,因此当清除默认持有的列时复合类型失败。

  • [orm] 修正了另一个0.5.4的bug,即当整个对象被序列化时,可变属性(即PickleType)不会被正确地反序列化。

    参考文献:#1426

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

  • [orm] 修复了潜在的内存泄漏,因为先前被剔除的对象放回到会话中将不会被完全垃圾收集,除非Session被明确关闭。

  • [orm] 修正了基于列表的属性,如pickletype和PGArray,无法合并()的错误。

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

  • [orm] 修剪InstanceState的pickle格式,这会进一步减少pickled实例的内存占用。格式应该与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] 修复了不基于参数或不是executemany()风格的SQL异常打印。

的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] 修正了0.5.4中引入的一个属性错误,当merge()与一个不完整的对象一起使用时会发生。

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,复合关联)的映射相关,该实现还提高了性能。这消除了gc过程的开销并简化了内部行为。

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

      此更改还会影响内部属性API,但不会影响AttributeExtension界面或任何公开记录的属性函数。

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

    参考文献:#1398

  • [orm] 修改了DynamicAttributeImpl上的query_cls以接受AppenderQuery的完整混合版本,该版本允许对AppenderMixin进行子类化。

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

    参考文献:#1300

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

  • [orm] 修正了“动态”关系的“集合集合”功能,以正确启动事件。以前只能将一个集合分配给待处理的父实例,否则修改后的事件不会被正确触发。Set集合现在兼容merge(),修复。

    参考文献:#1352

  • [orm] 允许对使用检测描述符构造的PropertyOption对象进行酸洗;以前,在酸洗一个加载了基于描述符的选项的对象(比如query.options(eagerload(MyClass.foo))时会发生pickle错误。

  • 如果“延迟加载”SQL子句与get()使用的子句相匹配,但包含某些硬编码参数,则懒惰加载程序将不会使用get()。[orm] 以前,懒惰策略会失败,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] 修复了autoflush干扰session.merge()的另一个位置。autoflush在merge()now期间被完全禁用。

    参考文献:#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] 会话的固定文档weak_identity_map - 默认值为True,表示正在使用的弱引用地图。

  • [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] 修复了使用预先加载关系的Query.update()和Query.delete()失败。

    参考文献:#1378

  • [orm] 在foreign_keys或remote_side集合中指定二进制primaryjoin条件的列现在是错误的。而以前它只是无意义的,但会以非确定性的方式获得成功。

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] 修复了__clause_element __()风格构造(即声明性列)构造的ForeignKey上的__repr __()和其他_get_colspec()方法。

    参考文献:#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] 修改了保存点逻辑的工作方式,以防止它跨过非保存点导向的例程。Savepoint支持仍然是非常实验性的。

  • [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*从A 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] 向InstrumentationManager添加了“post_configure_attribute”方法,以便“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] 在sqlalchemy.orm.attributes中添加了一个属性助手方法set_committed_value给定一个对象,属性名称和值,会将该对象的值设置为其“已提交”状态的一部分,即可以理解为已从数据库加载的状态。帮助创建本土收集装载机等。

  • [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这样的数据库来说,它的字符限制非常小,因此更为重要。

    参考文献:#1309

  • [sql] __selectable __()接口已被完全替换为__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] 声明式定位“inherits”类,使用__bases__进行搜索,跳过子类本地的mixins。

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

  • [extensions] 如果它是一个字符串,Declarative将正确地解释backref()中的“foreign_keys”参数。

  • [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在确定“孤立”状态时都不会扫描整套潜在父母 - 对于持久对象,它只检测到一个in-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] 修复了一个急切的加载错误,即自引用加载加载会阻止其他加载,自引用或不加载,从而正确加入父JOIN。感谢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 selectables时可能会泄漏内存。

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

  • [orm] 对“no mapped table”异常进行了现代化处理,并为声明式添加了更明确的__table __ / __ tablename__异常。

  • [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] 添加了一个新的关系()关键字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] 使用保持持久性的最终InstrumentedAttribute对象构造现在的仪器类属性。_CompileOnAttr / __ getattribute __()方法已被删除。最终结果是,基于列的映射类属性现在可以在类级完全使用,而无需调用映射器编译操作,从而大大简化了声明中的典型使用模式。

    参考文献:#1269

  • [orm] ColumnProperty(和deferred等前端助手)不再忽略未知的**关键字参数。

  • [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] 将新的Column对象添加到使用__table __指定现有表的声明类中是错误的。

0.5.0 ¶ T0>

发布时间:2009年1月6日

一般¶ T0>

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

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

  • [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接受query_class =来自定义用于动态集合和由它构建的查询的Query类。

  • [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

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

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

    参考文献:#1242

  • [orm] Query.select_from(),from_statement()确保给定的参数分别是FromClause或Text / Select / Union。

  • [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的多对一关系的比较根据not _()。正确转换为IS NOT NULL。

  • [orm] 为了确保显式的primaryjoin / secondaryjoin是ClauseElement实例,添加额外的检查以防止以后出现更多混淆错误。

    参考文献:#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] 修复了在分片API中导致总线错误的“double iter()”调用,从0.4版本中删除了错误的result.close()。

    参考文献:#1099#1228

  • [orm] 使Session.merge级联不会触发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] 修复了ShardedSession.execute()中的shard_id参数。

    参考文献:#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] 修正了涉及将远程模式表与外键引用反映到该模式中的另一个表的问题。

源码¶ 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] 重构日期/时间类型。smalldatetime数据类型不再仅截断为日期,现在将映射到MSSmallDateTime类型。

    参考文献:#1254

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

  • [mssql] char_length映射到LEN()函数。

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

  • [mssql] 如果该列是primary_key的一部分,它将是NOT NULL t4 >因为MSSQL在primary_key列中不允许NULL

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

    参考文献:#1249

  • [mssql] get_default_schema_name现在基于用户的默认模式从数据库反映出来。这只适用于MSSQL 2005及更高版本。

    参考文献:#1258

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

    参考文献:#1248

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

  • [mssql] 增加了保存点的实验性支持。它目前不能完全用于会话。

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

    参考文献:#1243

预言¶ T0>

  • [oracle] 调整create_xid()的格式来修复两阶段提交。我们现在已经有Oracle两阶段提交的现场报告,可以正确处理这种变化。

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

    参考文献:#1233

  • [oracle] 修正了防止接收某些类型的参数的错误;非常感谢wwu.edu huddlej!

    参考文献:#1265

杂项¶ T0>

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

  • [engine/pool] Connection.invalidate()检查关闭状态以避免属性错误。

    参考文献:#1246

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

    参考文献:#1094

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

    参考文献:#799

  • [engine/pool] _execute_clauseelement()返回为私有方法。在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 ...)”,以便返回真实的行计数,即query(func.count(A.name))之类的查询。 .count()将返回一个值,因为该查询将返回一行。

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

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

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

  • [orm] 当针对多个实体执行时,Query.get()返回更多信息错误消息。

    参考文献:#1220

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

    参考文献:#1140#1221

  • [orm] 固定PendingDeprecationWarning涉及relation()中的order_by参数。

    参考文献:#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] 需要将子查询作为二进制表达式的一部分转换为使用IN和NOT IN语法的正确情况。

  • [mssql] 固定E符号问题,阻止插入小于1E-6的十进制值的能力。

    参考文献:#1216

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

    参考文献:#1217

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

杂项¶ T0>

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

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

    参考文献:#1017

  • [access] 更正连接问题。访问只支持左外部或内部,而不仅仅是自己加入。

    参考文献:#1017

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

  • [ext] 固定的基于字符串的“remote_side”,“order_by”等在backref()中使用时不能正确传播。

0.5.0rc3 ¶ T0>

发布时间:2008年11月7日

ORM ¶ T0>

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

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

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

  • [orm] 改进了别名()对象的行为,以便更精确地调整生成的表达式,这特别有助于自引用比较。

    参考文献:#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对象现在会在处置时删除对自身的循环引用,以将其保留在循环垃圾回收之外。

  • [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()函数如果与列的名称不同,它将尊重每个列的“键”。

  • [orm] 通过“删除”级联修复了多对一关系()上“被动删除”的支持。

    参考文献:#1183

  • [orm] 修正了阻止主键复合类型发生变异的复合类型的错误。

    参考文献:#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事件仍然为待定实例初始化attrbutes和集合。

    参考文献:#1202

SQL ¶ T0>

  • [sql] SQL compiler optimizations and complexity reduction. 编译典型select()构造的调用次数比0.5.0rc2少20%。

  • [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] 简化对ResultProxy的检查,“无结果自动关闭”仅基于cursor.description的存在。所有关于返回行的语句的基于正则表达式的猜测已被删除。

    参考文献:#1212

  • [sql] 直接执行union()构造会正确设置结果行处理。

    参考文献:#1194

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

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

  • [sql] 修复了table.tometadata()方法,以便将传入的模式参数传播到ForeignKey构造。

  • [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] 在create_engine()上将auto_convert_lobs设置为False也会指示OracleBinary类型返回未更改的cx_oracle LOB对象。

杂项¶ T0>

  • [ext] 添加了新的扩展名sqlalchemy.ext.serializer。提供镜像Pickle / Unpickle,以及dump()和loads()的Serializer / Deserializer“classes”。这个序列化器实现了一个“外部对象”pickler,它在pickle流之外保存关键的上下文敏感对象,包括引擎,会话,元数据,表/列和映射器,并且可以在以后使用任何引擎/元数据/会话来恢复pickle供应商。这不是用于酸洗常规对象实例,这些对象实例可以在没有任何特殊逻辑的情况下进行选择,而是用于酸洗表达式对象和完整的Query对象,这样所有映射器/引擎/会话依赖关系可以在不打开时恢复。 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,它可能在重入映射器编译()调用时死锁,这是在ForeignKey对象内部使用声明性构造时发生的。

  • [orm] ScopedSession.query_property现在接受一个query_cls工厂,覆盖会话配置的query_cls。

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

  • [orm] 固定Query上的切片(即query [x:y]),以便零长度切片正常工作,切片两端都是None。

    参考文献:#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()用法现在与一个Query相兼容,该查询还包含常规的负载和限制/偏移量,因为这些列被添加到Query生成的子查询中。/ T2>

    参考文献:#1180

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

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

  • [orm] 修正了autocommit = False会话中session.transaction.commit()未启动新事务

  • [orm] 对Session.identity_map的弱引用行为进行一些调整以减少异步GC副作用。

  • [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>

预言¶ 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] 查询现在具有delete()和update(values)方法。这允许使用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. 直接的Column对象,如Query(table.c.col)将返回Column的“key”属性。

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

  • [orm] 改进了在实体的query()列表中放置SQL表达式时确定FROM子句的情况。特别是标量子查询不应该将其内部的FROM对象“泄漏”到包含查询中。

  • [orm] 将一个关系()从一个映射类连接到一个映射子类,其中映射子类配置了单个表继承,将包含一个IN子句,该子句将联接类的子类型限制为在加入的ON子句中请求的那些。这对于热切加载连接以及query.join()都有效。请注意,在某些情况下,IN子句将出现在查询的WHERE子句中,因为此歧视具有多个触发点。

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

  • [orm] column_property(),composite_property()和relation()现在使用“extension”关键字参数接受一个或一系列AttributeExtensions

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

  • [orm] 添加了一个Validator AttributeExtension,以及一个@validates装饰器,它以与@reconstructor类似的方式使用,并将方法标记为验证一个或多个映射属性。 / T2>

  • [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] Session和其他人的“extension”参数现在可以有选择地作为列表,支持发送到多个SessionExtension实例的事件。会话在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] 修复了从基类继承的子类的@reconstructor钩子。

    参考文献:#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] 修正了自定义的检测错误,其中get_instance_dict()未针对未由ORM加载的新构建的实例调用。

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

    参考文献:#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] InstrumentedAttribute中删除了冲突的contains()运算符,该运算符不接受escape kwaarg。¶ T5>

    参考文献:#1153

SQL ¶ T0>

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

    参考文献:#1068

  • 存在()构造不会将其包含的元素列表“导出”为FROM子句,从而可以在SELECT的columns子句中更有效地使用它们。 [sql]

  • [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] 将select_from()方法添加到exists()构造中,该构造变得与常规select()更加兼容。

  • [sql] 添加了func.min(),func.max(),func.sum()作为“通用函数”,它基本上允许自动确定返回类型。有助于在SQLite上使用日期,小数类型和其他类型。

    参考文献:#1160

  • [sql] 将decimal.Decimal添加为“自动检测”类型;绑定参数和泛型函数会在使用Decimal时将它们的类型设置为Numeric。

架构¶ 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'。'length'已被弃用,仍然被警告接受。

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

MySQL的¶ T0>

  • [mysql] MSInteger,MSBigInteger,MSTinyInteger,MSSmallInteger和MSYear的'length'参数已被重命名为'display_width'。

  • [mysql] 新增MSMediumInteger类型

    参考文献:#1146

  • [mysql] 函数func.utc_timestamp()编译为UTC_TIMESTAMP,没有括号,与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] 修复了如果复合主键引用了另一个尚未定义的表,映射器无法初始化的问题。

    参考文献:#1161

  • [declarative] 修正了当基于字符串的primaryjoin条件与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] 修复了可能发生在映射器延迟加载的继承属性内的无限循环错误。

  • [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] relation()的'cascade'参数接受None作为一个值,这相当于没有级联。

  • [orm] 对动态关系的一个重要修复允许在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] 当继承其继承的映射器的列时,从另一个继承的映射器将使用该继承映射器中指定的任何重新分配的属性名称。以前,如果“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()会引发一条信息错误消息。

  • [orm] 在继续之前,懒加载器现在会触发自动刷新。这允许集合或标量关系的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] 即使定义了table / mapper特定绑定,Session.bind也会被用作默认值。

SQL ¶ T0>

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

架构¶ T0>

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

    参考文献:#1075

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

源码¶ T0>

  • [sqlite] 修改SQLite的“微秒”表示以匹配str(somedatetime)的输出,即微秒以字符串格式表示为小数秒。这使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将日期格式化为字符串,请使用String类型。如果您希望他们尽管接受字符串作为输入,仍然返回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()函数如果与列的名称不同,它将尊重每个列的“键”。

  • [orm] 修复了0.4个仅限于防止复合列与继承映射器正常工作的错误

    参考文献:#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] 修正了阻止主键复合类型发生变异的复合类型的错误。

    参考文献:#1213

  • [orm] 新增了ScopedSession.is_active访问者。

    参考文献:#976

  • [orm] 类绑定存取器可以用作relation()order_by的参数。

    参考文献:#939

  • [orm] 修复了ShardedSession.execute()中的shard_id参数。

    参考文献:#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] 修正了防止接收某些类型的参数的错误;非常感谢wwu.edu huddlej!

    参考文献:#1265

火鸟¶ T0>

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

杂项¶ T0>

  • 由mapper添加的“__init__”触发器/修饰器现在试图精确地镜像原始__init__的参数签名。'_sa_session'的传递不再是隐式的,你必须在你的构造函数中允许this关键字参数。

  • ClassState被重命名为ClassManager。

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

  • 自定义检测可以使用任何机制将ClassManager与类关联起来,并将InstanceState与实例关联起来。这些对象的属性仍然是SQLAlchemy的本地工具使用的默认关联机制。

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

  • prepare_instrumentation的_prepare_instrumentation别名已被删除。

  • sqlalchemy.exceptions已更名为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.

  • MapperExtensions附加到多个entity_name =一个类的主映射器的行为已被更改。为类定义的第一个mapper()是符合MapperExtension'instrument_class','init_instance'和'init_failed'事件的唯一映射器。这是倒退不相容的;之前定义的最后一个映射器的扩展将接收这些事件。

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

    参考文献:#714