<div dir="ltr">I have little experience with postgres myself, but it seem to that if you just want to split the database but keep one DBIx::Class schema, you should be able to do that using the postgres&#39; schema search path which allows you to refer to tables in schemas other than the current without qualifying the tables names.<div>
<br></div><div>/L<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 3, 2014 at 5:19 PM, Bill Moseley <span dir="ltr">&lt;<a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Thu, Apr 3, 2014 at 7:07 AM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, Apr 03, 2014 at 05:47:18AM -0700, Bill Moseley wrote:<br>
&gt;<br>
&gt; One option is to hunt down every use of $schema for the subset of tables<br>
&gt; and replace it with $other_schema.<br>
<br>
</div>This is what I would recommend. Can you give ideas of the scale of<br>
changes required?<br></blockquote><div><br></div></div><div>Hard to quantify.  It&#39;s a few big apps and command-line utilities.   It&#39;s just normal work to hunt down every possible usage.   Making lots of changes has its risks, too.</div>


<div><br></div><div>But, not everything is as simple as literal $schema-&gt;resultset( ... ) lines everywhere, of course. There&#39;s code that says &quot;Oh, this things works with &quot;Foo&quot;, or this is &quot;Foo&quot; controller so I&#39;ll use $schema-&gt;resltset( &#39;Foo&#39; )&quot;. That is, much of the high-level code assumes a single $schema.</div>


<div><br></div><div>DBIC is the common later, which would make it handy to solve there.</div><div class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>&gt; But, is there anything I might do that is a bit more &quot;clever&quot;?:<br>
&gt;<br>
&gt; $schema-&gt;resultset( &#39;Foo&#39; )  # uses one database<br>
&gt; $schema-&gt;resultset( &#39;Bar&#39; )  # uses a different connection<br>
<br>
</div>A schema object is by definition a &quot;proxy that ties mutliple sources and<br>
a *single* storage object together&quot;. As such cleverness in this area is<br>
likely to bite you. I can not think of specifics at this moment, but the<br>
gut feeling is &quot;don&#39;t do it&quot;.<br></blockquote><div><br></div></div><div>Well, gut felling is a valid response.</div><div><br></div><div>Perhaps a different animal, but the replication code manages multiple database connections which made me think about doing something similar at the $storage layer.</div>


<div><br></div><div>Thanks,</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div></font></span></div><span class="HOEnZb"><font color="#888888">-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</font></span></div></div>
<br>_______________________________________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" 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" target="_blank">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a><br></blockquote></div><br></div>