Seraph v0.2.2 Seraph.Changeset
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
t()
t() :: t(Seraph.Schema.Node.t() | Seraph.Schema.Relationship.t() | map() | nil)
Link to this type
t(data_type)
t(data_type) :: %Seraph.Changeset{ action: action(), changes: %{required(atom()) => term()}, constraints: [], data: data_type, empty_values: term(), errors: [{atom(), error()}], filters: %{required(atom()) => term()}, params: %{required(String.t()) => term()} | nil, prepare: [(t() -> t())], repo: atom() | nil, repo_changes: term(), repo_opts: Keyword.t(), required: [atom()], types: nil | %{required(atom()) => Ecto.Type.t()}, valid?: boolean(), validations: [{atom(), term()}] }
Link to this section Functions
Link to this function
add_error(changeset, key, message, keys \\ [])
add_error(Seraph.Changeset.t(), atom(), String.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
apply_changes(changeset)
apply_changes(Seraph.Changeset.t()) :: Seraph.Schema.t() | data()
Link to this function
cast(data, params, permitted, opts \\ [])
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 \\ %{})
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)
delete_change(Seraph.Changeset.t(), atom()) :: Seraph.Changeset.t()
Link to this function
fetch_change(changeset, key)
fetch_change(Seraph.Changeset.t(), atom()) :: {:ok, term()} | :error
Link to this function
fetch_change!(changeset, key)
fetch_change!(Seraph.Changeset.t(), atom()) :: term()
Link to this function
fetch_field(changeset, key)
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)
fetch_field!(Seraph.Changeset.t(), atom()) :: term()
Link to this function
force_change(changeset, key, value)
force_change(Seraph.Changeset.t(), atom(), term()) :: Seraph.Changeset.t()
Link to this function
get_change(changeset, key, default \\ nil)
get_change(Seraph.Changeset.t(), atom(), term()) :: term()
Link to this function
get_field(changeset, key, default \\ nil)
get_field(Seraph.Changeset.t(), atom(), term()) :: term()
Link to this function
merge(changeset1, changeset2)
merge(Seraph.Changeset.t(), Seraph.Changeset.t()) :: Seraph.Changeset.t()
Link to this function
put_change(changeset, key, value)
put_change(Seraph.Changeset.t(), atom(), term()) :: Seraph.Changeset.t()
Link to this function
traverse_errors(changeset, msg_func)
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)
update_change(Seraph.Changeset.t(), atom(), (term() -> term())) :: Seraph.Changeset.t()
Link to this function
validate_acceptance(changeset, field, opts \\ [])
validate_acceptance(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_change(changeset, field, validator)
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)
Link to this function
validate_confirmation(changeset, field, opts \\ [])
validate_confirmation(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_exclusion(changeset, field, data, opts \\ [])
validate_exclusion(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_format(changeset, field, format, opts \\ [])
validate_format(Seraph.Changeset.t(), atom(), Regex.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_inclusion(changeset, field, data, opts \\ [])
validate_inclusion(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_length(changeset, field, opts)
validate_length(Seraph.Changeset.t(), atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_number(changeset, field, opts)
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 \\ [])
validate_required(Seraph.Changeset.t(), list() | atom(), Keyword.t()) :: Seraph.Changeset.t()
Link to this function
validate_subset(changeset, field, data, opts \\ [])
validate_subset(Seraph.Changeset.t(), atom(), Enum.t(), Keyword.t()) :: Seraph.Changeset.t()
See Ecto.Changeset.validate_subset/
Link to this function
validations(changeset)
validations(Seraph.Changeset.t()) :: [{atom(), term()}]