From 44617ea783efac02b2103df040af0d54f4b0dac9 Mon Sep 17 00:00:00 2001 From: Deeman Date: Tue, 10 Mar 2026 17:16:34 +0100 Subject: [PATCH] docs: document prod_query.py in CLAUDE.md Co-Authored-By: Claude Opus 4.6 --- .claude/CLAUDE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index eddca42..75f12b7 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -74,6 +74,24 @@ DUCKDB_PATH=local.duckdb SERVING_DUCKDB_PATH=analytics.duckdb \ ``` +## Production queries + +Use `scripts/prod_query.py` to query the production DuckDB over SSH. **Always prefer this over raw SSH commands** — it handles escaping, enforces read-only, and blocks mutation keywords. + +```bash +# Query analytics.duckdb (serving tables — default) +uv run python scripts/prod_query.py "SELECT COUNT(*) FROM serving.location_profiles" + +# Query lakehouse.duckdb (foundation/staging tables) +uv run python scripts/prod_query.py --db lakehouse "SELECT * FROM foundation.dim_countries LIMIT 5" + +# JSON output +uv run python scripts/prod_query.py --json "SELECT COUNT(*) FROM serving.location_profiles" + +# Limit rows (default 500) +uv run python scripts/prod_query.py --max-rows 1000 "SELECT ..." +``` + ## Architecture documentation | Topic | File |