Re: [CDBI] Connection with a fixed "where" clause.

[prev] [thread] [next] [Date index for 2005/08/22]

From: Matt S Trout
Subject: Re: [CDBI] Connection with a fixed "where" clause.
Date: 20:50 on 22 Aug 2005
On Mon, Aug 22, 2005 at 09:36:51AM +0200, Karl.Moens@xxxxx.xxx wrote:
> Hi ListMembers,
> 
> Is it possible to have a class with a fixed "where" clause?

It'd be a bit of a pain to do, but it's definitely possible. Class::DBI
defines all its SQL statements as Ima::DBI set_sqls, so all (!) you'd have to
do is redefine those - e.g.

__PACKAGE__->set_sql(SearchSQL => <<'');
SELECT %s
FROM   %s
WHERE  %s

would become

__PACKAGE__->set_sql(SearchSQL => <<'');
SELECT %s
FROM   %s
WHERE  restricted_access = 0 AND %s

        -- 
             Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Connection with a fixed "where" clause.
Karl.Moens 07:36 on 22 Aug 2005

Re: [CDBI] Connection with a fixed "where" clause.
Brian Phillips 11:17 on 22 Aug 2005

Re: [CDBI] Connection with a fixed "where" clause.
Matt S Trout 20:50 on 22 Aug 2005

Re: [CDBI] Connection with a fixed "where" clause.
merlyn (Randal L. Schwartz) 21:17 on 22 Aug 2005

Generated at 10:42 on 28 Aug 2005 by mariachi v0.52