25 May, 2011, Silenus wrote in the 1st comment:
Votes: 0
Hi,

I haven't been around much lately, but I am curious if there are some SQL bindings for Ruby which work reasonably well for a number of different databases. I am hoping to find something that reasonably mirrors (perhaps using operator overloading) Codd's relational algebra (and perhaps calculus). Does anyone know of such things out there?
25 May, 2011, Runter wrote in the 2nd comment:
Votes: 0
Nope. Low(er) level bindings in Ruby isn't really something I explored for this, but my advice is datamapper, activerecord, or some other ORM. Keep in mind you can actually query the story where required in these with SQL, if you really have to. (You don't.) But they do meet your requirement of working with many different databases. Including nosql databases.
26 May, 2011, Tyche wrote in the 3rd comment:
Votes: 0
I've seen a Codd's relational algebra DSL for Lisp.
There is a direct mapping from relational algebra to SQL, so it should be rather easy to implement as a front end DSL to just about any Ruby SQL binding.
I don't think most humans, even within the subset of programmers, would use it; which is probably why it hasn't been written yet. ;-)
26 May, 2011, Silenus wrote in the 4th comment:
Votes: 0
Are there specific ones that work with RoR?
26 May, 2011, Tyche wrote in the 5th comment:
Votes: 0
Silenus said:
Are there specific ones that work with RoR?


It depends on what you mean by "work with RoR". You can use any sort of database gem with Rails. For example, I've used GDBM, YAML, and straight Ruby file reading/writing as a backend to Rails. However, in using such a mechanism directly you forego using all framework goodies of something like ActiveRecord. You can also use ActiveRecord to execute any SQL statement directly. The caveat is it would have to be legal SQL for the particular RDBMS ActiveRecord is using.
27 May, 2011, Silenus wrote in the 6th comment:
Votes: 0
Thanks guys.
0.0/6