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

Link existing events to another stream #103

Merged
merged 14 commits into from
Jan 29, 2018

Conversation

slashdotdash
Copy link
Member

@slashdotdash slashdotdash commented Jan 27, 2018

Link one or more existing events to another stream.

Event linking allows you to include events in multiple streams, such as copying an event from one stream to another, but only a reference to the original event is stored.

An event may be present in a stream only once, but may be linked into as many streams as required.

Linked events are used to build the $all stream containing every persisted event, globally ordered.

Use each recorded event's event_number field for the position of the event within the read/received stream. The stream_uuid and stream_version fields refer to the event's original stream.

Example usage

Read source events:

{:ok, events} = EventStore.read_stream_forward(source_stream_uuid)

Link events to another stream:

:ok = EventStore.link_to_stream(target_stream_uuid, 0, events)

@slashdotdash slashdotdash changed the title Stream events table Link to stream Jan 27, 2018
@slashdotdash slashdotdash changed the title Link to stream Link existing events to another stream Jan 27, 2018
@slashdotdash slashdotdash force-pushed the feature/stream-events-table branch from c823b1b to 5c902d8 Compare January 29, 2018 13:02
@slashdotdash slashdotdash force-pushed the feature/stream-events-table branch from 5c902d8 to 261bc32 Compare January 29, 2018 13:03
@slashdotdash slashdotdash merged commit 14ffdf3 into master Jan 29, 2018
@slashdotdash slashdotdash deleted the feature/stream-events-table branch January 29, 2018 13:25
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.

1 participant