CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-connectorx

Load data from databases to dataframes, the fastest way.

86

1.04x

Quality

Pending

Does it follow best practices?

Impact

86%

1.04x

Average score across 10 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-4/

Database Schema Inspector

A utility tool that retrieves and validates database schema information without loading actual data.

Capabilities

Schema Retrieval

Retrieve column names and data types from a database query without fetching the actual data rows.

  • Given connection string "sqlite:///:memory:" and query "SELECT 1 as id, 'test' as name", return {"id": "Int64", "name": "object"} @test
  • Given connection string "sqlite:///:memory:" and query selecting from a table with columns (id INTEGER, price REAL, description TEXT), return correct schema with three entries @test

Schema Comparison

Compare schemas from two queries to identify structural differences.

  • Given two queries with columns (id, name) and (id, email) respectively, return comparison showing "id" as common and "name", "email" as unique @test

Error Handling

Handle invalid queries appropriately when retrieving schema.

  • Given query "SELECT * FROM nonexistent_table", raise an exception @test

Implementation

@generates

API

def get_schema(connection_string: str, query: str) -> dict[str, str]:
    """
    Retrieve the schema (column names and types) from a database query.

    Args:
        connection_string: Database connection string
        query: SQL query to inspect

    Returns:
        Dictionary mapping column names to their data type names

    Raises:
        Exception: If the connection fails or query is invalid
    """
    pass

def compare_schemas(connection_string: str, query1: str, query2: str) -> dict[str, list[str]]:
    """
    Compare schemas from two queries.

    Args:
        connection_string: Database connection string
        query1: First SQL query
        query2: Second SQL query

    Returns:
        Dictionary with keys:
        - 'common': List of column names present in both queries
        - 'only_query1': List of column names only in query1
        - 'only_query2': List of column names only in query2
    """
    pass

Dependencies { .dependencies }

connectorx { .dependency }

Provides high-performance database connectivity and metadata retrieval capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-connectorx

tile.json