Python数据持久层框架 SQLAlchemy

fmms 13年前

SQLAlchemy 是一个Python 的SQL 工具包以及数据库对象映射框架

示例代码:

user1 = User(name='user1')  user2 = User(name='user2')  session.add(user1)  session.add(user2)    session.commit()     # write changes to the databas

以下是它的一些特性:

  • No ORM Required
  • Mature, High Performing Architecture
  • DBA Approved
  • Non-Opinionated
  • Unit Of Work
  • Function-based query construction
  • Modular and Extensible
  • Separate mapping and class design
  • Eager-loading and caching of related objects and collections
  • Composite (multiple-column) primary keys
  • Self-referential Object Mappings
  • Inheritance Mapping
  • Raw SQL statement mapping
  • Pre- and post-processing of data

项目主页:http://www.open-open.com/lib/view/home/1328847857312