Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This pull request adds support for defining and running multiple event store modules within a single Elixir application.
Getting started
First, you must define your own event store module using the
EventStore
macro:You can name your event store module however you like.
Secondly, configure the
MyApp.EventStore
module inconfig/config.exs
:Finally, the event store module must be included within your application's supervision tree (e.g. in
lib/my_app/application.ex
, inside thestart/2
function):Optionally, you can configure the event store modules in
config/config.exs
to allow running the event store mix tasks without providing the event store module as a command line argument:The above configuration allows you to run
mix event_store.init
instead ofmix event_store.init -e MyApp.EventStore
(as an example).Usage
Use your event store module exactly as you would have previously used the
EventStore
itself.For ease of upgrading you can alias your own event store module:
You can define and use as many different event store modules as you like. Each store will use its own separate database and be completely isolated from one another.