pyeventsourcing / esdbclient

Python gRPC client for EventStoreDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
Screenshot 2023-12-31 at 21 19 43

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;
    }
})

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 :-)

commented

It's great news. Thanks so much!