datasette-create-view by datasette

125 downloads this week        Star

README source code

datasette-create-view

PyPI Changelog Tests License

Create a SQL view from a query

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-create-view

This plugin requires Datasette 1.0a12 or later.

Usage

Users with the create-table permission will get a new menu item on the query results page offering to save the query as a view.

This option will only show for SQL queries that do not use :named parameters.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-create-view
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest