[Dbix-class] Is it possible to search with the accessor instead of the column name?

Eden Cardim edencardim at gmail.com
Wed Jan 7 00:50:27 GMT 2009


On Tue, Jan 6, 2009 at 9:02 PM, fREW Schmidt <frioux at gmail.com> wrote:
> Ok, so we have some legacy databases with long, obscure column names and I'd
> like to define accessors with nicer, more clear names.  I took care of that
> just fine, but I'd like to be able to search by the accessor names.  Is
> there a way to do that?

There's no built-in functionality for aliasing search columns (adding
the feature would imply an SQLA rewrite, I think) but it should be
easy to write a non-generic solution by overriding your resultset's
search_rs() to swap keys specifically from your app's search
conditions.

> Also, where is the hash describing a column documented besides the Intro?

DBIx::Class::ResultSource


-- 
   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://edenc.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list