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

John Napiorkowski jjn1056 at yahoo.com
Mon May 7 15:22:57 GMT 2007


--- Matt S Trout <dbix-class at trout.me.uk> wrote:

> 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 :)

I was thinking about this over the weekend.  I agree
that it would be better if the DDL created performed
some sort of sorting to make sure FK dependencies are
properly organized.  I can sorta see what this sorting
algorithm might look like so I think I'll give that a
whirl.  However I still think the big hammer ability
to do certain types of things in a reasonable cross
database manner would be very useful for the
deployment and management tasks.  It's also the
easiest thing to do.  I have time this week to play
with this and I'll report back to the group about it. 
The code is pretty light work for the big hammer so if
we decide to chuck it it won't waste my time.  I'll
just make it a component for my local projects or
something.

--john


> 
> -- 
>       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/ 
> 
> _______________________________________________
> List:
>
http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN:
>
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
>
http://www.mail-archive.com/dbix-class@lists.rawmode.org/
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Dbix-class mailing list