
Essential SQLAlchemy
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Essential SQLAlchemy
- SPECIAL OFFER: Upgrade this ebook with O'Reilly
- A Note Regarding Supplemental Files
- Preface
- Audience
- Assumptions This Book Makes
- Contents of This Book
- Conventions Used in This Book
- Using Code Examples
- How to Contact Us
- Acknowledgments
- 1. Introduction to SQLAlchemy
- What Is SQLAlchemy
- The Object/Relational "Impedance Mismatch"
- SQLAlchemy Philosophy
- SQLAlchemy Architecture
- Engine
- Connection pooling
- SQL dialect management
- MetaData Management
- Types System
- SQL Expression Language
- Object Relational Mapper (ORM)
- 2. Getting Started
- Installing SQLAlchemy
- Installing the SQLAlchemy Package
- Installing setup tools
- Installing SQLAlchemy with easy_install
- Testing the install
- Installing Some Database Drivers
- Installing the SQLite driver on Python versions before 2.5
- Other supported drivers
- SQLAlchemy Tutorial
- Connecting to the Database and Creating Some Tables
- Performing Queries and Updates
- Mapping Objects to Tables
- 3. Engines and MetaData
- Engines and Connectables
- Configuring SQLAlchemy Logging
- Database Connections and ResultProxys
- Connection Pooling
- MetaData
- Getting Started with MetaData
- Defining Tables
- Table reflection
- Column Definitions
- Constraints
- Primary keys
- Foreign keys
- UNIQUE constraints
- CHECK constraints
- Defaults
- Active defaults
- Passive defaults
- Defining Indexes
- The Index object
- Creating Explicit Sequences
- MetaData Operations
- Binding MetaData
- Create/drop MetaData and schema objects
- Adapt Tables from one MetaData to another
- 4. SQLAlchemy Type Engines
- Type System Overview
- Built-in Types
- Generic Types
- Dialect-Specific Types
- Application-Specific Custom Types
- Implementing a TypeDecorator
- Creating a New TypeEngine
- 5. Running Queries and Updates
- Inserts, Updates, and Deletes
- Insert Statements
- Update Statements
- Delete Statements
- Queries
- Basic Query Construction
- The select() function versus the select() method
- Result set objects
- Operators and functions in WHERE clauses
- Using custom bind parameters
- Using literal text in queries
- Ordering and grouping results, returning distinct values
- Limiting results returned
- Using the "generative" query interface
- Joins and Set Operations
- Joining selectables
- Set operations (UNION, INTERSECT, EXCEPT)
- Using aliases
- Subqueries
- Embedding subqueries in the column list
- Correlated versus uncorrelated subqueries
- Embedding subqueries in an IN clause
- Embedding subqueries in the FROM clause
- 6. Building an Object Mapper
- Introduction to ORMs
- Design Concepts in the ORM
- The data mapper pattern
- The unit of work pattern
- Declaring Object Mappers
- Basic Object Mapping
- Customizing Property Mapping
- Using include_properties and exclude_properties
- Customizing the name of the mapped column
- Using synonyms
- Mapping subqueries
- Mapping composite values
- Eager versus deferred loading
- Mapping Arbitrary Selectables
- Other mapper() Parameters
- Declaring Relationships Between Mappers
- Basic Relationships
- 1:N relations
- M:N relations
- 1:1 relations
- Using BackRefs
- Using a Self-Referential Mapper
- Cascading Changes to Related Objects
- Other relation() and backref() Parameters
- Using custom collections in relations
- Extending Mappers
- ORM Partitioning Strategies
- Vertical Partitioning
- Horizontal Partitioning
- 7. Querying and Updating at the ORM Level
- The SQLAlchemy ORM Session Object
- Creating a Session
- Saving Objects to the Session
- Updating Objects in the Session
- Embedding SQL expressions in a flush
- Deleting Objects from the Session
- Flushing, Committing, and Rolling Back Session Changes
- Other Session Methods
- Extending Sessions
- Querying at the ORM Level
- ORM Querying with Joins
- Customizing the Select Statement in ORM Queries
- Other Query Methods
- Contextual or Thread-Local Sessions
- Using Contextual Sessions with Mappers and Classes
- 8. Inheritance Mapping
- Overview of Inheritance Mapping
- Single Table Inheritance Mapping
- Concrete Table Inheritance Mapping
- Joined Table Inheritance Mapping
- Optimizing Performance with Joined Table Inheritance Mapping
- Using deferred loading
- Using select_table
- Relations and Inheritance
- 9. Elixir: A Declarative Extension to SQLAlchemy
- Introduction to Elixir
- Installing Elixir
- Using Elixir
- Fields and Properties
- Elixir deferred properties
- Relations
- Attribute-based syntax
- DSL syntax
- Inheritance
- Querying Using Elixir
- Elixir Extensions
- Associable Extension
- Encrypted Extension
- Versioned Extension
- 10. SqlSoup: An Automatic Mapper for SQLAlchemy
- Introduction to SqlSoup
- Using SqlSoup for ORM-Style Queries and Updates
- Joins with SqlSoup
- Mapping Arbitrary Selectables
- Directly Accessing the Session
- Using SqlSoup for SQL-Level Inserts, Updates, and Deletes
- When to Use SqlSoup Versus Elixir Versus "Bare" SQLAlchemy
- SqlSoup Pros and Cons
- Elixir Pros and Cons
- 11. Other SQLAlchemy Extensions
- Association Proxy
- Ordering List
- Deprecated Extensions
- Index
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with O'Reilly
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.