mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 17:24:21 -05:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user