-
Notifications
You must be signed in to change notification settings - Fork 479
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
Adding an Optional DeleteWithPrefix Method for State Stores to Allow Deletion of Actor State #3262
Comments
Please include the actual interface method you propose adding. Without that this proposal is not meaningful. |
I want to know what the new request object will be called and what it will look like, and what the new method is called. https://github.com/dapr/components-contrib/blob/main/state/store.go#L38 |
@berndverst updated the proposal to include both suggestions |
LGTM And for say Postgres this will eventually be translated to In other words delete every entry where the ID begins with prefix. |
The goal is that, and the query is "like" that (see what I did there? :) ) More of an implementation detail, but I've guided @RyanLettieri to avoid the use of Also worth noting that if the key doesn't have a prefix (which is possible in Dapr, such as |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
Describe the proposal
This proposal stems from the following feature request inside dapr runimte: dapr/dapr#6992
After a discussion with various members of the project, the following solution was proposed: dapr/dapr#6992 (comment)
By adding in an optional interface called 'DeleteWithPrefix', we will allow users to delete an actor's state. The interface is optional since some databases will not be able to implement it as highlighted by ItalyPaleAle, an active contributor for dapr here: dapr/dapr#7223 (comment)
Looking at sqlite as an example, a second migration will be added in order to generate a virtual "prefix" column. This column will contain all the information from the actor state entry up to but not including the key. For example, if the key entry is as follows:
app-id||actor-type||actor-id||key
the new virtual prefix column will containapp-id||actor-type||actor-id
New request that would be included in state/requests.go:
New interface that would be included in state/store.go:
List of components that are compatible with this optional method:
The text was updated successfully, but these errors were encountered: