Ecto Adapter for AWS Redshift.
This adapter is based on Ecto's builtin Postgres adapter. It delegates some functions to it but changes the implementation of most that are incompatible with Redshift. The differences are detailed in the documentation.
Documentation can be found at https://hexdocs.pm/redshift_ecto.
Add redshift_ecto
to your list of dependencies in mix.exs
:
def deps do
[
{:redshift_ecto, "~> 0.1.0"}
]
end
config :my_app, MyApp.Repo,
adapter: RedshiftEcto,
url: "ecto://user:pass@data-warehouse.abc123.us-east-1.redshift.amazonaws.com:5439/db"
Redshift doesn't support nested transactions which makes the builtin sandbox implementation of Ecto unusable for testing. RedshiftEcto depends on ecto_replay_sandbox which implements pseudo transactions that provides a similar experience in testing to the Ecto's sandbox. See the integration tests of the adapter for an example on how to use it.