mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-06 01:25:43 -05:00
Fix for displaying multiple table (#1075)
This commit is contained in:
@@ -1,21 +1,27 @@
|
||||
using System.Data;
|
||||
using Microsoft.Kusto.ServiceLayer.QueryExecution;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
namespace Microsoft.Kusto.ServiceLayer.DataSource
|
||||
{
|
||||
internal class KustoResultsReader : DataReaderWrapper
|
||||
{
|
||||
public KustoResultsReader(IDataReader reader) : base(reader)
|
||||
public KustoResultsReader(IDataReader reader)
|
||||
: base(reader)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Kusto returns 3 results tables - QueryResults, QueryProperties, QueryStatus. When returning query results
|
||||
/// we want the caller to only read the first table. We override the NextResult function here to only return one table
|
||||
/// from the IDataReader.
|
||||
/// </summary>
|
||||
public override bool NextResult()
|
||||
{
|
||||
return false;
|
||||
/// Kusto returns atleast 4 results tables - QueryResults(sometimes more than one), QueryProperties, QueryStatus and Query Results Metadata Table.
|
||||
/// When returning query results we need to trim off the last 3 tables as we want the caller to only read results table.
|
||||
/// </summary>
|
||||
|
||||
public void SanitizeResults(List<ResultSet> resultSets)
|
||||
{
|
||||
if (resultSets.Count > 3)
|
||||
{
|
||||
resultSets.RemoveRange(resultSets.Count - 3, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user