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