2min chapter

Elixir Mix cover image

Reusable Ecto Code with Mika Kalathil - EMx 164

Elixir Mix

CHAPTER

Is It Necessary to Remove the Query From the Context?

The licksier the one thing about how active queries work all of these appear functions right so if at some point you realize okay for example the user module gets too big because there's a lot of validation maybe also going on and change sets. You could easily move that into a module of its own but you could say okay now I'm gonna create a user queries model or even multiple queries model if you have distinct use cases where you might want to use those. Nothing is stopping you from splitting that app into multiple distinct paths then composing them back together which is like a very very nice quality of pure functions which which we have here. So why not start with the schema module and keep it

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