[DBIx-Class-Devel] Pull Request: topic/docs-pod-inherit

Brendan Byrd Perl at ResonatorSoft.org
Tue Dec 11 20:12:12 GMT 2012


On Tue, Dec 11, 2012 at 2:57 PM, Peter Rabbitson <rabbit+dbic at rabbit.us> wrote:
> On Tue, Dec 11, 2012 at 02:45:53PM -0500, Brendan Byrd wrote:
>> It's a shame that it's problematic to implement, as it would be nice
>> to have some sort of virtual_view type View class that doesn't require
>> knowledge of SQL to implement.  I will also redirect users to the View
>> docs as an alternative to rs_attr, since many of the asks around that
>> could be solved via View.
>
> I may be missing something here - can you give me an example/use case
> (pseudocode ir whatnot) of such a "virtual_view without knowing SQL".
> Then I probably will be able to give a more convincing answer.

Well, in the gist I linked above, the guy was trying to basically link
two tables together and always have the data prefetched.  One of my
solutions was to just have the two tables joined as a View, but
view_definition requires knowledge of SQL to implement.  Another use
case is the very example in View, which is just a where clause on a
table, and the alternative "solution" is on ATTR->where (which is
where I found rs_attr).  Again, in this case, view_definition requires
knowledge of SQL, but the rs_attr example doesn't.

It would be nice if you could define view_definition in the form of a
search() param.  DBIC would recreate the SQL, and then use that for
the View definition.

> I am +1 on that with the caveat that I would like things to continue
> building the way they do now - with externalized .pod files. AFAIK
> the normal usage of POD::Weaver involves manglig the contents of the
> .pm's directly, and this is enerally a no-go, unless it happens after
> the final code line (1; or whatever it is). Anything else that would
> make pod-building less hateful, and the result more pleasant to look
> at - I am all +1 for.

https://metacpan.org/module/Pod::Weaver

The SYNOPSIS example has the new document output as an object, which
can be written to a different POD.  You can also direct P:W where you
want to put the sections (new or otherwise).  I'll have to play around
with the options, but it has a lot of flexibility with what stays,
what goes, and what gets moved around where.

-- 
Brendan Byrd <Perl at ResonatorSoft.org>
Brendan Byrd <BBYRD at CPAN.org>



More information about the DBIx-Class-Devel mailing list