# SQLAlchemy 2.0 Documentation

# SQLAlchemy 2.0 Documentation

# Table of Contents

Full table of contents.  For a high level overview of all
documentation, see [SQLAlchemy Documentation](https://docs.sqlalchemy.org/en/20/index.html).

- [Overview](https://docs.sqlalchemy.org/en/20/intro.html)
- [SQLAlchemy Unified Tutorial](https://docs.sqlalchemy.org/en/20/tutorial/index.html)
  - [Establishing Connectivity - the Engine](https://docs.sqlalchemy.org/en/20/tutorial/engine.html)
  - [Working with Transactions and the DBAPI](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html)
  - [Working with Database Metadata](https://docs.sqlalchemy.org/en/20/tutorial/metadata.html)
  - [Working with Data](https://docs.sqlalchemy.org/en/20/tutorial/data.html)
    - [Using INSERT Statements](https://docs.sqlalchemy.org/en/20/tutorial/data_insert.html)
    - [Using SELECT Statements](https://docs.sqlalchemy.org/en/20/tutorial/data_select.html)
    - [Using UPDATE and DELETE Statements](https://docs.sqlalchemy.org/en/20/tutorial/data_update.html)
  - [Data Manipulation with the ORM](https://docs.sqlalchemy.org/en/20/tutorial/orm_data_manipulation.html)
  - [Working with ORM Related Objects](https://docs.sqlalchemy.org/en/20/tutorial/orm_related_objects.html)
  - [Further Reading](https://docs.sqlalchemy.org/en/20/tutorial/further_reading.html)
- [SQLAlchemy ORM](https://docs.sqlalchemy.org/en/20/orm/index.html)
  - [ORM Quick Start](https://docs.sqlalchemy.org/en/20/orm/quickstart.html)
  - [ORM Mapped Class Configuration](https://docs.sqlalchemy.org/en/20/orm/mapper_config.html)
    - [ORM Mapped Class Overview](https://docs.sqlalchemy.org/en/20/orm/mapping_styles.html)
    - [Mapping Classes with Declarative](https://docs.sqlalchemy.org/en/20/orm/declarative_mapping.html)
      - [Declarative Mapping Styles](https://docs.sqlalchemy.org/en/20/orm/declarative_styles.html)
      - [Table Configuration with Declarative](https://docs.sqlalchemy.org/en/20/orm/declarative_tables.html)
      - [Mapper Configuration with Declarative](https://docs.sqlalchemy.org/en/20/orm/declarative_config.html)
      - [Composing Mapped Hierarchies with Mixins](https://docs.sqlalchemy.org/en/20/orm/declarative_mixins.html)
    - [Integration with dataclasses and attrs](https://docs.sqlalchemy.org/en/20/orm/dataclasses.html)
    - [SQL Expressions as Mapped Attributes](https://docs.sqlalchemy.org/en/20/orm/mapped_sql_expr.html)
    - [Changing Attribute Behavior](https://docs.sqlalchemy.org/en/20/orm/mapped_attributes.html)
    - [Composite Column Types](https://docs.sqlalchemy.org/en/20/orm/composites.html)
    - [Mapping Class Inheritance Hierarchies](https://docs.sqlalchemy.org/en/20/orm/inheritance.html)
    - [Non-Traditional Mappings](https://docs.sqlalchemy.org/en/20/orm/nonstandard_mappings.html)
    - [Configuring a Version Counter](https://docs.sqlalchemy.org/en/20/orm/versioning.html)
    - [Class Mapping API](https://docs.sqlalchemy.org/en/20/orm/mapping_api.html)
    - [Mapping SQL Expressions](https://docs.sqlalchemy.org/en/20/orm/scalar_mapping.html)
      - [Mapping Table Columns](https://docs.sqlalchemy.org/en/20/orm/mapping_columns.html)
  - [Relationship Configuration](https://docs.sqlalchemy.org/en/20/orm/relationships.html)
    - [Basic Relationship Patterns](https://docs.sqlalchemy.org/en/20/orm/basic_relationships.html)
    - [Adjacency List Relationships](https://docs.sqlalchemy.org/en/20/orm/self_referential.html)
    - [Configuring how Relationship Joins](https://docs.sqlalchemy.org/en/20/orm/join_conditions.html)
    - [Working with Large Collections](https://docs.sqlalchemy.org/en/20/orm/large_collections.html)
    - [Collection Customization and API Details](https://docs.sqlalchemy.org/en/20/orm/collection_api.html)
    - [Special Relationship Persistence Patterns](https://docs.sqlalchemy.org/en/20/orm/relationship_persistence.html)
    - [Using the legacy ‘backref’ relationship parameter](https://docs.sqlalchemy.org/en/20/orm/backref.html)
    - [Relationships API](https://docs.sqlalchemy.org/en/20/orm/relationship_api.html)
  - [ORM Querying Guide](https://docs.sqlalchemy.org/en/20/orm/queryguide/index.html)
    - [Writing SELECT statements for ORM Mapped Classes](https://docs.sqlalchemy.org/en/20/orm/queryguide/select.html)
    - [Writing SELECT statements for Inheritance Mappings](https://docs.sqlalchemy.org/en/20/orm/queryguide/inheritance.html)
    - [ORM-Enabled INSERT, UPDATE, and DELETE statements](https://docs.sqlalchemy.org/en/20/orm/queryguide/dml.html)
    - [Column Loading Options](https://docs.sqlalchemy.org/en/20/orm/queryguide/columns.html)
    - [Relationship Loading Techniques](https://docs.sqlalchemy.org/en/20/orm/queryguide/relationships.html)
    - [ORM API Features for Querying](https://docs.sqlalchemy.org/en/20/orm/queryguide/api.html)
    - [Legacy Query API](https://docs.sqlalchemy.org/en/20/orm/queryguide/query.html)
  - [Using the Session](https://docs.sqlalchemy.org/en/20/orm/session.html)
    - [Session Basics](https://docs.sqlalchemy.org/en/20/orm/session_basics.html)
    - [State Management](https://docs.sqlalchemy.org/en/20/orm/session_state_management.html)
    - [Cascades](https://docs.sqlalchemy.org/en/20/orm/cascades.html)
    - [Transactions and Connection Management](https://docs.sqlalchemy.org/en/20/orm/session_transaction.html)
    - [Additional Persistence Techniques](https://docs.sqlalchemy.org/en/20/orm/persistence_techniques.html)
    - [Contextual/Thread-local Sessions](https://docs.sqlalchemy.org/en/20/orm/contextual.html)
    - [Tracking queries, object and Session Changes with Events](https://docs.sqlalchemy.org/en/20/orm/session_events.html)
    - [Session API](https://docs.sqlalchemy.org/en/20/orm/session_api.html)
  - [Events and Internals](https://docs.sqlalchemy.org/en/20/orm/extending.html)
    - [ORM Events](https://docs.sqlalchemy.org/en/20/orm/events.html)
    - [ORM Internals](https://docs.sqlalchemy.org/en/20/orm/internals.html)
    - [ORM Exceptions](https://docs.sqlalchemy.org/en/20/orm/exceptions.html)
  - [ORM Extensions](https://docs.sqlalchemy.org/en/20/orm/extensions/index.html)
    - [Asynchronous I/O (asyncio)](https://docs.sqlalchemy.org/en/20/orm/extensions/asyncio.html)
    - [Association Proxy](https://docs.sqlalchemy.org/en/20/orm/extensions/associationproxy.html)
    - [Automap](https://docs.sqlalchemy.org/en/20/orm/extensions/automap.html)
    - [Baked Queries](https://docs.sqlalchemy.org/en/20/orm/extensions/baked.html)
    - [Declarative Extensions](https://docs.sqlalchemy.org/en/20/orm/extensions/declarative/index.html)
    - [Mypy  / Pep-484 Support for ORM Mappings](https://docs.sqlalchemy.org/en/20/orm/extensions/mypy.html)
    - [Mutation Tracking](https://docs.sqlalchemy.org/en/20/orm/extensions/mutable.html)
    - [Ordering List](https://docs.sqlalchemy.org/en/20/orm/extensions/orderinglist.html)
    - [Horizontal Sharding](https://docs.sqlalchemy.org/en/20/orm/extensions/horizontal_shard.html)
    - [Hybrid Attributes](https://docs.sqlalchemy.org/en/20/orm/extensions/hybrid.html)
    - [Indexable](https://docs.sqlalchemy.org/en/20/orm/extensions/indexable.html)
    - [Alternate Class Instrumentation](https://docs.sqlalchemy.org/en/20/orm/extensions/instrumentation.html)
  - [ORM Examples](https://docs.sqlalchemy.org/en/20/orm/examples.html)
- [SQLAlchemy Core](https://docs.sqlalchemy.org/en/20/core/index.html)
  - [SQL Statements and Expressions API](https://docs.sqlalchemy.org/en/20/core/expression_api.html)
    - [Column Elements and Expressions](https://docs.sqlalchemy.org/en/20/core/sqlelement.html)
    - [Operator Reference](https://docs.sqlalchemy.org/en/20/core/operators.html)
    - [SELECT and Related Constructs](https://docs.sqlalchemy.org/en/20/core/selectable.html)
    - [Insert, Updates, Deletes](https://docs.sqlalchemy.org/en/20/core/dml.html)
    - [SQL and Generic Functions](https://docs.sqlalchemy.org/en/20/core/functions.html)
    - [Custom SQL Constructs and Compilation Extension](https://docs.sqlalchemy.org/en/20/core/compiler.html)
    - [Expression Serializer Extension](https://docs.sqlalchemy.org/en/20/core/serializer.html)
    - [SQL Expression Language Foundational Constructs](https://docs.sqlalchemy.org/en/20/core/foundation.html)
    - [Visitor and Traversal Utilities](https://docs.sqlalchemy.org/en/20/core/visitors.html)
  - [Schema Definition Language](https://docs.sqlalchemy.org/en/20/core/schema.html)
    - [Describing Databases with MetaData](https://docs.sqlalchemy.org/en/20/core/metadata.html)
    - [Reflecting Database Objects](https://docs.sqlalchemy.org/en/20/core/reflection.html)
    - [Column INSERT/UPDATE Defaults](https://docs.sqlalchemy.org/en/20/core/defaults.html)
    - [Defining Constraints and Indexes](https://docs.sqlalchemy.org/en/20/core/constraints.html)
    - [Customizing DDL](https://docs.sqlalchemy.org/en/20/core/ddl.html)
  - [SQL Datatype Objects](https://docs.sqlalchemy.org/en/20/core/types.html)
    - [The Type Hierarchy](https://docs.sqlalchemy.org/en/20/core/type_basics.html)
    - [Custom Types](https://docs.sqlalchemy.org/en/20/core/custom_types.html)
    - [Base Type API](https://docs.sqlalchemy.org/en/20/core/type_api.html)
  - [Engine and Connection Use](https://docs.sqlalchemy.org/en/20/core/engines_connections.html)
    - [Engine Configuration](https://docs.sqlalchemy.org/en/20/core/engines.html)
    - [Working with Engines and Connections](https://docs.sqlalchemy.org/en/20/core/connections.html)
    - [Connection Pooling](https://docs.sqlalchemy.org/en/20/core/pooling.html)
    - [Core Events](https://docs.sqlalchemy.org/en/20/core/events.html)
  - [Core API Basics](https://docs.sqlalchemy.org/en/20/core/api_basics.html)
    - [Events](https://docs.sqlalchemy.org/en/20/core/event.html)
    - [Runtime Inspection API](https://docs.sqlalchemy.org/en/20/core/inspection.html)
    - [Core Exceptions](https://docs.sqlalchemy.org/en/20/core/exceptions.html)
    - [Core Internals](https://docs.sqlalchemy.org/en/20/core/internals.html)
- [Dialects](https://docs.sqlalchemy.org/en/20/dialects/index.html)
  - [PostgreSQL](https://docs.sqlalchemy.org/en/20/dialects/postgresql.html)
  - [MySQL and MariaDB](https://docs.sqlalchemy.org/en/20/dialects/mysql.html)
  - [SQLite](https://docs.sqlalchemy.org/en/20/dialects/sqlite.html)
  - [Oracle](https://docs.sqlalchemy.org/en/20/dialects/oracle.html)
  - [Microsoft SQL Server](https://docs.sqlalchemy.org/en/20/dialects/mssql.html)
- [Frequently Asked Questions](https://docs.sqlalchemy.org/en/20/faq/index.html)
  - [Installation](https://docs.sqlalchemy.org/en/20/faq/installation.html)
  - [Connections / Engines](https://docs.sqlalchemy.org/en/20/faq/connections.html)
  - [MetaData / Schema](https://docs.sqlalchemy.org/en/20/faq/metadata_schema.html)
  - [SQL Expressions](https://docs.sqlalchemy.org/en/20/faq/sqlexpressions.html)
  - [ORM Configuration](https://docs.sqlalchemy.org/en/20/faq/ormconfiguration.html)
  - [Performance](https://docs.sqlalchemy.org/en/20/faq/performance.html)
  - [Sessions / Queries](https://docs.sqlalchemy.org/en/20/faq/sessions.html)
  - [Third Party Integration Issues](https://docs.sqlalchemy.org/en/20/faq/thirdparty.html)
- [Error Messages](https://docs.sqlalchemy.org/en/20/errors.html)
- [Changes and Migration](https://docs.sqlalchemy.org/en/20/changelog/index.html)
  - [SQLAlchemy 2.0 - Major Migration Guide](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html)
  - [What’s New in SQLAlchemy 2.0?](https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html)
  - [2.0 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html)
  - [1.4 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_14.html)
  - [1.3 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_13.html)
  - [1.2 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_12.html)
  - [1.1 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_11.html)
  - [1.0 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_10.html)
  - [0.9 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_09.html)
  - [0.8 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_08.html)
  - [0.7 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_07.html)
  - [0.6 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_06.html)
  - [0.5 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_05.html)
  - [0.4 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_04.html)
  - [0.3 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_03.html)
  - [0.2 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_02.html)
  - [0.1 Changelog](https://docs.sqlalchemy.org/en/20/changelog/changelog_01.html)
  - [What’s New in SQLAlchemy 1.4?](https://docs.sqlalchemy.org/en/20/changelog/migration_14.html)
  - [What’s New in SQLAlchemy 1.3?](https://docs.sqlalchemy.org/en/20/changelog/migration_13.html)
  - [What’s New in SQLAlchemy 1.2?](https://docs.sqlalchemy.org/en/20/changelog/migration_12.html)
  - [What’s New in SQLAlchemy 1.1?](https://docs.sqlalchemy.org/en/20/changelog/migration_11.html)
  - [What’s New in SQLAlchemy 1.0?](https://docs.sqlalchemy.org/en/20/changelog/migration_10.html)
  - [What’s New in SQLAlchemy 0.9?](https://docs.sqlalchemy.org/en/20/changelog/migration_09.html)
  - [What’s New in SQLAlchemy 0.8?](https://docs.sqlalchemy.org/en/20/changelog/migration_08.html)
  - [What’s New in SQLAlchemy 0.7?](https://docs.sqlalchemy.org/en/20/changelog/migration_07.html)
  - [What’s New in SQLAlchemy 0.6?](https://docs.sqlalchemy.org/en/20/changelog/migration_06.html)
  - [What’s new in SQLAlchemy 0.5?](https://docs.sqlalchemy.org/en/20/changelog/migration_05.html)
  - [What’s new in SQLAlchemy 0.4?](https://docs.sqlalchemy.org/en/20/changelog/migration_04.html)

## Indices and tables

- [Glossary](https://docs.sqlalchemy.org/en/20/glossary.html#glossary)
- [Index](https://docs.sqlalchemy.org/en/20/genindex.html)
