Packages
db_connection
0.1.6
2.10.2
2.10.1
2.10.0
2.9.0
2.8.1
2.8.0
2.7.0
2.6.0
2.5.0
2.4.3
2.4.2
2.4.1
2.4.0
2.3.1
2.3.0
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0-rc.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
1.0.0-rc.5
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
1.0.0-rc.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Database connection behaviour for database transactions and connection pooling
Current section
Files
Jump to
Current section
Files
db_connection
mix.exs
mix.exs
defmodule DBConnection.Mixfile do
use Mix.Project
@pools [:connection, :poolboy, :sojourn]
@version "0.1.6"
def project do
[app: :db_connection,
version: @version,
elixir: "~> 1.0",
deps: deps,
docs: docs,
description: description,
package: package,
build_per_environment: false,
test_paths: test_paths(Mix.env),
aliases: ["test.all": ["test", "test.pools"],
"test.pools": &test_pools/1],
preferred_cli_env: ["test.all": :test]]
end
def application do
[applications: [:logger, :connection, :backoff],
mod: {DBConnection.App, []}]
end
defp deps do
[{:connection, "~> 1.0.2"},
{:backoff, "~> 1.0"},
{:poolboy, "~> 1.5", [optional: true]},
{:sbroker, "~> 0.7", [optional: true]},
{:earmark, "~> 0.1", only: :dev},
{:ex_doc, "~> 0.11.1", only: :dev}]
end
defp docs do
[source_url: "https://github.com/fishcakez/db_connection",
source_ref: "v#{@version}",
main: DBConnection]
end
defp description do
"""
Database connection behaviour for database transactions and connection pooling
"""
end
defp package do
%{licenses: ["Apache 2.0"],
maintainers: ["James Fish"],
links: %{"Github" => "https://github.com/fishcakez/db_connection"}}
end
defp test_paths(pool) when pool in @pools, do: ["integration_test/#{pool}"]
defp test_paths(_), do: ["test"]
defp test_pools(args) do
for env <- @pools, do: env_run(env, args)
end
defp env_run(env, args) do
args = if IO.ANSI.enabled?, do: ["--color"|args], else: ["--no-color"|args]
IO.puts "==> Running tests for MIX_ENV=#{env} mix test"
{_, res} = System.cmd "mix", ["test"|args],
into: IO.binstream(:stdio, :line),
env: [{"MIX_ENV", to_string(env)}]
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
end