Changing SQLiteConnection's _queryAddLimitOffset() to the following
fixes the missing upper bound problem.
def _queryAddLimitOffset(self, query, start, end):
if not start:
return "%s LIMIT %i" % (query, end)
if not end:
return "%s LIMIT 0 OFFSET %i" % (query, start)
return "%s LIMIT %i OFFSET %i" % (query, end-start, start)
Matt Goodall wrote:
> python 2.2.2
> sqlite 2.8.3
> pysqlite 0.4.3
> SQLObject 0.4rc1
> SQLite support seems a bit broken ...
> len(Person.select('all')) - "TypeError: an integer is required". I
> guess this is because SQLite always uses strings.
> Also, when a slice does not include an upper bound, i.e.
> Person.select('all')[10:] or Person.select('all'), the generated
> SQL is missing the LIMIT part of the clause. According to the SQLite
> docs it should include "LIMIT 0" if there is no upper bound.
> All of the above work fine with PostgreSQL.
> Cheers, Matt
> Ian Bicking wrote:
>> I believe I have everything together for SQLObject 0.4 A release
>> candidate exists at:
>> I'd appreciate it people could give it a try, to see if there's problems
>> with the distribution or anything else. I've also restructured and
>> rewritten a lot of the documentation, so I'd appreciate any feedback
>> anyone has on that as well.
>> The changes are described in News.txt
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>> sqlobject-discuss mailing list
Matt Goodall, Pollenation Internet Ltd
t: 0113 2252500