I am trying to run a DBIx::Class query on a PostGIS function with binders,
with the attributes of the search query having something like:

  'as' => [
          'order_by' => ['distance_from_location'],
          'join' => [],
          'select' => [
              \ 'me.id::int',
                  'ST_AsText' => 'me.location'
              \ [
                  'ST_Distance(me.location,ST_GeomFromText(?, 27700))',
                   'POINT(400928 298992)'

This worked. Then, for reasons I don't understand, stopped working.

I get the error

   ERROR:  column "distance_from_location" does not exist

Ok. It's not generating an 'as' in the SQL statement.

The examples in the DBIx::Class POD all deal with common functions, e.g.

  { count => 'cds.cdid', -as => 'amount_of_cds' }

So how do I specify the 'as' attribute for bound functions?

List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to