<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"><<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>></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>
><br>
> One option is to hunt down every use of $schema for the subset of tables<br>
> 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's a few big apps and command-line utilities. It'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->resultset( ... ) lines everywhere, of course. There's code that says "Oh, this things works with "Foo", or this is "Foo" controller so I'll use $schema->resltset( 'Foo' )". 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="">> But, is there anything I might do that is a bit more "clever"?:<br>
><br>
> $schema->resultset( 'Foo' ) # uses one database<br>
> $schema->resultset( 'Bar' ) # uses a different connection<br>
<br>
</div>A schema object is by definition a "proxy that ties mutliple sources and<br>
a *single* storage object together". 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 "don't do it".<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>