]> git.jsancho.org Git - datasette-pytables.git/blobdiff - datasette_pytables/__init__.py
PyTables Connection class
[datasette-pytables.git] / datasette_pytables / __init__.py
index 8516315cd49bbf4bf4507590d3e47e5a4878a1b1..dc6823472e8abdf6190009648a83d8a6f79122f6 100644 (file)
@@ -1,5 +1,7 @@
 import tables
 
+_connector_type = 'pytables'
+
 def inspect(path):
     "Open file and return tables info"
     h5tables = {}
@@ -23,4 +25,12 @@ def inspect(path):
         }
 
     h5file.close()
-    return h5tables, views
+    return h5tables, views, _connector_type
+
+class Connection:
+    def __init__(self, path):
+        self.path = path
+        self.h5file = tables.open_file(path)
+
+    def execute(self, sql, params):
+        return [], False, []