Datasette plugin for modifying table schemas
Project description
datasette-edit-schema
Datasette plugin for modifying table schemas
Features
- Add new columns to a table
- Rename columns in a table
- Modify the type of columns in a table
- Re-order the columns in a table
- Rename a table
- Delete a table
Installation
Install this plugin in the same environment as Datasette.
$ pip install datasette-edit-schema
Usage
Navigate to /-/edit-schema/dbname/tablename
on your Datasette instance to edit a specific table.
Use /-/edit-schema/dbname
to create a new table in a specific database.
By default only the root actor can access the page - so you'll need to run Datasette with the --root
option and click on the link shown in the terminal to sign in and access the page.
Permissions
The edit-schema
permission governs access. You can use permission plugins such as datasette-permissions-sql to grant additional access to the write interface.
These permission checks will call the permission_allowed()
plugin hook with three arguments:
action
will be the string"edit-schema"
actor
will be the currently authenticated actor - usually a dictionaryresource
will be the string name of the database
Screenshot
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-edit-schema
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and tests:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for datasette-edit-schema-0.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2fdc76c80f401a41bc659fa0a15d43a63eed654426f2b069d698b113600dac8 |
|
MD5 | 72dd42ae23bfff03582722fca7adacaf |
|
BLAKE2b-256 | 47d8abfc8b56c3fd842756e241804527da13ab72e25b7a181a572799acfb4c0e |
Hashes for datasette_edit_schema-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4bd94aebd93d8761d7432f3dd5e208ff3551d78c904f491f249447a777cb03a |
|
MD5 | d455fe1983f2cf3c27a606bc2344c51d |
|
BLAKE2b-256 | 41ae19f1c7b030989dbd61c923ef5870b42c57473d029ee33c77f28aeac5367d |