Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-20T05:40:35.000Z (about 1 year ago)
- Last Synced: 2024-09-21T11:54:49.934Z (4 months ago)
- Language: Python
- Homepage:
- Size: 99.6 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-write-ui
[![PyPI](https://img.shields.io/pypi/v/datasette-write-ui.svg)](https://pypi.org/project/datasette-write-ui/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-write-ui?include_prereleases&label=changelog)](https://github.com/datasette/datasette-write-ui/releases)
[![Tests](https://github.com/datasette/datasette-write-ui/workflows/Test/badge.svg)](https://github.com/datasette/datasette-write-ui/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](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
```