DDD.Config (vicander v0.1.1)

Copy Markdown View Source

The framework's application configuration, in one place.

# config/config.exs of your application
config :vicander, repo: MyApp.Repo

repo is the Ecto.Repo the framework uses unless a command, query, handler or projection names another with repo: (for example use DDD.Command, repo: MyApp.OtherRepo). It is read when the code runs, not when it compiles, so a test can change it.

The other keys are documented where they apply:

Summary

Functions

Resolve a repo: option: :default is the configured repo, nil stays nil (no transaction), and a module is itself.

The configured repo. Raises, saying how to configure it, when there is none.

Functions

repo(repo)

@spec repo(:default | nil | module()) :: module() | nil

Resolve a repo: option: :default is the configured repo, nil stays nil (no transaction), and a module is itself.

repo!()

@spec repo!() :: module()

The configured repo. Raises, saying how to configure it, when there is none.