© 2026 Hashnode
from collections.abc import AsyncGenerator import uuid # UUID = Universally Unique Identifier. from sqlalchemy import Column , String , Text , DateTime , ForeignKey from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.ext.asyncio impo...

The Nightmare Scenario Your FastAPI app runs perfectly on your local machine. You deploy it to production. It works fine for a few hours. Then, suddenly, requests start hanging. Your logs are flooded with this error: Plaintext sqlalchemy.exc.TimeoutE...

If you recently upgraded to SQLAlchemy 2.0 and suddenly saw AttributeError: 'AsyncSession' object has no attribute 'query', nothing is actually broken. This error appears because SQLAlchemy 2.0 removed legacy query patterns entirely and async session...

Introduction If you’re using FastAPI with SQLAlchemy 2.0 async and suddenly hit a MissingGreenlet error, you’re not alone. This error usually appears when async database calls are executed outside the proper event loop context -often due to incorrect...

Introduction Building async APIs with FastAPI and SQLAlchemy 2.0 looks straightforward in tutorials, until you deploy to production. Suddenly you start seeing issues like random MissingGreenlet errors, confusing async session behavior, blocked event ...
