# orkestra v0.2.0 - Table of Contents

CQRS/ES toolkit for Elixir with pluggable message bus and event store

## Pages

- [Orkestra](readme.md)

## Modules

- [Orkestra](Orkestra.md): CQRS/ES toolkit for Elixir.
- [Orkestra.Aggregate](Orkestra.Aggregate.md): Behaviour for functional event-sourced aggregates.
- [Orkestra.Aggregate.Root](Orkestra.Aggregate.Root.md): The imperative shell for functional aggregates.
- [Orkestra.Command](Orkestra.Command.md): Behaviour and struct builder for CQRS commands.
- [Orkestra.CommandEnvelope](Orkestra.CommandEnvelope.md): Wraps a command with dispatch context: routing, retries, and lifecycle tracking.
- [Orkestra.CommandHandler](Orkestra.CommandHandler.md): Macro for defining command handlers with automatic subscription and ack/nack.
- [Orkestra.ES.Auth.ApiKey](Orkestra.ES.Auth.ApiKey.md): `Snap.Auth` implementation for Elasticsearch/OpenSearch API key authentication.
- [Orkestra.ES.Facet](Orkestra.ES.Facet.md): Canonical facet structs shared by the `Orkestra.ES` subsystem.
- [Orkestra.ES.Facet.Attribute](Orkestra.ES.Facet.Attribute.md): A facet attribute: a `code`/`name` pair owning an ordered list of
`Orkestra.ES.Facet.Value` structs.

- [Orkestra.ES.Facet.Value](Orkestra.ES.Facet.Value.md): A single facet value belonging to an `Orkestra.ES.Facet.Attribute`.
- [Orkestra.ES.Index](Orkestra.ES.Index.md): Elasticsearch/OpenSearch index lifecycle utilities.
- [Orkestra.ES.Page](Orkestra.ES.Page.md): A page of results returned by `Orkestra.ES.Repository`'s `get_paged/1`.
- [Orkestra.ES.PagedQuery](Orkestra.ES.PagedQuery.md): Pure builder and response parser behind `Orkestra.ES.Repository.get_paged/1`.
- [Orkestra.ES.Query](Orkestra.ES.Query.md): Pipe-based DSL for composing Elasticsearch bool queries.
- [Orkestra.ES.Repository](Orkestra.ES.Repository.md): Generates a CRUD/read repository for an `Orkestra.ES.Schema`.
- [Orkestra.ES.Schema](Orkestra.ES.Schema.md): Declarative, Ecto-like schema DSL for Elasticsearch/OpenSearch read models.
- [Orkestra.ES.Schema.Casting](Orkestra.ES.Schema.Casting.md): Converts between an `Orkestra.ES.Schema` struct and its Elasticsearch
document representation.
- [Orkestra.ES.Schema.Compiler](Orkestra.ES.Schema.Compiler.md): Compile-time validation for `Orkestra.ES.Schema`.
- [Orkestra.ES.Schema.Mapping](Orkestra.ES.Schema.Mapping.md): Builds the full Elasticsearch index mapping for an `Orkestra.ES.Schema`.
- [Orkestra.Event](Orkestra.Event.md): Behaviour and struct builder for domain events.
- [Orkestra.EventEnvelope](Orkestra.EventEnvelope.md): Wraps a domain event with dispatch and delivery context.
- [Orkestra.EventHandler](Orkestra.EventHandler.md): Macro for defining event handlers with automatic subscription and ack/nack.
- [Orkestra.EventStore](Orkestra.EventStore.md): Behaviour for event persistence with optimistic concurrency.
- [Orkestra.EventStore.EventStoreDB](Orkestra.EventStore.EventStoreDB.md): EventStoreDB adapter via Spear gRPC client.
- [Orkestra.EventStore.InMemory](Orkestra.EventStore.InMemory.md): In-memory EventStore adapter backed by an Agent.
For tests and local development without EventStoreDB.
- [Orkestra.EventStore.Snapshot](Orkestra.EventStore.Snapshot.md): Snapshot support for aggregates.
- [Orkestra.MessageBus](Orkestra.MessageBus.md): Behaviour for dispatching commands and publishing events.
- [Orkestra.MessageBus.Handler](Orkestra.MessageBus.Handler.md): Behaviour for command and event handlers.
- [Orkestra.MessageBus.PubSub](Orkestra.MessageBus.PubSub.md): In-process MessageBus implementation using Phoenix.PubSub.
- [Orkestra.MessageBus.RabbitMQ](Orkestra.MessageBus.RabbitMQ.md): Distributed MessageBus implementation using RabbitMQ.
- [Orkestra.Metadata](Orkestra.Metadata.md): Metadata carried by every command and event envelope.
- [Orkestra.Projection.Checkpoint](Orkestra.Projection.Checkpoint.md): Ecto schema for persisting a projector's position and halt status.
- [Orkestra.Projection.DeadLetter](Orkestra.Projection.DeadLetter.md): Ecto schema for persisting parked (dead-lettered) events (ERR-02).
- [Orkestra.Projection.Migration](Orkestra.Projection.Migration.md): Creates and drops Orkestra's internal projection tables.
- [Orkestra.Projection.Storage](Orkestra.Projection.Storage.md): Behaviour for pluggable read-model storage adapters.
- [Orkestra.Projection.Storage.Elasticsearch](Orkestra.Projection.Storage.Elasticsearch.md): Elasticsearch/OpenSearch storage adapter implementing `Orkestra.Projection.Storage`.
- [Orkestra.Projection.Storage.Postgres](Orkestra.Projection.Storage.Postgres.md): PostgreSQL storage adapter implementing `Orkestra.Projection.Storage`.
- [Orkestra.Projection.Supervisor](Orkestra.Projection.Supervisor.md): Supervisor for Orkestra projectors.
- [Orkestra.Projector](Orkestra.Projector.md): DSL macro for defining Orkestra projectors.
- [Orkestra.Projector.GenServer](Orkestra.Projector.GenServer.md): Runtime GenServer for Orkestra projection subsystem.
- [Orkestra.Projector.Lifecycle](Orkestra.Projector.Lifecycle.md): Pure functions for projector error classification and retry decisions.
- [Orkestra.Telemetry](Orkestra.Telemetry.md): OpenTelemetry tracing and structured logging helpers for Orkestra.

