Skip to main content

Tail DuckLake tables via CDC

Project description

ducktail

tail -f for DuckLake tables.

Screenshot

Watch inserts, deletes, and updates flow through a DuckLake table in real time, powered by DuckLake's built-in CDC.

$ ducktail tail orders -C meta.duckdb

+ id=1 name=Alice amount=100.0
+ id=2 name=Bob amount=50.0
- id=2 name=Bob amount=50.0
Δ amount: 100.0 → 150.0

Install

pip install ducktail        # or: uv add ducktail

Requires Python 3.12+ and DuckDB 1.4+ (ducklake extension loads automatically).

Usage

Basic

ducktail tail TABLE -C CONNECTION
# DuckDB metadata catalog
ducktail tail events -C meta.duckdb -d /data

# Postgres metadata catalog
ducktail tail events -C "postgres:dbname=ducklake host=localhost user=ducklake password=ducklake"

Interactive mode

Full-screen TUI with color-coded rows (green inserts, red deletes, yellow updates):

ducktail tail events -C meta.duckdb -m interactive

Filter what you see

# Only specific columns
ducktail tail events -C meta.duckdb -col status -col amount

# Server-side filter (pushed into the CDC query)
ducktail tail events -C meta.duckdb -f "amount > 100"

# Faster polling
ducktail tail events -C meta.duckdb -i 0.5

Compose with Unix tools

Pager mode (the default) writes one line per change to stdout, so it plays nicely with the usual suspects:

# Inserts only
ducktail tail orders -C meta.duckdb | grep '^\+'

# Deletes only
ducktail tail orders -C meta.duckdb | grep '^\-'

# Count changes per second
ducktail tail orders -C meta.duckdb | pv -l > /dev/null

Options

ducktail tail [OPTIONS] TABLE_NAME
Option Short Default Description
TABLE_NAME (required) Table to tail
--connection -C (required) Catalog connection string
--catalog -c lake Catalog name
--data-path -d . Path to DuckLake data files
--namespace -n main Table namespace
--interval -i 1.0 Poll interval (seconds)
--columns -col (all) Columns to show (repeat for multiple)
--filter -f (none) CDC filter expression
--mode -m pager pager or interactive

Change symbols

Symbol Color Meaning
+ Green Row inserted
- Red Row deleted
Δ Yellow Row updated — shows column: old → new for each changed field

Try the demo

The repo includes a Docker-based demo that stands up a Postgres metadata catalog and a producer that streams a mix of inserts, deletes, and updates.

# Terminal 1 — infrastructure + producer
just demo-up
just demo-producer

# Terminal 2 — watch it happen
just demo-tail                # pager mode
just demo-tail-interactive    # or interactive mode

# Cleanup
just demo-down

Development

Requires flox and Docker (for integration tests and demo).

flox activate
just sync       # install deps
just test       # unit tests
just ci         # format + lint + typecheck + unit tests
Recipe What it does
just sync Install dependencies
just fmt Format code
just lint Lint
just typecheck mypy strict
just test Unit tests
just test-integration Integration tests
just test-all Both
just ci fmt-check + lint + typecheck + test

License

Apache License 2.0

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

ducktail-1.0.0.tar.gz (661.6 kB view details)

Uploaded Source

Built Distribution

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

ducktail-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ducktail-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for ducktail-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2c7d60027ad176622fc6c1ea04ed45930f6b2d8867f49ec2799886bad4848cfc
MD5 1c511038d1ca55c83cd1771e3dfcced6
BLAKE2b-256 3fc9a242dcf12e5deb6884922f88f17258702d434f98826ead079a40891c909b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducktail-1.0.0.tar.gz:

Publisher: release.yml on jghoman/ducktail

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

File details

Details for the file ducktail-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ducktail-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79a2bf0dba0c6e33b30eda6aa3fb74c42b0bb2972ceb792367b6fbf5eed3e611
MD5 1b32a2300c6ef16e0e2d163a18cc47ef
BLAKE2b-256 e2cc980f0b9caaa0745f1f8f964667ae50fdb2d3042e6416f3b916a10eb8ee9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducktail-1.0.0-py3-none-any.whl:

Publisher: release.yml on jghoman/ducktail

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