serverlesstechnology / cqrs

A lightweight, opinionated CQRS and event sourcing framework.
Other
346 stars 36 forks source link

Upcasting replays #81

Closed rogierknoester closed 8 months ago

rogierknoester commented 8 months ago

An attempt at implementing upcasting in query replays. I think this implementation has the least amount of breaking changes without, it requires that ReplayStream accepts upcasters in its next(...) function. Another approach could be to have a method like next_with_upcasting(...). If that is preferred, I can change it. Other solutions like passing them to stream_all_events(...) would require updating other crates and possibly breaking people's own implementations of event repositories.

Let me know if I missed something :)

codecov[bot] commented 8 months ago

Codecov Report

Merging #81 (8d2ce5e) into main (164070d) will increase coverage by 0.60%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   83.77%   84.38%   +0.60%     
==========================================
  Files          21       21              
  Lines        2120     2196      +76     
==========================================
+ Hits         1776     1853      +77     
+ Misses        344      343       -1     
Files Coverage Δ
src/persist/event_stream.rs 93.61% <100.00%> (+6.52%) :arrow_up:
src/persist/replay.rs 92.59% <100.00%> (+4.24%) :arrow_up:

... and 2 files with indirect coverage changes

davegarred commented 8 months ago

LGTM, thanks for the help @rogierknoester