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/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to