<p dir="ltr"><br>
On Mar 7, 2016 07:57, "Peter Rabbitson" <<a href="mailto:rabbit%2Bdbic@rabbit.us">rabbit+dbic@rabbit.us</a>> wrote:<br>
><br>
> On 03/07/2016 01:25 PM, Paul Bennett wrote:<br>
>><br>
>> Hi, DBICers,<br>
>><br>
>> I have most of a spec (and a tiny bit of pseudocode) prepared for<br>
>> adding operator overloads to Result Sets, to make it easier to write &<br>
>> reuse pieces of queries in a style more like Relational Algebra &<br>
>> Tuple-Relational Calculus.<br>
><br>
> This is an interesting experiment. </p>
<p dir="ltr">Thanks. You wouldn't believe the mess I got into trying to spec it before DBIC came into my life. </p>
<p dir="ltr">> It is especially intriguing how the above will deal with corner cases of non-trivial-selection resultsets.<br>
></p>
<p dir="ltr">I can't say that I don't expect interesting times.</p>
<p dir="ltr">> Please continue pursuing this ;)</p>
<p dir="ltr">Your enthusiasm has doubled my resolve.</p>
<p dir="ltr">>> However, if I subclass, then I (or someone) would end up writing<br>
>> Dancer2::Plugin::DBIC::Algebra (or whatever the naming ends up being),<br>
>> and so on</p>
<p dir="ltr">> Your relational algebra plugin has no bearing on such an orthogonal concept as "web framework model" - your users would simply 'load_components()' your plugin as part of their base resultset class.<br>
><br>
> 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's design is rather natural and least-effort way to gain extra functionality.<br>
><br>
> For extra inspiration look through this library of ResultSet components:<br>
> <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'd known before: helper & component. Some very interesting stuff there.</p>
<p dir="ltr">> Feel free to ask further questions - the underlying work is very interesting!<br>
></p>
<p dir="ltr">Thanks again. I hope I haven'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>