Skip to content

Read model projections for Commanded using Ecto

License

Notifications You must be signed in to change notification settings

commanded/commanded-ecto-projections

Folders and files

NameName
Last commit message
Last commit date
Jan 17, 2024
Jan 18, 2024
Jan 18, 2024
Mar 20, 2024
May 25, 2020
Jan 18, 2024
Oct 8, 2018
May 16, 2021
Jan 17, 2024
Jan 18, 2024
May 16, 2021
Mar 10, 2023
Jan 18, 2024
Jan 17, 2024

Repository files navigation

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

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)
  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:

mix deps.get
MIX_ENV=test mix setup
mix test

Contributors

Need help?

Please open an issue if you encounter a problem, or need assistance. You can also seek help in the #commanded channel in the official Elixir Slack.

Copyright and License

Copyright (c) 2017 Ben Smith

This library is released under the MIT License. See the LICENSE.md file for further details.