3min chapter

Elixir Mix cover image

Reusable Ecto Code with Mika Kalathil - EMx 164

Elixir Mix

CHAPTER

Query Reusability

A lot of queries are just like fragments under the hood so they're just calling out to a fragment and if you had that in the context directly we'd probably have double if not more context than we do already. We'd also lose the ability to reuse the functions very easily or else the reusability would just look a bit weird because you're calling other context modules from within a context. You might get cyclical calls to your context essentiallyYes it also I feel like it cleans up the context because I mean otherwise you kind of operate in different layers of abstraction there. It's similar to what I did with ectoshorts which is a library I also introduced at the very bottom of the

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode