View Source Cldr.Unit.Ecto.Map.Type (Cldr Units SQL v1.0.1)

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 context then round trip conversion should be expected. The default precision in the context is 28 digits.

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.

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.