CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/sqlalchemy-best-practices

SQLAlchemy patterns — engine setup, session management, declarative models,

98

1.96x
Quality

99%

Does it follow best practices?

Impact

98%

1.96x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Async Notification Service

Build an async notification service using SQLAlchemy and FastAPI. The service manages user notifications.

Domain

  • User: name, email (unique), created_at
  • Notification: message (text), is_read (boolean, default false), created_at, belongs to a user

Requirements

Produce Python files in a src/ directory:

  • src/database.py -- async engine configuration, async session factory, Base class, and async session dependency for FastAPI
  • src/models.py -- User and Notification ORM models with their relationship
  • src/main.py -- FastAPI app with these endpoints:
    • POST /notifications -- accepts JSON with user_id and message, creates a notification
    • GET /users/{user_id}/notifications -- returns all unread notifications for the user
    • PATCH /notifications/{notification_id}/read -- marks a notification as read

No test files, no migration files.

evals

scenario-1

criteria.json

task.md

tile.json