Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/sqlmodel@0.0.x
tile.json

tessl/pypi-sqlmodel

tessl install tessl/pypi-sqlmodel@0.0.0

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

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1x

Baseline

Agent success rate without this tile

85%

task.mdevals/scenario-10/

Task Management Database

Build a simple task management database system that stores projects and their associated tasks.

Requirements

Create a database system that:

  1. Defines two data models:

    • A Project model with fields: id (integer, auto-generated), name (string), and description (optional string)
    • A Task model with fields: id (integer, auto-generated), title (string), completed (boolean, defaults to False), and project_id (integer, references Project)
  2. Initializes a SQLite database connection using an in-memory database (:memory:)

  3. Creates all necessary database tables based on the model definitions

  4. Provides a function setup_database() that returns a database session ready for use

Implementation

@generates

API

def setup_database():
    """
    Initialize the database connection, create all tables, and return a session.

    Returns:
        A database session object ready for operations
    """
    pass

Test Cases

  • The setup_database function successfully creates a database session @test
  • The Project table exists in the database after setup @test
  • The Task table exists in the database after setup @test
  • A Project can be inserted and retrieved from the database @test

Dependencies { .dependencies }

sqlmodel { .dependency }

Provides database modeling and SQL operations support.