Query Module

Specific Commands

query-logic :Read side of the project

    query-logic Lottery {
    function lotteryNameExists(lotteryName:String):Boolean
}

Projector :Read side of the project

    projector [LotteryStream] Lottery {
            LotteryCreated,ParticipantAdded,LotteryRan
}

Recipes

Projector: LotteryProjectorCode gets generated under src. LotteryProjector is the interface under src-gen, LotteryProjectorCode extends LotteryProjector. Anytime definition changes, LotteryProjector regenerates, and any mismatch would be guided by the compiler.

override def project(event: LotteryCreated, context: EventContext): Unit = ?? //for all the events handle method gets generated

Query And Function: LotteryQueryLogicCode gets generated and functions are defined here. One LotteryQueryLogic interface also gets generated under src-gen and LotteryQueryLogicCode extends that interface, so that any time any changes in the definition then compiler make sure that there is no orphan method or any method definition is not overridden by the Code file.

override def lotteryNameExists(lotteryName:String):Boolean = ??