Skip to content

Commit 10a2534

Browse files
committed
Clarified the comment on when PK is checked for autogen column property in UPSERT.
1 parent eab3471 commit 10a2534

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

DataGateway.Service/Services/RequestValidator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ public static void ValidateUpsertRequestContext(
217217

218218
foreach (KeyValuePair<string, ColumnDefinition> column in tableDefinition.Columns)
219219
{
220-
// Primary Key columns are validated separately.
220+
// Primary Key(s) should not be present in the request body. We do not fail a request
221+
// if a PK is autogenerated here, because an UPSERT request may only need to update a
222+
// record. If an insert occurs on a table with autogenerated primary key,
223+
// a database error will be returned.
221224
if (tableDefinition.PrimaryKey.Contains(column.Key))
222225
{
223226
continue;

0 commit comments

Comments
 (0)