Kusto Special Character Database Fix (#1201)

* Removed Parallel.Invoke from KustoIntellisenseClient.cs > LoadSchema. Added EscapeName from databaseName to LoadSchema and GetTableInfos

* Reverted change to Parallel.Invoke in LoadSchema
This commit is contained in:
Justin M
2021-04-30 17:33:08 -07:00
committed by GitHub
parent 10c24aaeb3
commit 7fc07d08c0
2 changed files with 4 additions and 5 deletions

View File

@@ -44,9 +44,8 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
var source = new CancellationTokenSource(); var source = new CancellationTokenSource();
Parallel.Invoke(() => Parallel.Invoke(() =>
{ {
tableSchemas = var tableQuery = $".show database {KustoQueryUtils.EscapeName(databaseName)} schema";
_kustoClient.ExecuteQueryAsync<ShowDatabaseSchemaResult>($".show database {databaseName} schema", source.Token, databaseName) tableSchemas = _kustoClient.ExecuteQueryAsync<ShowDatabaseSchemaResult>(tableQuery, source.Token, databaseName).Result;
.Result;
}, },
() => () =>
{ {
@@ -332,7 +331,7 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense
foreach (var autoCompleteItem in completion.Items) foreach (var autoCompleteItem in completion.Items)
{ {
var label = autoCompleteItem.DisplayText; var label = autoCompleteItem.DisplayText;
var insertText = autoCompleteItem.Kind == CompletionKind.Table var insertText = autoCompleteItem.Kind == CompletionKind.Table || autoCompleteItem.Kind == CompletionKind.Database
? KustoQueryUtils.EscapeName(label) ? KustoQueryUtils.EscapeName(label)
: label; : label;

View File

@@ -467,7 +467,7 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource
CancellationTokenSource source = new CancellationTokenSource(); CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = source.Token; CancellationToken token = source.Token;
string query = $".show database {databaseName} cslschema"; string query = $".show database {KustoQueryUtils.EscapeName(databaseName)} cslschema";
using (var reader = _kustoClient.ExecuteQuery(query, token, databaseName)) using (var reader = _kustoClient.ExecuteQuery(query, token, databaseName))
{ {