liveBook · Manning

SQLAlchemy

SQLAlchemy is a Python SQL toolkit and object-relational mapping library for connecting to and working with relational databases.

How 4 Manning books explain it

The Well-Grounded Python Developer: How the pros use Python and Flask

SQLAlchemy is a Python SQL toolkit and object-relational mapping library for working with relational databases.

How it is used
Uses SQLAlchemy to persist application data and work with related database records as Python objects.
How deep it goes
Explains ORM benefits and class-based models through application examples; defers detailed SQLAlchemy treatment during the initial authentication setup.
Examples
Uses invoice data, SQLite-backed user records, and a parent-child post model to illustrate mapping and persistence.
What you can do after
Apply it via Flask-SQLAlchemy to define database models and work with persistent, related records in Python.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains SQLAlchemy →

Build Python Web Apps with Streamlit

SQLAlchemy is a Python database toolkit and object-relational mapping library that provides database connectivity, SQL execution, and transaction management.

How it is used
Uses SQLAlchemy behind Streamlit’s database connection to support programmatic queries and changes in a PostgreSQL app.
How deep it goes
Shows a reusable query wrapper with parameter passing, commits, and rollbacks, without developing object-relational mapping.
Examples
Uses a Database class and a SELECT query that displays stored haikus with st.write.
What you can do after
Apply it via Streamlit’s st.connection to execute parameterized queries and manage write transactions.

Read how Build Python Web Apps with Streamlit explains SQLAlchemy →

Build Financial Software with Generative AI (From Scratch)

SQLAlchemy is a Python library and ORM toolkit for working with relational databases through SQL expressions and mapped objects.

How it is used
Simplifies relational-database code while fitting testing, table design, and API construction into an ACH-file workflow.
How deep it goes
Contrasts ORM benefits and limitations with direct SQL but stops short of detailed SQLAlchemy implementation.
Examples
Uses an ACH-file schema, PlantUML table definition, and table-relationship diagram as concrete design artifacts.
What you can do after
Apply it via SQLAlchemy after comparing direct SQL, project standards, query complexity, and maintenance costs.

Read how Build Financial Software with Generative AI (From Scratch) explains SQLAlchemy →

The Quick Python Book, Fourth Edition

SQLAlchemy is a Python SQL toolkit and object-relational mapping library for connecting to and working with relational databases.

How it is used
Automates database tasks while providing Python object interfaces and continued access to SQL.
How deep it goes
Demonstrates setup and basic CRUD through tables and declarative objects, without descending into ORM internals.
Examples
Uses a SQLite people table to insert, query, filter, update, add, modify, and delete records.
What you can do after
Apply it via engines, sessions, table definitions, and declarative classes to perform relational database CRUD.

Read how The Quick Python Book, Fourth Edition explains SQLAlchemy →

Also covered in

What to know first

Related concepts

Questions about SQLAlchemy

What is SQLAlchemy?

SQLAlchemy is a Python SQL toolkit and object-relational mapping library for connecting to and working with relational databases.

Which Manning books explain SQLAlchemy?

The Well-Grounded Python Developer: How the pros use Python and Flask, Build Python Web Apps with Streamlit, Build Financial Software with Generative AI (From Scratch) and The Quick Python Book, Fourth Edition.

What should I know before learning SQLAlchemy?

Manning books that teach SQLAlchemy usually introduce Python and SQL first.

What is SQLAlchemy a kind of?

SQLAlchemy is a kind of object-relational mapper. An object-relational mapper is software that maps between programming-language objects and operations and relational database structures and operations.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.