Seraph.Changeset (Seraph v0.2.4)
Changesets allow filtering, casting, validation and definition of constraints when manipulating structs.
Seraph.Changeset
is a graph-specific subset of Ecto.Changeset
. Most of its
functions are delegated to Ecto.Changeset
but you should not use
Ecto.Changeset
functions as they will fail.
See Ecto.Changeset
for more information.
Link to this section Summary
Functions
See Ecto.Changeset.fetch_field/
2
See Ecto.Changeset.validate_number/
See Ecto.Changeset.validate_subset/
Link to this section Types
Link to this type
action()
Specs
action() :: nil | :create | :merge | :set | :delete | :ignore
Link to this type
data()
Specs
data() :: Ecto.Changeset.data()
Link to this type
error()
Specs
error() :: Ecto.Changeset.error()
Specs
t() :: t(Seraph.Schema.Node.t() | Seraph.Schema.Relationship.t() | map() | nil)
Link to this type
t(data_type)
Specs
t(data_type) :: %Seraph.Changeset{ action: action(), changes: %{optional(atom()) => term()}, constraints: [], data: data_type, empty_values: term(), errors: [{atom(), error()}], filters: %{optional(atom()) => term()}, params: %{optional(String.t()) => term()} | nil, prepare: [(t() -> t())], repo: atom() | nil, repo_opts: Keyword.t(), required: [atom()], types: nil | %{optional(atom()) => Ecto.Type.t()}, valid?: boolean(), validations: [{atom(), term()}] }
Link to this type
types()
Specs
types() :: Ecto.Changeset.types()
Link to this section Functions
Link to this function
add_error(changeset, key, message, keys \\ [])
Specs
add_error(Seraph.Changeset.t(), atom(), String.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
apply_changes(changeset)
Specs
apply_changes(Seraph.Changeset.t()) :: Seraph.Schema.t() | data()
Link to this function
cast(data, params, permitted, opts \\ [])
Specs
cast( Seraph.Schema.t() | Seraph.Changeset.t() | {data(), types()}, %{required(binary()) => term()} | %{required(atom()) => term()} | :invalid, [atom()], Keyword.t() ) :: Seraph.Changeset.t()
Link to this function
change(data, changes \\ %{})
Specs
change( Seraph.Schema.t() | Seraph.Changeset.t() | {data(), types()}, %{required(atom()) => term()} | Keyword.t() ) :: Seraph.Changeset.t()
Link to this function
delete_change(changeset, key)
Specs
delete_change(Seraph.Changeset.t(), atom()) :: Seraph.Changeset.t()
Link to this function
fetch_change(changeset, key)
Specs
fetch_change(Seraph.Changeset.t(), atom()) :: {:ok, term()} | :error
Link to this function
fetch_change!(changeset, key)
Specs
fetch_change!(Seraph.Changeset.t(), atom()) :: term()
Link to this function
fetch_field(changeset, key)
Specs
fetch_field(Seraph.Changeset.t(), atom()) :: {:changes, term()} | {:data, term()} | :error
See Ecto.Changeset.fetch_field/
2
Link to this function
fetch_field!(changeset, key)
Specs
fetch_field!(Seraph.Changeset.t(), atom()) :: term()
Link to this function
force_change(changeset, key, value)
Specs
force_change(Seraph.Changeset.t(), atom(), term()) :: Seraph.Changeset.t()
Link to this function
get_change(changeset, key, default \\ nil)
Specs
get_change(Seraph.Changeset.t(), atom(), term()) :: term()
Link to this function
get_field(changeset, key, default \\ nil)
Specs
get_field(Seraph.Changeset.t(), atom(), term()) :: term()
Link to this function
merge(changeset1, changeset2)
Specs
merge(Seraph.Changeset.t(), Seraph.Changeset.t()) :: Seraph.Changeset.t()
Link to this function
put_change(changeset, key, value)
Specs
put_change(Seraph.Changeset.t(), atom(), term()) :: Seraph.Changeset.t()
Link to this function
traverse_errors(changeset, msg_func)
Specs
traverse_errors( Seraph.Changeset.t(), (error() -> String.t()) | (Seraph.Changeset.t(), atom(), error() -> String.t()) ) :: %{required(atom()) => [String.t()]}
Link to this function
update_change(changeset, key, function)
Specs
update_change(Seraph.Changeset.t(), atom(), (term() -> term())) :: Seraph.Changeset.t()
Link to this function
validate_acceptance(changeset, field, opts \\ [])
Specs
validate_acceptance(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_change(changeset, field, validator)
Specs
validate_change( Seraph.Changeset.t(), atom(), (atom(), term() -> [{atom(), String.t()} | {atom(), {String.t(), Keyword.t()}}]) ) :: Seraph.Changeset.t()
Link to this function
validate_change(changeset, field, metadata, validator)
Specs
Link to this function
validate_confirmation(changeset, field, opts \\ [])
Specs
validate_confirmation(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_exclusion(changeset, field, data, opts \\ [])
Specs
validate_exclusion(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_format(changeset, field, format, opts \\ [])
Specs
validate_format(Seraph.Changeset.t(), atom(), Regex.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_inclusion(changeset, field, data, opts \\ [])
Specs
validate_inclusion(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_length(changeset, field, opts)
Specs
validate_length(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_number(changeset, field, opts)
Specs
validate_number(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
See Ecto.Changeset.validate_number/
Link to this function
validate_required(changeset, fields, opts \\ [])
Specs
validate_required(Seraph.Changeset.t(), list() | atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_subset(changeset, field, data, opts \\ [])
Specs
validate_subset(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
See Ecto.Changeset.validate_subset/
Link to this function
validations(changeset)
Specs
validations(Seraph.Changeset.t()) :: [{atom(), term()}]