Did you planned to support the projections?
ikasymov opened this issue · comments
Hi @ikasymov!
Yes this is something we are planning to support. It wasn't included for the forthcoming v1.0 release, but it will be supported soon in a subsequent release. I've mentioned your question to the EventStoreDB people I'm working with, so hopefully it will become a priority now. :-)
@ikasymov In this issue, did you mean reading the system projections, or creating new projections?
@johnbywater Creating the new projections. If I understand correctly, we can read system projections already.
Alright, thanks for letting me know. Yes we can read system projections already. Creating new projections is forthcoming.
@johnbywater Stop, I can't read the custom projection result by the read_stream function. I got the error:
esdbclient.exceptions.NotFound: Stream 'tester_projection' not found
This projection already registered on eventstoredb:
What do I need to do to read the result of the simple projection like this?
fromStream('stock_1')
.when({
$init: function(){
return {
count: 0
}
},
$any: function(s,e){
s.count += 1;
}
})
@ikasymov I've implemented the Projections API.
https://github.com/pyeventsourcing/esdbclient?tab=readme-ov-file#projections
Published as pre-release v1.1b1:
https://pypi.org/project/esdbclient/1.1b1/
What do I need to do to read the result of the simple projection like this?
You need to call the get_projection_state()
method - see the docs :-)
It's great news. Thanks so much!