Hi there, I'm getting up to speed on DBIx::Class, in the context of Catalyst. Can someone help me with this query?
I need to validate whether a particular column exists in the schema
before calling a search, as I get an SQL error if it doesn't exist.
I'm doing something like this:
my $order_by = $c->request->params->{order_by} || $default_order;
my $rs = $c->model('Domain')->
search(undef,
{ page => $page, rows => 10,
order_by => $order_by,
prefetch => ['registrant', 'owner']
});
So, the value of order_by can be something like 'domainname' or
'owner.username'.
How do I check with D::C whether the column exists before feeding it to
search, which expects it to exist? I've scanned loads of manual pages,
but can't find anything relevant.
Thanks for you help :),
Joe
--
Josef Karthauser ([EMAIL PROTECTED]) http://www.josef-k.net/
Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================
pgpRreM2svGu5.pgp
Description: PGP signature
_______________________________________________ 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/ Searchable Archive: http://www.mail-archive.com/[email protected]/
