View Source Tds.Ecto.VarChar (Ecto SQL v3.8.1)
An Tds adapter Ecto Type that wraps erlang string into tuple so TDS driver can understand if erlang string should be encoded as NVarChar or Varchar.
Due some limitations in Ecto and Tds driver, it is not possible to
support collations other than the one that is set on connection during login.
Please be aware of this limitation if you plan to store varchar values in
your database using Ecto since you will probably lose some codepoints in
the value during encoding. Instead use tds_encoding
library and first
encode value and then annotate it as :binary
by calling Ecto.Query.API.type/2
in your query. This way all codepoints will be properly preserved during
insert to database.
Link to this section Summary
Functions
Same as cast/1
but raises Ecto.CastError
on invalid arguments.
Casts to string.
Converts a string representing a VarChar into a tuple {value, :varchar}
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Loads the DB type as is.
Link to this section Types
Link to this section Functions
Same as cast/1
but raises Ecto.CastError
on invalid arguments.
Casts to string.
Converts a string representing a VarChar into a tuple {value, :varchar}
.
Returns :error
if value is not binary.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Loads the DB type as is.