query-prod-db

Query production PostgreSQL with Entra ID authentication for user investigation and data debugging.

801|25|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/learntocloud/learn-to-cloud-app --skill query-prod-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-prod-db
Source: https://github.com/learntocloud/learn-to-cloud-app/tree/main/.github/skills/query-prod-db
Command: npx skills add https://github.com/learntocloud/learn-to-cloud-app --skill query-prod-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Investigating learner progress issues or debugging data in a production PostgreSQL database requires secure, auditable access without hard-coded credentials or risky ad-hoc changes. This Skill provides a safe, repeatable workflow for running authenticated read-only queries against the production database.

Core Features & Use Cases

  • Entra ID Authentication: Connects to PostgreSQL using an Azure OSS RDBMS access token and the signed-in Entra principal, avoiding stored passwords.
  • Schema-Aware Queries: Targets known tables like verification_attempts and learner_step_completions keyed by user_id and requirement or step UUIDs.
  • Safe Write Guardrails: Requires showing affected rows, explaining rollback behavior, and obtaining explicit confirmation before any write transaction or firewall rule change.
  • Use Case: A learner reports their verification status is stuck. Use this Skill to look up their verification_attempts rows by user_id and diagnose the current state without modifying data.

Quick Start

Ask the assistant to query the production database for a specific user's verification attempts using their user ID.

Frequently Asked Questions about query-prod-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Azure PostgreSQL with Entra ID authentication?

Retrieve an access token with az account get-access-token --resource-type oss-rdbms, set it as PGPASSWORD, and use your signed-in Entra display name as the psql user. Connect with sslmode=require against the discovered host.

How do I query production database for user verification status?

Query the verification_attempts table keyed by user_id and requirement_uuid to see the current learner verification state. Step progress lives in learner_step_completions keyed by user_id and step_uuid.

Can I run write queries against the production database?

Writes are allowed only with safeguards: show the exact affected rows, explain rollback behavior, and obtain explicit confirmation before executing the transaction. Read-only queries are the default mode.

How do I find the production PostgreSQL host without hard-coding it?

Discover the current host from Terraform output or Azure rather than hard-coding its generated suffix. This keeps queries working when infrastructure is redeployed with a new hostname.

What precautions apply when opening firewall access to production PostgreSQL?

Obtain confirmation before adding a narrow firewall rule for the current IP, record the rule name, and remove it after the query session ends. Never leave temporary rules in place.