Skip to content
Provides common fields for Ecto
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.formatter.exs
.gitignore
LICENSE
README.md
mix.exs
mix.lock

README.md

EctoFields

Provides commonly used fields for Ecto projects.

Installation

To install EctoFields:

  1. Add ecto_fields to your list of dependencies in mix.exs :
  def deps do
    [{:ecto_fields, "~> 1.2.0"}]
  end
  1. Use the fields in your Ecto schema:
 schema "user" do
   field :name, :string
   field :email, EctoFields.Email
   field :website, EctoFields.URL
   field :ip_address, EctoFields.IP
 end

Current fields

  • EctoFields.Atom
  • EctoFields.Email
  • EctoFields.IP (accepts both ipv4 and ipv6)
  • EctoFields.IPv4
  • EctoFields.IPv6
  • EctoFields.PositiveInteger
  • EctoFields.Slug
  • EctoFields.Static
  • EctoFields.URL

Roadmap

Likely:

  • EctoFields.Duration

Maybe:

  • EctoFields.File
  • EctoFields.Image
You can’t perform that action at this time.