Getting started

EventStore is available in Hex and can be installed as follows:

  1. Add eventstore to your list of dependencies in mix.exs:

      def deps do
        [{:eventstore, "~> 0.11"}]
      end
    
  2. Add an eventstore config entry containing the PostgreSQL database connection details to each environment's mix config file (e.g. config/dev.exs):

      config :eventstore, EventStore.Storage,
        username: "postgres",
        password: "postgres",
        database: "eventstore_dev",
        hostname: "localhost",
        pool_size: 10,
        pool_overflow: 5
    

    The database connection pool configuration options are:

  • :pool_size - The number of connections (default: 10).
  • :pool_overflow - The maximum number of overflow connections to start if all connections are checked out (default: 0).

  1. Create the EventStore database and tables using the mix task:

      $ mix event_store.create
    

Next: Using the EventStore