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

task.mdevals/scenario-7/

Database Connection Pool Manager

A module that configures and manages database connection pooling for optimal performance in production environments.

Capabilities

Configure Production Connection Pool

  • Creates an engine with a pool size of 10 connections @test
  • Sets max overflow to 5 additional connections @test
  • Enables pool pre-ping to verify connection health @test

Configure Test Connection Pool

  • Creates an engine with a single static connection for testing @test
  • Test engine maintains one connection for test isolation @test

Pool Timeout Configuration

  • Sets pool timeout to 30 seconds for connection acquisition @test

Implementation

@generates

API

def create_production_engine(database_url: str):
    """
    Creates a database engine with production-ready connection pool settings.

    The engine should be configured with:
    - Pool size of 10 connections
    - Max overflow of 5 additional connections
    - Pool timeout of 30 seconds
    - Pre-ping enabled to verify connection health

    Args:
        database_url: Database connection string

    Returns:
        Database engine with production connection pool configuration
    """
    pass

def create_test_engine(database_url: str):
    """
    Creates a database engine with test-appropriate pool settings.

    The engine should use a single static connection suitable for testing.

    Args:
        database_url: Database connection string

    Returns:
        Database engine with single connection for testing
    """
    pass

Dependencies { .dependencies }

sqlmodel { .dependency }

Provides database engine creation and connection pooling functionality.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-sqlmodel

tile.json