<div dir="ltr">As per doc, -&gt;new_result creates a new $result, and therefore you&#39;re calling -&gt;as_query on an object which doesn&#39;t have that method, which, instead, is described in the ResultSet class.<div>Cfr.: <a href="http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/ResultSet.pm#new_result">http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/ResultSet.pm#new_result</a></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 21 Oct 2015 at 16:00 Bill Moseley &lt;<a href="mailto:moseley@hank.org">moseley@hank.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a test script that generates a large number of inserts.   What I&#39;d like to do is capture the SQL inserts into a file so I can later run the inserts using psql -f foo.sql or psql&#39;s \i command.<div><br></div><div>I thought I might get lucky and call -&gt;new_result( \%cols )-&gt;as_query, but no.</div><div><br></div><div>I know I can create a debug object and capture on -&gt;query_start calls.    But, I&#39;d like to <i>not</i> actually insert into the database.</div><div><br></div><div>I suppose I could die in the query_start method and eval every insert.</div><div><br></div><div>Any other ideas how to capture the insert SQL without actually inserting?</div><div><br></div><div><div><br></div>-- <br><div>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a></div>
</div></div>
_______________________________________________<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-bin/mailman/listinfo/dbix-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/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/dbix-class@lists.scsys.co.uk</a></blockquote></div>