Re:BMG: A Production Ready Relational Algebra in Ruby
by elcritch on Tuesday July 14, 2020 @12:19PM
(#23833812)
This is great looking! I don't use Ruby, but it's good to see libraries like this. It still surprises me how few libraries implement the relational algebra. Building on proper mathematical theory that's conducive to programming languages really removes a lot of impedance mismatch and leaky abstractions over ORM's.
[ Parent
| on HN ]
Re:BMG: A Production Ready Relational Algebra in Ruby
by bdcravens on Tuesday July 14, 2020 @12:27PM
(#23833952)
The Rails ORM (ActiveRecord) is built atop of a relational algebra gem (arel, which was eventually pulled into the AR library). I'm pretty sure the arel functions are considered private API, so it's not necessarily best practice, but you have the option to call those functions directly when you find the ORM lacking and don't want to pass around raw SQL.
Re:BMG: A Production Ready Relational Algebra in Ruby
by blambeau on Tuesday July 14, 2020 @12:47PM
(#23834325)
AFAIK Arel is not a real algreba, since it does not really allow composing relations the way we want.
More info here: http://www.try-alf.org/blog/2013-10-21-relations-as-first-cl...