tds_ecto v2.1.3 Tds.VarChar
Wrapps erlang string into structure which TDS undestends and can encode this value into varchar type
Link to this section Summary
Functions
Casts the given input to the custom type
Dumps the given term into an Ecto native type
Loads the given term into a custom type
Returns :varchar atom, so we can use :varchar type in migration files
Link to this section Functions
Casts the given input to the custom type.
This callback is called on external input and can return any type,
as long as the dump/1
function is able to convert the returned
value into an Ecto native type. There are two situations where
this callback is called:
- When casting values by
Ecto.Changeset
- When passing arguments to
Ecto.Query
Callback implementation for Ecto.Type.cast/1
.
Dumps the given term into an Ecto native type.
This callback is called with any term that was stored in the struct and it needs to validate them and convert it to an Ecto native type.
Callback implementation for Ecto.Type.dump/1
.
Loads the given term into a custom type.
This callback is called when loading data from the database and
receive an Ecto native type. It can return any type, as long as
the dump/1
function is able to convert the returned value back
into an Ecto native type.
Callback implementation for Ecto.Type.load/1
.
Returns :varchar atom, so we can use :varchar type in migration files