Class Outline: Advanced Databases with SQLAlchemy
Part 1: advanced database concepts
==================================
Subqueries
----------
- scalar
- in FROM
Functions
---------
- One query is almost always better than multiple
- parse overhead
- driver and/or network overhead
- pl/pgsql
- pl/pythonu
Triggers
--------
- Performance
- Single point of maintenance
- Declarative vs procedural
- per-statement vs per-row
Part 2: mapping with SQLAlchemy
===============================
Introduction
------------
- Data Mapper pattern vs Active Record
- Reusable constructs vs collections of special cases
Data constructs
---------------
- Constraints
- FKs
- ON UPDATE, ON DELETE
- How SA plays nicely with in-db defaults and triggers
Queries
-------
- Joins
- Subqueries
- Aliasing
Mapping to Python classes
-------------------------
- one to many, many to many
- backreferences
- mapping to lists; cascade options
- inheritance
Advanced mapping & optimization
-------------------------------
- logging query duration with a proxy Engine
- lazy / eager loading
- identity map is not a cache
- mapping function calls and subqueries