On Mon, Mar 03, 2008 at 03:10:33PM -0600, Kevin J. Rice wrote:
> y = list(MySObjectThing.select().limit(1))
>
> generates:
>
> 1. select field1, field2,... from mysqlobjectthing where 1 = 1 limit 1
> 2. select count(*) from mysqlobjectthing;
In what SQLObject version? For 0.9.3 with SQLite there is only one
query:
from sqlobject import *
from sqlobject.sqlbuilder import *
__connection__ = "sqlite:/:memory:?debug=1"
class Test(SQLObject):
name = StringCol()
value = IntCol()
Test.createTable()
print list(Test.select().limit(1))
Output:
1/Query : CREATE TABLE test (
id INTEGER PRIMARY KEY,
name TEXT,
value INT
)
1/QueryR : CREATE TABLE test (
id INTEGER PRIMARY KEY,
name TEXT,
value INT
)
2/Select : SELECT test.id, test.name, test.value FROM test WHERE 1 = 1 LIMIT 1
2/QueryR : SELECT test.id, test.name, test.value FROM test WHERE 1 = 1 LIMIT 1
[]
Seems fine.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.
|