<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">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 class="">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>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><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">&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>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><div><br></div><div><br></div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</div></div>