EctoSqlReadiness (ecto_sql_readiness v0.2.0)

How can we ensure that there are no pending migration during deployment? How can we ensure that Ecto is ready?

This library has been used with AWS Codedeploy, so we don't send any traffic to the containers unless we ensure that Ecto is ready to work.

Summary

Functions

Uses to known when the Ecto Repo is ready.

Types

@type repo() :: module()

Functions

Link to this function

pending_migrations(repos)

@spec pending_migrations([repo()]) ::
  [{repo(), id :: term(), name :: String.t()}] | []
@spec probes([repo()]) :: :ok | :fail_connection | :pending_migrations

Uses to known when the Ecto Repo is ready.

Examples

iex> EctoSqlReadiness.probes([Store.Repo])

:ok