- if query:
- table_rows = table.where(query, params, start, end)
- else:
- table_rows = table.iterrows(start, end)
+ # Limit number of rows
+ if 'limit' in parsed_sql:
+ max_rows = int(parsed_sql['limit'])
+ if end - start > max_rows:
+ end = start + max_rows
+
+ # Execute query
+ if query:
+ table_rows = table.where(query, params, start, end)