{"id":15722110,"url":"https://github.com/cldellow/datasette-rewrite-sql","last_synced_at":"2025-05-13T03:17:21.625Z","repository":{"id":65428268,"uuid":"592161819","full_name":"cldellow/datasette-rewrite-sql","owner":"cldellow","description":"A Datasette hook to inspect/rewrite the SQL users run.","archived":false,"fork":false,"pushed_at":"2023-01-23T06:11:06.000Z","size":9,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T03:17:13.367Z","etag":null,"topics":["datasette","datasette-io","datasette-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cldellow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-23T04:25:08.000Z","updated_at":"2023-07-27T13:02:12.000Z","dependencies_parsed_at":"2023-02-12T20:45:35.723Z","dependency_job_id":null,"html_url":"https://github.com/cldellow/datasette-rewrite-sql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Fdatasette-rewrite-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Fdatasette-rewrite-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Fdatasette-rewrite-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldellow%2Fdatasette-rewrite-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldellow","download_url":"https://codeload.github.com/cldellow/datasette-rewrite-sql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253863173,"owners_count":21975596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datasette","datasette-io","datasette-plugin"],"created_at":"2024-10-03T22:04:01.000Z","updated_at":"2025-05-13T03:17:21.601Z","avatar_url":"https://github.com/cldellow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datasette-rewrite-sql\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-rewrite-sql.svg)](https://pypi.org/project/datasette-rewrite-sql/)\n[![Changelog](https://img.shields.io/github/v/release/cldellow/datasette-rewrite-sql?include_prereleases\u0026label=changelog)](https://github.com/cldellow/datasette-rewrite-sql/releases)\n[![Tests](https://github.com/cldellow/datasette-rewrite-sql/workflows/Test/badge.svg)](https://github.com/cldellow/datasette-rewrite-sql/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/cldellow/datasette-rewrite-sql/blob/main/LICENSE)\n\nAdds a rewrite_sql hook to Datasette.\n\n\u003e **Warning**\n\u003e\n\u003e This hook is added by monkey-patching Datasette. YOLO, but also, govern yourself accordingly.\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n\n    datasette install datasette-rewrite-sql\n\n## Usage\n\nWrite a hook like:\n\n```python\nfrom datasette import hookimpl\n\n@hookimpl\ndef rewrite_sql(sql):\n  if sql == 'select 123':\n    return 'select 234'\n\n  return sql\n```\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n\n    cd datasette-rewrite-sql\n    python3 -m venv venv\n    source venv/bin/activate\n\nNow install the dependencies and test dependencies:\n\n    pip install -e '.[test]'\n\nTo run the tests:\n\n    pytest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Fdatasette-rewrite-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldellow%2Fdatasette-rewrite-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldellow%2Fdatasette-rewrite-sql/lists"}