]> git.jsancho.org Git - datasette-connectors.git/blobdiff - datasette_connectors/connection.py
Merge pull request #1 from PyTables/dependabot/pip/datasette-0.46
[datasette-connectors.git] / datasette_connectors / connection.py
diff --git a/datasette_connectors/connection.py b/datasette_connectors/connection.py
new file mode 100644 (file)
index 0000000..b9081f4
--- /dev/null
@@ -0,0 +1,18 @@
+from .cursor import Cursor
+
+
+class Connection:
+    def __init__(self, path, connector_class):
+        self.path = path
+        self.connector_class = connector_class
+
+    def execute(self, *args, **kwargs):
+        cursor = Cursor(self)
+        cursor.execute(*args, **kwargs)
+        return cursor
+
+    def cursor(self):
+        return Cursor(self)
+
+    def set_progress_handler(self, handler, n):
+        pass