Execute return always rows, truncated, description tuple
authorJavier Sancho <jsf@jsancho.org>
Mon, 28 May 2018 10:38:36 +0000 (12:38 +0200)
committerJavier Sancho <jsf@jsancho.org>
Mon, 28 May 2018 10:38:36 +0000 (12:38 +0200)
datasette_pytables/__init__.py

index 751e260..b3d5b9a 100644 (file)
@@ -80,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 = []
@@ -216,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"