adding LIMIT, OFFSET to CDBI::AbstractSearch and SQL::Abstract

[prev] [thread] [next] [Date index for 2004/04/27]

From: fliptop
Subject: adding LIMIT, OFFSET to CDBI::AbstractSearch and SQL::Abstract
Date: 15:10 on 27 Apr 2004
list

i am wanting to implement a limit/offset clause similar to how order_by
works w/ CDBI::AbstractSearch and SQL::Abstract.  however, this is not
supported in the same manner between databases.  for example, in
postgresql i'd use:

SELECT cdid
FROM music
WHERE year = 1990
ORDER BY title
LIMIT 5 OFFSET 0

but in mysql it'd be:

SELECT cdid
FROM music
WHERE year = 1990
ORDER BY title
LIMIT 5, 0

i'm not sure how it works in other databases, or if it's even implemented
at all.  for this reason, would it be more appropriate to create new
modules that inherit from the 2 mentioned above and supply new
limit/offset method(s)?  for example:

Class::DBI::AbstractSearch::Pg
SQL::Abstract::Pg


adding LIMIT, OFFSET to CDBI::AbstractSearch and SQL::Abstract
fliptop 15:10 on 27 Apr 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52