# Commanded Ecto Projections

Read model projections for [Commanded]( CQRS/ES applications using [Ecto]( for persistence.

Read the [Changelog]( for recent changes and the [Hex Docs]( on API usage.

> This README and the following guides follow the `master` branch which may not be the currently published version.

### Overview

- [Getting started](guides/
- [Usage](guides/
  - [Creating a read model](guides/
  - [Creating a projector](guides/
  - [Supervision](guides/
  - [Error handling](guides/
    - [`error/3` callback](guides/
    - [Error handling example](guides/
  - [`after_update/3` callback](guides/
  - [Schema prefix](guides/
  - [Rebuilding a projection](guides/

### Example projector

defmodule MyApp.ExampleProjector do
  use Commanded.Projections.Ecto,
    application: MyApp.Application,
    repo: MyApp.Projections.Repo,
    name: "MyApp.ExampleProjector"

  project %AnEvent{} = event, _metadata, fn multi ->
    %AnEvent{name: name} = event

    projection = %ExampleProjection{name: name}

    Ecto.Multi.insert(multi, :example_projection, projection)

### Contributing

Pull requests to contribute new or improved features, and extend documentation are most welcome. Please follow the existing coding conventions.

You should include unit tests to cover any changes. Run `mix test` to execute the test suite:

mix deps.get
MIX_ENV=test mix setup
mix test

### Contributors

- [Andrey Akulov](
- [Ben Smith](
- [CptBreeza](
- [Florian Ebeling](
- [Sascha Wolf](
- [Tobiasz Małecki](

## Need help?

Please [open an issue]( if you encounter a problem, or need assistance. You can also seek help in the [Gitter chat room]( for Commanded.

For commercial support, and consultancy, please contact [Ben Smith](

## Copyright and License

Copyright (c) 2017 Ben Smith

This library is released under the MIT License. See the [](./ file for further details.