- How to use SQLAlchemy
- Primarily as an ORM layer
- But also explaining the other parts
- Relational databases
- Python DBAPI
- ORM layers
- Abstraction (leaky)
- But Hand-Coded
- Database Independence (SQL dialects, data types)
- Logical set of classes that relate to database constructs
- Engine <=> Database
- Session <=> Database Connection
- (Data Type) <=> Column Type
- Schemas: Table, Column, Index, ForeignKey, Sequence...
- SQL statements/xepressions: Select, Insert, Update, Join ...
- And so on...
Working through the standard tutorial from the documentation. Code on github, if you want to follow along
- Basics
- Querying
- Relationships
- Eagerness
- Deleting
- Bonus Round
- Importing declarative and setting up a table
- Creating records, adding and simple querying
- Record statuses, flushing and committing
- Rollback
- Querying - record objects, named tuples
- Aliases
- Filtering
- Ordering, selecting ranges, first/one/all
- Literal SQL
- Counting
- Declaring relationships with foreign keys
- Working with related records
- Querying with joins
- Table aliases
- Subqueries and mapping to entities
- exists, has, any
- Relationship operators
- Eager loading
- Joined load
- Deleting
- Cascading
- Many to many relationships
- What is your name?
- What is your favourite colour?
- Concurrent connections and avoiding deadlocks
- You can replace anything on any layer