diff --git a/datasette/app.py b/datasette/app.py index 545a65c8..139e4c34 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -625,9 +625,12 @@ class Datasette: return action return None - async def refresh_schemas(self): + async def refresh_schemas(self, *, force=False): # Throttle schema refreshes to at most once per second - if time.monotonic() - getattr(self, "_last_schema_refresh", 0) < 1.0: + if ( + not force + and time.monotonic() - getattr(self, "_last_schema_refresh", 0) < 1.0 + ): return self._last_schema_refresh = time.monotonic() if self._refresh_schemas_lock.locked(): diff --git a/datasette/templates/execute_write.html b/datasette/templates/execute_write.html index 949850ed..0d0a9931 100644 --- a/datasette/templates/execute_write.html +++ b/datasette/templates/execute_write.html @@ -93,20 +93,25 @@ form.sql.core input[data-execute-write-submit]:disabled { {% endif %}
- {% if write_template_tables %} + {% if write_create_table_template_sql or write_template_tables %}
Start with a template

- - + {% for table_name, table in write_template_tables|dictsort %} + + {% endfor %} + + {% for operation in write_template_operations %} + {% endfor %} - - {% for operation in write_template_operations %} - - {% endfor %} + {% endif %}

@@ -252,11 +257,12 @@ window.addEventListener("DOMContentLoaded", () => { }); -{% if write_template_tables %} +{% if write_create_table_template_sql or write_template_tables %}