EventStore adapter for Commanded
Use the PostgreSQL-based EventStore with Commanded.
MIT License
Getting started
The package can be installed from hex as follows.
-
Add
commanded_eventstore_adapterto your list of dependencies inmix.exs:def deps do[{:commanded_eventstore_adapter, "~> 0.2"}]end -
Include
:eventstorein the list of applications to start.For Elixir 1.4, add
:eventstoreto the extra applications list inmix.exs:def application do[extra_applications: [:logger,:eventstore,],]endFor Elixir 1.3 and before, add
:eventstoreto the applications list inmix.exs:def application do[applications: [:logger,:eventstore,],]end -
Configure Commanded to use the event store adapter:
config :commanded,event_store_adapter: Commanded.EventStore.Adapters.EventStore -
Configure the
eventstorein each environment's mix config file (e.g.config/dev.exs), specifying usage of the included JSON serializer:config :eventstore, EventStore.Storage,serializer: Commanded.Serialization.JsonSerializer,username: "postgres",password: "postgres",database: "eventstore_dev",hostname: "localhost",pool_size: 10 -
Create the
eventstoredatabase and tables using themixtask:mix event_store.create