Ecto.Repo

Parsed documentation:
View on GitHub
Defines a repository.

A repository maps to a data store, for example an SQL database.
A repository must implement `conf/0` and set an adapter (see `Ecto.Adapter`)
to be used for the repository.

When used, the following options are allowed:

* `:adapter` - the adapter to be used for the repository

* `:env` - configures the repository to support environments

## Example

    defmodule MyRepo do
      use Ecto.Repo, adapter: Ecto.Adapters.Postgres

      def conf do
        parse_url "ecto://postgres:postgres@localhost/postgres"
      end
    end

Most of the time, we want the repository to work with different
environments. In such cases, we can pass an `:env` option:

    defmodule MyRepo do
      use Ecto.Repo, adapter: Ecto.Adapters.Postgres, env: Mix.env

      def conf(env), do: parse_url url(env)

      defp url(:dev),  do: "ecto://postgres:postgres@localhost/postgres_dev"
      defp url(:test), do: "ecto://postgres:postgres@localhost/postgres_test?size=1"
      defp url(:prod), do: "ecto://postgres:postgres@localhost/postgres_prod"
    end

Notice that, when using the environment, developers should implement
`conf/1` which automatically passes the environment instead of `conf/0`.

Note the environment is only used at compilation time. That said, make
sure the `:build_per_environment` option is set to true (the default)
in your Mix project configuration.
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.