## Mix Tasks

- [mix orkestra.es.migrate](Mix.Tasks.Orkestra.Es.Migrate.md): Reconciles the Elasticsearch alias of every configured `Orkestra.ES.Schema`
with its current mapping. Missing aliases are created; drifted aliases are
reindexed zero-downtime via `Snap.Indexes.hotswap/5`; in-sync aliases are
left untouched.
- [mix orkestra.es.setup](Mix.Tasks.Orkestra.Es.Setup.md): Sets up the Elasticsearch alias + versioned index for every configured
`Orkestra.ES.Schema` (idempotent — existing aliases are left untouched).
- [mix orkestra.es.status](Mix.Tasks.Orkestra.Es.Status.md): Prints a read-only status table for every configured `Orkestra.ES.Schema`,
reporting whether each alias exists and whether its deployed mapping has
drifted from the current schema definition. Makes no changes.
- [mix orkestra.projection.drop](Mix.Tasks.Orkestra.Projection.Drop.md): Rolls back all migrations for the named projection and deletes its
checkpoint and dead-letter rows.
- [mix orkestra.projection.es.rebuild](Mix.Tasks.Orkestra.Projection.Es.Rebuild.md): Rebuilds an Elasticsearch projection by creating a new versioned index,
replaying all events, atomically swapping the alias, and cleaning up
the old index — without any search downtime.
- [mix orkestra.projection.migrate](Mix.Tasks.Orkestra.Projection.Migrate.md): Runs all pending migrations for the named projection.
- [mix orkestra.projection.rebuild](Mix.Tasks.Orkestra.Projection.Rebuild.md): Rebuilds a projection by stopping its GenServer, rolling back and
re-running all migrations, resetting the checkpoint, and restarting
the GenServer. The projector then replays the full event stream from
position 0, transitioning to live automatically once caught up.
- [mix orkestra.projection.rollback](Mix.Tasks.Orkestra.Projection.Rollback.md): Rolls back migrations for the named projection.

