datasette-explain by simonw
187 downloads this week Star
README source code
Explain SQL queries executed using Datasette
Install this plugin in the same environment as Datasette.
datasette install datasette-explain
The plugin adds JavaScript to the query editor page which will constantly update the page with information gained from running EXPLAIN QUERY PLAN queries against the entered SQL.
This may result in an error message, or it may show the query plan along with any tables used by the query.
You can see this plugin in action on datasette.simonwillison.net.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-explain
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest