Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>QueryLensNew to Visual Studio Code? Get it now.
QueryLens

QueryLens

Ahmed Samir

|
5 installs
| (0) | Free
MySQL extension with LSP support and Visualization
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

QueryLens

QueryLens is a powerful VS Code extension for MySQL that combines robust query execution capabilities with advanced visualization tools and Language Server Protocol (LSP) support. It is designed to streamline your database development workflow by providing intelligent features directly within your editor.

Features

  • Intelligent SQL Support: Powered by sqls, QueryLens provides autocompletion, diagnostics, and other LSP features for MySQL.
  • Query Execution: Run SQL queries directly from your editor. Supports multiple statements and displays results in a clean, paginated table view.
  • Visual Explain Plans: Visualize your query execution plans with EXPLAIN and EXPLAIN ANALYZE to optimize performance. Supports both tree view and JSON-based visualizations.
  • Connection Management: Easily manage multiple database connections through a dedicated sidebar view. Passwords are securely stored using VS Code's secret storage.
  • Zero Configuration LSP: The extension automatically handles the downloading and configuration of the sqls language server binary.

Getting Started

1. Installation

Install the extension from the VS Code Marketplace.

2. Managing Connections

  1. Open the QueryLens sidebar view (click the database icon in the Activity Bar).
  2. Click the Add Connection button.
  3. Fill in your connection details:
    • Name: A display name for the connection.
    • Host: Database host (e.g., localhost or 127.0.0.1).
    • Port: Database port (default is 3306).
    • User: Database username.
    • Password: Database password (stored securely).
    • Database: The specific database schema to connect to.
  4. Save the connection. You can now switch between connections using the "Active" toggle or by selecting them in the sidebar.

3. Running Queries

  1. Open a .sql file.
  2. Write your SQL query.
  3. Place your cursor on the query or select the specific part you want to run.
  4. Press Ctrl+Enter (or Cmd+Enter on macOS) or use the QueryLens: Run Query command from the Command Palette.
  5. Results will appear in a new panel.

4. Visualizing Query Plans

To analyze the performance of a query:

  1. Select the query.
  2. Right-click and select Explain Analyze Query (or use the command QueryLens: Explain Analyze Query).
  3. A visualization of the query plan will be displayed, helping you identify bottlenecks.

Commands

  • QueryLens: Run Query (Ctrl+Enter / Cmd+Enter): Execute the current query or selection.
  • QueryLens: Explain Analyze Query: Run EXPLAIN ANALYZE on the current query and visualize the result.
  • QueryLens: Database Connections: Open the connections management sidebar.
  • QueryLens: Refresh Configuration: Refresh the LSP configuration.

Requirements

  • MySQL Database: Access to a MySQL server.
  • VS Code: Version 1.85.0 or higher.

Extension Settings

This extension currently uses the following settings:

  • querylens.pageSize: (Internal) Controls the number of rows per page in the result view (default: 50).

Known Issues

  • Please report any issues on the GitHub Repository.

Release Notes

0.0.1

  • Initial release with Query Execution, Visualization, and LSP support.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft