[Dbix-class] Problem with DBIC::PK::Auto::Oracle and composite
triggers
Matt S Trout
dbix-class at trout.me.uk
Tue Jan 3 20:57:27 CET 2006
On Tue, Jan 03, 2006 at 01:40:38PM -0600, Brandon Black wrote:
> On 1/3/06, James FitzGibbon <jfitzgibbon at primustel.ca> wrote:
> > [...]
> > A cursory examination of the Oracle docs doesn't suggest a place in the
> > dictionary that lets you see a normalized view of the triggering events.
> > So, I figure that the solution is one of:
> >
> > - change my trigger auto-generation to create separate triggers (or at least
> > separate triggers for sequence creation
> >
> > - modify PK::Auto::Oracle to use "LIKE '%INSERT%'" instead of "= 'INSERT'"
> > to find the trigger body (either in the proper dist, or if this is a "just
> > me" thing, a private subclass that overrides _get_autoinc_seq)
> >
> > Any thoughts?
> >
>
> I would split those triggers up, unless there's a good reason not to.
> If you have a bunch of huge "INSERT OR UPDATE OR DELETE" triggers, and
> they all have a top-level switch that says "IF INSERTING ... IF
> UPDATING ...", then it seems they'd be better off (cleaner) as
> seperate triggers anyways.
>
> The PK::Auto code for most backends will probably always be a bit
> heuristic in nature, and there will probably always be odd cases that
> it cannot figure out without hints from you. I think perhaps the most
> productive change to PK::Auto and friends would be to make it easier
> and more obvious for you to override _get_autoinc_seq logic for your
> particular database class as a whole (as opposed to per-table).
I keep wondering if we shouldn't move most of it into Storage, and maybe
have Storage::DBI auto-rebless itself into a subclass if it finds one. But
then how do you pass through more specific info from the outside world?
auto-inc is kinda several things, and hard to factor cleanly; anybody with
good ideas, please speak up :)
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Dbix-class
mailing list