Re: Class::DBI _auto_increment_value update/suggestion

[prev] [thread] [next] [Date index for 2005/06/26]

From: stelf
Subject: Re: Class::DBI _auto_increment_value update/suggestion
Date: 23:34 on 26 Jun 2005
> I can't make the specific DBD versions of MySQL and SQLite be pre-reqs, a=
s
> they're not required at all. But it might be worth noting in the docs

   another possible solution is doing is_a check for DBD drivers known
to implement the last_insert_id properly and outputting a warning in
all other cases. this won't introduce any mandatory pre-reqs. the idea
is that no DBDs should be listed as prereqs, 'cause last_insert_id is
prototyped in DBI and as far as I know DBD authors extend it (ar at
least are expected to) in order to handle specific driver issues...

   stelf

On 6/26/05, Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:
> On Thu, Jun 23, 2005 at 10:28:51PM +0100, Tim Bunce wrote:
> > > >    my $id  =3D $dbh->last_insert_id(undef, undef, $self->table, und=
ef );
> > > Tim, does this sound like a good idea?
> > Yes, though "most DB drivers already handle it" may be a little optimis=
tic.
> > It returns undef "if the driver does not support the method or can't
> > determine the value" so if you get an undef you're no worse off than be=
fore.
>=20
> Well, we're worse off than before if we actually replace the code that
> does the specific calls to MySQL and SQLite with the generic version,
> and they break.
>=20
> I can't make the specific DBD versions of MySQL and SQLite be pre-reqs, a=
s
> they're not required at all. But it might be worth noting in the docs
> that people will need certain versions if they're using those databases
> and want to use auto-incrementing PKs?
>=20
> Tony
>=20


--=20
    jr`

Re: Class::DBI _auto_increment_value update/suggestion
stelf 23:34 on 26 Jun 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52