datasette-query-files
Write Datasette canned queries as plain SQL files.
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-query-files
Or using pip or pipenv:
pip install datasette-query-files
pipenv install datasette-query-files
Usage
This plugin will look for canned queries in the filesystem, in addition any defined in metadata.
Let's say you're working in a directory called project-directory, with a database file called my-project.db. Start by creating a queries directory with a my-project directory inside it. Any SQL file inside that my-project folder will become a canned query that can be run on the my-project database. If you have a query-name.sql file and a query-name.json (or query-name.yml) file in the same directory, the JSON file will be used as query metadata.
project-directory/
my-project.db
queries/
my-project/
query-name.sql # a query
query-name.yml # query metadata
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-query-files
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-query-files 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasette-query-files-0.1.1.tar.gz | 6.8 kB | Without provenance | Details for datasette-query-files-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_query_files-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for datasette_query_files-0.1.1-py3-none-any.whl |
Total release size: 14.2 kB
Release files / datasette-query-files-0.1.1.tar.gz
| Download URL | datasette-query-files-0.1.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfcd8880fb6b1126545a1fb21448e228963596ea877754527e7cb4edf95baad8
|
|
BLAKE2b-256 checksum How to use checksums |
72607b7e3466023744720fa446713dbb93a7987c778d77b5828796dd14484d63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / datasette_query_files-0.1.1-py3-none-any.whl
| Download URL | datasette_query_files-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6521e38682668f257bae09f78c02837f0a6158124c5cc10c0a125deb3d28676b
|
|
BLAKE2b-256 checksum How to use checksums |
af0731fb0cc38c202388c9d0076929e1ac7b9b3c2788e247248abdcbb4e74c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for datasette-query-files 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.