Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Fast Query Store ⚡

Running locally

You need python, git, docker and docker-compose to run this project.

Setup

git clone <repository-url>
cd fast-query-store
cp env.example .env
source .env

Install dependencies

python -m venv env
source env/bin/activate

pip install -r requirements.txt

Export config variables

fast-query-store will look for a .json file containing the queries information. The environment variable queries_file_path tells where this file is located.

export queries_file_path=/path/to/queries.json

Example of queries.json file

{
    "slug-1": {
        "query": "SELECT * FROM table_1",
        "db_url": "postgresql:///..."
    },
    "slug-2": {
        "query": "SELECT COUNT(1) FROM table_1",
        "db_url": "sqlite:///..."
    },
    "slug-3": {
        "query": "SELECT * FROM table_3",
        "db_url": "${DATABASE_URL}"
    }
}

Note: It is also possible to set the db_url with a enviroment variable.

Running it

export queries_file_path=queries.json
uvicorn app.main:app --workers 2 --host 0.0.0.0 --port 8000

Getting available query slugs

GET http://localhost:8000/
HTTP/1.1 200 OK
content-length: 73
content-type: application/json
date: Fri, 14 May 2021 12:47:37 GMT
server: uvicorn

{
    "slugs": [
        "slug-1",
        "slug-2",
        "slug-3"
    ]
}

Executing a query

GET http://localhost:8000/query/slug-1
HTTP/1.1 200 OK
content-length: 151
content-type: application/json
date: Fri, 14 May 2021 12:53:09 GMT
server: uvicorn

{
    "result_set": [
        {
            "name": "Cheese",
            "price": 9.99,
            "product_no": 1
        },
        {
            "name": "Bread",
            "price": 1.99,
            "product_no": 2
        },
        {
            "name": "Milk",
            "price": 2.99,
            "product_no": 3
        }
    ]
}

Running the tests

pip install -r requirements-development.txt
source .env
docker-compose f docker-compose.yml up -d
pytest -v

Metadata

Release files for fast-query-store 0.0.7.dev0

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

Source distribution (sdist)

Source distribution for fast-query-store 0.0.7.dev0
File Size Uploaded Provenance
fast-query-store-0.0.7.dev0.tar.gz 4.3 kB Without provenance Details

Release files / fast-query-store-0.0.7.dev0.tar.gz

Download URL fast-query-store-0.0.7.dev0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4853794c48a82f3fbc85e69fbaf1d3871942ce82374a5db0453b3cd80a121069
BLAKE2b-256 checksum
How to use checksums
da6476d0b4a00bc82529cea8a158dacf64d2028b2db4949c44be029cf7372d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

Security for fast-query-store 0.0.7.dev0

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.

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