The GizmoSQL adapter plugin for dbt
Project description
dbt-gizmosql
dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
dbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis.
GizmoSQL
GizmoSQL is an Apache Arrow Flight-based SQL engine for data warehouses. It is designed to be fast, scalable, and easy to use.
It has DuckDB and SQLite back-ends. You can see more information about GizmoSQL here.
Features
This adapter provides feature parity with dbt-duckdb for all features applicable to a remote Flight SQL connection:
Materializations
- Table and View (SQL and Python)
- Incremental with four strategies:
append-- simple record additionsdelete+insert-- key-based upserts with DuckDB'sDELETE...USINGsyntaxmerge-- uses DuckDB'sMERGEwithUPDATE BY NAME/INSERT BY NAMEmicrobatch-- time-based batch processing viaevent_timewindows
- Snapshot (check and timestamp modes) using UPDATE+INSERT pattern
- Schema change handling:
ignore,append_new_columns,sync_all_columns,fail
Python Models
Python models execute client-side using a local DuckDB instance for full API compatibility, then ship results to GizmoSQL via ADBC bulk ingest:
def model(dbt, session):
dbt.config(materialized="table")
df = dbt.ref("upstream_model")
df = df.filter(df.amount > 100)
return df
- Supports DuckDB relations, pandas DataFrames, and PyArrow Tables as return types
dbt.ref()anddbt.source()fetch data from GizmoSQL as Arrow and expose it as DuckDB relations- Incremental Python models supported (with proper
dbt.is_incrementalhandling)
Seed Loading
Seeds are loaded using DuckDB's CSV reader on the client side with ADBC bulk ingest to the server:
- Correct null handling (empty CSV fields become SQL
NULL, not the string'null') - Proper type inference (dates detected as
DATE, integers asBIGINT, etc.) - Supports
column_typesoverrides and custom delimiters - Significantly faster than dbt's default batch
INSERTpath
Constraints
All constraint types are enforced: CHECK, NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY.
Documentation
persist_docssupport (COMMENT ONfor relations and columns)- Full catalog generation with
dbt docs generate
Utility Macros
DuckDB-compatible overrides for: dateadd, last_day, listagg, split_part.
Installation
Option 1 - from PyPi
# Create the virtual environment
python3 -m venv .venv
# Activate the virtual environment
. .venv/bin/activate
pip install --upgrade pip
python -m pip install dbt-core dbt-gizmosql
Option 2 - from source (for development)
git clone https://github.com/gizmodata/dbt-gizmosql
cd dbt-gizmosql
# Create the virtual environment
python3 -m venv .venv
# Activate the virtual environment
. .venv/bin/activate
# Upgrade pip, setuptools, and wheel
pip install --upgrade pip setuptools wheel
# Install the dbt GizmoSQL adapter - in editable mode with dev dependencies
pip install --editable .[dev]
Configuration
Profile setup
Add the following to your ~/.dbt/profiles.yml (change values to match your environment):
my-gizmosql-db:
target: dev
outputs:
dev:
type: gizmosql
host: localhost
port: 31337
database: dbt
user: [username]
password: [password]
use_encryption: True
tls_skip_verify: True
threads: 2
OAuth/SSO Authentication
For browser-based OAuth/SSO, use auth_type: external -- no username or password needed:
my-gizmosql-db:
target: dev
outputs:
dev:
type: gizmosql
host: gizmosql.example.com
port: 31337
auth_type: external
use_encryption: True
threads: 2
Architecture
This adapter connects to GizmoSQL via Apache Arrow Flight SQL using the ADBC driver (adbc-driver-gizmosql). Key architectural decisions:
- Autocommit mode: Each statement auto-commits immediately. Flight SQL's
PREPAREphase validates against committed catalog state, so explicit transactions would cause DDL from earlier statements to be invisible to later ones. - Client-side DuckDB: Seeds and Python models use a local DuckDB instance for processing, with results shipped to the server via ADBC bulk ingest (Arrow columnar format over gRPC).
- MERGE BY NAME: Incremental merges use DuckDB's
UPDATE BY NAME/INSERT BY NAMEsyntax, which is resilient to column ordering differences.
Versioning
This adapter follows semantic versioning. The major.minor version tracks dbt-core (e.g., dbt-core 1.11.x -> dbt-gizmosql 1.11.x).
Reporting bugs and contributing code
- Want to report a bug or request a feature? Open an issue
- Want to contribute? Pull requests are welcome
Code of Conduct
Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the dbt Code of Conduct.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbt_gizmosql-1.11.12.tar.gz.
File metadata
- Download URL: dbt_gizmosql-1.11.12.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02eeb791e0642ff89ed24625f253a7fc1eb32281fecf840b5bbea56d96f4c615
|
|
| MD5 |
c618fefc099e806039bf4a55a91ee7d5
|
|
| BLAKE2b-256 |
a2beb39fc47c86a070c52b09739489bb60abb26bc003713c2d0e068604e34151
|
Provenance
The following attestation bundles were made for dbt_gizmosql-1.11.12.tar.gz:
Publisher:
ci.yml on gizmodata/dbt-gizmosql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_gizmosql-1.11.12.tar.gz -
Subject digest:
02eeb791e0642ff89ed24625f253a7fc1eb32281fecf840b5bbea56d96f4c615 - Sigstore transparency entry: 1206277515
- Sigstore integration time:
-
Permalink:
gizmodata/dbt-gizmosql@fb36bb2a7f8ae919261b042bb8a536db4ffcbaa2 -
Branch / Tag:
refs/tags/v1.11.12 - Owner: https://github.com/gizmodata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fb36bb2a7f8ae919261b042bb8a536db4ffcbaa2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbt_gizmosql-1.11.12-py3-none-any.whl.
File metadata
- Download URL: dbt_gizmosql-1.11.12-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1f893ccf60242ffda8c0b6fe9b885775febc99a99879e11b20be6bec14bcebf
|
|
| MD5 |
84bec089b0eb15f691c9252ebce2db7b
|
|
| BLAKE2b-256 |
0a6fe021f6a8facc0c63c45baea484b7cdd919cad6a0f5c1a00db9f25757872e
|
Provenance
The following attestation bundles were made for dbt_gizmosql-1.11.12-py3-none-any.whl:
Publisher:
ci.yml on gizmodata/dbt-gizmosql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_gizmosql-1.11.12-py3-none-any.whl -
Subject digest:
d1f893ccf60242ffda8c0b6fe9b885775febc99a99879e11b20be6bec14bcebf - Sigstore transparency entry: 1206277533
- Sigstore integration time:
-
Permalink:
gizmodata/dbt-gizmosql@fb36bb2a7f8ae919261b042bb8a536db4ffcbaa2 -
Branch / Tag:
refs/tags/v1.11.12 - Owner: https://github.com/gizmodata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fb36bb2a7f8ae919261b042bb8a536db4ffcbaa2 -
Trigger Event:
push
-
Statement type: