Closed neoeinstein closed 5 years ago
Right now, the cqrs-postgres
implementations for read_events
and read_events_with_metadata
return Result<Option<Vec<Result<Event, E>>>, E>
. Seems like we could clean that up by just returning a Result<Option<Vec<Event>>, E>
Lazy loading may be useful, but I think we are better just relying on the caller asking for reasonable page sizes, since we are loading everything into a Vec
right now anyway.
Right now, the
cqrs-postgres
implementations forread_events
andread_events_with_metadata
returnResult<Option<Vec<Result<Event, E>>>, E>
. Seems like we could clean that up by just returning aResult<Option<Vec<Event>>, E>
Lazy loading may be useful, but I think we are better just relying on the caller asking for reasonable page sizes, since we are loading everything into aVec
right now anyway.
Yeah I agree switching to Result<Option<Vec<Event>>, E>
is a bit nicer for consumers. We can also add a lazy method later down the line if it's determined that would be useful to have
See #4 for the change to simplify. We can merge that first, then I can fix up this PR to match.
Makes it possible to retrieve metadata information out of the event store. Adds a demonstration to the
cqrs-todoql-psql
example.