On Thu Mar 11 15:40:24 2010, laurent.dami@free.fr wrote:
Show quoted text> Le 10.03.2010 09:39, Dexter Tad-y via RT a écrit :
> > Wed Mar 10 03:39:15 2010: Request 55411 was acted upon.
> > Transaction: Ticket created by DTADY
> > Queue: DBIx-DataModel
> > Subject: Add Support for Multiple LIMIT/OFFSET dialects
> > Broken in: (no value)
> > Severity: Wishlist
> > Owner: Nobody
> > Requestors: DTADY@cpan.org
> > Status: new
> > Ticket<URL:
https://rt.cpan.org/Ticket/Display.html?id=55411>
> >
> >
> > Hi,
> >
> > We are heavy users of DBIx::DM and I would like to thank you for your
> > great work.
> >
> > We have hit a minor issue with LIMIT/OFFSET feature and we would like to
> > propose if it is possible to support multiple dialects of LIMIT/OFFSET.
> > Queries like select() with -limit -offset queries breaks with MySQL 4.x.
> > For MySQL 5.x, LIMIT/OFFSET is supported and is a non-issue.
> >
> > Given the dependency to SQL::Abstract, there is another module
> > SQL::Abstract::Limit that may be a starting point. Either the API
> > directly includes a -limitDialect param in the select() method.
> > Alternatively, unintrusively introduce a Schema level setting for
> > specifying/overriding the limit dialect.
> >
> > Thanks!
> >
> > Dex
> >
> >
> Hi Dex,
>
> Nice to hear of DBIx::DM users.
>
> True enough, LIMIT/OFFSET is currently hardcoded in Statement.pm, so
> it's a good idea to parameterize it.
> One way would be to exploit the Schema(sqlAbstract => ..) parameter and
> then rely on SQL::Abstract::Limit.
> Another way would be to add it within the Schema(sqlDialect => ...)
> parameter.
> This is a schema thing, so I'm not so keen of adding it in select(...,
> -limitDialect => ...).
> Need to think a bit of various options ...
> Which kind of dialect do you need (which syntax for Limit/Offset) ?
>
> Cheers, Laurent D.
Hi Laurent,
The dialect were using, in SQL::Abstract::Limit's terminology, are:
LimitOffset => PostgreSQL, SQLite, MySQL 5.x
LimitXY => MySQL 4.x (encountered when I deployed on a older system)
You are right in pointing out that it is a schema thing. I feel it is
flexible if one can specify his/her own SQL::Abstract instance. Please,
feel free to implement whatever is/feels correct, design-wise.
Looking forward for a better DBIx::DM.
Thanks!
Dex