Engineering
sql avatar

sql

Executes SQL queries against the WordPress development database for inspection, troubleshooting, and audit log analysis.

Introduction

This skill provides a direct command-line interface for interacting with the WordPress database within a development environment. It is primarily designed for developers and site maintainers who need to perform deep inspections of system data, verify state changes, or debug database-related issues within the Simple History plugin ecosystem. By leveraging this tool, you can interface with MariaDB containers to execute precise SQL statements, allowing for efficient data retrieval from core tables such as wp_simple_history and wp_simple_history_contexts.

The utility is particularly useful when you need to bypass standard GUI limitations to perform complex data filtering or correlate event data with raw database records. It helps in validating table schemas, checking for data corruption, or verifying that custom logging actions have persisted correctly to the storage layer.

  • Executes SQL queries directly within the docker compose environment using the mariadb service.

  • Supports standard SQL syntax for SELECT, SHOW, DESCRIBE, and administrative commands.

  • Provides immediate access to key Simple History tables including wp_simple_history and its associated metadata tables.

  • Facilitates rapid debugging by allowing the inspection of event rows, log levels, and contextual metadata.

  • Follows security best practices by requiring explicit confirmation for destructive operations like UPDATE or DELETE.

  • Ensure you check CLAUDE.local.md for specific database credentials before attempting to execute commands.

  • Always be mindful of table prefixes; the tool supports standard wp_ as well as custom prefixes like wp_nightly_ or wp_multisite_.

  • Use this tool in isolation for development-only environments; it is not intended for production database manipulation.

  • When performing batch updates or deletions, verify the affected record count via a preliminary SELECT query first to avoid unintended data loss.

  • The output displays raw results directly in the terminal, making it ideal for piping into further analysis tools or scripts if needed.

  • Typical workflows include troubleshooting plugin conflicts, investigating missing audit logs, or auditing database table structures during local development cycles.

Repository Stats

Stars
316
Forks
75
Open Issues
1
Language
PHP
Default Branch
main
Sync Status
Idle
Last Synced
May 4, 2026, 12:10 AM
View on GitHub