[Dbix-class] Case sensitivity in column names using Oracle

Michael Gray mjg17 at eng.cam.ac.uk
Mon Feb 13 16:02:33 CET 2006


Hello all, and thanks for doing a great job with DBI::Class.  

I'm just starting in with DBIC, and I am trying to port an existing 
application which was written to use DBIx::Recordset.  Smooth progress 
with tables which are largely read-only, but I've hit a big bump with 
inserting into tables with auto-incrementing keys.  

This first manifested itself as appauling performance on multiple 
inserts, whereas everything else had thus far been significantly faster. 
Closer investigation revealed that PK::Auto::insert() was calling 
ResultSource::column_info() and thus Storage::DBI::columns_info_for() 
and DBD::Oracle::column_info() on *every* insert.

Further digging revealed that my database is set up with upper-case 
table and column names, but that the application uses lower-case 
everywhere.  This mostly works, except that columns_info_for() gets the 
upper-case information back, and column_info fails to cache anything as 
it is churning through the returned info looking for entries using 
lower-case column names.

It's possible to work around this by specifying upper-case names to 
add_columns() in my schema class, but this results in upper-case 
accessors and is going to be a right pain (not to mention ugly) in my 
application.

I'd like to do something more systematic, possibly doing case conversion 
in ResultSource::column_info() or Storage::DBI::columns_info_for(), but 
I'm not sure where would be best, nor how to toggle the behaviour in a 
DBIx::Class approved fashion.

Tips and pointers very welcome.

Thanks
-- 
-- 
Michael Gray                        Email: mjg17 at eng.cam.ac.uk
Computer Officer
Cambridge University Engineering Department, Cambridge CB2 1PZ



More information about the Dbix-class mailing list