[CDBI] Class::DBI patch

Veselin Slavov vess at slavof.net
Fri Jan 18 22:28:20 GMT 2008

Edward J. Sabol wrote:
>>> I probably shouldn't speak for Tony, but I can't imagine him accepting such a
>>> patch. It's very PostgreSQL-specific.
>> No it isn't, it's improving Class::DBI's support for the DBI documented
>> standard approach of getting the last inserted id.
> It's the "schema_name.table_name" parsing that appears to be Pg-specific to
> me, or at least not universally valid. I suspect that it would break usage
> with some non-Pg DBMSs. If anyone can show otherwise, then I would gladly
> support such a DBMS-agnostic change, FWIW.
'Pandora's box was open' , is't it ... ;-)

In base  DBI:
db => {             # Database Session Class Interface ...
last_insert_id  => { U =>[5,6,'$catalog, $schema, $table_name, 
$field_name [, \%attr ]'], O=>0x2800 },

Where is Class::DBI's schema support in  'last_insert_id(undef, undef, 
$self->table, undef)' ?!

if  "schema_name.table_name"  is 'Pg-specific' , what about 
__PACKAGE->schema - /Tony sugest it/?!

If default __PACKAGE->schema = undef and some one defined schema name 
not be Pg-specific call:

'last_insert_id(undef, $self->schema, $self->table, undef) - If DB 
supports schema defined,  if not undefined.

This is elegant method to solve problem without complications and any 
paches in other packages.

Why must predefined method '_auto_increment_value {...}' in more than 
one DB if more than one.

More information about the ClassDBI mailing list