Edit Data: Create Row with Nullable Columns (#553)

* WIP

* All the new RowCreate tests are working

* Fixing a couple bugs with the row delete and row update tests

* Regenerating localization files

* Fixing multiple iteration in tests
This commit is contained in:
Benjamin Russell
2017-11-28 14:59:48 -08:00
committed by GitHub
parent bc8aef6a15
commit 2190039df2
33 changed files with 17699 additions and 7445 deletions

View File

@@ -214,13 +214,13 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
// Make sure a value was provided for the cell
if (cell == null)
{
// If there isn't a default, then fail
if (DefaultValues[i] == null)
// If the column is not nullable and there is no default defined, then fail
if (!column.AllowDBNull.HasTrue() && DefaultValues[i] == null)
{
throw new InvalidOperationException(SR.EditDataCreateScriptMissingValue);
throw new InvalidOperationException(SR.EditDataCreateScriptMissingValue(column.ColumnName));
}
// There is a default value, so trust the db will apply it
// There is a default value (or omitting the value is fine), so trust the db will apply it correctly
continue;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -212,7 +212,7 @@ EditDataInvalidFormatBinary = Invalid format for binary column
EditDataInvalidFormatBoolean = Allowed values for boolean columns are 0, 1, "true", or "false"
EditDataCreateScriptMissingValue = A required cell value is missing
EditDataCreateScriptMissingValue(string colName) = The column '{0}' is defined as NOT NULL but was not given a value
EditDataDeleteSetCell = A delete is pending for this row, a cell update cannot be applied.

View File

@@ -475,9 +475,10 @@
<note></note>
</trans-unit>
<trans-unit id="EditDataCreateScriptMissingValue">
<source>A required cell value is missing</source>
<source>The column '{0}' is defined as NOT NULL but was not given a value</source>
<target state="new">A required cell value is missing</target>
<note></note>
<note>.
Parameters: 0 - colName (string) </note>
</trans-unit>
<trans-unit id="EditDataDeleteSetCell">
<source>A delete is pending for this row, a cell update cannot be applied.</source>