API for interacting with streams in EventStoreDB.
==Main operations==
- subscribing to the global stream or an individual stream.
- reading from the global stream or an individual stream.
- appending event data to an existing stream or creating a new stream.
- deleting events from a stream.
Value members
Abstract methods
Appends EventData to a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
Appends EventData to a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
- Value Params
- data
event data to be appended to the stream. See EventData.
- expectedState
the state that the stream is expected to in. See StreamState for details.
- streamId
the id of the stream to append to.
- See also
https://ahjohannessen.github.io/sec/docs/writing for details about appending to a stream.
Deletes a stream and returns DeleteResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.
Deletes a stream and returns DeleteResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.
- Value Params
- expectedState
the state that the stream is expected to in. See StreamState for details.
- streamId
the id of the stream to delete.
- See also
https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to delete a stream.
- Note
Deleted streams can be recreated.
Returns an sec.api.streams.Reads instance. This is useful when you need more granularity from readAll
or
readStream
operations.
Returns an sec.api.streams.Reads instance. This is useful when you need more granularity from readAll
or
readStream
operations.
Read events from the global stream, sec.StreamId.All.
Read events from the global stream, sec.StreamId.All.
- Value Params
- direction
whether to read forwards or backwards.
- from
log position to read from.
- maxCount
limits maximum events returned.
- resolveLinkTos
whether to resolve EventType.LinkTo events automatically.
- Returns
a Stream that emits AllEvent values.
Read events from an individual stream. A sec.api.exceptions.StreamNotFound is raised when the stream does not exist.
Read events from an individual stream. A sec.api.exceptions.StreamNotFound is raised when the stream does not exist.
- Value Params
- direction
whether to read forwards or backwards.
- from
stream position to read from.
- maxCount
limits maximum events returned.
- resolveLinkTos
whether to resolve EventType.LinkTo events automatically.
- streamId
the id of the stream to subscribe to.
- Returns
a Stream that emits StreamEvent values.
Subscribes to the global stream, StreamId.All.
Subscribes to the global stream, StreamId.All.
- Value Params
- exclusiveFrom
position to start from. Use None to subscribe from the beginning.
- resolveLinkTos
whether to resolve EventType.LinkTo events automatically.
- Returns
a Stream that emits AllEvent values.
Subscribes to the global stream, StreamId.All using a subscription filter.
Subscribes to the global stream, StreamId.All using a subscription filter.
- Value Params
- exclusiveFrom
log position to start from. Use None to subscribe from the beginning.
- filterOptions
to use when subscribing - See sec.api.SubscriptionFilterOptions.
- resolveLinkTos
whether to resolve EventType.LinkTo events automatically.
- Returns
a Stream that emits either Checkpoint or AllEvent values. How frequent Checkpoint is emitted depends on
filterOptions
.
Subscribes to an individual stream.
Subscribes to an individual stream.
- Value Params
- exclusiveFrom
stream position to start from. Use None to subscribe from the beginning.
- resolveLinkTos
whether to resolve EventType.LinkTo events automatically.
- streamId
the id of the stream to subscribe to.
- Returns
a Stream that emits StreamEvent values.
Tombstones a stream and returns TombstoneResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.
Tombstones a stream and returns TombstoneResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.
- Value Params
- expectedState
the state that the stream is expected to in. See StreamState for details.
- streamId
the id of the stream to delete.
- See also
https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to tombstone a stream.
- Note
Tombstoned streams can never be recreated.
Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.
Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.
- Value Params
- creds
Custom user credentials to use.