<p dir="ltr"><br>
On Mar 7, 2016 07:57, &quot;Peter Rabbitson&quot; &lt;<a href="mailto:rabbit%2Bdbic@rabbit.us">rabbit+dbic@rabbit.us</a>&gt; wrote:<br>
&gt;<br>
&gt; On 03/07/2016 01:25 PM, Paul Bennett wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi, DBICers,<br>
&gt;&gt;<br>
&gt;&gt; I have most of a spec (and a tiny bit of pseudocode) prepared for<br>
&gt;&gt; adding operator overloads to Result Sets, to make it easier to write &amp;<br>
&gt;&gt; reuse pieces of queries in a style more like Relational Algebra &amp;<br>
&gt;&gt; Tuple-Relational Calculus.<br>
&gt;<br>
&gt; This is an interesting experiment. </p>
<p dir="ltr">Thanks. You wouldn&#39;t believe the mess I got into trying to spec it before DBIC came into my life. </p>
<p dir="ltr">&gt; It is especially intriguing how the above will deal with corner cases of non-trivial-selection resultsets.<br>
&gt;</p>
<p dir="ltr">I can&#39;t say that I don&#39;t expect interesting times.</p>
<p dir="ltr">&gt; Please continue pursuing this ;)</p>
<p dir="ltr">Your enthusiasm has doubled my resolve.</p>
<p dir="ltr">&gt;&gt; However, if I subclass, then I (or someone) would end up writing<br>
&gt;&gt; Dancer2::Plugin::DBIC::Algebra (or whatever the naming ends up being),<br>
&gt;&gt; and so on</p>
<p dir="ltr">&gt; Your relational algebra plugin has no bearing on such an orthogonal concept as &quot;web framework model&quot; - your users would simply &#39;load_components()&#39; your plugin as part of their base resultset class.<br>
&gt;<br>
&gt; However as I described in the rest of my reply - the immutability of DBIx/Class/ResultSet.pm is of little consequence. Your idea belongs squarely in an extension/component, which due to DBIC&#39;s design is rather natural and least-effort way to gain extra functionality.<br>
&gt;<br>
&gt; For extra inspiration look through this library of ResultSet components:<br>
&gt; <a href="https://metacpan.org/source/FREW/DBIx-Class-Helpers-2.032000/lib/DBIx/Class/Helper/ResultSet">https://metacpan.org/source/FREW/DBIx-Class-Helpers-2.032000/lib/DBIx/Class/Helper/ResultSet</a></p>
<p dir="ltr">See, there are two words already that I wish I&#39;d known before: helper &amp; component. Some very interesting stuff there.</p>
<p dir="ltr">&gt; Feel free to ask further questions - the underlying work is very interesting!<br>
&gt;</p>
<p dir="ltr">Thanks again. I hope I haven&#39;t bitten off more than I can chew, but time will tell.<br><br></p>
<p dir="ltr">--<br>
Paul W Bennett<br>
P/PW/PWBENNETT</p>