Skip to main content

datasette-rewrite-sql

PyPI Changelog Tests License

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

Metadata

Release files for datasette-rewrite-sql 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datasette-rewrite-sql 0.1
File Size Uploaded
datasette-rewrite-sql-0.1.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datasette-rewrite-sql 0.1
File Interpreter ABI Platform
datasette_rewrite_sql-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / datasette-rewrite-sql-0.1.tar.gz

Download URL datasette-rewrite-sql-0.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2249308ea9f218d9c1f8fbe2e24e13ef17dbf3328180c2395d3c8d015e82f389
BLAKE2b-256 checksum
How to use checksums
f6e96b968d504abedd9a7a512f2f9e3cd888b434f013a38d08f913fcde8a3bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / datasette_rewrite_sql-0.1-py3-none-any.whl

Download URL datasette_rewrite_sql-0.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ad2ad45b6ae6457c8421746be25e9cb11dbf11d01fb892f4ee7e65e0b417f15
BLAKE2b-256 checksum
How to use checksums
a719c5b2817a9c9e4379b629b9f80f2307eb480962ca2b862785c30d676008e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page