[Dbix-class] Master/Slave Replication (again)

Matt S Trout dbix-class at trout.me.uk
Thu Jan 17 03:01:42 GMT 2008


On Mon, Jan 14, 2008 at 01:39:55PM +0000, Aaron Trevena wrote:
> On 11/01/2008, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > On Thu, Jan 10, 2008 at 02:19:49PM +0000, Aaron Trevena wrote:
> > > The current system has been updated to accept an argument when getting
> > > a connection as to whether it should be using master or slave.
> > >
> > > This works well as it's transparent in the application as to which is
> > > being used as there are many cases where data having been just been
> > > writen will immediately be read again - such as creating, then
> > > confirming new records, etc.
> > >
> > > I can see how to do this in class::dbi - I'd pass the the 'use master'
> > > flag down to the point where it get's the connection. I can't see how
> > > I would do this with DBIx::Class - any suggestions as to how that
> > > could/should work or equivilent alternatives would be much
> > > appreciated.
> >
> > Same principle should work.
> 
> Neat. That would be good.
> 
> > DBIC tends to pass along any attribute it doesn't recognise at a given stage,
> > so unknown resultset attributes should make it all the way to storage and
> > you can grab 'em there and act appropriately.
> 
> Cool. Don't suppose anybody can point me at where this kind of thing
> (i.e. passing arguments to storage) has been done before on a wiki or
> list archive, or is it ReallyVerySimple.

It really is, have a quick poke at the select/insert/update/delete methods
in Storage::DBI and it should all come clear.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list