14.02.2026

SQL-Tap: A Zero-Config SQL Traffic Inspector

head-image

Troubleshooting database performance often means digging through application logs or enabling slow query logs on the database itself. Both approaches add friction. SQL-Tap takes a different path: it runs as a transparent proxy between your application and database, capturing every query in real-time and displaying it in an interactive terminal UI.

What is SQL-Tap?

SQL-Tap consists of two components: a proxy daemon (sql-tapd) and a TUI client (sql-tap). The daemon speaks native PostgreSQL and MySQL wire protocols, so your application connects to it without modification. Every query, transaction, and error flows through the proxy and streams to connected TUI clients via gRPC.

This architecture means zero code changes. Point your app at the proxy port, launch the TUI, and start inspecting traffic immediately.

Key Features

  • Real-time query streaming: See queries as they execute, complete with timing data and row counts.
  • Transaction tracking: Group queries by transaction to understand batch behavior.
  • Built-in EXPLAIN: Run EXPLAIN or EXPLAIN ANALYZE directly from the TUI without switching tools.
  • Analytics view: Aggregate queries by pattern to find the slowest or most frequent offenders.
  • Copy with bindings: Extract queries with parameter values for easy reproduction.

Installation

Install via Homebrew on macOS:

brew install --cask mickamy/tap/sql-tap

Or build from source with Go:

go install github.com/mickamy/sql-tap@latest
go install github.com/mickamy/sql-tap/cmd/sql-tapd@latest

Docker images work well for containerized environments. Add the daemon binary to your existing database image and configure it as an entrypoint wrapper.

Usage

Start the proxy daemon pointing at your database:

DATABASE_URL="postgres://user:pass@localhost:5432/db?sslmode=disable" \
  sql-tapd --driver=postgres --listen=:5433 --upstream=localhost:5432

Connect your application to port 5433 instead of 5432. Then launch the TUI:

sql-tap localhost:9091

Queries appear as they execute. Press x to run EXPLAIN on any query, s to toggle sorting by duration, and a to open the analytics view for pattern-based aggregation.

Operational Tips

Run SQL-Tap in staging or development environments to profile query patterns before production deploys. In production, consider enabling it temporarily during incident investigations. The proxy adds minimal latency since it only parses the wire protocol without executing queries itself.

Conclusion

SQL-Tap removes the friction from database debugging. No log parsing, no slow query configuration, just a live view of your SQL traffic with EXPLAIN at your fingertips. Check out the GitHub repository to get started.

Looking to automate your infrastructure operations? Akmatori helps SRE teams build AI agents that handle routine tasks, powered by Gcore's global edge infrastructure.

Automate incident response and prevent on-call burnout with AI-driven agents!