Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Xinq - SQL Query ManagerNew to Visual Studio Code? Get it now.
Xinq - SQL Query Manager

Xinq - SQL Query Manager

Sajjad Alipour

| (0) | Free
A powerful VS Code extension for managing and organizing SQL queries in XML-based definition files. Perfect for .NET developers working with T-SQL.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Xinq - SQL Query Management for VS Code

Version Downloads License: MIT

A VS Code extension for managing SQL queries in XML-based .xinq definition files. Built for .NET developers working with SQL Server and T-SQL.

This project is derived from soheilpro/Xinq, the original Visual Studio Xinq extension.

First public release: 1.0.0 — see CHANGELOG.md for the full list of features and fixes.

Xinq editor overview

Features

Query management

  • Custom editor for .xinq files with a query list and Monaco SQL pane
  • Inline rename, comments, duplicate, and remove
  • Search by query name, comment, or SQL text
  • Optional grouping by regex prefix patterns
  • Sort A–Z / Z–A, or drag to reorder (when ungrouped and not filtering)

SQL editing

  • Monaco editor with T-SQL syntax highlighting
  • Keyword completion and common SQL snippets
  • Uses your VS Code editor font settings

Developer experience

  • Generates C# .Designer.cs classes on save
  • Updates .csproj entries for generated files
  • Warnings in the Problems panel for duplicate or invalid query names
  • Settings for save-time sorting and generator version
  • Keyboard shortcuts for common actions

A ready-made sample file is included in the repository at examples/Queries.xinq.

Note: in untrusted workspaces the editor works read-only style — C# code generation and .csproj updates are disabled until you trust the workspace. Virtual workspaces (e.g. remote repositories without a local filesystem) are not supported.

Search filtering with match hints

Installation

From VS Code Marketplace (recommended)

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for Xinq
  4. Click Install

Or install directly from the Visual Studio Marketplace.

Manual installation

  1. Download the .vsix from GitHub Releases
  2. In VS Code: Extensions → Install from VSIX...
  3. Select the downloaded .vsix file

Quick Start

1. Create a New Xinq File

  • Right-click a folder in the Explorer
  • Select New Xinq File
  • Choose a location and name for your query file

2. Add Your First Query

  • Click Add Query in the toolbar (or press Shift+N)
  • Enter a descriptive name
  • Write SQL in the editor pane
  • Optionally add a comment

3. Generate C# Code

  • Save the .xinq file (Ctrl+S)
  • The extension generates a matching .Designer.cs file
  • Use the generated C# class in your .NET code

Usage

Creating Queries

<xinq>
  <queries>
    <query name="GetUsers">
      <comment>Get all active users from the database</comment>
      <text><![CDATA[
        SELECT UserId, UserName, Email, IsActive
        FROM Users
        WHERE IsActive = 1
        ORDER BY UserName
      ]]></text>
    </query>
  </queries>
</xinq>

Generated C# Code

namespace YourNamespace
{
    internal class Queries
    {
        private static Query _getUsers = new Query(@"SELECT UserId, UserName, Email, IsActive
FROM Users
WHERE IsActive = 1
ORDER BY UserName");

        /// <summary>
        /// Get all active users from the database
        /// </summary>
        internal static Query GetUsers {
            get { return _getUsers; }
        }
    }
}

Configuration

Extension Settings

  • xinq.save.sortQueriesByName: Sort queries alphabetically when saving (default: false)
  • xinq.generator.version: Version string for generated code attributes (default: "1.0.9.0")

Accessing Settings

  1. Open VS Code Settings (Ctrl+,)
  2. Search for xinq
  3. Modify the settings as needed

Keyboard Shortcuts

Shortcuts work inside the Xinq editor webview:

Shortcut Action
Shift+N Add new query
Delete Remove selected query
F2 Rename selected query
Ctrl+D Duplicate selected query
Ctrl+C Copy selected query SQL
Ctrl+F Focus search
Arrow Up/Down Move between queries
Home / End Jump to first / last query

Development

  1. Clone the repository
  2. Install dependencies: npm install
  3. Compile: npm run compile
  4. Open in VS Code and press F5 to debug

Building and testing

  • npm run compile — Compile TypeScript
  • npm run watch — Watch mode compilation
  • npm run lint — Run ESLint
  • npm run test:unit — Run fast unit tests (no VS Code download)
  • npm test — Run the full test suite in a VS Code host
  • npm run package — Create a .vsix package

Requirements

  • VS Code: 1.87.0 or later
  • Node.js: 18.x or later (for development)

License

This project is licensed under the MIT License — see the LICENSE file for details.

Support

  • Issues: GitHub Issues
  • Discussions: GitHub Discussions

Changelog

See CHANGELOG.md.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft