self.path = path
self.h5file = tables.open_file(path)
- def execute(self, sql, params=None, truncate=False):
+ def execute(self, sql, params=None, truncate=False, page_size=None):
if params is None:
params = {}
rows = []
if end - start > max_rows:
end = start + max_rows
+ # Truncate if needed
+ if page_size and truncate:
+ if end - start > page_size:
+ end = start + page_size
+ truncated = True
+
# Execute query
if query:
table_rows = table.where(query, params, start, end)
'sql': 'select identity from [/group1/table1]',
'params': {}
} == data['query']
+ assert 50 == len(data['rows'])
assert [
{'identity': 'This is particle: 0'},
{'identity': 'This is particle: 1'},