SQLAlchemy is a popular SQL toolkit and ORM. A bridge between your application and database “that gives developers the full power and flexibility of SQL”. Understanding that real apps have complex database schemas and operations, you can automate and personalize it to your needs, all while avoiding much python code —and bugs. So much versatility can make, though, being effective in SQLAlchemy a daunting task.
In this tutorial we learn SQLAlchemy’s ORM by example, using snippets of a real open-source web app that the speaker built, relating to other tutorials and the official documentation: learning how to map classes with tables; setting-up, automating, and keeping data consistency with relationships and SQLAlchemy events; and implementing sessions, views, indexes, and natural search. All while taking advantage of SQLAlchemy’s SQL expressions and plugins; gracefully going to raw SQL when needed, and using Postgres as a rich database system.
Check the repository for instructions about getting the sample code and installing the required tools.
More to come…