https://github.com/datasette/datasette-write-ui
A Datasette plugin that adds UI elements to edit, insert, or delete rows in SQLite tables
https://github.com/datasette/datasette-write-ui
Last synced: 2 months ago
JSON representation
A Datasette plugin that adds UI elements to edit, insert, or delete rows in SQLite tables
- Host: GitHub
- URL: https://github.com/datasette/datasette-write-ui
- Owner: datasette
- License: apache-2.0
- Created: 2023-07-12T15:51:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-14T18:36:18.000Z (6 months ago)
- Last Synced: 2025-04-03T08:17:03.564Z (3 months ago)
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-write-ui
[](https://pypi.org/project/datasette-write-ui/)
[](https://github.com/datasette/datasette-write-ui/releases)
[](https://github.com/datasette/datasette-write-ui/actions?query=workflow%3ATest)
[](https://github.com/datasette/datasette-write-ui/blob/main/LICENSE)A Datasette plugin that adds UI elements to edit, insert, or delete rows in SQLite tables.
## Installation
This plugin requires the alpha version of Datasette 1.0. You can install it with:
```bash
pip install datasette==1.0a3
```After that, you can install this plugin in the same environment as Datasette.
```bash
datasette install datasette-write-ui
```## Usage
Once installed, the new UI elements will appear on the table page. You'll need special permission in order to see them. The easiest way is to [use the root user](https://docs.datasette.io/en/latest/authentication.html#using-the-root-actor), or otherwise use a [custom actor](https://docs.datasette.io/en/latest/authentication.html#actors).
If you actor has the `insert-row` permissions, you'll see the "Insert new row" button at the bottom of the page.
If your actor has the `update-row` permissions, you'll see a new "Edit row" option in a new menu on each row.
If your actor has the `delete-row` permissions, you'll see a new "Delete row" option in a new menu on each row.
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd datasette-write-ui
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```
pip install -e '.[test]'
```
To install the JavaScript build dependencies, run this:
```bash
npm install
```
You can use the [Just](https://github.com/casey/just) command runner to build the TypeScript to minified JavaScript like this:
```bash
just js
```
To run the tests:
```bash
pytest
```