Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/sqlalchemy-2-0
Modern async ORM with type-safe models and efficient queries
Passed 22 of 24 test cases with the skill, and 21 of 24 without it.
1 fixed21 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I have a query fetching posts where each post has many tags. I want to eager-load the tags collection efficiently in a single async query execution without causing duplicate post rows due to SQL JOIN cartesian products. Which relationship loading option should I apply to the select query?
| Checked | Without skill | With skill |
|---|---|---|
| Uses selectinload option for loading the collection relationship. | Missed | Passed |
| Passes selectinload inside query options(). | Missed | Passed |
The instructions your model reads when the skill loads.
from sqlalchemy.ext.asyncio import AsyncAttrs, async_sessionmaker, create_async_engine, AsyncSession
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
import asyncio
# Base class for models
class Base(AsyncAttrs, DeclarativeBase):
pass
# Async engine
engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db")
# Session factory
async_session = async_sessionmaker(engine, expire_on_commit=False)
# Example model
class User(Base):
__tablename__ = "users"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(50))
email: Mapped[str] = mapped_column(String(100))
async def create_user(name: str, email: str) -> User:
async with async_session() as session:
async with session.begin():
user = User(name=name, email=email)
session.add(user)
await session.flush() # Get the ID
return user
test cases passed, vs 21 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.