View Source Exandra.EmbeddedType (exandra v0.10.2)

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

options

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

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

Link to this section Summary

Link to this section Types