[Dbix-class] admin functions for the storage object?

Matt S Trout dbix-class at trout.me.uk
Mon May 7 14:45:53 GMT 2007


On Fri, May 04, 2007 at 08:48:22PM +0100, Jess Robinson wrote:
> 
> On Fri, 4 May 2007, John Napiorkowski wrote:
> 
> >Hi,
> >
> >Not sure if this is something other people care about but I end up have to 
> >write some
> >driver specific code for stuff like dis/enabling FK constraints and so 
> >forth to make it
> >easier to deploy tables and preload data.  I know this doesn't effect all 
> >databases
> >and each database has it's own way to deal with this.  So I was wondering 
> >if this might
> >be a useful thing to add to the storage class.  I would add some methods 
> >to do stuff
> >like
> >
> >-- dis/enable FK support
> >-- dis/enable triggers
>
> This is/should be already done by SQL::Translator::Producer::MySQL (turns 
> off foreign key constraints), if you'd like to patch sql for the rest, 
> I'll commit the patches.

The problem is that it's also important for bulk data-loading, which is kinda
on the boundary between DDL and DML stuff. Really, I think we probably need
to accept that there are some things that mix across boundaries and in the
absence of a unified SQLT/SQLA type project the storage object is probably
the best place for it.

Plus, correctly formulated DDL shouldn't actually require FK constraints to
be turned off so I'd rather see a patch to SQLT to re-order things correctly
and not do that in there at all!

John, I'd vote for chucking yourself a branch up and getting prototyping but
keep an eye on this discussion and make sure your work can end up elsewhere if
somebody comes up with a good argument for why we're wrong about this :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
Shadowcat Systems Ltd.   Contact mst (at) shadowcatsystems.co.uk for a quote
                                          http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list