Async SQLAlchemy 2.x, pgvector semantic search, and Alembic migrations for this FastAPI/PostgreSQL stack. Activates automatically when working in backend/ or on database-related code.
Stack: async SQLAlchemy 2.x, asyncpg driver, pgvector (1536-dim IVFFlat), Alembic migrations.
expire_on_commit=False on AsyncSessionLocal — prevents MissingGreenlet errors after commituser_id = current_user.id (prevents IDOR)selectinload() or joinedload() explicitly on every relationshipALTER TABLE in application codepostgresql+asyncpg:// — never psycopg2 with async code