~/talk

Wrangle Your SQL With Arel

Talkat RailsConf 2020 CE · 2020-05-04..05-05· [ruby, ruby-on-rails]
links:none on file
slides:none on file

Claims raw SQL can be replaced by composable Ruby query objects built with Arel, and demonstrates concretely: building a date_trunc month-first-gift subquery, producing repeating left join lateral offsets to make donor timelines, and assembling a cohort query that sums months into columns. Examples show using Arel::Nodes.build_quoted and unary nodes for intervals, running to_SQL and executing queries against Postgres in tests, and carrying the code from Rails 4.2 to 6.0 while relying on test coverage because Arel is a private API.

AI-written summary · about

  1. 0:00Introduction
  2. 0:41Example
  3. 1:42Posteco
  4. 3:04Strings
  5. 3:39Private APIs
  6. 5:16A Rail Code
  7. 6:52A Rail Objects
  8. 7:38Sequel
  9. 8:09Query Object
  10. 14:34Rails Integration
  11. 15:43Outro
~/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.