Skip to content

Should we add a projection abstraction? #32

@dgoerdes

Description

@dgoerdes

In the example app we highlight the importance of the revision field for projections.

export const User = z.object({
    _id: z.string().length(24),
    id: z.string(),

    // The revision is an important bit of
    // information. We set the latest event id
    // from the EventSourcingDB related to this user
    // here.
    // This is used to resume the projection if the
    // application is restarted. We do not want to
    // apply all events again but pick up where we left off.
    //
    // See also getUserProjectionLowerBound() in users.projection.ts
    // for additional details on this.
    revision: z.string(),

    email: z.string(),
    firstName: z.string(),
    lastName: z.string(),
    invitedAt: z.string(),
    acceptedAt: z.string().nullable(),
});

Would it be good to add some abstraction for projections to Nimbus?
How should this look like, e.g. a type or interface that could simply be extended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions