Skip to content

Commit

Permalink
Merge pull request #107 from josephschorr/del-limits
Browse files Browse the repository at this point in the history
Add support for limits on delete relationships API
  • Loading branch information
josephschorr committed May 9, 2023
2 parents 23f8f10 + e8761b3 commit e75d140
Show file tree
Hide file tree
Showing 6 changed files with 679 additions and 418 deletions.
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S buf generate buf.build/authzed/api:c74bd229f3d3572ae3ba7d2dbab522600f3e9494 --template
#!/usr/bin/env -S buf generate buf.build/authzed/api:d7e27e8163e5b6fddc0e3f989c8aefad8ca81184 --template
---
version: "v1"
plugins:
Expand Down
26 changes: 25 additions & 1 deletion proto/apidocs.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,16 @@
}
},
"definitions": {
"DeleteRelationshipsResponseDeletionProgress": {
"type": "string",
"enum": [
"DELETION_PROGRESS_UNSPECIFIED",
"DELETION_PROGRESS_COMPLETE",
"DELETION_PROGRESS_PARTIAL"
],
"default": "DELETION_PROGRESS_UNSPECIFIED",
"description": " - DELETION_PROGRESS_COMPLETE: DELETION_PROGRESS_COMPLETE indicates that all remaining relationships matching the filter\nwere deleted. Will be returned even if no relationships were deleted.\n - DELETION_PROGRESS_PARTIAL: DELETION_PROGRESS_PARTIAL indicates that a subset of the relationships matching the filter\nwere deleted. Only returned if optional_allow_partial_deletions was true, an optional_limit was\nspecified, and there existed more relationships matching the filter than optional_limit would allow.\nOnce all remaining relationships have been deleted, DELETION_PROGRESS_COMPLETE will be returned."
},
"DeveloperErrorErrorKind": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -922,6 +932,15 @@
"items": {
"$ref": "#/definitions/v1Precondition"
}
},
"optionalLimit": {
"type": "integer",
"format": "int64",
"description": "optional_limit, if non-zero, specifies the limit on the number of relationships to be deleted.\nIf there are more matching relationships found to be deleted than the limit specified here,\nthe deletion call will fail with an error to prevent partial deletion. If partial deletion\nis needed, specify below that partial deletion is allowed. Partial deletions can be used\nin a loop to delete large amounts of relationships in a *non-transactional* manner."
},
"optionalAllowPartialDeletions": {
"type": "boolean",
"description": "optional_allow_partial_deletions, if true and a limit is specified, will delete matching found\nrelationships up to the count specified in optional_limit, and no more."
}
},
"description": "DeleteRelationshipsRequest specifies which Relationships should be deleted,\nrequesting the delete of *ALL* relationships that match the specified\nfilters. If the optional_preconditions parameter is included, all of the\nspecified preconditions must also be satisfied before the delete will be\nexecuted."
Expand All @@ -930,7 +949,12 @@
"type": "object",
"properties": {
"deletedAt": {
"$ref": "#/definitions/v1ZedToken"
"$ref": "#/definitions/v1ZedToken",
"description": "deleted_at is the revision at which the relationships were deleted."
},
"deletionProgress": {
"$ref": "#/definitions/DeleteRelationshipsResponseDeletionProgress",
"description": "deletion_progress is an enumeration of the possible outcomes that occurred when attempting to delete the specified relationships."
}
}
},
Expand Down
66 changes: 43 additions & 23 deletions proto/authzed/api/v1/error_reason.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e75d140

Please sign in to comment.