~/talk

A custom design pattern for building dynamic ActiveRecord queries

links:none on file
slides:none on file

A concrete pattern replaces a 230+ line SQL concatenation file with named query classes, builders, nodes that return ActiveRecord relations, use Ruby and Rails only, and run in the console and repo demo. The Builder uses reduce + visitor pattern to filter invalid nodes, merge clauses, and support nested nodes and subqueries. Three engineers build and iterate the repo, it composes conditional branching cleanly, stays performant, and is ready to adapt to real endpoints.

AI-written summary · about

  1. 0:00Introduction
  2. 1:02Talk agenda
  3. 2:05Composable queries overview
  4. 3:34Dynamic query criteria
  5. 4:36Legacy SQL issues
  6. 5:41Builder pattern preview
  7. 6:23Query composition tools
  8. 9:35Custom Builder pattern
  9. 9:55Builder and Visitor deep dive
  10. 10:38Repository context
  11. 11:19Core components
  12. 13:28Nodes and conditions
  13. 14:39Builder methods
  14. 15:57Live query demo
  15. 17:30Builder takeaways
  16. 18:01Component interactions
  17. 19:32Reduce algorithm
  18. 21:16Why reduce works
  19. 22:19Builder with reduce and nodes
  20. 22:44Nested nodes metaphor
  21. 23:45Nested nodes example
  22. 26:23Builder best practices
  23. 28:32Modular node classes
  24. 29:19Builder abstraction
  25. 30:10Maintainable code
  26. 30:38Acknowledgments
  27. 31:23Question and answer session
~/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.