X-Git-Url: https://git.jsancho.org/?p=datasette-pytables.git;a=blobdiff_plain;f=datasette_pytables%2F__init__.py;h=b3d5b9a7d0ab3ec31eacf6bfe410169130fe094a;hp=d16109b541d106447ab22964d3a20beffd74d60e;hb=6cc3c0fa57c1155e9c76bf0c1b4ebfcc65772e12;hpb=4063788a1580d4d236d3b89b8c6d87e12c158f33 diff --git a/datasette_pytables/__init__.py b/datasette_pytables/__init__.py index d16109b..b3d5b9a 100644 --- a/datasette_pytables/__init__.py +++ b/datasette_pytables/__init__.py @@ -1,4 +1,3 @@ -from collections import OrderedDict from moz_sql_parser import parse import re import tables @@ -81,7 +80,9 @@ class Connection: parsed_sql = _parse_sql(sql, params) if parsed_sql['from'] == 'sqlite_master': - return self._execute_datasette_query(sql, params) + rows = self._execute_datasette_query(sql, params) + description = (('value',)) + return rows, truncated, description table = self.h5file.get_node(parsed_sql['from']) table_rows = [] @@ -217,10 +218,7 @@ class Connection: description.append((field,)) # Return the rows - if truncate: - return rows, truncated, tuple(description) - else: - return rows + return rows, truncated, tuple(description) def _execute_datasette_query(self, sql, params): "Datasette special queries for getting tables info"