class: center, middle # `nil` .b[[@abelar_s](https://twitter.com/abelar_s) - [@ParisRB](https://twitter.com/parisrb) - [@RailsGirlsParis](https://twitter.com/railsgirlsparis)] [maitre-du-monde.fr](maitre-du-monde.fr) .contrib[[Contribute to this talk on GitHub!](https://github.com/abelards/abelards.github.com/edit/master/talks/arel_extensions.html)] ??? --- # Giving love * if you like it, don't trust yourself * widespread hate for: - Regexen (I have a talk) - SQL (this is it!) - CSS (I want to do a salsa/CSS talk) --- # SQL * Structured Query Language * 30 years * support varies per engine * @MarkusWinand (modern SQL, use the index, SQL performance...) --- # Adapters * mysql, oracle... * ... jdbc for JRuby --- class: left # Dialects * CSS resets anyone? * abstractions, interfaces, polyfills, shims, generation... * SQL versions * basic things in their native way https://github.com/Faveod/arel-extensions/tree/master/init --- class: left # What is Arel anyway? * AST: Abstract Syntax Tree * Nodes * Visitor --- class: left # Are these DSLs? * DSL: Domain-Specific Language * You write, I understand * Ruby is flexible and allows for great DSL-isation --- class: left # Just remember the goal * Arel is just method calls, but it's a DSL too * Conversions: like physics or an essay in a foreign language * A more "natural" way? --- class: left # So what? * `+` or `<<` not `CONCAT` * `blank` and `||` not comparisons and `COALESCE` * `>` or `>=` not `gteq` --- class: left # What we do under the hood * converting * datetime formats * datetime functions (extract, compare...) * string functions (like, susbstr...) * number functions (ceil, floor, round...) https://github.com/Faveod/arel-extensions/blob/master/lib/arel_extensions.rb --- class: left # Parting thoughts * pay respects where they are due * don't use SQL, use AR & Arel * don't just use arel, use arel_extensions * learn about SQL * help us merge most of these in Arel :) --- class: center, middle, happy # Questions? .b[[@abelar_s](https://twitter.com/abelar_s) - [@ParisRB](https://twitter.com/parisrb) - [@RailsGirlsParis](https://twitter.com/railsgirlsparis)] [maitre-du-monde.fr](maitre-du-monde.fr) .contrib[[Contribute to this talk on GitHub!](https://github.com/abelards/abelards.github.com/edit/master/talks/arel_extensions.html)]