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

View File

@@ -467,7 +467,7 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource
CancellationTokenSource source = new CancellationTokenSource();
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))
{