Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created November 10, 2014 20:54
Show Gist options
  • Save bjhaid/4826ce0a280ae21f9992 to your computer and use it in GitHub Desktop.
Save bjhaid/4826ce0a280ae21f9992 to your computer and use it in GitHub Desktop.
defmodule Repo do
use Ecto.Repo, adapter: Ecto.Adapters.Postgres, env: Mix.env
@doc "Adapter configuration"
def conf(env) do
a = parse_url url(env)
IO.inspect(a)
a
end
defp url(:dev) do
"ecto://postgres:postgres@localhost:5433/foo_dev"
end
defp url(:test) do
"ecto://postgres:postgres@localhost:5433/foo_test?size=1&max_overflow=0"
end
defp url(:prod) do
"ecto://postgres:postgres@localhost:5433/foo_prod"
end
@doc "The priv directory to load migrations and metadata."
def priv do
app_dir(:elixir_worker, "priv/foo")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment