Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides patterns for managing database sessions via get_db() and defining ORM models on a Base class.
18% 100%+82 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 4 of 22 without it.
We are deploying an update to production and need to run all pending database migrations using Alembic. What exact command should be executed?
The command is python -m alembic upgrade head
3 of 3 safety checks passed
This skill covers patterns for managing database sessions and models.
Trigger: Load when working with database interactions.
| Task | Pattern |
|---|---|
| Create a database session | get_db() |
| Define a database model | Base |
get_db() to create a session for database operations.Base to define your database models.Use get_db() to create a session for database operations, ensuring proper management of database connections.
from apps.server.app.models.database import get_db
async def some_database_operation():
async with get_db() as session:
# Perform database operations
pass
Utilize Base to define your database models, which will serve as the foundation for your ORM mappings.
Next to this one in the catalogue, plus more from the same author.