SQLAlchemy Documentation¶
Getting Started
New to SQLAlchemy? Start here:
For Python Beginners: Installation Guide - basic guidance on installing with pip and similar
For Python Veterans: SQLAlchemy Overview - brief architectural overview
Tutorials
The SQLAlchemy 2.0 series represents a major rework of the classic 1.x SQLAlchemy APIs that have evolved over more than 15 years. The new tutorial is recommended for all new users as well as veterans of older SQLAlchemy versions alike.
For a quick glance: ORM Quick Start - a glimpse at what working with the ORM looks like
For all users: SQLAlchemy 2.0 Tutorial - SQLAlchemy 2.0’s main tutorial, for complete learning
Migration Notes
Migrating to SQLAlchemy 2.0 - Complete background on migrating from 1.3 or 1.4 to 2.0
Changelog catalog - Detailed changelogs for all SQLAlchemy Versions
Reference Documentation
SQLAlchemy ORM
ORM Configuration: Mapper Configuration | Relationship Configuration
ORM Usage: Session Usage and Guidelines | Querying Data, Loading Objects | AsyncIO Support
Configuration Extensions: Mypy integration | Association Proxy | Hybrid Attributes | Automap | Mutable Scalars | All extensions
Extending the ORM: ORM Events and Internals
Other: Introduction to Examples
SQLAlchemy Core
Engines, Connections, Pools: Engine Configuration | Connections, Transactions, Results | AsyncIO Support | Connection Pooling
Schema Definition: Overview | Tables and Columns | Database Introspection (Reflection) | Insert/Update Defaults | Constraints and Indexes | Using Data Definition Language (DDL)
SQL Reference: SQL Expression API docs
Datatypes: Overview | Building Custom Types | API
Core Basics: Overview | Runtime Inspection API | Event System | Core Event Interfaces | Creating Custom SQL Constructs
Dialect Documentation
The dialect is the system SQLAlchemy uses to communicate with various types of DBAPIs and databases. This section describes notes, options, and usage patterns regarding individual dialects.
PostgreSQL | MySQL | SQLite | Oracle | Microsoft SQL Server
Supplementary
Frequently Asked Questions - A collection of common problems and solutions
Glossary - Terms used in SQLAlchemy’s documentation
Error Message Guide - Explainations of many SQLAlchemy Errors