SQLAlchemy 1.0.0b1 发布,Python的ORM框架

jopen 10年前

SQLAlchemy 在构建在 WSGI 规范上的下一代 Python Web 框架中得到了广泛应用,它是由 Mike Bayer 和他的核心开发人员团队开发的一个单独的项目。使用 ORM 等独立 SQLAlchemy 的一个优势就是它允许开发人员首先考虑数据模型,并能决定稍后可视化数据的方式(采用命令行工具、Web 框架还是 GUI 框架)。这与先决定使用 Web 框架或 GUI 框架,然后再决定如何在框架允许的范围内使用数据模型的开发方法极为不同。

什么是 WSGI?

WSGI 是下一代 Python Web 框架、应用程序和服务器应该遵循的规范。WSGI 中 一个有趣的方面是创建 Python 中间件,并在使用 Python 或任何语言创建的 Web 应用程序中使用。 

SQLAlchemy 的一个目标是提供能兼容众多数据库(如 SQLite、MySQL、Postgres、Oracle、MS-SQL、SQLServer 和 Firebird)的企业级持久性模型。


This is the first beta release in the new 1.0 series of SQLAlchemy. Users are encouraged to ensure that their pip installations are up-to-date, so that version 1.0.0b1 will only install if explcitly specified using the --pre flag.

Release 1.0.0b1 features a large degree of internal rearchitecture, new features, and bug fixes. Key highlights include:

  • 性能改进 - Function call counts are reduced in many areas across the library, including Core execution and result set formulation, ORM query construction, ORM result set fetching, mass object expiration, and ORM persistence. The memory footprint of an ORM application is also greatly reduced by rolling out the use of __slots__ across a wide array of internal structures.
  • 新的性能特性 - for even more performance gains, new APIs are introduced to the ORM which can dramatically improve the performance of certain operations. See features such as Baked Queries and Bulk Insert/Update API. New documentation and examples regarding performance are added as well, including the new example performance suite.
  • New Dialect Features - In particular, the Postgresql, MySQL, and SQLite dialects have significant changes, in particular regarding improved datatype support and improved database reflection.
  • Dozens of other improvements - Small but useful improvements like removing the need for use_alter and autoload_with implies autoload=True are part of a long list of changes which can be seen in the What's new in 1.0? document.

Users should carefully review the migration document as well as the Changelog to note which behaviors and issues are affected. We'd like to thank the many contributors who helped with this release.

SQLAlchemy 1.0.0b1 is available on the Download Page.