Skip to main content

sauceql

A JSON-schema-defined, agent-safe read-only SQL query DSL and compiler.

Define your tables (columns, relations, and safety restrictions like required filters, max limit, allowed operators) in a JSON file validated against db_schema.json. Agents submit queries as JSON matching query_schema.json - a structured AST (no raw SQL strings), which is validated against your table definitions and compiled to parameterized PostgreSQL SQL.

Install

pip install sauceql

Usage

from sauceql import SauceEngine

engine = SauceEngine(tables_path="my_tables.json")

query = {
    "from": "orders",
    "select": ["orders.id", "orders.status"],
    "where": {"column": "status", "op": "eq", "value": "paid"},
    "order_by": [{"column": "created_at", "dir": "desc"}],
    "limit": 20,
}

sql, params = engine.toPGSQL(query, context={"tenant_id": "acme-corp"})

See examples/demo.py and examples/example_tables.json for a full worked example with joins, aggregates, and tenant-scoping restrictions.

Status

Early / pre-1.0. See the project's design notes for known gaps (no window functions, CTEs, subqueries, DISTINCT, or expression columns yet).

Metadata

Release files for sauceql 0.1.0

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

Source distribution (sdist)

Source distribution for sauceql 0.1.0
File Size Uploaded Provenance
sauceql-0.1.0.tar.gz 10.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sauceql 0.1.0
File Interpreter ABI Platform
sauceql-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / sauceql-0.1.0.tar.gz

Download URL sauceql-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
05ec0f4bb0b4aeeb23e4f8bf2cc9a23e79e73d1eaac22c2ca4466c6e709fc527
BLAKE2b-256 checksum
How to use checksums
7fac58cf897392faf3ffe951b62da07fc2b92a5ac2ec3b76f0cfda8f523b7b32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / sauceql-0.1.0-py3-none-any.whl

Download URL sauceql-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a457ac06bf6929820863784fffbb8a9a424a21a47dda101e6148fc389bd2135
BLAKE2b-256 checksum
How to use checksums
aeb4ff909a59476b8eb9698fdd99f93cd4620bccf9751472343769709d365581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Security for sauceql 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sauceql-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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