-
Notifications
You must be signed in to change notification settings - Fork 146
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
Read events by event type #276
Comments
When you're doing this, "streams" are irrelevant. So you'll need a different struct with only the the event table data. |
and I think you'll need to do this to construct the query: |
Reading events like this doesn't really fit in a "general" event store. If you wanna have this feature you can look into creating your own custom stream that has all of those events. Like the purposed feature #169 here using https://github.com/commanded/eventstore/blob/master/guides/Usage.md#linking-events-between-streams |
I would be conservative about adding functionality that could be done at the application level. |
I just plain disagree with that statement. it does have a use and there's no definition of a concrete "general event store". see the of_type method here https://railseventstore.org/docs/v2/read/ I did end up writing my own function that does so at the query level and gives me what I need. it COULD (and should) be a part of this lib though. |
It can be, but why would I opt to feed the entire database through my application, when I can filter at the db level and save a lot of cpu time. I suspect you didn't really read/understand my request, and didn't go click the link to see this is exactly present in that [very extensive] ruby library. |
Pull requests are accepted if you'd like to contribute this feature. |
your reply is just plain idiotic. this entire library can be done at the "application level" |
yes, will do so in the future |
@ericlyoung is there any reason to use "idiotic" here? I do not appreciate your response.
That was precisely the point, you can have the code outside of the package itself and test things out in your app, and then bring the learning into the package. But as I said, try to be conservative because you can have your own package with such functionalities added. |
I need the ability to query events by event_type
See here https://railseventstore.org/docs/v2/read/
You are lacking the "of_type" function.
example: EventStore.read_events_by_type_forward([OrderCreated])
This is needed for event sourcing when I want to rebuild my "orders" read model table. You typically query for the "initiating" events ("OrderCreated") of the streams ("Order:abc-123") and rebuild the aggregates to dump into the read model tables.
I'll do this myself if you refuse, but you're probably much quicker.
The text was updated successfully, but these errors were encountered: