https://github.com/surister/queryzen
Parametrized, named and versioned SQL queries over HTTP
https://github.com/surister/queryzen
backend http queries sql
Last synced: 11 months ago
JSON representation
Parametrized, named and versioned SQL queries over HTTP
- Host: GitHub
- URL: https://github.com/surister/queryzen
- Owner: surister
- Created: 2025-01-24T12:38:57.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-14T10:07:41.000Z (11 months ago)
- Last Synced: 2025-03-14T11:23:32.508Z (11 months ago)
- Topics: backend, http, queries, sql
- Language: Python
- Homepage:
- Size: 256 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QueryZen - SQL over HTTP made easy.
[](https://github.com/surister/queryzen/actions/workflows/client_test.yml)
[](https://github.com/surister/queryzen/actions/workflows/release.yml)

[](https://sonar.pyramidops.com/dashboard?id=surister_queryzen_c0946901-04b6-4415-85f3-a9b95135b8e1)
[](https://sonar.pyramidops.com/dashboard?id=surister_queryzen_c0946901-04b6-4415-85f3-a9b95135b8e1)
[](https://sonar.pyramidops.com/dashboard?id=surister_queryzen_c0946901-04b6-4415-85f3-a9b95135b8e1)
[](https://sonar.pyramidops.com/dashboard?id=surister_queryzen_c0946901-04b6-4415-85f3-a9b95135b8e1)
[](https://sonar.pyramidops.com/dashboard?id=surister_queryzen_c0946901-04b6-4415-85f3-a9b95135b8e1)
QueryZen allows you to create and run `Zens`, a `Zen` is a named, parameterized and versioned SQL query
that is run over HTTP REST endpoints. Decouple your SQL from you application, version it,
and secure it from development to production.
QueryZen ships:
- HTTP REST backend to handle the lifetime of Zens.
- Task execution backend to handle the execution of the queries.
- Database driver abstraction for Python SQL drivers.
- Pythonic package to programmatically use QueryZen.
We also have a docker-compose to streamline development and deployment.
## Quick example using HTTP.
### Create a Zen.
```sh
curl -X PUT https://your-queryzen-server.com/v1/collection/development/zen/summits \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT * FROM sys.summits WHERE height = :height and COUNTRY = :country
"parameters": {
"height": {
"type": "integer",
"default" 2500
},
"country": {
"type": "string",
"default": "Canada"
}
}
}'
```
### Run a Zen.
```sh
curl -X POST https://your-queryzen-server.com/v1/collection/development/zen/summits \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"parameters": {
"height": 1000,
"country": "Austria"
}
}'
```
## Quick example using our python library.
```python
...
```
# Why QueryZen & Use cases.
With QueryZen you can:
- Quickly create HTTP Rest endpoints of your SQL data.
- Integrate your SQL data in your data pipelines with minimal configuration.
- Monitor individual query executions and analyze metrics.
- Version your SQL queries, build and test queries without affecting production.
- Create materialized views for SQL databases that do not support them.
todo Add an example of each.
# Architecture overview
todo Explain architecture