Query-Runner
CLI tool to help with running queries.
Quickstart
Pass through a sqlalchemy DB URL and a query to run a query and export to file. (You may need the relevant DB drivers installed also.)
python -m queryrunner show "sqlite:///" "SELECT 'Val' as col1"
python -m queryrunner to-csv "sqlite:///" "SELECT 'Val' as col1" "output.csv"
You can also use an environment variable to contain your connection string, and a file to contain your SQL query.
DB_URI="sqlite:///"
# example-query.sql
SELECT 'Val' as col1
python -m queryrunner to-csv "DB_URI" "example-query.sql" "output.csv"
Query Parameters
You can pass query parameters as extra CLI options, but this only works for strings.
So this will work:
python -m queryrunner show "sqlite:///" "SELECT '5' as col1 WHERE col1=:val" --val 5
python -m queryrunner show "sqlite:///" "SELECT 5 as col1 WHERE CAST(col1 as text)=:val" --val 5
But this will not:
python -m queryrunner show "sqlite:///" "SELECT 5 as col1 WHERE col1=:val" --val 5
Metadata
Release files for queryrunner 0.1.0
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 |
|---|---|---|---|---|
| queryrunner-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for queryrunner-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| queryrunner-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for queryrunner-0.1.0-py3-none-any.whl |
Total release size: 11.7 kB
Release files / queryrunner-0.1.0.tar.gz
| Download URL | queryrunner-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbd7343f087a2781ed82015694d8d7c149ccfcfee10074a673a1190c2d18b14b
|
|
BLAKE2b-256 checksum How to use checksums |
075f569f9e01f0b1dcb710ef1ced4a3b194b9c7d8febbd7b09d5183ccb847623
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6
|
Release files / queryrunner-0.1.0-py3-none-any.whl
| Download URL | queryrunner-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f602c494a11ed4331d47bbdb625b4ef715f7e73c23af1350e51e6a9becb61d7f
|
|
BLAKE2b-256 checksum How to use checksums |
74f7ca579dcca85dabb8a14d3595e9e4660ea07fedf1181bd50efffdf702dc5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6
|
Security for queryrunner 0.1.0
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.