Skip to content

Getting Started

JSONQL lets you describe queries in JSON, execute them through SDKs, and keep your data contract consistent across systems.

Choose the SDK for your runtime:

SDKInstallFrameworks
Gogo get github.com/jsonql-standard/jsonql-goGin, Echo, net/http
TypeScriptnpm install @jsonql-standard/jsonql-tsExpress, Fastify, NestJS
Pythonpip install jsonql-pyFlask, FastAPI, Django
JavaMaven dependencySpring Boot, Jakarta EE

JSONQL queries are JSON documents. A minimal example:

{
"version": "1.0",
"fields": ["id", "name", "email"],
"where": {
"status": { "eq": "active" }
},
"sort": "-created_at",
"limit": 20
}

Post the query to any JSONQL-powered endpoint:

Terminal window
curl -X POST http://localhost:8080/users \
-H "Content-Type: application/json" \
-d '{"fields": ["id", "name"], "where": {"status": {"eq": "active"}}, "limit": 10}'

Response:

{
"data": [
{ "id": 1, "name": "Alice" },
{ "id": 2, "name": "Bob" }
]
}

Fetch nested data with include:

{
"fields": ["id", "name"],
"include": {
"posts": {
"fields": ["id", "title"],
"sort": "-created_at",
"limit": 3
}
}
}

Each SDK provides a fluent builder for constructing queries programmatically. For example, in Python:

from jsonql import QueryBuilder
from jsonql.conditions import eq, gt, field, and_
query = (
QueryBuilder()
.from_table("users")
.select("id", "name")
.where(and_(field("status", eq("active")), field("age", gt(18))))
.order_by("-created_at")
.limit(10)
.build()
)

Or in Go:

q := builder.New().
From("users").
Select("id", "name").
Where(map[string]any{"status": map[string]any{"eq": "active"}}).
AndWhere(map[string]any{"age": map[string]any{"gte": 18}}).
OrderBy("-created_at").
Limit(10).
Build()

Verify your adapter works correctly by running the compliance suite:

Terminal window
cd jsonql-tests
./run_tests.sh --target your-adapter

All 63 compliance configurations (Go + TypeScript + Java + Python) pass 135/135 tests across 5 databases. See Compliance Testing for details.