Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TrackingTable streamId eventId st
- createTrackingTable :: (MonadError Error m, MonadIO m) => (forall r. (Connection -> IO r) -> IO r) -> Query -> Query -> Query -> Query -> m (TrackingTable streamId eventId st)
- upsertTrackingTable :: (ToField streamId, ToField eventId, ToField st) => TrackingTable streamId eventId st -> streamId -> eventId -> Either String st -> SqlAction
- doUpsertTrackingTable :: (MonadError Error m, MonadIO m, ToField eventId, ToField streamId, ToField st) => TrackingTable streamId eventId st -> streamId -> eventId -> Either String st -> m ()
Documentation
data TrackingTable streamId eventId st Source #
Instances
(MonadError Error m, MonadIO m, FromField eventId, FromField st, FromField streamId, ToField eventId, ToField st, ToField streamId) => TrackingTable m (TrackingTable streamId eventId st) streamId eventId st Source # | |
Defined in Database.CQRS.PostgreSQL.TrackingTable getTrackedState :: TrackingTable streamId eventId st -> streamId -> m (TrackedState eventId st) # upsertError :: TrackingTable streamId eventId st -> streamId -> eventId -> String -> m () # |
:: (MonadError Error m, MonadIO m) | |
=> (forall r. (Connection -> IO r) -> IO r) | |
-> Query | Name of the tracking table. |
-> Query | Type of stream identifiers. |
-> Query | Type of event identifiers. |
-> Query | Type of the state. |
-> m (TrackingTable streamId eventId st) |
Create tracking table if it doesn't exist already.
A tracking table is a table used to track the last events processed by a projection for each stream in a stream family. It allows them to restart from where they have left off.
:: (ToField streamId, ToField eventId, ToField st) | |
=> TrackingTable streamId eventId st | |
-> streamId | |
-> eventId | |
-> Either String st | The new state or the error message if it failed. |
-> SqlAction |
Return SQL query to upsert a row in a tracking table.
doUpsertTrackingTable Source #
:: (MonadError Error m, MonadIO m, ToField eventId, ToField streamId, ToField st) | |
=> TrackingTable streamId eventId st | |
-> streamId | |
-> eventId | |
-> Either String st | The new state or the error message if it failed. |
-> m () |
Update the tracking table for the given stream.