You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The vector tile endpoint needs to accept the same filtering/faceting URL parameters as the main TableView. This is complex because the vector tile server needs to access the entire dataset, ignoring paging, and the SQL needs to have a geographic bounding-box clause added before execution.
This isn't possible with the current renderer hook from simonw/datasette#441, because these renderer hooks are called after the SQL is executed.
As far as I see it, there are two options here:
Option 1: Extend renderer hooks
We could extend the renderer hook system so it also gets some kind of callback before the SQL is executed. This callback could extend the SQL. Vector tiles could then be implemented as a renderer hook rather than a separate view as they are currently.
It could provide a way for other renderer plugins to bypass the paging limits, which could be useful for stuff like .xslx exports, where downloading an Excel file with a subset of the data isn't going to be useful. Some kind of caching would probably be needed here.
Cons:
Datasette-geo would have to shoehorn the tile server URLs into the existing datasette URL paths, rather than using a more conventional tileserver-style URL scheme. This is doable though, if slightly ugly.
Option 2: Access Datasette code outside the hook system
This is the option I was thinking of originally. If the TableView.data function was refactored so the SQL generation could be hooked into by a subclass, datasette-geo could do this independent of the hook system.
Pros:
Less complex hooks?
Cons:
More brittle coupling between plugins and datasette.
The prepare_sanic hook is still needed.
By writing this I think I've convinced myself that option 1 is better now.
The text was updated successfully, but these errors were encountered:
The vector tile endpoint needs to accept the same filtering/faceting URL parameters as the main TableView. This is complex because the vector tile server needs to access the entire dataset, ignoring paging, and the SQL needs to have a geographic bounding-box clause added before execution.
This isn't possible with the current renderer hook from simonw/datasette#441, because these renderer hooks are called after the SQL is executed.
As far as I see it, there are two options here:
Option 1: Extend renderer hooks
We could extend the renderer hook system so it also gets some kind of callback before the SQL is executed. This callback could extend the SQL. Vector tiles could then be implemented as a renderer hook rather than a separate view as they are currently.
Pros:
prepare_sanic
hook from Add inspect and prepare_sanic hooks simonw/datasette#437 any more, which completely removes the coupling with Sanic..xslx
exports, where downloading an Excel file with a subset of the data isn't going to be useful. Some kind of caching would probably be needed here.Cons:
Option 2: Access Datasette code outside the hook system
This is the option I was thinking of originally. If the TableView.data function was refactored so the SQL generation could be hooked into by a subclass, datasette-geo could do this independent of the hook system.
Pros:
Cons:
prepare_sanic
hook is still needed.By writing this I think I've convinced myself that option 1 is better now.
The text was updated successfully, but these errors were encountered: