<story><title>RethinkDB 2.0 is amazing</title><url>http://rob.conery.io/2015/04/17/rethinkdb-2-0-is-amazing/</url></story><parent_chain><item><author>TylerE</author><text>Let me give you an arbitrary, unknown sql string in a variable `s`, and I&amp;#x27;ll do the same with a ReQL query.&lt;p&gt;The challenge is to make sure the column&amp;#x2F;field `age` is more than 20.&lt;p&gt;My code is:&lt;p&gt;&lt;pre&gt;&lt;code&gt;   query.filter(r.row[&amp;#x27;age&amp;#x27;] &amp;gt; 20)
&lt;/code&gt;&lt;/pre&gt;
What&amp;#x27;s yours? (Hint: start by writing a compliant SQL parser)</text></item><item><author>army</author><text>&amp;#x27;When you query with ReQL you tack on functions and “compose” your data, with SQL you tell the query engine the steps necessary (aka prescribe) to return your data:&amp;#x27;&lt;p&gt;... what?  ReQL and SQL are both declarative query languages: I don&amp;#x27;t really see the author is getting at. Is there an implication that SQL isn&amp;#x27;t declarative?&lt;p&gt;The only real difference is that the API is based around chaining function calls rather than expressing what is needed as a string - there are many SQL query builder APIs that will let you build SQL queries by chaining together function calls.</text></item></parent_chain><comment><author>ghc</author><text>Let us compare this newfangled &amp;quot;auto-mobile&amp;quot; invention to my favorite form of transportation, the horse: Where would you mount your favorite riding saddle on an auto-mobile?&lt;p&gt;(Hint: start by learning metalworking)</text></comment>
<story><title>RethinkDB 2.0 is amazing</title><url>http://rob.conery.io/2015/04/17/rethinkdb-2-0-is-amazing/</url></story><parent_chain><item><author>TylerE</author><text>Let me give you an arbitrary, unknown sql string in a variable `s`, and I&amp;#x27;ll do the same with a ReQL query.&lt;p&gt;The challenge is to make sure the column&amp;#x2F;field `age` is more than 20.&lt;p&gt;My code is:&lt;p&gt;&lt;pre&gt;&lt;code&gt;   query.filter(r.row[&amp;#x27;age&amp;#x27;] &amp;gt; 20)
&lt;/code&gt;&lt;/pre&gt;
What&amp;#x27;s yours? (Hint: start by writing a compliant SQL parser)</text></item><item><author>army</author><text>&amp;#x27;When you query with ReQL you tack on functions and “compose” your data, with SQL you tell the query engine the steps necessary (aka prescribe) to return your data:&amp;#x27;&lt;p&gt;... what?  ReQL and SQL are both declarative query languages: I don&amp;#x27;t really see the author is getting at. Is there an implication that SQL isn&amp;#x27;t declarative?&lt;p&gt;The only real difference is that the API is based around chaining function calls rather than expressing what is needed as a string - there are many SQL query builder APIs that will let you build SQL queries by chaining together function calls.</text></item></parent_chain><comment><author>joevandyk</author><text>using ActiveRecord:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    query.where(&amp;#x27;age &amp;gt; ?&amp;#x27;, 20)
&lt;/code&gt;&lt;/pre&gt;
If I&amp;#x27;m understanding you correctly.</text></comment>