[Dbix-class] overlaps
Jason Thaxter
thaxter at gomoos.org
Tue Jul 24 22:46:55 GMT 2007
Any suggestions on how to use the overlaps operator? Using Postgresql..
I read the SQL::Abstract page after bottoming out on:
Cannot mix placeholder styles ":foo" and "?"
I found this in the docs:
my %where = (
user => 'nwiger',
completion_date => {
-not_between => ['2002-10-01', '2003-02-06']
}
);
Would give you:
WHERE user = ? AND completion_date NOT BETWEEN ( ? AND ? )
But it doesn't seem to recognize OVERLAPS the same way as BETWEEN:
(start_time,end_time)" => { -overlaps => [$pg_alpha, $pg_omega] }
generates:
WHERE ( ( ( (start_time,end_time) OVERLAPS $1 ) OR ( ...
Of course what I want is
WHERE ( ( ( ( start_time,end_time) OVERLAPS (?, ?)
I could simulate overlaps with some OR clauses, but I made a mistake with that
before, so I'd rather use the proper SQL function.
--
----------------------------------------------
Jason Thaxter GoMOOS
350 Commercial Street, Suite 308
Portland, ME 0410
Office: 207.773.0423
Tel: 207.228.1665
Email: thaxter at gomoos.org
----------------www.gomoos.org----------------
More information about the Dbix-class
mailing list