sql

Commands for running SQL and capturing query plans against a Microsoft Fabric Data Warehouse or SQL Analytics Endpoint. A query plan shows how the database intends to execute a query.

In plain words
What is it for?
Run inline or file-based SQL, return query results, and capture execution plans for database troubleshooting and analysis.
Why use it?
They provide one place to execute SQL statements or files and examine how queries are processed, including multi-statement batches.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/sdebruyn/fabric-dw-mcp-cli/sql
Clone the repo
git clone --depth 1 https://github.com/sdebruyn/fabric-dw-mcp-cli
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,747 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03747
Opus 5 $0.00000 $0.01873
Sonnet 5 $0.00000 $0.00749
Haiku 4.5 $0.00000 $0.00375

Measured 2d ago against content hash 4b3e9ce7a084, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/sql.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Running SQL

SQL execution and query-plan capture against a Fabric Data Warehouse or SQL Analytics Endpoint.

Targets: Data Warehouse / SQL Analytics Endpoint

CLI

sql exec

Execute a SQL statement or file against a warehouse or SQL Analytics Endpoint. Provide the query via -q/--query or -f/--file (not both). Multi-statement batches are supported; the CLI keeps the last result set that has a column list (i.e. the last query), not the last statement. A batch that ends with DDL/DML after a query, such as SELECT id FROM t; UPDATE t SET x = 1;, shows the SELECT result and does not separately report that the UPDATE ran. A statement with no result set at all (DDL/DML with nothing else in the batch) returns empty columns and rows.

!!! warning

This command executes arbitrary SQL, including DDL and DML. Ensure you have the correct target before running destructive statements.

Synopsis

fdw [-w WORKSPACE] sql exec [OPTIONS] [ITEM]
Option Description
-q / --query TEXT SQL statement or batch to execute inline.
-f / --file PATH Path to a .sql file to execute. UTF-8 and UTF-8 BOM files are both supported.
--watch SECONDS Re-execute and redraw every positive number of seconds. Cannot be combined with --json.

Output defaults to a Rich table (rows/columns). Pass --json on the root command to emit machine-readable JSON ({"columns": [...], "rows": [...], "rowcount": N}).

Whether a Query executed successfully. rowcount=N message or a table is shown depends on the returned result set (see above), not on whether it has any rows. A SELECT that matches nothing still returns its column list, so it renders as a table with headers and a (0 rows) line underneath; the rowcount=N message only appears when no result set with columns was returned at all. When the columns are too wide to fit the terminal, the empty table is replaced by a wrapped Columns: ... list, still followed by (0 rows), so the column names stay readable instead of being truncated inside a table cell.

Read the full file on GitHub · 277 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 277 lines · 0 tokens per session scan A 4b3e9ce7a084

Subscribe to this mod's changes

sql is a command published in the GitHub repository sdebruyn/fabric-dw-mcp-cli (10 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,747 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.