]> git.jsancho.org Git - datasette-pytables.git/commitdiff
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 751e2605e7d216a82c610d9fc3b7dc4df376b617..b3d5b9a7d0ab3ec31eacf6bfe410169130fe094a 100644 (file)
@@ -80,7 +80,9 @@ class Connection:
         parsed_sql = _parse_sql(sql, params)
 
         if parsed_sql['from'] == 'sqlite_master':
         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 = []
 
         table = self.h5file.get_node(parsed_sql['from'])
         table_rows = []
@@ -216,10 +218,7 @@ class Connection:
                 description.append((field,))
 
         # Return the rows
                 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"
 
     def _execute_datasette_query(self, sql, params):
         "Datasette special queries for getting tables info"