-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add new generic on PgStore and converter trait to decouple persistence from Aggregate::Event #191
Conversation
9ebfc46
to
ff9bac4
Compare
…e from Aggregate::Event
ff9bac4
to
25d3329
Compare
0f21d16
to
dea2073
Compare
8fb9d09
to
7f55781
Compare
7f55781
to
0bef40c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. Very nice solution and top for the non-breaking change!
Only some notes (collected together in the meet) regarding some changes that would be worth it doing in this PR:
- Split
schema
example into multiple examples, trying to let examples as easy as possible. - Update readme with a section like "Decoupe Aggregate Event from DB Event (Schema)"
- Rename
Event
trait to be a bit more consistent to its role. - Rename some generics to be a one-letter-only generic?
15bf67c
to
e75ac61
Compare
7c653e9
to
0dcb1db
Compare
bd186b7
to
1841719
Compare
1841719
to
4a9077b
Compare
@@ -1 +1 @@ | |||
msrv = "1.58.0" | |||
msrv = "1.74.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project currently does not compile with version 1.73.0
. We can fix the issue in the crate itself, but it looks like sqlx-core-0.7.4
does not compile with 1.73.0
either. If we wanted to address this we might need to use an older version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to set 1.74 as minimum version
7463ffe
to
95396c6
Compare
95396c6
to
0b165f8
Compare
769d131
to
69ef2d3
Compare
This PR adds a way to decouple the persistence from the domain Aggregate::Event types.
This removes the need to Aggregate::Event to implement the Event trait to work with PgStore.
It simultaneously provides a way to deprecate events without the effects propagating through a code base. Furthermore it provides an alternative way to upcast events.
I have added an example to demonstrate the use case of deprecation and upcasting.