[Dbix-class] No such column: me. error

Christopher H. Laco claco at chrislaco.com
Tue Nov 22 18:27:11 CET 2005


Christopher H. Laco wrote:
> I'm stumped on this. I'm working through the Handel test suite and I'm
> getting this error on a write activity:
> 
>> t/cart_add................................ok 5/44DBD::SQLite::db prepare failed: no such column: me.sku(1) at dbdimp.c l
>> ine 268 at C:/Perl/site/lib/DBIx/Class/Storage/DBI.pm line 226.
>> Can't call method "execute" on an undefined value at C:/Perl/site/lib/DBIx/Class/Storage/DBI.pm line 177.
>> # Looks like you planned 44 tests but only ran 5.
>> # Looks like your test died just after 5.
> 
> Here's my cart/item classes:
> 
>>     use base 'Handel::DBI';
>> __PACKAGE__->table('cart');
>> __PACKAGE__->iterator_class('Handel::Iterator');
>> __PACKAGE__->columns(All => qw(id shopper type name description));
>> __PACKAGE__->set_primary_key(qw/id/);
>> __PACKAGE__->has_many(_items => 'Handel::Cart::Item', {'foreign.cart' => 'self.id'});
> 
> and
> 
>>     use base 'Handel::DBI';
>> __PACKAGE__->table('cart_items');
>> __PACKAGE__->autoupdate(1);
>> __PACKAGE__->iterator_class('Handel::Iterator');
>> __PACKAGE__->columns(All => qw(id cart sku quantity price description));
>> __PACKAGE__->set_primary_key(qw/id/);
>> __PACKAGE__->inflate_column(price => {inflate => 'Handel::Currency'});
> 
> 
> Where is the "me" in me.sku coming from?

I forgot to mention this.. I have columns wrappered in my DBI class
since I already had an add_columns of my own...

I'll refactor that out later. calling __PACKAGE__->SUPER::columns
returns the columns I set, so they're in there.

-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20051122/9f0aeb42/smime.bin


More information about the Dbix-class mailing list