CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/sqlite-python-best-practices

SQLite best practices for Python -- PRAGMAs per connection, context manager transactions, parameterized queries, row_factory, executemany, FK indexes

92

1.73x
Quality

90%

Does it follow best practices?

Impact

97%

1.73x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

Recipe Collection App

Problem/Feature Description

Build a backend for a personal recipe collection app using Python and Flask. Use SQLite as the database (this is a single-user app running locally).

The system needs:

  • Recipes: title, description, prep time in minutes, cook time in minutes, servings, difficulty level (easy/medium/hard), created and updated timestamps.
  • Ingredients: each recipe has multiple ingredients with name, quantity, and unit (e.g. "2 cups flour"). Ingredients belong to exactly one recipe. Deleting a recipe should delete its ingredients.
  • Tags: recipes can have multiple tags (e.g. "vegetarian", "quick", "dessert"). Tags are shared across recipes (many-to-many relationship).
  • CRUD for recipes including their ingredients (create recipe with ingredients in one operation, update recipe and replace its ingredients atomically).
  • Search recipes by tag, by ingredient name (partial match), or by title (partial match).
  • List recipes sorted by most recently updated.

Output Specification

Produce:

  • app/database.py -- Database connection and schema setup
  • app/models.py -- Data classes or Pydantic models
  • app/routes.py -- Flask route handlers
  • app/app.py -- Flask application factory
  • requirements.txt -- With dependencies

Complete Python code, no placeholders or TODO comments.

evals

tile.json