[Dbix-class] mysql insert seems wrong

Matt S Trout dbix-class at trout.me.uk
Fri Feb 2 11:52:08 GMT 2007


On 2 Feb 2007, at 11:35, Johannes Rumpf wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> i'm new to this module and actual a bit confused about a  
> errormessage. I
> hope you can help me out here:
>
> Very Simple example using a XAMPP- DB.
> Here is my code:
> - --------
> package mydb::Schema;
> use base qw/DBIx::Class::Schema/;
>
> #__PACKAGE__->load_components (qw/ Core /);
> __PACKAGE__->load_classes ();
> 1;
> - --------
> package mydb::Schema::cds;
> use base qw/DBIx::Class/;
>
> @columns = qw/ interpret id jahr titel /;
>
> sub get_columns(){
> return @columns;
> }

BOOM

Don't override get_columns, it's a ::Row method that insert uses.

There's already an ->columns method that'll do what you want anyway.

-- 
Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for  
Catalyst,
DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for  
details.
+ Help us build a better perl ORM: http://dbix- 
class.shadowcatsystems.co.uk/ +





More information about the Dbix-class mailing list