[Dbix-class] Branch for supporting column attributes checked in

Matt S Trout dbix-class at trout.me.uk
Tue Nov 21 23:00:02 GMT 2006


John Napiorkowski wrote:
> --- Matt S Trout <dbix-class at trout.me.uk> wrote:
> 
>> John Napiorkowski wrote:
>>>> Also, I see absolutely no reason to pollute the
>>>> column_info with DB-specific 
>>>> crud - why can't Storage::DBI::Pg detect 
>>>> $source->column_info($col)->{data_type} being
>>>> 'bytea' and DWIM?
>>> $source->column_info($col)->{data_type} would have
>> to
>>> return the expected data type number, not the
>> string
>>> it currently returns.  If someone with Oracle
>> could
>>> experiment with this and let me know what it
>> currently
>>> returns so I can find out a way to map it to
>>> DBD::Oracle::ORA_[type] that would help out.
>> No it wouldn't have to return that, no fucking way
>> in hell :)
>>
>> The point is that each Storage::DBI::* would map
>> that string to the 
>> appropriate DBD-specific constant internally and
>> handle stuff appropriately 
>> from there - if you start including data type
>> numbers you're getting 
>> storage-specific crap bleeding out into your classes
>> again, at which point I 
>> start getting ready to stab you in the face :)
> 
> Don't start sharpening your knife yet, I don't plan to
> mess with column_info.  What do you think if I made a
> new method in the database specific Storage object
> called "column_bind_attribute(colname)" so I have
> somewhere to do this mapping?  That we each database
> storage object knows all about itself, if it need the
> attribute or not. --john

Sounds great. I'll be keeping the chainsaw sharp anyway, mind, plenty of other 
deserving victims :)



More information about the Dbix-class mailing list