/fabric-data-warehouse:warehouse-query <description> [--view] [--cte] [--cross-db]from fabric-data-warehouse
Generates optimized T-SQL queries, views, or CTEs for Microsoft Fabric Data Warehouse from a natural-language description. Supports --view, --cte, and --cross-db flags.
Ships in fabric-data-warehouse. Installing the plugin adds it to Claude Code.
Create an optimized T-SQL query, view, or CTE based on a natural-language description.
<description> — What the query should return (e.g., "monthly sales by product category with year-over-year comparison").--view — Wrap the query in a CREATE VIEW rpt.<name> statement.--cte — Structure the query using CTEs for readability.--cross-db — The query spans multiple databases (warehouse + lakehouse or warehouse + warehouse).Based on the description, identify:
If the tables are not obvious, ask the user or scan existing SQL files in the project for table definitions.
Query optimization rules (always apply):
SELECT * — list specific columns.WHERE filters as early as possible, especially on date columns.DECIMAL for currency calculations, never FLOAT.APPROX_COUNT_DISTINCT for approximate large-cardinality counts.LEFT JOIN over subqueries for nullable dimension lookups.ISNULL() or COALESCE() for NULL-safe calculations.OPTION (LABEL = '<description>') for production queries.When --cte:
MonthlySales, CustomerSegments).When --cross-db:
database.schema.table.When --view:
CREATE VIEW rpt.<ViewName> AS.rpt schema by default.ORDER BY unless TOP or OFFSET is used.Common patterns to apply when the description implies them:
SUM() OVER (ORDER BY ...)ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...)LAG() OVER (ORDER BY ...)AVG() OVER (ORDER BY ... ROWS BETWEEN ...)SUM() OVER () for grand totalWrite the query to a SQL file (e.g., views/<name>.sql or queries/<name>.sql) or display inline.
Show the user:
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub thelobbi/claude-m --plugin fabric-data-warehouse7 commands in this plugin
/sample-warehouse-bootstrapBootstrap a Fabric Sample Warehouse with deterministic setup and validation steps./warehouse-createCreate a new Fabric Data Warehouse with schemas and initial configuration/warehouse-loadGenerate data loading scripts — COPY INTO, CTAS, MERGE, or incremental load procedures/warehouse-monitorGenerate monitoring queries for warehouse performance, long-running queries, and capacity usage/warehouse-setupSet up the Fabric Data Warehouse plugin — configure workspace connection, install SQL tools, verify access/warehouse-table-createGenerate CREATE TABLE DDL for dimension, fact, or staging tables with proper data typesOther plugins' commands for the same job