Skip to main content
Welcome to the SQLAlchemy API reference documentation. This section provides comprehensive documentation for all public APIs.

API Modules

ORM API

Session, declarative base, relationships, and ORM utilities

Core SQL

SQL expression language: select, insert, update, delete

Engine

Engine, Connection, Result, and execution APIs

Schema

MetaData, Table, Column, and constraints

Types

Data types: Integer, String, DateTime, and custom types

Connection Pool

Connection pooling strategies and configuration

Dialects

Database dialect system and dialect-specific APIs

Events

Event system and listeners

Most Used APIs

Engine & Connection:
  • create_engine() - Create a database engine
  • Engine.connect() - Get a connection
  • Connection.execute() - Execute statements
ORM:
  • Session - ORM session for persistence
  • DeclarativeBase - Base class for mapped classes
  • relationship() - Define relationships
  • mapped_column() - Define mapped columns
Core SQL:
  • select() - Build SELECT statements
  • insert() - Build INSERT statements
  • update() - Build UPDATE statements
  • delete() - Build DELETE statements
Schema:
  • MetaData - Schema metadata container
  • Table - Table definition
  • Column - Column definition

API Conventions

All public APIs are exported from the top-level sqlalchemy package. Import them directly:
from sqlalchemy import create_engine, select, Column, Integer
from sqlalchemy.orm import Session, DeclarativeBase, relationship

Version Information

This documentation covers SQLAlchemy 2.0+. For information on migrating from 1.x, see the official migration guide.
Some APIs marked as deprecated in 2.0 will be removed in future versions. Use modern alternatives where indicated.