Skip to main content

Adds a rewrite_sql hook to Datasette

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette-rewrite-sql-0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_rewrite_sql-0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file datasette-rewrite-sql-0.1.tar.gz.

File metadata

  • Download URL: datasette-rewrite-sql-0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for datasette-rewrite-sql-0.1.tar.gz
Algorithm Hash digest
SHA256 2249308ea9f218d9c1f8fbe2e24e13ef17dbf3328180c2395d3c8d015e82f389
MD5 321517f311ac0dec779d9949be597470
BLAKE2b-256 f6e96b968d504abedd9a7a512f2f9e3cd888b434f013a38d08f913fcde8a3bb6

See more details on using hashes here.

File details

Details for the file datasette_rewrite_sql-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_rewrite_sql-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad2ad45b6ae6457c8421746be25e9cb11dbf11d01fb892f4ee7e65e0b417f15
MD5 4eb658a0c9f4ce5d210cfbf362bb1c9e
BLAKE2b-256 a719c5b2817a9c9e4379b629b9f80f2307eb480962ca2b862785c30d676008e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page