Ordinary-claude-skills sql
Run SQL queries against the WordPress development database. Use when querying database tables, inspecting Simple History events, checking WordPress data, or debugging database issues.
install
source · Clone the upstream repo
git clone https://github.com/Microck/ordinary-claude-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Microck/ordinary-claude-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills_all/sql" ~/.claude/skills/microck-ordinary-claude-skills-sql && rm -rf "$T"
manifest:
skills_all/sql/SKILL.mdsource content
Run SQL Queries
You are tasked with running SQL queries against the WordPress development database.
Prerequisites
- Database credentials are stored in
under "Database Access"CLAUDE.local.md - Docker compose services must be running
- Commands must be run from the docker-compose project directory
Command Pattern
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "YOUR_SQL_HERE"
Refer to
CLAUDE.local.md for the actual credentials and connection details.
Examples
Show all tables
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SHOW TABLES;"
Query Simple History events
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SELECT * FROM wp_simple_history ORDER BY id DESC LIMIT 10;"
Describe a table structure
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "DESCRIBE wp_simple_history;"
Count records
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SELECT COUNT(*) FROM wp_posts;"
Table Prefixes
The database contains multiple WordPress installations with different prefixes:
| Prefix | Installation |
|---|---|
| Main install (wordpress_mariadb) |
| Nightly build |
to | Version-specific installs |
| Multisite install |
| PHP 7.4 install |
| Subfolder install |
Simple History Tables
The main Simple History tables (using
wp_ prefix):
- Main events tablewp_simple_history
- Event context/metadatawp_simple_history_contexts
Instructions
- Read credentials from
CLAUDE.local.md - Ask the user what SQL query they want to run (if not specified)
- Run the query using the command pattern above
- Display the results
- Offer to run follow-up queries if needed
Notes
- For complex queries, consider using
at the end for vertical output\G - Be careful with UPDATE/DELETE queries - always confirm with user first