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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b736a92d5086acbc72d9d79889c1c590823da78b6fe58cd5ad8eaaba0a05d59 |
|
MD5 | 12c27567b644ba728d8eb04cfcf21b78 |
|
BLAKE2b-256 | d2af1dd8132921ab3c03feb2cf4140042398a367628fdd35d609269feae1d4ec |
Hashes for datasette_edit_schema-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0691d603320f43005648516fa962c755ce2ccac7ced074f783170d36437a0019 |
|
MD5 | b1313652e01027ea270df4fc82926be5 |
|
BLAKE2b-256 | 43b210195b68ed60cfd3ccd08405ea16957bd3898bc425888e14f6f2a52b1053 |