SQLAlchemy and Alembic 2 · Querying

Get by primary key

Look up one object by primary key; it returns None if missing.

user = session.get(User, 1)

Official SQLAlchemy and Alembic 2 documentation

More querying commands

All querying commands · SQLAlchemy and Alembic 2 cheatsheet

Was this page helpful?