Re: [CDBI] Using scalar functions with AbstractSearch

[prev] [thread] [next] [Date index for 2006/02/02]

From: Matt S Trout
Subject: Re: [CDBI] Using scalar functions with AbstractSearch
Date: 00:05 on 02 Feb 2006
On Thu, Feb 02, 2006 at 12:50:15AM +0100, Rhesa Rozendaal wrote:
> Dylan Vanderhoof wrote:
> >Trying to figure out a way to have an arbitrary where clause with
> >AbstractSearch/AbstractCount that includes a scalar function (Such as
> >NOW()).
> >
> >Is there any way to do this?  I haven't been able to find anything in
> >the documentation for SQL::Abstract or any of the other associated
> >modules that indicates this is possible.
> 
> According to the SQL::Abstract docs, you can do this by passing a reference 
> to a string:
> 
> 	some_date => \q{< now()},
> 
> I've even used something like this in CDBI::Sweet:
> 
> $class->search({
> 	q{now()} => \q{ between start_date and end_date }
> });

Why not just use { -between => [ $start, $end ] } ?

        -- 
             Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + 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

(message missing)

[CDBI] Using scalar functions with AbstractSearch
Dylan Vanderhoof 23:37 on 01 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Rhesa Rozendaal 23:50 on 01 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Matt S Trout 00:05 on 02 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Rhesa Rozendaal 00:07 on 02 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Rhesa Rozendaal 01:41 on 02 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Rhesa Rozendaal 04:54 on 02 Feb 2006

[CDBI] Re: Using scalar functions with AbstractSearch
Edward J. Sabol 05:16 on 02 Feb 2006

Re: [CDBI] Using scalar functions with AbstractSearch
Tatsuhiko Miyagawa 05:33 on 02 Feb 2006

RE: [CDBI] Using scalar functions with AbstractSearch
Dylan Vanderhoof 05:29 on 02 Feb 2006

Generated at 17:59 on 03 Feb 2006 by mariachi v0.52