Add support for Kusto control commands (.show, .alter, .create, .drop)#4
Open
roshauli wants to merge 1 commit into
Open
Add support for Kusto control commands (.show, .alter, .create, .drop)#4roshauli wants to merge 1 commit into
roshauli wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Quest previously only supported KQL queries, which are sent to the
/v1/rest/queryendpoint. 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.) inRunQueryAsync()ICslAdminProvider+ExecuteControlCommandAsyncfor commands (mgmt endpoint)ICslQueryProvider+ExecuteQueryAsyncfor regular KQL queries (query endpoint)Examples & docs:
server/Models/KustoDataSource.cs.show tables,.show version,.show database schema as jsonWalkthrough:
extension/resources/walkthrough/create-query.mdREADME:
README.mdHow it works
The Kusto SDK has two distinct providers:
ICslQueryProvider→ sends to/v1/rest/query(for KQL queries likeStormEvents | 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 existingSchemaHandler.cscode that was already sending.show tables/.show databasesthroughRunQueryAsync.