mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 01:25:40 -05:00
Adds a execute and return result message (#383)
* inital request * refactored query execution failure callback to take exception * added failure callback to execute and return * added test for query execute and return * updated params * removed dead code * addressed feedback; added multiple active result set support; updated tests * addessed feedback and added testing and errors and verification * change <= to == * changed name of trashQ to removedQuery
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts.ExecuteRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for executing a query from a provided string
|
||||
/// </summary>
|
||||
public class SimpleExecuteParams
|
||||
{
|
||||
/// <summary>
|
||||
/// The string to execute
|
||||
/// </summary>
|
||||
public string QueryString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The owneruri to get connection from
|
||||
/// </summary>
|
||||
public string OwnerUri { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Result
|
||||
/// </summary>
|
||||
public class SimpleExecuteResult
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The number of rows that was returned with the resultset
|
||||
/// </summary>
|
||||
public long RowCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Details about the columns that are provided as solutions
|
||||
/// </summary>
|
||||
public DbColumnWrapper[] ColumnInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 2D array of the cell values requested from result set
|
||||
/// </summary>
|
||||
public DbCellValue[][] Rows { get; set; }
|
||||
}
|
||||
|
||||
public class SimpleExecuteRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<SimpleExecuteParams, SimpleExecuteResult> Type =
|
||||
RequestType<SimpleExecuteParams, SimpleExecuteResult>.Create("query/simpleexecute");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user