db:rows(sql)

Execute a SQL statement and return an iteration function that can be used in a for loop. The values will be returned as a table that uses the column names as the index.

Example
sum=0
db=sqlite.open('testdb')
for row in db:rows[[select x from foo]] do
sum=sum+row.x
end