Essential SQLAlchemy

Rick Copeland

  • 出版商: O'Reilly
  • 出版日期: 2008-06-15
  • 定價: $1,180
  • 售價: 2.5$299
  • 語言: 英文
  • 頁數: 240
  • 裝訂: Paperback
  • ISBN: 0596516142
  • ISBN-13: 9780596516147
  • 相關分類: SQL
  • 立即出貨(限量) (庫存=5)

買這商品的人也買了...

商品描述

Essential SQLAlchemy introduces a high-level open-source code library that makes it easier for Python programmers to access relational databases such as Oracle, DB2, MySQL, PostgreSQL, and SQLite. SQLAlchemy has become increasingly popular since its release, but it still lacks good offline documentation. This practical book fills the gap, and because a developer wrote it, you get an objective look at SQLAlchemy's tools rather than an advocate's description of all the "cool" features.

SQLAlchemy includes both a database server-independent SQL expression language and an object-relational mapper (ORM) that lets you map "plain old Python objects" (POPOs) to database tables without substantially changing your existing Python code. Essential SQLAlchemy demonstrates how to use the library to create a simple database application, walks you through simple queries, and explains how to use SQLAlchemy to connect to multiple databases simultaneously with the same Metadata. You also learn how to:

  • Create custom types to be used in your schema, and when it's useful to use custom rather than built-in types
  • Run queries, updates, and deletes with SQLAlchemy's SQL expression language
  • Build an object mapper with SQLAlchemy, and understand the differences between this and active record patterns used in other ORMs
  • Create objects, save them to a session, and flush them to the database
  • Use SQLAlchemy to model object oriented inheritance
  • Provide a declarative, active record pattern for use with SQLAlchemy using the Elixir extension
  • Use the SQLSoup extension to provide an automatic metadata and object model based on database reflection

In addition, you'll learn how and when to use other extensions to SQLAlchemy, including AssociationProxy, OrderingList, and more.

Essential SQLAlchemy is the much-needed guide for every Python developer using this code library. Instead of a feature-by-feature documentation, this book takes an "essentials" approach that gives you exactly what you need to become productive with SQLAlchemy right away.

商品描述(中文翻譯)

《Essential SQLAlchemy》介紹了一個高級的開源代碼庫,使得Python程序員更容易訪問關聯數據庫,如Oracle、DB2、MySQL、PostgreSQL和SQLite。自從釋出以來,SQLAlchemy越來越受歡迎,但它仍然缺乏良好的離線文檔。這本實用的書填補了這一空白,因為是由開發者撰寫的,所以你可以客觀地了解SQLAlchemy的工具,而不是一個支持者對所有“酷炫”功能的描述。

SQLAlchemy包括一個獨立於數據庫服務器的SQL表達語言和一個對象關係映射器(ORM),它允許你將“普通的Python對象”(POPOs)映射到數據庫表,而不需要大幅更改現有的Python代碼。《Essential SQLAlchemy》演示了如何使用該庫創建一個簡單的數據庫應用程序,引導你進行簡單的查詢,並解釋如何使用SQLAlchemy同時連接多個數據庫並使用相同的元數據。

你還將學習以下內容:
- 創建自定義類型以在模式中使用,以及何時使用自定義類型而不是內置類型
- 使用SQLAlchemy的SQL表達語言運行查詢、更新和刪除操作
- 使用SQLAlchemy構建對象映射器,並了解其與其他ORM中使用的活動記錄模式之間的區別
- 創建對象,將其保存到會話中,並將其刷新到數據庫
- 使用SQLAlchemy建模面向對象的繼承
- 使用Elixir擴展提供聲明式的活動記錄模式,以與SQLAlchemy一起使用
- 使用SQLSoup擴展基於數據庫反射提供自動元數據和對象模型

此外,你還將學習如何在適當的時候使用SQLAlchemy的其他擴展,包括AssociationProxy、OrderingList等。

《Essential SQLAlchemy》是每個使用這個代碼庫的Python開發者所需的指南。這本書不是按功能進行的文檔,而是採用了一種“基本要點”的方法,讓你立即掌握SQLAlchemy所需的內容,提高工作效率。