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.. (

Sign in to participate in the conversation – a Fediverse instance for & by the Chaos community