Skip to content

ZEUSXXIV/SQL-Charts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuerySight: SQL Charting Visualizer & DBA Diagnostics for SSMS 22 (v2.0.1)

QuerySight is a premium, dual-component database charting and diagnostics suite designed to enable SSMS users and their GitHub Copilot/LLM agents to automatically visualize query results and monitor database performance. Built natively for SQL Server Management Studio (SSMS) 22, QuerySight delivers a beautiful, theme-integrated dashboard directly inside the IDE.

QuerySight consists of:

  1. SSMS VSIX Extension (v2.0.1): A C# VSPackage containing a WPF tool window hosting a WebView2 HTML5 canvas (Chart.js) with real-time refresh timers, diagnostics dashboards, database schema navigation, and an active blocking tree manager.
  2. Python MCP Server (v2.0.1): An asynchronous FastMCP server exposing query execution, schema catalog listing, diagnostics reports, process management, and automated chart rendering tools to external LLM clients.
  3. Unified Windows Installer (.MSI): A custom-themed installer package (created by ZEUSXXIV) that automates the deployment of both components and auto-configures Claude Desktop, VS Code, and SSMS Copilot environments.

Key Features

1. Interactive Visualizations & Pinned Dashboards

  • Multiple Chart Types: Supported formats include Bar, StackedBar, Line, Pie, KPI, and Gauge charts, styled with modern dark-mode palettes and linear gradients.
  • Deduplicated Pinning: Pin multiple charts to a persistent dashboard grid. Card titles can be modified in-place.
  • Connection-Isolated Dashboards: Dashboards are saved as server- and database-specific JSON files (dashboards/[Server]_[Database].json), switching automatically as you change your active query editor or Object Explorer focus.
  • Auto-Refresh & In-Place Reload: Individual cards can be reloaded in-place or configured to auto-refresh at customizable intervals (from 30 seconds to 12 hours) using background threads that keep the SSMS UI responsive.

2. Pre-Built DBA Diagnostics & Performance Monitor

  • Instance Overview: Interactive doughnut chart breaking down running vs. sleeping sessions, alongside system memory usage metrics.
  • Database Sizes: Server-wide storage allocation sorted in a responsive grid and bar chart.
  • Index Fragmentation: Automatically identifies highly fragmented tables and indexes in the active database.

3. Active Blocking Tree Viewer

  • Parent-Child Hierarchy: Resolves locking contention in real-time, mapping downstream sessions to root blockers.
  • Detailed Session Context: Visualizes wait types, duration (ms), host programs, query text, and SPID logins with color-coded alerts (red warning banners for root blockers).
  • In-App SPID Termination: Allows administrators to Kill blocking sessions directly from the visualizer UI.

4. Dynamic About Screen

  • Custom borderless dialog styled in deep charcoal and purple.
  • Dynamic Version Resolution: Automatically reads and displays the package version from source.extension.vsixmanifest at runtime, ensuring version synchronicity.

Model Context Protocol (MCP) Agent Tools

QuerySight exposes an extensive tool set to the SSMS GitHub Copilot agent and Claude Desktop, enabling a fully autonomous DBA assistant workflow:

  1. get_ssms_connection_status: Returns connection details (server, database, user, auth type) and supported chart types.
  2. get_ssms_schema: Returns the catalog of user tables and columns inside the active database to help the agent draft valid queries.
  3. execute_ssms_query: Runs a SQL query. To protect database integrity, executions are strictly restricted to read-only queries (SELECT and WITH). All modifying commands (INSERT, UPDATE, DELETE, DROP, CREATE, etc.) are parsed and blocked. Returns results as a formatted markdown table.
  4. get_ssms_diagnostics: Returns performance snapshots (Overview, Database Sizes, Index Fragmentation, or Blocking lock tree) formatted as clean markdown tables.
  5. kill_ssms_session: Terminates a session SPID (useful for resolving locking blocks).
  6. render_ssms_chart: Renders query data. Supports dynamic auto-detection (chart_type="auto") and falls back gracefully to bar with an agent warning if an unsupported chart type is requested.

