Cldr.UnitWithUsage.Ecto.Map.Type (Cldr Units SQL v0.3.0) View Source

Implements Ecto.Type behaviour for Cldr.Unit, where the underlying schema type is a map.

This is the required option for databases such as MySQL that do not support composite types.

In order to preserve precision, the value is serialized as a string since the JSON representation of a numeric value is either an integer or a float.

Decimal.to_string/1 is not guaranteed to produce a string that will round-trip convert back to the identical number. However given enough precision in the Decimal.get_context/0 then round trip conversion should be expected. The default precision in the context is 28 digits.

Link to this section Summary

Functions

Callback implementation for Ecto.Type.cast/1.

Callback implementation for Ecto.Type.dump/1.

Callback implementation for Ecto.Type.embed_as/1.

Callback implementation for Ecto.Type.equal?/2.

Callback implementation for Ecto.Type.load/1.

Callback implementation for Ecto.Type.type/0.

Link to this section Functions

Callback implementation for Ecto.Type.cast/1.

Callback implementation for Ecto.Type.dump/1.

Callback implementation for Ecto.Type.embed_as/1.

Callback implementation for Ecto.Type.equal?/2.

Callback implementation for Ecto.Type.load/1.

Callback implementation for Ecto.Type.type/0.