diff --git a/datasette/app.py b/datasette/app.py index 793bc931eb..5b3494b47f 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -443,6 +443,8 @@ def inspect(self): "views": inspect_views(conn), "tables": inspect_tables(conn, (self.metadata("databases") or {}).get(name, {})) } + for result in pm.hook.inspect(database=name, conn=conn, datasette=self): + self._inspect[name].update(result) except sqlite3.OperationalError as e: if (e.args[0] == 'no such module: VirtualSpatialIndex'): raise click.UsageError( @@ -716,6 +718,7 @@ async def handle_request(self, request, write_callback, stream_callback): RowView.as_view(self), r"///", ) + pm.hook.prepare_sanic(app=app, datasette=self) self.register_custom_units() # On 404 with a trailing slash redirect to path without that slash: diff --git a/datasette/hookspecs.py b/datasette/hookspecs.py index 6db9534457..886e3be1d8 100644 --- a/datasette/hookspecs.py +++ b/datasette/hookspecs.py @@ -30,6 +30,16 @@ def extra_body_script(template, database, table, datasette): "Extra JavaScript code to be included in