~/talk

Doing weird things with Ecto

Talkat ElixirConf EU 2021 · 2021-09-09..09-10· [databases]
slides:none on file

Uses Ecto.Schema and Changeset to pre-validate and normalize complex API params, turning nested filter maps into typed structs so core functions get well-formed data and controllers return 422 JSON on errors. Speeds multi-step batch DB work by using Ecto.Multi with temp tables (create temp table, fill via queries, dedupe with window functions, insert_all into target) to avoid shipping large payloads through the app. Shows per-row updates by joining on an interpolated JSONB array, a maybe_join macro to add joins only once, and two approaches for polymorphic embeds (embedded changesets vs custom Ecto.Type) with structured errors.

AI-written summary · about

  1. 0:00Intro
  2. 0:33Nikolas background
  3. 1:49Database use
  4. 2:19NonDatabase use
  5. 2:42Disclaimer
  6. 3:01Normalization
  7. 5:26Example
  8. 13:23Ecto Multi Example
  9. 18:45Batch Transpose
  10. 21:02Joins
  11. 23:06Query
  12. 24:24Polymorphic embed
  13. 30:37Custom Ecto type
  14. 34:42Final thoughts
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.