Skip to main content

The zero-dependency regression testing tool for modern data warehouses. DuckDB-powered data diffing across Snowflake, Postgres, and more.

Project description

quack-diff

quack-diff logo

The zero-dependency regression testing tool for modern data warehouses.

DuckDB-powered data diffing across Snowflake, Postgres, and more.

Features

  • DuckDB-First Architecture: Uses DuckDB as a universal adapter for database connectivity
  • Dialect-Safe Hashing: Handles NULL values and type mismatches correctly across databases
  • Time-Travel Support: Compare data against historical snapshots (Snowflake, Delta Lake)
  • CI/CD Ready: Exit codes for pipeline integration, environment variable configuration
  • Hacker-Friendly: Rich terminal output with beautiful diff tables

Installation

pip install quack-diff

Or with uv:

uv add quack-diff

Quick Start

Basic Diff

# Compare two tables
quack-diff diff --source db1.users --target db2.users --key id

# Compare with threshold (allow up to 1% difference)
quack-diff diff --source prod.orders --target dev.orders --key order_id --threshold 0.01

Time-Travel Diff (Snowflake)

# Compare current data with 5 minutes ago
quack-diff diff \
  --source snowflake.orders \
  --target snowflake.orders \
  --source-at "5 minutes ago" \
  --key order_id

Schema Comparison

quack-diff schema --source db1.users --target db2.users

Configuration

quack-diff supports configuration via environment variables:

# Snowflake
export QUACK_DIFF_SNOWFLAKE_ACCOUNT="your-account"
export QUACK_DIFF_SNOWFLAKE_USER="your-user"
export QUACK_DIFF_SNOWFLAKE_PASSWORD="your-password"

# PostgreSQL
export QUACK_DIFF_POSTGRES_CONNECTION_STRING="postgresql://user:pass@host:5432/db"

Or via a quack-diff.yaml configuration file:

snowflake:
  account: your-account
  user: your-user
  database: your-database
  
postgres:
  connection_string: postgresql://user:pass@host:5432/db

defaults:
  threshold: 0.0

How It Works

quack-diff leverages DuckDB's extension system to connect to external databases:

  1. Attach: Mount remote databases using DuckDB extensions (snowflake, postgres_scanner)
  2. Hash: Generate row-level hashes using dialect-safe SQL (handles NULLs, type coercion)
  3. Compare: Identify mismatches by comparing hash values
  4. Report: Display results in beautiful terminal tables

Development

# Clone the repository
git clone https://github.com/matteorenoldi/quack-diff.git
cd quack-diff

# Install with dev dependencies
uv sync

# Run tests
uv run pytest

# Lint
uv run ruff check .

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quack_diff-0.0.1.tar.gz (136.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quack_diff-0.0.1-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file quack_diff-0.0.1.tar.gz.

File metadata

  • Download URL: quack_diff-0.0.1.tar.gz
  • Upload date:
  • Size: 136.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quack_diff-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2a05f0d7c60a53c9cdfdf811d01fde63b9474bed85f8245f7f3acc1b3b89e462
MD5 82f0c7fdcf92002e4e25a0cdc5d6c8ab
BLAKE2b-256 5132d66a3d96072fdb22262e3291681aee2c8a7007f048d066629690955950b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for quack_diff-0.0.1.tar.gz:

Publisher: publish.yml on mattcristal/quack-diff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quack_diff-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: quack_diff-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quack_diff-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a33b8c3c6f66c88e92b73cdda01bfbf1405a6d4ce2e999f5cf1798500f76cd18
MD5 4de45951e99d6f4fba87b73a6b86c727
BLAKE2b-256 57a9b6541b11649812d8e3ea873ce1c7d266003e4f1da202749f2fa9fcffc3ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for quack_diff-0.0.1-py3-none-any.whl:

Publisher: publish.yml on mattcristal/quack-diff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page