api: return error if no tuples/objects #382
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this patch, the behavior of
*_many
requests if empty array of tuples/objects were rather confusing. For example, due to format processing all*_object_many
operations resulted innil, {}
-- error request with zero errors.insert_many
andreplace_many
calls result innil, nil
-- no result, no error.upsert_many
results in{metadata = metadata}, nil
with norows
in response. Thus, for all six*_many
calls trying to execute the request with empty array on input result in malformed response.After this patch, trying to run
*_many
request with empty array of tuples/objects will result innil, {err}
, similar to existing*_many
API. Single tuple crud API already does not allow to run with no tuples/objects.Closes #377