[Dbix-class] Help needed to get a much needed feature into DBIC (low barrier to entry)

neil.lunn neil at mylunn.id.au
Fri Jan 10 04:08:54 GMT 2014


On 9/01/2014 5:55 PM, Peter Rabbitson wrote:
> Greetings dear lurkers, your mad recursive algorithm fu is needed ;)
>
> There is a long-standing design/spec for proper custom join
> conditions/options specified on the fly via search() directly in your
> join/prefetch attributes. In particular the new design calls for
> treating anything starting with a '-' in a special way. The trouble is
> that the bit implementing the join/prefetch attribute parser is... a
> little convoluted and hard to maintain.
Just to clarify. Is the objective here to 'flatten out' a single element 
array for any key with a "-" prefix only or is it wanted that anything 
that is a single element arrayref no longer being an arrayref, but just 
what it contains.

Seems likely that latter but was just trying to clarify the goal without 
sifting through every failed test, which seemed a little obtuse.

>
> So we need your help!
>
> There is a failing test which codifies all the permutations of desired
> behavior in [1]. All one willing to help would need to do is to sit
> down, gut and rewrite the code in [2].
>
> The required knowledge of the rest of DBIC internals is 0 - this bit is
> entirely standalone and decoupled from anything else going on around
> this function. The rules of the "contest"
>
> - The proposed algorithm needs to be esier to maintain than the current
> implementation (in other words we want to avoid having to issue the same
> distress call in couple years)
>
> - The test must pass as-is without further change requests akin to "but
> nobody is going to do that"
>
> - It is possible that the authors missed a particular use-case: in other
> words the test in question may attain new failing units (which otoh will
> still be compatible with the general "logical spirit" of this algorithm)
>
> - The final solution may end up being based on a submission, or may even
> end up being an amalgamation of several proposed ideas. If your solution
> is not accepted as-is and/or undergoes a significant amount of changes,
> please do not take this personally.
>
> How to get started:
>
> git clone git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git dbic
> cd dbic
> perl Makefile.PL --skip-author-deps
> make installdeps        # or make listdeps | cpanm
> cpan Test::Differences 	# temporary dep to ease testing
> prove -l t/91merge_joinpref_attr.t
>
> Cheers and thanks in advance for your help!
>
> [1] https://github.com/dbsrgits/dbix-class/blob/wip/join_prefs/t/91merge_joinpref_attr.t
> [2] https://github.com/dbsrgits/dbix-class/blob/wip/join_prefs/lib/DBIx/Class/ResultSet.pm#L3678:L3789
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




More information about the DBIx-Class mailing list