# Sqlpysim

> Sqlpysim is an open-source agent skill for databases. Runs SQL queries and multi-threaded workloads from Python using mssql-python. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/microsoft/sqlsimtools/tree/main/.github/skills/sqlpysim
- **Repository:** https://github.com/microsoft/sqlsimtools
- **GitHub stars:** 50
- **License:** MIT
- **Skill name:** sqlpysim
- **Collection:** https://github.com/microsoft/sqlsimtools
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-03

## About

sqlpysim is a Python port of the sqlsim load and query tool, built on Microsoft's native mssql-python driver. It gives an agent a way to run single queries, SQL script files and multi-threaded workloads against SQL Server and Azure SQL from a Python environment, with options for quiet output, JSON results written to a file, and mixed workload groups loaded from a sqlsim-format workload file.

The skill tells the agent how to resolve the entry point, either a sqlpysim.py copy in the workspace or an installed sqlpysim command, and to install the release requirements before running anything. It includes canonical command patterns for Windows authentication, Azure access tokens passed through stdin, live progress streaming as newline-delimited JSON, and periodic query-statistic snapshots written to a file during a run.

The skill sets rules for the agent: keep secrets out of process arguments, do not set the reserved application name, treat sqlpysim JSON as separate from sqlsim JSON, and start load tests with small thread counts while watching client and server resources. Running it requires Python, the sqlpysim release and access to a SQL Server or Azure SQL instance.

## When your agent uses it

> Public Preview Python-based port of sqlsim built on Microsoft's native `mssql-python` driver. USE FOR — running SQL queries, scripts, and multi-threaded workloads from Python environments; mixed workload files (`-workload`); live progress streaming (`-stream-json`); periodic query-statistic snapshots (`-querystats-interval`); comparing driver behavior between native ODBC (sqlsim) and `mssql-python`; producing sqlpysim JSON for automation. DO NOT USE FOR — sqlsim-only replay modes; setting an application name (`-app`, which the driver reserves); exact cross-tool JSON compatibility; or performance comparisons that require the lowest possible client overhead (use sqlsim instead).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/microsoft/sqlsimtools/tree/HEAD/.github/skills/sqlpysim)
- [License: MIT](https://github.com/microsoft/sqlsimtools/tree/HEAD/.github/skills/sqlpysim)

## Features

- **Single query execution:** Runs an inline query or a SQL script file against a SQL Server or Azure SQL database.
- **Multi-threaded workloads:** Runs queries across several threads with set thread counts and repetition counts.
- **Mixed workload groups:** Loads grouped workloads from a sqlsim-format workload file.
- **Live progress streaming:** Emits one JSON event per line during a run for a supervising process to read.
- **Query statistic snapshots:** Writes periodic server-side query statistics to a file while a run is in progress.
- **Token and secure password input:** Passes Azure access tokens or passwords through stdin so secrets stay out of process arguments.

## Good for

- Run a SQL script against a local SQL Server with Windows authentication
- Load test an Azure SQL database with several threads and collect JSON results
- Replay a mixed workload file from a sqlsim-format definition
- Stream live progress from a long benchmark run to a monitoring script
- Compare driver behavior between native ODBC sqlsim and mssql-python

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/sqlpysim` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/sqlsimtools.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/sqlpysim &&
cp -R "$tmp/.github/skills/sqlpysim" ~/.claude/skills/sqlpysim &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/sqlpysim` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/sqlpysim` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/sqlsimtools.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/sqlpysim &&
cp -R "$tmp/.github/skills/sqlpysim" ~/.agents/skills/sqlpysim &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/sqlpysim` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/sqlpysim` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/sqlsimtools.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/sqlpysim &&
cp -R "$tmp/.github/skills/sqlpysim" ~/.cursor/skills/sqlpysim &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/sqlpysim` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/microsoft/sqlsimtools.git --path .github/skills/sqlpysim
```

Or copy the folder to `~/.gemini/skills/sqlpysim` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/sqlpysim`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/sqlsimtools.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/sqlpysim &&
cp -R "$tmp/.github/skills/sqlpysim" ~/.copilot/skills/sqlpysim &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/sqlpysim` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/microsoft/sqlsimtools.git
```

Then copy `sqlsimtools/.github/skills/sqlpysim` into your agent's skills folder as `sqlpysim`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Sqlpysim runs?

A sqlpysim release installed in the workspace with its Python requirements, or an installed sqlpysim command on PATH. The skill itself supplies agent guidance only, not the runtime.

### Can Sqlpysim set an application name?

No. The -app option is rejected because mssql-python reserves the application name and always reports MSSQL-Python. The skill advises using sqlsim when the application name matters.

### How does live progress work?

With -stream-json, sqlpysim prints one JSON event per line on stdout. Events are cumulative, so the current rate has to be computed from differences between events.

### Does Sqlpysim write query statistics to a file during a run?

Yes, with -querystats-interval it writes periodic snapshots to a file, defaulting to querystats-live.json, and the run continues even if a write fails.

### How do I install Sqlpysim in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/sqlpysim to use it in all your projects, or to .claude/skills/sqlpysim in one project.

### Does Sqlpysim run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Sqlpysim?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Sqlpysim?

The closest alternatives to Sqlpysim are Sqlsim, SQL optimization, Azure cosmos db py, SQL server table reconciliation and Azure data tables py.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Sqlsim](https://ai-powered.com/skills/sqlsim): Sqlsim is an open-source agent skill for databases.
- [SQL optimization](https://ai-powered.com/skills/sql-optimization): SQL optimization is an open-source agent skill for databases.
- [Azure cosmos db py](https://ai-powered.com/skills/azure-cosmos-db-py): Azure cosmos db py is an open-source agent skill for cloud and infrastructure.
- [SQL server table reconciliation](https://ai-powered.com/skills/sql-server-table-reconciliation): SQL server table reconciliation is an open-source agent skill for databases.
- [Azure data tables py](https://ai-powered.com/skills/azure-data-tables-py): Azure data tables py is an open-source agent skill for cloud and infrastructure.
- [Azure cosmos py](https://ai-powered.com/skills/azure-cosmos-py): Azure cosmos py is an open-source agent skill for cloud and infrastructure.
- [Cloud SQL basics](https://ai-powered.com/skills/cloud-sql-basics): Cloud SQL basics is an open-source agent skill for databases.
- [Azure resource manager SQL dotnet](https://ai-powered.com/skills/azure-resource-manager-sql-dotnet): Azure resource manager SQL dotnet is an open-source agent skill for databases.

---
Source: https://ai-powered.com/skills/sqlpysim
