[Dbix-class] +select problem with 0.7006
    Will Hawes 
    wdhawes at gmail.com
       
    Thu Jun  7 12:05:02 GMT 2007
    
    
  
>From the docs and a quick chat on IRC I understand that the following:
package My::Schema::Order_Product;
...
__PACKAGE__->table('order_product');
__PACKAGE__->add_columns(qw/ id product quantity unitprice /);
...
my $rs = $c->model('Order_Product')->search(
  {},
  {
    +select => ['quantity * unitprice'],
    +as => ['line_total']
  }
);
should cause DBIC to generate something like:
SELECT id, product, quantity, unitprice, quantity * unitprice FROM
order_product me
It's only giving me the following though:
SELECT quantity * unitprice FROM order_product me
The only way I can get the other columns is to add them manually using
the "select" attribute.
What have I done wrong here?
    
    
More information about the Dbix-class
mailing list