diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/KustoIntellisenseClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/KustoIntellisenseClient.cs index 8345c056..f321caa6 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/KustoIntellisenseClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/KustoIntellisenseClient.cs @@ -44,9 +44,8 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense var source = new CancellationTokenSource(); Parallel.Invoke(() => { - tableSchemas = - _kustoClient.ExecuteQueryAsync($".show database {databaseName} schema", source.Token, databaseName) - .Result; + var tableQuery = $".show database {KustoQueryUtils.EscapeName(databaseName)} schema"; + tableSchemas = _kustoClient.ExecuteQueryAsync(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; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs index 4739f783..c4a9c8d7 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs @@ -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)) {