A comprehensive chapter from Miguel Grinberg's SQLAlchemy 2 in Practice book covering the fundamentals of working with database tables using SQLAlchemy ORM. Topics include setting up the database engine, defining model classes with Python type hints, managing database metadata and naming conventions, using sessions for transactions, and executing queries with filters, ordering, aggregation, grouping, pagination, and indexes. Code examples use a RetroFun vintage computer catalog as a practical dataset throughout.

43m read timeFrom blog.miguelgrinberg.com
Post cover image
Table of contents
SQLAlchemy Core and SQLAlchemy ORMThe Database EngineModelsDatabase MetadataSessionsA First SQLALchemy ApplicationQueriesIndexesConstraintsDeletionsExercises

Sort: