skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
skill-hub.humanlaya.com53 installs

querying-analytics-db

Use when querying the data-analytics-platform online read-only PostgreSQL analytics database, validating dashboard data, inspecting ODS or DWS tables, or running ad hoc SELECT SQL against production analytics.

How do I install this agent skill?

npx skills add https://skill-hub.humanlaya.com --skill querying-analytics-db
view source ↗

Is this agent skill safe to install?

No partner audit is available yet. Read the source before installing.

What does this agent skill do?

Querying Analytics DB

Overview

Use this skill for direct SQL inspection against the online analytics PostgreSQL database for data-analytics-platform. Run read-only SQL and keep result sets bounded.

Connection

Connection target defaults are built into scripts/analytics-sql:

SettingValue
hostpc-2zeh15g9z2r440cr8.rwlb.rds.aliyuncs.com
port5432
databasedata_label_platform_analytics

Database credentials are not embedded in this skill. Apply for read-only access here: https://applink.feishu.cn/T98bU4gTRcRs

After access is granted, provide credentials at runtime through ANALYTICS_DB_USER and ANALYTICS_DB_PASSWORD, or let scripts/analytics-sql prompt for them.

Quick Reference

# Prompt for credentials.
read -rp "Analytics DB user: " ANALYTICS_DB_USER
read -rsp "Analytics DB password: " ANALYTICS_DB_PASSWORD; echo
export ANALYTICS_DB_USER ANALYTICS_DB_PASSWORD

# Run a bounded table query.
/Users/carota/.agents/skills/querying-analytics-db/scripts/analytics-sql \
  "SELECT schemaname, tablename FROM pg_tables WHERE schemaname IN ('public', 'analytics') LIMIT 20"

# Pipe SQL from a file or heredoc.
/Users/carota/.agents/skills/querying-analytics-db/scripts/analytics-sql --csv <<'SQL'
SELECT *
FROM analytics.dws_project_daily
ORDER BY stat_date DESC
LIMIT 10
SQL

Required Safety Rules

  • Only run SELECT, WITH, EXPLAIN, or SHOW.
  • Include LIMIT for exploratory queries unless the aggregate returns one row.
  • Before writing business SQL, check references/table-declarations.md and the linked project docs for table grain and metric semantics.
  • Prefer analytics DWS tables for dashboard validation and public ODS tables only for source inspection.
  • Keep date predicates explicit and use Asia/Shanghai business dates when matching dashboard docs.
  • Do not run mutating functions, maintenance commands, DDL, DML, COPY, CALL, DO, REFRESH, or multi-statement SQL.
  • If a query might be expensive, first inspect table size and indexes, then narrow by date/project/user.

Business Declarations

This database is the online analytics database connected to /Users/carota/Documents/GitHub/data-analytics-platform. Use references/table-declarations.md as the lightweight table map for common business semantics: ODS vs DWD/DWS, table grain, canonical date fields, default filters, and source-of-truth docs.

When a query reveals useful table semantics, update that reference with the table, grain, Business Rule, and Source of Truth. Keep formal metric definitions in the project docs/metrics and formal table definitions in docs/schemas.

Helper Behavior

scripts/analytics-sql performs an offline SQL guard, then executes inside a read-only transaction with statement timeout and no pager. Use --check-only to validate a query without connecting.

/Users/carota/.agents/skills/querying-analytics-db/scripts/analytics-sql --check-only \
  "SELECT COUNT(*) FROM analytics.dws_project_daily"

Common Mistakes

MistakeFix
Missing database accessApply through https://applink.feishu.cn/T98bU4gTRcRs
Missing runtime credentialsSet ANALYTICS_DB_USER and ANALYTICS_DB_PASSWORD, or wait for prompts
Querying raw ODS for complex dashboard metricsCheck DWS schema docs first and query pre-aggregated tables
Returning full tablesAdd LIMIT, date predicates, and only needed columns
Trusting client-side checks aloneRely on both the script guard and read-only database permissions

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/skill-hub.humanlaya.com/querying-analytics-db">View querying-analytics-db on skillZs</a>