Embrace the Database With Ecto
summary
Uses Ecto + Postgres to enforce real constraints (Postgres check constraints, not null and foreign keys) and to build queries as composable data. Demonstrates counts and samples: 1,066 posts, 32 developers, ~37 posts per developer. Shows raw SQL via repo.query, Ecto fragments and custom macros (between, age in hours, greatest) to compute a hotness score = likes / age^0.8, returns top‑5 post IDs and titles from a production TIL dataset — query runs and returns sensible results.
AI-written summary · about
chapters (62)
- 0:00Introduction
- 0:23About Josh
- 1:00Database is your friend
- 1:19Database is scary
- 1:40Database doesnt have to be dumb
- 2:10Most important asset
- 2:33Data
- 2:53Postgres
- 3:33Agenda
- 3:54Sample Data Set
- 4:08Hash Rocket
- 4:34Database Schema
- 5:02Post Table
- 5:24Developers Table
- 6:07Asking Questions
- 6:20Sequel
- 6:34Elixir Necto
- 7:05Query Nectar
- 7:37Query Data
- 8:05Data Integrity
- 8:21Solid Foundation
- 8:35Mismanaged Data
- 8:55Web Developers
- 9:34Validations
- 10:04Database
- 10:34Data Types
- 11:01Custom Data Types
- 11:50Not Null Constraint
- 12:16Not In Constraint
- 12:43Enforce Relationships
- 14:29Why Schema List
- 15:39How Many Developers
- 16:57Join Clause
- 18:36Aggregate Function
- 18:56Add Account
- 19:27Count Posts
- 20:27Keyword List
- 21:15Query
- 21:56Query Results
- 22:56Sub Query
- 23:53Simple Solution
- 24:18Partial Query
- 25:12Developers
- 25:45Distinct
- 26:55Where
- 27:27Output
- 27:56UpdateAll
- 28:09Actos
- 28:24Repo Query
- 28:46Fragment Functions
- 31:10Fragment
- 31:46Custom Functions
- 32:19Custom Functions Module
- 32:43Reusable Functions
- 32:53Hottest Posts
- 33:28Hottest Posts Algorithm
- 34:19Agent Hours
- 35:27OurCents
- 36:30Post Filter
- 37:11Greatest
- 40:06Database Snapshot
- 40:20Conclusion
related talks
35mElixir's Ecto: Functional Relational Data Access Done Right
30mDiving into Ecto.Query
41mEcto: A language integrated query for Elixir
37mLeveling Up With Ecto
34mSimple and Awesome Database Tricks
35mEcto - the Past, the Present, the Future
23mFANTASTIC DATABASES AND WHERE TO FIND THEM
38mDoing weird things with Ecto
