From 91ed9aea59b67efa65b97c9a9bd45c499282f187 Mon Sep 17 00:00:00 2001 From: benrr101 Date: Mon, 22 Aug 2016 12:04:43 -0700 Subject: [PATCH] Cleanup for comments/copyright --- .../QueryExecution/Batch.cs | 22 ++++++++++++++++--- .../SqlContext/QueryExecutionSettings.cs | 17 ++++++++++---- .../QueryExecution/Common.cs | 7 +++++- .../QueryExecution/DisposeTests.cs | 7 +++++- .../QueryExecution/ExecuteTests.cs | 7 +++++- .../QueryExecution/SubsetTests.cs | 7 +++++- 6 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs index 5fb927cd..bd29f1d6 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs @@ -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.Data; using System.Data.Common; @@ -10,6 +15,9 @@ using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts; namespace Microsoft.SqlTools.ServiceLayer.QueryExecution { + /// + /// This class represents a batch within a query + /// public class Batch { private const string RowsAffectedFormat = "({0} row(s) affected)"; @@ -21,10 +29,13 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution public string BatchText { get; set; } /// - /// Whether or not the query has an error + /// Whether or not this batch has an error /// public bool HasError { get; set; } + /// + /// Whether or not this batch has been executed, regardless of success or failure + /// public bool HasExecuted { get; set; } /// @@ -33,7 +44,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution public List ResultMessages { get; set; } /// - /// The result sets of the query execution + /// The result sets of the batch execution /// public List ResultSets { get; set; } @@ -70,6 +81,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution ResultMessages = new List(); } + /// + /// Executes this batch and captures any server messages that are returned. + /// + /// The connection to use to execute the batch + /// Token for cancelling the execution public async Task Execute(DbConnection conn, CancellationToken cancellationToken) { // Sanity check to make sure we haven't already run this batch diff --git a/src/Microsoft.SqlTools.ServiceLayer/SqlContext/QueryExecutionSettings.cs b/src/Microsoft.SqlTools.ServiceLayer/SqlContext/QueryExecutionSettings.cs index 7e8853a7..4934a4da 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/SqlContext/QueryExecutionSettings.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/SqlContext/QueryExecutionSettings.cs @@ -1,16 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ServiceLayer.SqlContext { + /// + /// Collection of settings related to the execution of queries + /// public class QueryExecutionSettings { + /// + /// Default value for batch separator (de facto standard as per SSMS) + /// private const string DefaultBatchSeparator = "GO"; private string batchSeparator; + /// + /// The configured batch separator, will use a default if a value was not configured + /// public string BatchSeparator { get { return batchSeparator ?? DefaultBatchSeparator; } diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/Common.cs b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/Common.cs index 0f2b2907..aa72cb4e 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/Common.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/Common.cs @@ -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.Data; using System.Data.Common; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/DisposeTests.cs b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/DisposeTests.cs index c0fed697..8ff0affd 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/DisposeTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/DisposeTests.cs @@ -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 Microsoft.SqlTools.ServiceLayer.Hosting.Protocol; using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/ExecuteTests.cs b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/ExecuteTests.cs index 4f4ec505..f4788014 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/ExecuteTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/ExecuteTests.cs @@ -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.Linq; using System.Threading; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/SubsetTests.cs b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/SubsetTests.cs index 6549cf8b..cf0d66a7 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/SubsetTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test/QueryExecution/SubsetTests.cs @@ -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 Microsoft.SqlTools.ServiceLayer.Hosting.Protocol; using Microsoft.SqlTools.ServiceLayer.QueryExecution;