April 2019
Beginner to intermediate
244 pages
6h 34m
English
In Chapter 3, Connecting Your Tables to Elixir Structs with Schemas, we learned about the data types Ecto provides for creating schemas. Ecto uses these data types to translate values expressed in Elixir code into values that a database can store. A String value in Elixir, for example, becomes a VARCHAR when stored in a MySQL table.
Most of the time, Ecto’s built-in data types will give you everything you need. But there may be times when you want to use a data type that’s not directly supported by Ecto. For these cases, Ecto provides a mechanism for defining your own custom types. By implementing just a few functions, you can add support for storing any data type in your database.
In this chapter, ...
Read now
Unlock full access