Exandra.EmbeddedType (exandra v1.0.0)

Copy Markdown View Source

Ecto.ParameterizedType for User-Defined Types (UDTs) with Ecto.Schemas.

Options

  • :cardinality (atom/0) - :one for a regular UDT column, or :many for a frozen list of UDTs. default is :one

  • :using (atom/0) - Required. The Ecto.Schema to use for the UDT.

Examples

defmodule PageView do

use Ecto.Schema
use Exandra.Embedded

schema "page_views" do
  field :url, :string
  embedded_type :view_meta, ViewMeta
end

def changeset(entity, params) do
  entity
  |> cast(params, [:url, :view_meta])
end

end

Summary

Types

t()

@type t() :: any()