Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of deletes #45

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Initial implementation of deletes #45

merged 5 commits into from
Nov 11, 2024

Conversation

burdiyan
Copy link
Collaborator

@burdiyan burdiyan commented Nov 1, 2024

This PR implements a new Refs API, which can be (arguably counter-intuitively) used to delete documents.

Notable changes:

  1. CreateRef lets you create a Ref blob for a given account + path. Currently only tombstone targets are implemented.
  2. GetRef lets you get an existing Ref. Not sure why would you want it, but it's there.
  3. GetDocument has a new ignore_deleted flag, which can be used to get the latest version of the document even if it's deleted.
  4. ListDocuments has a new deleted_only flag which lets only list deleted documents in a given account.
  5. Getting documents with exact version works regardless of the deletion.

So, if you'd want to delete a document, you'd create a tombstone Ref. This will make the document disappear from the list request (unless deleted_only is specified). A get request would return an error with FailedPrecondition GRPC error code, unless ignore_deleted flag is specified.

I still need to test if it will let you publish something again on the same path after deletion or not.

@burdiyan burdiyan force-pushed the feat/delete-documents branch 2 times, most recently from 8564779 to 3653958 Compare November 5, 2024 10:40
@burdiyan burdiyan force-pushed the feat/delete-documents branch 3 times, most recently from a4bfef5 to 1b2f51d Compare November 8, 2024 11:21
@burdiyan burdiyan merged commit 8f8bf23 into main Nov 11, 2024
2 checks passed
@burdiyan burdiyan deleted the feat/delete-documents branch November 11, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants