mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-15 10:58:31 -05:00
use file path instead of content in the request (#1562)
* use file path instead of content in the request * remove unused using statement
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
@@ -13,9 +12,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
public class ParseTSqlScriptRequestParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the script content
|
||||
/// Gets or sets the script file path.
|
||||
/// </summary>
|
||||
public string Script { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DSP.
|
||||
@@ -26,7 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
/// <summary>
|
||||
/// Result for the ParseTSqlScript Request.
|
||||
/// </summary>
|
||||
public class ParseTSqlScriptResult : ResultStatus
|
||||
public class ParseTSqlScriptResult
|
||||
{
|
||||
public bool ContainsCreateTableStatement { get; set; }
|
||||
}
|
||||
|
||||
@@ -311,9 +311,10 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
{
|
||||
try
|
||||
{
|
||||
var script = System.IO.File.ReadAllText(requestParams.FilePath);
|
||||
await requestContext.SendResult(new ParseTSqlScriptResult()
|
||||
{
|
||||
ContainsCreateTableStatement = DacTableDesigner.ScriptContainsCreateTableStatements(requestParams.Script, requestParams.DatabaseSchemaProvider)
|
||||
ContainsCreateTableStatement = DacTableDesigner.ScriptContainsCreateTableStatements(script, requestParams.DatabaseSchemaProvider)
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user