From zero to a governed endpoint
Python 3.11 or newer. Java 11+ only if you connect to H2. Everything else is a pip extra, imported only when a connection of that type is used.
Install
With pip
all installs every database driver plus flow, encryption and jwt. Add the rest by what you use:
- Databases
mysql,postgres,clickhouse,duckdb,mongo,h2 - Agents and sign-in
mcp,jwt - Running several instances
redis,server - Tracing
otel - Secrets
encryption,aws - Query flow diagrams
flow
The Docker image includes otel and aws. Vault and secrets from files need no extra.
With Docker
The image includes every driver except H2, plus Redis, MCP, tracing, AWS and gunicorn, and runs non-root on a read-only root filesystem. Tags: X.Y.Z and latest; X.Y.Z-h2 adds Java for H2 and generic JDBC. Pin a version. For several instances behind Caddy with Docker Compose, see guide 32 and guide 42.
With Helm, on Kubernetes
One pod on SQLite with its store on a volume, or several on PostgreSQL and Redis; the chart refuses setups that can't work. Chart X.Y.Z runs server X.Y.Z. See guide 54, and guide 55 to drive it from a configuration file.
Verify a release first
From 0.31, the image and the chart are signed keyless with cosign, with SLSA provenance and an SBOM. Check them with cosign verify, or let an admission controller refuse anything unsigned: guide 59.
Quickstart
A small generated database (films, customers, rentals) and four worked example APIs, so the requests below work immediately. queryapigate examples unload removes them again.
With Docker: docker compose up. The image is ghcr.io/anantharajuc/queryapigate.
Your first endpoint, against your own database
Give a partner one query only
QUERYAPIGATE_API_KEY is the shared, full-access admin key. Anyone or anything that only needs to run queries gets a scoped key instead, limited to specific connections and, separately, to read-only access.
Then confirm it on the access map, or with the verify who can reach what guide.
Production
Choosing between one instance, several, or Kubernetes? See the reference architectures, with a production checklist and measured performance.
queryapigate serve is Flask's development server. In production use gunicorn with one worker and several threads, behind a TLS-terminating reverse proxy. For more capacity, run more instances on a shared PostgreSQL store and Redis.
Behind a proxy, set QUERYAPIGATE_TRUST_PROXY to the number of proxies so rate limits apply per real client. Reverse proxy, secrets, backups and monitoring are covered in Deployment; On Kubernetes, install the Helm chart (helm install queryapigate oci://ghcr.io/anantharajuc/charts/queryapigate, guide 54); plain manifests live under deploy/kubernetes.
Configuration
Everything is an environment variable. The ones you will meet first:
The full table, including pool size, CORS origins, host and port, is in the README.
Use these docs with AI
Your coding agent can read this documentation for itself. The QueryAPIGate documentation MCP server searches the docs, the 65 how-to guides and the blog, and returns any page, or one section of it, as markdown. It's read-only and needs no sign-in.
It answers questions about QueryAPIGate. To give agents your own data, QueryAPIGate itself is the MCP server: MCP server for AI agents →
Three tools: search_docs, get_page and list_pages. Rather point a tool at files? Every page is plain markdown too: llms.txt lists them all, and each guide's Copy page menu opens it in Claude or ChatGPT.