View Source EctoRange (ecto_range v0.1.0)

EctoRange is a tiny library that provides Ecto custom types for all Postgres Range types.

The main design goal of EctoRange is to be easy to use with native Elixir types, while providing the full flexibility of Postgres Range types inside of Ecto.

Postgres typeEcto.Type
int4rangeEctoRange.Int4
int8rangeEctoRange.Int8
numrangeEctoRange.Num
tsrangeEctoRange.NaiveDatetime
tstzrangeEctoRange.Datetime
daterangeEctoRange.Date

installation

Installation

If available in Hex, the package can be installed by adding ectorange to your list of dependencies in mix.exs:

def deps do
  [
    {:ecto_range, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ectorange.

alternative-libraries

Alternative libraries

If you're unhappy with the feature setEctoRange, there are some alternative libraries that provide similar functionality