mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-21 17:24:03 -05:00
Edit Data: Better Formatting Errors (#562)
* Refactoring sql script formatting helpers into To and From helpers * Updates to make error messages for formatting errors more useful * Fixing dumb breaks in unit tests * Addressing comments from PR * Updates to the SR files...
This commit is contained in:
@@ -14,7 +14,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.EditData.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility.SqlScriptFormatters;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
|
||||
@@ -202,7 +202,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
|
||||
// Add an out column if we're doing this for a command
|
||||
if (forCommand)
|
||||
{
|
||||
outColumns.Add($"inserted.{SqlScriptFormatter.FormatIdentifier(column.ColumnName)}");
|
||||
outColumns.Add($"inserted.{ToSqlScript.FormatIdentifier(column.ColumnName)}");
|
||||
}
|
||||
|
||||
// Skip columns that cannot be updated
|
||||
@@ -237,11 +237,11 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
|
||||
else
|
||||
{
|
||||
// This script isn't for command use, add the value, formatted for insertion
|
||||
inValues.Add(SqlScriptFormatter.FormatValue(cell.Value, column));
|
||||
inValues.Add(ToSqlScript.FormatValue(cell.Value, column));
|
||||
}
|
||||
|
||||
// Add the column to the in columns
|
||||
inColumns.Add(SqlScriptFormatter.FormatIdentifier(column.ColumnName));
|
||||
inColumns.Add(ToSqlScript.FormatIdentifier(column.ColumnName));
|
||||
}
|
||||
|
||||
// Begin the script (ie, INSERT INTO blah)
|
||||
|
||||
Reference in New Issue
Block a user