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
SQLAlchemy and Alembic 2 · Querying
Look up one object by primary key; it returns None if missing.
user = session.get(User, 1)
Official SQLAlchemy and Alembic 2 documentation
Was this page helpful?