Devops Run SQL
Table of Contents
1. When to use this skill
Running SQL in the environment — queries or scripts, with credentials and connection from .env.
2. How to use this skill
- Know which database you are about to touch. The connection comes from
this worktree's
.env, so the same command hits a different database in another worktree. Checkcompass whereif unsure. - Run the query through the recipe below, which supplies the credentials and connection rather than having you retype them.
- Prefer a read before a write. A
SELECTthat returns the rows aDELETEwould remove costs one command and prevents the mistake that needs a database rebuild.
3. Recipes
- How do I run SQL in the environment? — credentials and connection come from the .env.
4. Reference
- ores.compass — the tool every one of these commands runs through.