Skip to content
0:00 / 0:00

#phoenixliveview#ecto#postgres

SQL Grouping Sets & Ecto Fragments: Phoenix App from Scratch, Episode 7

Code and Stuff

6.6K subscribers • 20 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Linked in the descriptionChristianAlexander/tutorial-budget-app
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

1.4K views1 year ago1 recommendation

Web developmentDatabases and dataElixir and ErlangPostgresSQL

How to use Postgres grouping sets and Ecto fragments to calculate rolling balances in a Phoenix LiveView application.

[series] Build a complete budget tracking app in Phoenix LiveView! In this episode, we create a dedicated budget period view and implement advanced database aggregation to calculate rolling balances across budget periods! Along the way, we'll cover: - Moving functionality from one LiveView to another - Using Ecto fragments for Postgres specific features - How grouping sets can be used for efficient aggregation - Refactoring a changeset for validations - Calculating rolling balances with functional programming - Database query optimization techniques - Component reusability across LiveViews Links Screen recording software I use (affiliate): screen.studio/@Yy75o Project repo: github.com/ChristianAlexander/tutorial-budget-app Related changes: github.com/ChristianAlexander/tutorial-budget-app/pull/13 Related Documentation Ecto Fragments: hexdocs.pm/ecto/Ecto.Query.html#module-fragments Postgres grouping sets: postgresql.org/docs/current/queries-table-expressions.html#Q… Timestamps Context and setup - Implement get_budget_period - Pulling the right transactions - Ecto fragments - Bring back edit and delete - Better navigation - Refactor: enforce budget boundaries - Remove old table - Monthly grouping - Postgres grouping sets - Wire up the summaries - Calculate rolling balances - Zip and drop explained - Wire up the balances -

Why it's here

1 person recommends this

What people say. Recommended as a helpful tutorial on using Ecto fragments and advanced SQL grouping sets in Elixir applications.

u/GiraffeFireAlchemistin r/elixir • Recommends

SQL Grouping Sets & Ecto Fragments: Phoenix App from Scratch, Episode 7