From: Javier Sancho Date: Wed, 14 Oct 2020 08:46:01 +0000 (+0200) Subject: database page X-Git-Url: https://git.jsancho.org/?p=datasette-pytables.git;a=commitdiff_plain;h=bebf2dd8e68c9d857ba22e2eaf6977b6ca1a8a57 database page --- diff --git a/datasette_pytables/__init__.py b/datasette_pytables/__init__.py index 396cd0d..a56bc3d 100644 --- a/datasette_pytables/__init__.py +++ b/datasette_pytables/__init__.py @@ -53,6 +53,9 @@ class PyTablesConnector(dc.Connector): def detect_fts(self, table_name): return False + def foreign_keys(self, table_name): + return [] + def inspect(path): "Open file and return tables info" diff --git a/tests/test_api.py b/tests/test_api.py index 9d50932..a6c7809 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -11,7 +11,7 @@ def test_homepage(app_client): assert d['tables_count'] == 5 def test_database_page(app_client): - response = app_client.get('/test_tables.json', gather_request=False) + response = app_client.get('/test_tables.json') data = response.json assert 'test_tables' == data['database'] assert [{ @@ -19,46 +19,46 @@ def test_database_page(app_client): 'columns': ['value'], 'primary_keys': [], 'count': 2, - 'label_column': None, 'hidden': False, 'fts_table': None, - 'foreign_keys': {'incoming': [], 'outgoing': []} + 'foreign_keys': {'incoming': [], 'outgoing': []}, + 'private': False, }, { 'name': '/group1/array2', 'columns': ['value'], 'primary_keys': [], 'count': 10000, - 'label_column': None, 'hidden': False, 'fts_table': None, - 'foreign_keys': {'incoming': [], 'outgoing': []} + 'foreign_keys': {'incoming': [], 'outgoing': []}, + 'private': False, }, { 'name': '/group1/table1', 'columns': ['identity', 'idnumber', 'speed'], 'primary_keys': [], 'count': 10000, - 'label_column': None, 'hidden': False, 'fts_table': None, - 'foreign_keys': {'incoming': [], 'outgoing': []} + 'foreign_keys': {'incoming': [], 'outgoing': []}, + 'private': False, }, { 'name': '/group2/multi', 'columns': ['value'], 'primary_keys': [], 'count': 10, - 'label_column': None, 'hidden': False, 'fts_table': None, - 'foreign_keys': {'incoming': [], 'outgoing': []} + 'foreign_keys': {'incoming': [], 'outgoing': []}, + 'private': False, }, { 'name': '/group2/table2', 'columns': ['identity', 'idnumber', 'speed'], 'primary_keys': [], 'count': 10000, - 'label_column': None, 'hidden': False, 'fts_table': None, - 'foreign_keys': {'incoming': [], 'outgoing': []} + 'foreign_keys': {'incoming': [], 'outgoing': []}, + 'private': False, }] == data['tables'] def test_custom_sql(app_client):