Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/commanded/commanded-ecto-projections
Read model projections for Commanded using Ecto
https://github.com/commanded/commanded-ecto-projections
cqrs cqrs-es cqrs-framework ecto event-handler read-model
Last synced: 8 days ago
JSON representation
Read model projections for Commanded using Ecto
- Host: GitHub
- URL: https://github.com/commanded/commanded-ecto-projections
- Owner: commanded
- License: mit
- Created: 2017-06-08T19:47:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T22:59:13.000Z (8 months ago)
- Last Synced: 2024-10-29T22:37:26.636Z (11 days ago)
- Topics: cqrs, cqrs-es, cqrs-framework, ecto, event-handler, read-model
- Language: Elixir
- Size: 143 KB
- Stars: 89
- Watchers: 7
- Forks: 41
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-elixir-cqrs - Commanded Ecto projections - Read model projections for Commanded using Ecto. (Libraries)
README
# Commanded Ecto Projections
Read model projections for [Commanded](https://github.com/commanded/commanded) CQRS/ES applications using [Ecto](https://github.com/elixir-ecto/ecto) for persistence.
Read the [Changelog](CHANGELOG.md) for recent changes and the [Hex Docs](https://hexdocs.pm/commanded_ecto_projections/) 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/Getting%20Started.md)
- [Usage](guides/Usage.md)
- [Creating a read model](guides/Usage.md#creating-a-read-model)
- [Creating a projector](guides/Usage.md#creating-a-projector)
- [Supervision](guides/Usage.md#supervision)
- [Error handling](guides/Usage.md#error-handling)
- [`error/3` callback](guides/Usage.md#error3-callback)
- [Error handling example](guides/Usage.md#error-handling-example)
- [`after_update/3` callback](guides/Usage.md#after_update3-callback)
- [Schema prefix](guides/Usage.md#schema-prefix)
- [Rebuilding a projection](guides/Usage.md#rebuilding-a-projection)### Example projector
```elixir
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} = eventprojection = %ExampleProjection{name: name}
Ecto.Multi.insert(multi, :example_projection, projection)
end
end
```### 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:
```console
mix deps.get
MIX_ENV=test mix setup
mix test
```### Contributors
- [Andrey Akulov](https://github.com/astery)
- [Ben Smith](https://github.com/slashdotdash)
- [CptBreeza](https://github.com/CptBreeza)
- [Florian Ebeling](https://github.com/febeling)
- [Sascha Wolf](https://github.com/Zeeker)
- [Tobiasz Małecki](https://github.com/amatalai)## Need help?
Please [open an issue](https://github.com/commanded/commanded-ecto-projections/issues) if you encounter a problem, or need assistance. You can also seek help in the #commanded channel in the [official Elixir Slack](https://elixir-slackin.herokuapp.com/).
## Copyright and License
Copyright (c) 2017 Ben Smith
This library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file for further details.