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.
Allow soft or hard deletion of an event stream.
Soft delete
Will mark the stream as deleted, but will not delete its events. Events from soft deleted streams will still appear in the globally ordered all events (
$all
) stream and in any linked streams.A soft deleted stream cannot be read nor appended to. Subscriptions to the deleted stream will not receive any events.
Hard delete
Will permanently delete the stream and its events. This is irreversible and will remove data. Events will be removed from the globally ordered all events stream and any linked streams.
After being hard deleted, a stream can later be appended to and read as if had never existed.
Examples
Soft delete a stream
Delete a stream at any version:
Delete a stream at an expected version:
Delete stream will use soft delete by default so you can omit the type:
Hard delete a stream
Since hard deletes are destructive and irreversible they are disabled by default. To use hard deletes you must first enable them for the event store:
Or via config:
Hard delete a stream:
Fixes #170.