6 def for_each_connector(func):
8 def wrapper_for_each_connector(*args, **kwargs):
9 for connector in db_connectors.values():
11 return func(connector, *args, **kwargs)
15 raise Exception("No database connector found!!")
16 return wrapper_for_each_connector
22 for entry_point in pkg_resources.iter_entry_points('datasette.connectors'):
23 db_connectors[entry_point.name] = entry_point.load()
26 def add_connector(name, connector):
27 db_connectors[name] = connector
31 def table_names(connector, path):
32 return connector.table_names(path)
36 def hidden_table_names(connector, path):
37 return connector.hidden_table_names(path)
41 def view_names(connector, path):
42 return connector.view_names(path)
46 def table_columns(connector, path, table):
47 return connector.table_columns(path, table)
51 def primary_keys(connector, path, table):
52 return connector.primary_keys(path, table)
56 def fts_table(connector, path, table):
57 return connector.fts_table(path, table)
61 def get_all_foreign_keys(connector, path):
62 return connector.get_all_foreign_keys(path)
66 def table_counts(connector, path, *args, **kwargs):
67 return connector.table_counts(path, *args, **kwargs)
72 def table_names(path):
76 def hidden_table_names(path):
84 def table_columns(path, table):
88 def primary_keys(path, table):
92 def fts_table(path, table):
96 def get_all_foreign_keys(path):
100 def table_counts(path, *args, **kwargs):