commanded_ecto_projections v1.0.0-rc.0 Commanded.Projections.Ecto

Read model projections for Commanded using Ecto.

Example usage

defmodule Projector do
  use Commanded.Projections.Ecto,
    application: MyApp.Application,
    name: "my-projection",
    repo: MyRepo,
    schema_prefix: "my-prefix",
    timeout: :infinity

  project %Event{}, _metadata, fn multi ->
    Ecto.Multi.insert(multi, :my_projection, %MyProjection{...})
  end

  project %AnotherEvent{}, fn multi ->
    Ecto.Multi.insert(multi, :my_projection, %MyProjection{...})
  end
end

Guides

Link to this section Summary

Link to this section Functions

Link to this macro

project(event, lambda)

(macro)
Link to this macro

project(event, metadata, lambda)

(macro)