Ecto.ULID (helper v1.0.0) View Source

An Ecto type for ULID string:

  • ULID -> Universally Unique Lexicographically Sortable Identifier
  • The spec for ULID can be found here

Link to this section Summary

Types

Type definition for human readable form

t()

The type definition for ULID

Functions

Ecto.Type.autogenerate/0 callback implementation

Ecto.Type.cast/1 callback implementation

Ecto.Type.dump/1 callback implementation

Ecto.Type.embed_as/1 callback implementation

Ecto.Type.equal?/2 callback implementation

Ecto.Type.load/1 callback implementation

Ecto.Type.type/0 callback implementation

Check whether passed ULID (either raw or pretty format) is valid

Link to this section Types

Specs

pretty() :: <<_::208>>

Type definition for human readable form

Specs

t() :: <<_::128>>

The type definition for ULID

Specs

ulid() :: t() | pretty()

Link to this section Functions

Specs

autogenerate() :: t()

Ecto.Type.autogenerate/0 callback implementation

Specs

cast(pretty()) :: {:ok, t()} | :error

Ecto.Type.cast/1 callback implementation

Specs

dump(ulid()) :: {:ok, t()} | :error

Ecto.Type.dump/1 callback implementation

Specs

embed_as(atom()) :: :self

Ecto.Type.embed_as/1 callback implementation

Specs

equal?(t1, t2) :: boolean() when t1: ulid(), t2: t1

Ecto.Type.equal?/2 callback implementation

Specs

load(t()) :: :error | {:ok, pretty()}

Ecto.Type.load/1 callback implementation

Specs

type() :: :uuid

Ecto.Type.type/0 callback implementation

Specs

valid?(ulid()) :: boolean()

Check whether passed ULID (either raw or pretty format) is valid