aism_db_query
Run one read-only SQL query to count or inspect site database data and return columns plus rows, with writes and sensitive tables blocked.
Instructions
Run ONE read-only SQL query (SELECT, WITH, TABLE, SHOW, DESCRIBE or EXPLAIN) against the site database, for example to count or inspect plugin data. Runs in a read-only transaction with a time limit; comments, write/locking keywords, variables, backslashes and references to the users, usermeta and API key tables are rejected. Use the table prefix from aism_db_tables. Returns columns plus rows as arrays; long values are cut to max_value_bytes and obvious secrets are redacted. Add LIMIT/aggregates for large tables. The SQL is recorded in the site's activity log. Requires database:read and manage_options (companion 1.6.0+).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| site | No | Configured site name from aism_sites. Omit for the default site. | |
| max_rows | No | ||
| max_value_bytes | No | ||
| timeout_seconds | No |