Closed AlexWeinstein92 closed 3 months ago
This raises questions about how we should model projections in RIDDL. Assuming the intended target is a relational database makes it too rigid, in my view. I will try to synthesize a more abstract solution.
@AlexWeinstein92 - some conclusions I've made from considering your suggestion:
on event
bullet points can/should be done by sending messages to the repository. updating repository MyRepository
In projectors themselves multiple records should be allowed. This would allow for multiple tables in a single projector for joining
on result
.In on-clauses of projector handlers ideally the following is possible:
on event
:create
,update
, orremove
for record typewith index
forcreate
, for examplecreate record Table1Fields with index Table1Fields.id
with
for checking rows to alterupdate record Table1Fields with Table1Fields.Name equals Event.Name
records
remove records Table1Fields with Table1Fields.DateCreated less than today()
[now()
is also necessary]when
for conditional onwith
:create records ProductOrderFields with index Event.id when ProductFields.SKU equals Event.SKU
(prevents Orders with bad SKUs having Product entries created for them)set Table1Fields.Name to Event.Name
on query
:filter
join