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

Karl.Moens at marsh.com Karl.Moens at marsh.com
Tue Aug 23 09:14:34 BST 2005



Matt S Trout wrote:

> 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

Thanks, that  might indeed be the way to go. I will certainly look into it.

Karl


 --------------------------------------------------------------------------- 
                                                                             
 Reply from Karl Moens/ANT/BE/JHMarsh/MMC 23/08/2005 10:12:11 (Intl)         
 --------------------------------------------------------------------------- 
 dbix-class at trout.me.uk                                                      
 --------------------------------------------------------------------------- 
 22/08/2005 22:50:48 (Intl)                                                  
 --------------------------------------------------------------------------- 




From: dbix-class at trout.me.uk on 22/08/2005 21:50
                                                                                               
   To:    Karl Moens                                                                           
                                                                                               
                                                                                               
   cc:    classdbi at svr02.digitalcraftsmen.ne                                                   
          t                                                                                    
                                                                                               
                                                                                               
   bcc:                                                                                        
                                                                                               



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


On Mon, Aug 22, 2005 at 09:36:51AM +0200, Karl.Moens at marsh.com 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/ +





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This message and any attachments are confidential. If you have received
this message in error please delete it from your system. If you require any
assistance please notify the sender. Thank You.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






More information about the ClassDBI mailing list