Agent Skills: 1. List schemas

Query DTS PostgreSQL via Redash API for marketing data warehouse. Use when user says "DTS Postgres", "Redash query", "marketing warehouse", "funnel analysis".

UncategorizedID: tekliner/improvado-agentic-frameworks-and-skills/dts-postgres

Install this agent skill to your local

pnpm dlx add-skill https://github.com/tekliner/improvado-agentic-frameworks-and-skills/tree/HEAD/skills/dts-postgres

Skill Files

Browse the full folder contents for dts-postgres.

Download Skill

Loading file tree…

skills/dts-postgres/SKILL.md

Skill Metadata

Name
dts-postgres
Description
Query DTS PostgreSQL via Redash API for marketing data warehouse. Use when user says "DTS Postgres", "Redash query", "marketing warehouse", "funnel analysis".

πŸ“‹ DTS Postgres = Marketing Data Warehouse via Redash

Core Principle: Query DTS PostgreSQL through Redash API for marketing attribution and schema discovery.

Access Architecture (Continuant - TD):

graph TD
    Skill[DTS Skill] --> Client[DTSPostgresClient]
    Client --> Redash[Redash API]
    Redash --> DTS[(DTS PostgreSQL)]

    DTS --> Public[public schema]
    DTS --> Marketing[marketing schema]

Query Execution (Occurrent - LR):

graph LR
    Q[Query] --> C[Client] --> R[Redash API]
    R --> J[Job Created]
    J --> P[Poll Status]
    P --> D[Return Data]

Ontological Rule: TD for access layers, LR for query execution flow

Primary source: data_sources/dts_postgres/dts_postgres_redash_client.py Session: 2025-12-03 by Claude Code - v2.0.0 KF migration

🎯 CLI Commands

ΒΆ1 Core operations:

python -m data_sources.dts_postgres.dts_postgres_redash_client test
python -m data_sources.dts_postgres.dts_postgres_redash_client query "SELECT * FROM public.companies LIMIT 10"
python -m data_sources.dts_postgres.dts_postgres_redash_client tables --schema public
python -m data_sources.dts_postgres.dts_postgres_redash_client describe companies --schema public
python -m data_sources.dts_postgres.dts_postgres_redash_client search "marketing"

πŸ“ Python Integration

from data_sources.dts_postgres.dts_postgres_redash_client import DTSPostgresClient

client = DTSPostgresClient()
result = client.execute_query("SELECT * FROM public.companies LIMIT 10")
tables = client.get_tables(schema='public')
matches = client.search_tables('marketing')

πŸ“Š Schema Discovery

ΒΆ1 Workflow:

# 1. List schemas
python -m data_sources.dts_postgres.dts_postgres_redash_client schema
# 2. List tables
python -m data_sources.dts_postgres.dts_postgres_redash_client tables --schema marketing
# 3. Describe table
python -m data_sources.dts_postgres.dts_postgres_redash_client describe attribution --schema marketing

ΒΆ2 Key tables: public.companies, public.campaigns, marketing.attribution, marketing.funnel_stages

πŸ”§ Environment

REDASH_API_URL=https://redash.improvado.io
REDASH_API_TOKEN=your_token
DTS_POSTGRES_DATA_SOURCE_ID=your_id

Ground Truth

  • Client: data_sources/dts_postgres/dts_postgres_redash_client.py
  • API: Redash at https://redash.improvado.io
  • NOT for: ClickHouse data (use clickhouse-internal-analytics or improvado-mcp)