Workspace Directory Structure

SQL Charts/
├── QuerySight.Setup.msi                # Compiled standalone Windows Installer (ZEUSXXIV)
├── QuerySight.sln                      # VS 2022 Solution file (Extension & Setup)
├── README.md                           # This documentation
├── features.md                         # Product specifications
├── setup_guide.md                      # Advanced setup details
└── src/
    ├── QuerySight.Extension/           # SSMS 22 Extension Project (C# / .NET 4.8)
    │   ├── QuerySight.Extension.csproj # Project file mapping dependencies (WebView2, NewtonSoft.Json)
    │   ├── source.extension.vsixmanifest# VSIX targets and package identities
    │   ├── QuerySightPackage.cs        # Extension entry point & Request-Response router
    │   ├── ChartBridgeServer.cs        # WebSocket (port 8080) listener interface
    │   ├── QuerySightToolWindowControl.xaml / .cs # WPF host containing DTE / Object Explorer solvers
    │   ├── AboutWindow.xaml / .cs      # Dynamically versioned About dialog
    │   └── Resources/
    │       └── chart_canvas.html       # WebView2 Chart.js & Blocking Tree rendering canvas
    ├── QuerySight.McpServer/           # Python MCP Server
    │   ├── mcp_server.py               # FastMCP tool implementation
    │   └── requirements.txt            # Python runtime requirements
    └── QuerySight.Setup/               # WiX Toolset v4 Setup Project
        ├── Product.wxs                 # Wix installation package rules and registry injectors
        ├── mcp_helper.ps1              # Deployment and environment config helper (Claude/Copilot)
        └── cleanup_installer.ps1       # Elevated database installer cleanup script

Standalone Installation (.MSI)

We provide a unified installer that bundles all files and configures the environment.

  1. Download and Run the Installer: Double-click the QuerySight.Setup.msi file in the root of the workspace.
  2. Custom MCP Checkbox:
    • Checked (Recommended): Automatically checks for Python, installs required packages, registers the QuerySight MCP server with Claude Desktop (claude_desktop_config.json) and GitHub Copilot (.mcp.json), and updates SSMS Copilot flags in SSMS settings.json.
    • Unchecked: Installs only the SSMS VSIX extension without configuring any external LLM/MCP server integrations.
  3. Verify Installation:
    • Open SSMS 22.
    • Launch the visualizer via View -> Other Windows -> QuerySight SQL Chart.
    • Check the version signature by clicking About (displays Version 2.0.1).

Manual Developer Compilation

Prerequisites

  • Visual Studio 2022: Installed with the Visual Studio Extension Development workload.
  • WiX Toolset: Required to compile the .wixproj setup project.
  • Python 3.10+: Required for the MCP server.

1. Compile via MSBuild (Developer PowerShell)

Run the following from the root directory:

# Restore NuGet references
& "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" QuerySight.sln /t:Restore

# Build in Release
& "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" QuerySight.sln /p:Configuration=Release /t:Rebuild

The compiled installer will be generated at: src/QuerySight.Setup/bin/x64/Release/QuerySight.Setup.msi


Clean Uninstallation

To remove all artifacts and revert configuration files to their original state:

  • Run the uninstallation from the Windows Apps & Features control panel, OR
  • Run the MSI installer and select Remove.
  • The uninstaller will safely deregister the VSIX from SSMS, cleanse the Claude and global .mcp.json configs, and restore the SSMS settings.json keys to their original state.

About

A high-fidelity, dark-themed SQL visualization and query-assist extension for SSMS 22, featuring an interactive Chart.js canvas, an embedded Monaco SQL Editor, autocomplete, schema tree explorer, and a no-SQL visual query builder.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors