https://github.com/gizmodata/gizmosql
π GizmoSQL β High-Performance SQL Server
https://github.com/gizmodata/gizmosql
adbc apache-arrow apache-arrow-flight apache-arrow-flight-sql database databases duckdb gizmodata gizmosql ibis jdbc jwt-authentication pyarrow sql sqlalchemy sqlite sqlite3 tls
Last synced: 15 days ago
JSON representation
π GizmoSQL β High-Performance SQL Server
- Host: GitHub
- URL: https://github.com/gizmodata/gizmosql
- Owner: gizmodata
- License: other
- Created: 2024-09-17T21:41:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-31T15:02:00.000Z (about 1 month ago)
- Last Synced: 2026-03-31T15:09:32.321Z (about 1 month ago)
- Topics: adbc, apache-arrow, apache-arrow-flight, apache-arrow-flight-sql, database, databases, duckdb, gizmodata, gizmosql, ibis, jdbc, jwt-authentication, pyarrow, sql, sqlalchemy, sqlite, sqlite3, tls
- Language: C++
- Homepage: https://gizmodata.com/gizmosql
- Size: 2.55 MB
- Stars: 300
- Watchers: 5
- Forks: 33
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Notice: NOTICE
Awesome Lists containing this project
- awesome-sqlite - GizmoSQL - Arrow Flight SQL server with TLS/auth that can run on top of SQLite (or DuckDB), exposing JDBC/ADBC access via Docker or binary. (Tools)
- awesome-duckdb - GizmoSQL - Arrow Flight SQL Server - A C++ implementation of the [Arrow Flight SQL protocol](https://arrow.apache.org/docs/format/FlightSql.html) that runs in a client-server setup with DuckDB or SQLite as backends. (Client-Server Setups / Web Clients (WebAssembly))
README
# π GizmoSQL β High-Performance SQL Server for the Cloud
[](https://hub.docker.com/r/gizmodata/gizmosql)
[](https://github.com/gizmodata/gizmosql/pkgs/container/gizmosql)
[](https://arrow.apache.org/docs/format/FlightSql.html)
[](https://github.com/gizmodata/gizmosql)
[](https://github.com/gizmodata/gizmosql-jdbc-driver/releases/latest/download/gizmosql-jdbc-driver.jar)
[](https://pypi.org/project/adbc-driver-gizmosql/)
[](https://pypi.org/project/sqlalchemy-gizmosql-adbc-dialect/)
[](https://pypi.org/project/ibis-gizmosql/)
[](https://apps.apple.com/us/app/gizmosql/id6761951280)
---
## π What is GizmoSQL?
**GizmoSQL** is a lightweight, high-performance SQL server built on:
- π¦ [DuckDB](https://duckdb.org) or ποΈ [SQLite](https://sqlite.org) for query execution
- π [Apache Arrow Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html) for fast, modern connectivity
- π Middleware-based auth with optional TLS & JWT
Originally forked from [`sqlflite`](https://github.com/voltrondata/sqlflite) β and now enhanced into a more extensible, production-ready platform under the Apache 2.0 license.
---
## π¦ Editions
GizmoSQL is available in two editions:
| Feature | Core | Enterprise |
|---------|:----:|:----------:|
| DuckDB & SQLite backends | β
| β
|
| Arrow Flight SQL protocol | β
| β
|
| TLS & mTLS authentication | β
| β
|
| JWT token authentication | β
| β
|
| Query timeout | β
| β
|
| Session Instrumentation | β | β
|
| Kill Session | β | β
|
| Per-Catalog Permissions | β | β
|
| SSO/OIDC Authentication (JWKS) | β | β
|
| Authorized Email Filtering | β | β
|
**GizmoSQL Core** is free and open source under the Apache 2.0 license.
**GizmoSQL Enterprise** requires a commercial license. Contact [sales@gizmodata.com](mailto:sales@gizmodata.com) for licensing information.
For more details, see the [Editions documentation](https://docs.gizmosql.com/#/editions).
---
## π§ Why GizmoSQL?
- π°οΈ **Deploy Anywhere** β Run as a container, native binary, or in Kubernetes
- π¦ **Columnar Fast** β Leverages Arrow columnar format for high-speed transfers
- βοΈ **Dual Backends** β Switch between DuckDB and SQLite at runtime
- π **Built-in TLS + Auth** β Password-based login + signed JWT tokens
- π **Super Cheap Analytics** β TPC-H SF 1000 in 161s for ~$0.17 on Azure
- π§ͺ **CLI, Python, JDBC, SQLAlchemy, Ibis, WebSocket** β Pick your interface
---
## π¦ Component Versions
| Component | Version |
|----------------------------------------------------------------------------------|---------|
| [DuckDB](https://duckdb.org) | v1.5.2 |
| [SQLite](https://sqlite.org) | 3.52.0 |
| [Apache Arrow (Flight SQL)](https://arrow.apache.org/docs/format/FlightSql.html) | 23.0.1 |
| [jwt-cpp](https://thalhammer.github.io/jwt-cpp/) | v0.7.2 |
| [OpenTelemetry C++](https://opentelemetry.io/docs/languages/cpp/) | v1.25.0 |
| [nlohmann/json](https://json.nlohmann.me) | v3.12.0 |
## π Documentation
For detailed instructions and configuration information, see our full documentation:
[GizmoSQL Documentation](https://docs.gizmosql.com)
---
## π Quick Start
> **Default credentials:** The server's default username is `gizmosql_user` (override with `--username` or `GIZMOSQL_USERNAME`). A password is always required via `--password` or `GIZMOSQL_PASSWORD`.
### Option 1: Run from Docker
```bash
# Username defaults to "gizmosql_user" when GIZMOSQL_USERNAME is not set
docker run --name gizmosql \
--detach \
--rm \
--tty \
--init \
--publish 31337:31337 \
--env TLS_ENABLED="1" \
--env GIZMOSQL_PASSWORD="gizmosql_password" \
--env PRINT_QUERIES="1" \
--pull always \
gizmodata/gizmosql:latest
```
### Option 2: Mount Your Own DuckDB database file
```bash
duckdb ./tpch_sf1.duckdb << EOF
INSTALL tpch; LOAD tpch; CALL dbgen(sf=1);
EOF
docker run --name gizmosql \
--detach \
--rm \
--tty \
--init \
--publish 31337:31337 \
--env TLS_ENABLED="1" \
--env GIZMOSQL_PASSWORD="gizmosql_password" \
--pull always \
--mount type=bind,source=$(pwd),target=/opt/gizmosql/data \
--env DATABASE_FILENAME="data/tpch_sf1.duckdb" \
gizmodata/gizmosql:latest
```
### Option 3: Install via Homebrew (macOS & Linux)
```bash
brew tap gizmodata/tap
brew install gizmosql
```
Supported platforms:
- macOS (Apple Silicon / ARM64)
- Linux (x86-64 / AMD64)
- Linux (ARM64)
Then run the server (username defaults to `gizmosql_user`):
```bash
GIZMOSQL_PASSWORD="gizmosql_password" gizmosql_server --database-filename your.duckdb --print-queries
```
### Option 4: Windows Installer (MSI)
Download the latest MSI installer from the [GitHub Releases](https://github.com/gizmodata/gizmosql/releases) page. The installer adds `gizmosql_server.exe` and `gizmosql_client.exe` to `C:\Program Files\GizmoSQL` and updates the system PATH.
Then run the server from PowerShell or Command Prompt:
```powershell
$env:GIZMOSQL_PASSWORD="gizmosql_password"
gizmosql_server --database-filename your.duckdb --print-queries
```
### Option 5: iOS App (iPhone & iPad) π±
GizmoSQL is available as a native iOS app on the Apple App Store β run a full GizmoSQL server right on your iPhone or iPad.
[
](https://apps.apple.com/us/app/gizmosql/id6761951280)
The iOS edition bundles the DuckDB engine and the Arrow Flight SQL server, so any GizmoSQL client (JDBC, ADBC, CLI, UI, etc.) can connect to it over your local network.
> [!IMPORTANT]
> **The iOS app is intended for development, learning, demos, and local prototyping β not production workloads.** iOS enforces aggressive background execution limits, memory caps, and network/thermal throttling that make a phone or tablet unsuitable for hosting production SQL traffic. For production, run GizmoSQL via Docker, Kubernetes, Homebrew, or the native Linux/macOS/Windows binaries.
---
## π§° Clients and Tools
### π JDBC
Use with DBeaver or other JDBC clients:
```text
jdbc:gizmosql://localhost:31337?useEncryption=true&user=gizmosql_user&password=gizmosql_password&disableCertificateVerification=true
```
More info: [Setup guide](https://github.com/gizmodata/setup-gizmosql-jdbc-driver-in-dbeaver)
---
### π Python (ADBC)
**Prerequisite:** Python 3.10+ and the [GizmoSQL ADBC driver](https://pypi.org/project/adbc-driver-gizmosql/):
```bash
pip install adbc-driver-gizmosql
```
The driver also supports OAuth/SSO authentication for GizmoSQL Enterprise users.
```python
from adbc_driver_gizmosql import dbapi as gizmosql
with gizmosql.connect(
"grpc+tls://localhost:31337",
username="gizmosql_user",
password="gizmosql_password",
tls_skip_verify=True, # Not needed if you use a trusted CA-signed TLS cert
) as conn:
with conn.cursor() as cur:
cur.execute(
"SELECT n_nationkey, n_name FROM nation WHERE n_nationkey = ?",
parameters=[24],
)
x = cur.fetch_arrow_table()
```
---
### π Token authentication
See: https://github.com/gizmodata/generate-gizmosql-token for an example of how to generate a token and use it with GizmoSQL.
### π» CLI Client
GizmoSQL ships with an interactive SQL shell inspired by `psql` and the DuckDB CLI:
```bash
# Interactive session
GIZMOSQL_PASSWORD="gizmosql_password" gizmosql_client --host localhost --username gizmosql_user --tls --tls-skip-verify
```
Run a single query with `--command`:
```bash
GIZMOSQL_PASSWORD="gizmosql_password" gizmosql_client \
--host localhost --username gizmosql_user --tls --tls-skip-verify \
--command "SELECT version()"
```
Pipe SQL from a heredoc:
```bash
GIZMOSQL_PASSWORD="gizmosql_password" gizmosql_client \
--host localhost --username gizmosql_user --tls --tls-skip-verify --quiet <<'EOF'
SELECT n_nationkey, n_name
FROM nation
WHERE n_nationkey = 24;
EOF
```
More info: [Client Shell documentation](https://docs.gizmosql.com/#/client)
---
## ποΈ Build from Source (Optional)
```bash
git clone https://github.com/gizmodata/gizmosql --recurse-submodules
cd gizmosql
cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build --target install
```
Then run:
```bash
GIZMOSQL_PASSWORD="..." gizmosql_server --database-filename ./data/your.db --print-queries
```
---
## π§ͺ Advanced Features
- β
DuckDB + SQLite backend support
- β
TLS & optional mTLS
- β
JWT-based auth (automatically issued, signed server-side)
- β
Server initialization via `INIT_SQL_COMMANDS` or `INIT_SQL_COMMANDS_FILE`
- β
Slim Docker image for minimal runtime
---
## π Backend Selection
```bash
# DuckDB (default)
gizmosql_server -B duckdb --database-filename data/foo.duckdb
# SQLite
gizmosql_server -B sqlite --database-filename data/foo.sqlite
```
> [!TIP]
> You can now use the: `--query-timeout` argument to set a maximum query timeout in seconds for the server. Queries running longer than the timeout will be killed. The default value of: `0` means "unlimited".
> Example: `gizmosql_server (other args...) --query-timeout 10`
> will set a timeout of 10 seconds for all queries.
> [!TIP]
> The health check query can be customized using `--health-check-query` or the `GIZMOSQL_HEALTH_CHECK_QUERY` environment variable.
> The default is `SELECT 1`. This is useful when you need a more specific health check for your deployment.
> Example: `gizmosql_server (other args...) --health-check-query "SELECT 1 FROM my_table LIMIT 1"`
---
## π§© Extensions & Integrations
- π» [GizmoSQL UI](https://github.com/gizmodata/gizmosql-ui) π **NEW!**
- π [SQLAlchemy dialect](https://github.com/gizmodata/sqlalchemy-gizmosql-adbc-dialect)
- πΏ [Apache Superset compatible SQLAlchemy driver](https://github.com/gizmodata/superset-sqlalchemy-gizmosql-adbc-dialect)
- π [Ibis adapter](https://github.com/gizmodata/ibis-gizmosql)
- π [Flight SQL over WebSocket Proxy](https://github.com/gizmodata/flight-sql-websocket-proxy)
- π [Metabase driver](https://github.com/J0hnG4lt/metabase-flightsql-driver)
- βοΈ [dbt Adapter](https://github.com/gizmodata/dbt-gizmosql)
- π₯
[SQLMesh Adapter](https://github.com/gizmodata/sqlmesh-gizmosql) π **NEW!**
- β¨ [PySpark SQLFrame adapter](https://github.com/gizmodata/sqlframe-gizmosql) π **NEW!**
- πͺ© [ADBC Scanner by Query.Farm](docs/adbc_scanner_duckdb.md) π **NEW!**
- βοΈ [Kubernetes Operator](https://github.com/gizmodata/gizmosql-operator) π **NEW!**
- πΊ [GizmoSQLLine JDBC CLI Client](https://github.com/gizmodata/gizmosqlline) **NEW!**
- π₯ [Grafana Plugin](https://grafana.com/grafana/plugins/gizmodata-gizmosql-datasource/) **NEW!**
- πΈοΈ [JavaScript/TypeScript Client](https://github.com/gizmodata/gizmosql-client-js) **NEW!**
- βοΈ [JDBC Driver](https://github.com/gizmodata/gizmosql-jdbc-driver/releases/latest/download/gizmosql-jdbc-driver.jar) **NEW!**
- π [Python ADBC Driver (with OAuth/SSO)](https://github.com/gizmodata/adbc-driver-gizmosql) **NEW!**
- π [ODBC Driver](https://github.com/gizmodata/gizmosql-odbc-driver) **NEW!**
- π [Power BI Connector](https://github.com/gizmodata/gizmosql-powerbi-connector) **NEW!**
- πΊοΈ [QGIS Plugin (qgizmosql)](https://github.com/gizmodata/qgizmosql) π **NEW!**
---
## π Performance
π‘ On Azure VM `Standard_E64pds_v6` (~$3.74/hr):
- TPC-H SF 1000 benchmark:
β±οΈ 161.4 seconds
π° ~$0.17 USD total
> π Speed for the win. Performance for pennies.
---
## π License
**GizmoSQL Core** is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
**Enterprise features** (in `src/enterprise/`) are proprietary and require a commercial license from GizmoData LLC. See [src/enterprise/LICENSE](src/enterprise/LICENSE) for details.
---
## π« Contact
Questions or consulting needs?
π§ info@gizmodata.com
π [https://gizmodata.com](https://gizmodata.com)
---
> Built with β€οΈ by [GizmoDataβ’](https://gizmodata.com)