RedshiftEcto v0.1.0 RedshiftEcto View Source

Adapter module for Redshift.

It uses postgrex for communicating to the database and a connection pool, such as poolboy.

This adapter is based on Ecto’s builtin Ecto.Adapters.Postgres adapter. It delegates some functions to it but changes the implementation of most that are incompatible with Redshift. The differences are detailed in this documentation.

We also recommend developers to consult the documentation of the Postgres adapter.

Notable differences

  • no array type
  • maps are stored as json in varchar(max) columns
  • the :binary_id and :uuid Ecto types are stored in char(36) and generated as text
  • no binary type and literal support
  • no aliases in UPDATE and DELETE FROM statements
  • no RETURNING
  • no support for on_conflict (except for the default :raise)
  • no support for on_delete and on_update on foreign key definitions
  • no support for ALTER COLUMN
  • no support for CHECK and EXCLUDE constraints
  • since Redshift doesn’t enforce uniqueness and foreign key constraints the adapter can’t report violations

Link to this section Summary

Functions

Dumps the given structure

Loads the given structure

Link to this section Functions

Link to this function structure_dump(default, config) View Source

Dumps the given structure.

The path will be looked in the config under :dump_path or default to the structure path inside default.

Returns :ok if it was loaded successfully, an error tuple otherwise.

Examples

structure_dump("priv/repo", username: "postgres",
                            database: "ecto_test",
                            hostname: "localhost")

Callback implementation for Ecto.Adapter.Structure.structure_dump/2.

Link to this function structure_load(default, config) View Source

Loads the given structure.

The path will be looked in the config under :dump_path or default to the structure path inside default.

Returns :ok if it was loaded successfully, an error tuple otherwise.

Examples

structure_load("priv/repo", username: "postgres",
                            database: "ecto_test",
                            hostname: "localhost")

Callback implementation for Ecto.Adapter.Structure.structure_load/2.