From: Oleg B. <ph...@ph...> - 2009-07-28 20:37:45
|
On Tue, Jul 28, 2009 at 04:04:28PM -0400, Stef Telford wrote: > Oleg Broytmann wrote: >> Can I ask you do an experiment with a different program? What if you use >> sqlbuilder.Select() - a lower-level interface? How long it'd take to draw >> all these rows? > > Sorry, I have almost -0- experience with that low a level .. do you > have any nice canned example I could tailor to suit ? Very easy: sqlbuilder.Select(list_of_columns), convert the expression to a string (SQL query), execute the query and get back the results: connection = connectionForURI('...') class Test(SQLObject): _connection = connection a = IntCol() b = IntCol() Test.createTable() Test(a=1, b=2) Test(a=2, b=1) for row in connection.queryAll(connection.sqlrepr( sqlbuilder.Select([Test.q.a, Test.q.b]))): print row In case you want to pass the list of columns as a list of strings - pass the list of tables for the FROM clause: Select(['a', 'b'], staticTables=['test']) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |