CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-sqlmodel

SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.

Overall
score

85%

Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "context": "This criteria evaluates the engineer's ability to use SQLModel's relationship loading strategies to optimize database queries. It focuses on proper usage of the Relationship() function with sa_relationship_kwargs parameter and understanding of different lazy loading strategies.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Model Definition",
      "description": "Both Hero and Team models are defined as SQLModel classes with table=True parameter. Models include all required fields with proper type annotations and Field() usage for primary keys.",
      "max_score": 15
    },
    {
      "name": "Relationship Setup",
      "description": "Uses Relationship() function to define bidirectional relationships between Hero and Team models. Includes back_populates parameter to establish the bidirectional link.",
      "max_score": 20
    },
    {
      "name": "Default Lazy Loading",
      "description": "Implements get_hero_with_team_lazy using session.get() or session.exec() with select() to retrieve the hero. The relationship allows default lazy loading behavior (team loads on access).",
      "max_score": 15
    },
    {
      "name": "Joined Loading",
      "description": "Implements get_team_with_heroes_joined by configuring Relationship() with sa_relationship_kwargs={'lazy': 'joined'}, or uses selectinload/joinedload from SQLAlchemy to load heroes in a single query.",
      "max_score": 25
    },
    {
      "name": "Selectin Loading",
      "description": "Implements get_all_teams_with_heroes_selectin by configuring Relationship() with sa_relationship_kwargs={'lazy': 'selectin'}, ensuring heroes are loaded efficiently in a separate SELECT query for all teams.",
      "max_score": 25
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-sqlmodel

tile.json