Read Croft Prod DB
UTILITY SKILL. INVOKES: Rails schema/model files, bundled Ruby psql helper, read-only DigitalOcean replica. FOR SINGLE OPERATIONS: narrow production data inspection and plain-language summaries.
Read query workflow before querying.
USE FOR:
- "check Croft prod data"
- "validate this Sentry issue against production rows"
- "count or sample records in the Croft replica"
- "inspect schema relationships before a safe SELECT"
DO NOT USE FOR:
- Database writes, migrations, maintenance, data repair, or primary DB access.
- Local dev/test DB work, non-Croft databases, broad exports, or raw PII dumps.
- Guessing schema without reading
db/schema.rband relevantapp/models.
Workflow
- Inspect
db/schema.rband relevant models before non-trivial SQL. - Write the smallest useful
SELECT,WITH ... SELECT,SHOW, or plainEXPLAIN; prefer counts andLIMIT. - Run
scripts/query_prod_replica.rbwith--service db-ro-postgresql-nyc3-18224. - Summarize counts, key IDs, date ranges, or anomalies, redacting sensitive values.
Errors
If TCP fails, report the helper's exact your ip: ... is not trusted... line and stop before SQL. If the task requires writes or PII, refuse that part and offer a safe aggregate or read-only alternative.
Examples
- In scope: count recent Croft production rows, then sample non-sensitive IDs through the replica.
- Out of scope: update production rows; refuse the write and offer read-only verification.