<div dir="ltr">Matt will your way though not have multiple trips to the db?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 3:17 AM, Matt S Trout <span dir="ltr">&lt;<a href="mailto:mst@shadowcat.co.uk" target="_blank">mst@shadowcat.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 18, 2017 at 05:20:55PM +0300, Vladimir Melnik wrote:<br>
&gt; On Tue, Apr 18, 2017 at 02:43:55PM +0100, Dagfinn Ilmari Mannsåker wrote:<br>
&gt; &gt; What you are looking for is the &#39;union_all&#39; method from<br>
&gt; &gt; <a href="https://metacpan.org/pod/DBIx::Class::Helper::ResultSet::SetOperations" rel="noreferrer" target="_blank">https://metacpan.org/pod/DBIx:<wbr>:Class::Helper::ResultSet::<wbr>SetOperations</a><br>
&gt;<br>
&gt; Thank you very much, it&#39;s exactly what I&#39;ve been looking for!<br>
<br>
</span>Note that if you don&#39;t need an actual UNION query you can also do -<br>
<br>
  my $merged = $schema-&gt;resultset(&#39;Foo&#39;);<br>
  $merged-&gt;set_cache([ map $_-&gt;all, $rs1, $rs2, $rs3 ]);<br>
<br>
and then iterating $merged will just use the cache.<br>
<br>
This may or may not be better, depending on your goal.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue<br>
<br>
<a href="http://shadowcat.co.uk/blog/matt-s-trout/" rel="noreferrer" target="_blank">http://shadowcat.co.uk/blog/<wbr>matt-s-trout/</a>   <a href="http://twitter.com/shadowcat_mst/" rel="noreferrer" target="_blank">http://twitter.com/shadowcat_<wbr>mst/</a><br>
<br>
Email me now on mst (at) <a href="http://shadowcat.co.uk" rel="noreferrer" target="_blank">shadowcat.co.uk</a> and let&#39;s chat about how our CPAN<br>
commercial support, training and consultancy packages could help your team.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" rel="noreferrer" target="_blank">http://lists.scsys.co.uk/cgi-<wbr>bin/mailman/listinfo/dbix-<wbr>class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" rel="noreferrer" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" rel="noreferrer" target="_blank">http://dev.catalyst.perl.org/<wbr>repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" rel="noreferrer" target="_blank">http://www.grokbase.com/group/<wbr>dbix-class@lists.scsys.co.uk</a><br>
</div></div></blockquote></div><br></div>