Adds a rewrite_sql hook to Datasette
Project description
datasette-rewrite-sql
Adds a rewrite_sql hook to Datasette
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-rewrite-sql
Usage
Write a hook like:
from datasette import hookimpl
@hookimpl
def rewrite_sql(sql):
if sql == 'select 123':
return 'select 234'
return sql
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-rewrite-sql
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
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
Close
Hashes for datasette-rewrite-sql-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2249308ea9f218d9c1f8fbe2e24e13ef17dbf3328180c2395d3c8d015e82f389 |
|
MD5 | 321517f311ac0dec779d9949be597470 |
|
BLAKE2b-256 | f6e96b968d504abedd9a7a512f2f9e3cd888b434f013a38d08f913fcde8a3bb6 |
Close
Hashes for datasette_rewrite_sql-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ad2ad45b6ae6457c8421746be25e9cb11dbf11d01fb892f4ee7e65e0b417f15 |
|
MD5 | 4eb658a0c9f4ce5d210cfbf362bb1c9e |
|
BLAKE2b-256 | a719c5b2817a9c9e4379b629b9f80f2307eb480962ca2b862785c30d676008e1 |