I think this may be what you’re looking for:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-the-map-type