Use when querying, modifying, or investigating database state — enforces schema-first approach and mutation safety
Use this workflow when you need to query, investigate, or modify database state.
Gateway instructions already tell you WHICH tools handle database operations. This skill teaches the safe workflow for using them.
Before writing any query:
Never write a query against a table you haven't inspected.
Always run a SELECT to understand current state before any mutation:
| Operation | Caution Level |
|---|---|
| SELECT | Auto-execute OK |
| INSERT (new data) | Confirm with user — describe what will be inserted |
| UPDATE | Confirm with user — show the SELECT of affected rows first |
| DELETE | Always confirm — show affected rows and ask explicitly |
| DDL (ALTER, DROP) | Always confirm — these are irreversible |
After any INSERT/UPDATE/DELETE:
| Situation | Action |
|---|---|
| Need to understand data model | List tables → describe relevant tables |
| Simple data lookup | SELECT directly (schema check optional for known tables) |
| Data modification needed | SELECT first → confirm with user → execute → verify |
| Debugging a data issue | Schema check → SELECT to inspect state → trace the problem |
| Need to check logs | Use the Gateway's log retrieval tools |