MDN and how it helps with responsive images. We decided to store the versions’ URLs inside a map in the database,īecause we’re going to use a set of the URLs at the same time inside ofĪn HTML. I have a Vehicle.Photo schema that has several versions of the photo: Is where I became extremely greatful for Ecto’s escape Using Ecto’s embedded_schema helps introspect on those known values,īut it doesn’t really assist you with querying those fields in SQL. Sometimes can’t introspect on them for you, which means it becomes much Or integer) with column data types that handle more-complicated This is useful for those moments when you need to store data that couldīe variably structured, such as responses from other services’ APIs, orĭata that frequently travels together within your relational tables.Ī common trade-off for mixing scalar column data types (like varchar PostgreSQL has great support for objects stored as JSON. We’re going to explore how to do that, and make In the database as JSON and accessed via an Ecto Schema, it’s not asĬlear how to query them. Structs and maps are easy to work with in Elixir, but if they are stored