]> git.jsancho.org Git - datasette-connectors.git/blobdiff - tests/dummy.py
Adapting project to last datasette version (WIP)
[datasette-connectors.git] / tests / dummy.py
index b4ae1c097da4c9e200f59cea33d316eb0703b968..feadf0a2e1ed2e81c1e703769b5225149a391650 100644 (file)
@@ -1,7 +1,32 @@
 from datasette_connectors.row import Row
+from datasette_connectors.connectors import Connector
 
 
-_connector_type = 'dummy'
+class DummyConnector(Connector):
+    _connector_type = 'dummy'
+
+    @staticmethod
+    def table_names(path):
+        return ['table1', 'table2']
+
+    @staticmethod
+    def table_columns(path, table):
+        return ['c1', 'c2', 'c3']
+
+    @staticmethod
+    def get_all_foreign_keys(path):
+        return {
+            'table1': {'incoming': [], 'outgoing': []},
+            'table2': {'incoming': [], 'outgoing': []},
+        }
+
+    @staticmethod
+    def table_counts(path, *args, **kwargs):
+        return {
+            'table1': 2,
+            'table2': 2,
+        }
+
 
 def inspect(path):
     tables = {}