mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Cleanup for comments/copyright
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
//
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
@@ -10,6 +15,9 @@ using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
|||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class represents a batch within a query
|
||||||
|
/// </summary>
|
||||||
public class Batch
|
public class Batch
|
||||||
{
|
{
|
||||||
private const string RowsAffectedFormat = "({0} row(s) affected)";
|
private const string RowsAffectedFormat = "({0} row(s) affected)";
|
||||||
@@ -21,10 +29,13 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
|||||||
public string BatchText { get; set; }
|
public string BatchText { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not the query has an error
|
/// Whether or not this batch has an error
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool HasError { get; set; }
|
public bool HasError { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not this batch has been executed, regardless of success or failure
|
||||||
|
/// </summary>
|
||||||
public bool HasExecuted { get; set; }
|
public bool HasExecuted { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -33,7 +44,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
|||||||
public List<string> ResultMessages { get; set; }
|
public List<string> ResultMessages { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The result sets of the query execution
|
/// The result sets of the batch execution
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ResultSet> ResultSets { get; set; }
|
public List<ResultSet> ResultSets { get; set; }
|
||||||
|
|
||||||
@@ -70,6 +81,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
|||||||
ResultMessages = new List<string>();
|
ResultMessages = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes this batch and captures any server messages that are returned.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="conn">The connection to use to execute the batch</param>
|
||||||
|
/// <param name="cancellationToken">Token for cancelling the execution</param>
|
||||||
public async Task Execute(DbConnection conn, CancellationToken cancellationToken)
|
public async Task Execute(DbConnection conn, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Sanity check to make sure we haven't already run this batch
|
// Sanity check to make sure we haven't already run this batch
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
using System;
|
//
|
||||||
using System.Collections.Generic;
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
using System.Linq;
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
using System.Threading.Tasks;
|
//
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Collection of settings related to the execution of queries
|
||||||
|
/// </summary>
|
||||||
public class QueryExecutionSettings
|
public class QueryExecutionSettings
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default value for batch separator (de facto standard as per SSMS)
|
||||||
|
/// </summary>
|
||||||
private const string DefaultBatchSeparator = "GO";
|
private const string DefaultBatchSeparator = "GO";
|
||||||
|
|
||||||
private string batchSeparator;
|
private string batchSeparator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The configured batch separator, will use a default if a value was not configured
|
||||||
|
/// </summary>
|
||||||
public string BatchSeparator
|
public string BatchSeparator
|
||||||
{
|
{
|
||||||
get { return batchSeparator ?? DefaultBatchSeparator; }
|
get { return batchSeparator ?? DefaultBatchSeparator; }
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
//
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
//
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol;
|
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol;
|
||||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
//
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
using System;
|
//
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol;
|
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol;
|
||||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
||||||
|
|||||||
Reference in New Issue
Block a user