Skip to content

Add support for Kusto control commands (.show, .alter, .create, .drop)#4

Open
roshauli wants to merge 1 commit into
InbarR:masterfrom
roshauli:feature/control-command-support
Open

Add support for Kusto control commands (.show, .alter, .create, .drop)#4
roshauli wants to merge 1 commit into
InbarR:masterfrom
roshauli:feature/control-command-support

Conversation

@roshauli
Copy link
Copy Markdown

Summary

Quest previously only supported KQL queries, which are sent to the /v1/rest/query endpoint. Control commands like .show tables, .show version, .alter table, etc. would fail because they require the management endpoint (/v1/rest/mgmt).

This PR adds full support for Kusto control commands by detecting the . prefix and routing to the correct endpoint.

Changes

Core fix: libs/MyTools.Core/KustoService.cs

  • Detect control commands (queries starting with .) in RunQueryAsync()
  • Use ICslAdminProvider + ExecuteControlCommandAsync for commands (mgmt endpoint)
  • Continue using ICslQueryProvider + ExecuteQueryAsync for regular KQL queries (query endpoint)
  • Proper resource disposal for the admin provider

Examples & docs: server/Models/KustoDataSource.cs

  • Added 3 command examples under new Commands category: .show tables, .show version, .show database schema as json
  • Added 4 command entries to the Quick Start Guide

Walkthrough: extension/resources/walkthrough/create-query.md

  • Added KQL Control Command section explaining command support

README: README.md

  • Updated ADX description to mention control command support

How it works

The Kusto SDK has two distinct providers:

  • ICslQueryProvider → sends to /v1/rest/query (for KQL queries like StormEvents | take 10)
  • ICslAdminProvider → sends to /v1/rest/mgmt (for control commands like .show tables)

The fix detects the . prefix after trimming whitespace, then selects the appropriate provider. This also fixes the existing SchemaHandler.cs code that was already sending .show tables / .show databases through RunQueryAsync.

Previously, Quest only supported KQL queries (sent to /v1/rest/query endpoint).
Control commands like .show tables, .show version, .alter table, etc. would fail
because they require the management endpoint (/v1/rest/mgmt).

Changes:
- KustoService.cs: Detect control commands (starting with '.') and use
  ICslAdminProvider + ExecuteControlCommandAsync instead of ICslQueryProvider
- KustoDataSource.cs: Add command examples and quick-start guide entries
- create-query.md: Add walkthrough section for control commands
- README.md: Update ADX description to mention command support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant