跳到主要内容
知仓学习社ZHICANG

sql

Run SQL queries against the WordPress development database. Use when querying database tables, inspecting Simple History events, checking WordPress …

联网无严重或高危命中Microck/ordinary-claude-skills

它会碰到什么

扫了多少2 个文本文件,3 KB
它会碰到什么联网
命中总数1 处
命中统计严重 0 · 高 0 · 中 0 · 低 1

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Run SQL Queries

You are tasked with running SQL queries against the WordPress development database.

Prerequisites

  • Database credentials are stored in CLAUDE.local.md under "Database Access"
  • 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 |

|--------|--------------|

| wp_ | Main install (wordpress_mariadb) |

| wp_nightly_ | Nightly build |

| wp_6_0_ to wp_6_6_ | Version-specific installs |

| wp_multisite_ | Multisite install |

| wp_php74_ | PHP 7.4 install |

| wp_subfolder_ | Subfolder install |

Simple History Tables

The main Simple History tables (using wp_ prefix):

  • wp_simple_history - Main events table
  • wp_simple_history_contexts - Event context/metadata

Instructions

  1. Read credentials from CLAUDE.local.md
  2. Ask the user what SQL query they want to run (if not specified)
  3. Run the query using the command pattern above
  4. Display the results
  5. Offer to run follow-up queries if needed

Notes

  • For complex queries, consider using \G at the end for vertical output
  • Be careful with UPDATE/DELETE queries - always confirm with user first

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 3 个不同仓库或目录里都有叫 sql 的技能。它们内容并不相同,别混用: