Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register types rake task #446

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

erikrozendaal
Copy link
Member

Adds a new Rake task sequent:register:types to insert aggregate root, command, and event types into the *_types tables. Useful to run after deploying new code so all new types are registered in advance.

@erikrozendaal erikrozendaal force-pushed the register-types-rake-task branch from 2efe395 to f1dc77a Compare February 21, 2025 13:53
Copy link
Member

@lvonk lvonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is nice to have this also in a single class so it can be used in initializers. Rails apps can then check if preloading (a prerequisite for using Sequent) turned on:

https://sequent.io/docs/rails-sequent.html#eager-loading

connection

Sequent.configuration.event_store.register_types(
aggregate_root_classes: all_subclasses(Sequent::Core::AggregateRoot),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sequent::Core::AggregateRoot.descendants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants