Preloading in Elixir/Ecto
This is a pattern for preloading in Elixir that I have adopted for a few projects. I’m sharing it here for reference. The idea is to have one place to define your preloads instead of in every query.
@preloads [:listens]
defp with_preloads(query), do: preload(query, ^@preloads)
def preload_artist(a..#Elixir #Ecto(https://inhji.de/notes/preloading-in-elixir-ecto)