[Dbix-class] info from DBI::column_info to $class->_columns}

Zbigniew Lukasiak zzbbyy at gmail.com
Thu Dec 22 22:11:29 CET 2005


OK - I hope the attached svn diff will be what you wanted.

By the way I like to use print statements in my tests to see at once
what is wrong like here:

is($typeinfo->{TYPE_NAME}, 'INTEGER', 'column_info ok') or warn
'DBICTest::Artist->_columns: ' . Dumper(DBICTest::Artist->_columns);

It would be useful if Data::Dumper was available in the tests.

-- Zbyszek

On 12/22/05, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Thu, Dec 22, 2005 at 05:00:22PM +0000, Matt S Trout wrote:
> > On Wed, Dec 21, 2005 at 06:04:07PM +0100, Zbigniew Lukasiak wrote:
> > > The svn diff is attached.
> > > Problems:
> > >
> > > 1) Because SQLite (and perhaps other databases) dont implement
> > > column_info I used the technique from CDBI - a SELECT selecting no
> > > rows.
>
> Additional to my last message, that's a fair enough technique but you're
> doing a select per column - surely it would be more effective to do a table's
> worth of columns at a time ...
>
> > > 2)  I created the storage column_info_for method but storage is not
> > > available in the setup phase.  Anyway I think it should not be called
> > > for all columns at setup - because this information is needed only
> > > ocassionally - I propose to make the column_info method to call the
> > > storage column_info_for method and not use the _column class member.
> >
> > Actually, I think this info should be pre-populated by Loader if you're
> > using a Loader.
> >
> > If you aren't, column_type should fill the data out for the table using
> > column_info_for if it isn't already present, and then use the contents of
> > the column_info hash from then on.
>
> --
>      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/ +
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbic.diff
Type: text/x-patch
Size: 2579 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051222/83f12ab6/dbic.bin


More information about the Dbix-class mailing list