ssh_db_query
Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to one SELECT statement: the query must begin with SELECT, and INTO, file functions, and any insert, update, delete, drop, create, alter…
Instructions
Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to one SELECT statement: the query must begin with SELECT, and INTO, file functions, and any insert, update, delete, drop, create, alter, truncate, grant, revoke, or exec keyword are rejected before execution; it then runs inside a read-only transaction, so the database itself refuses any write. For mongodb it runs a find() and requires the collection parameter; the query must be a filter document (JSON or mongo shell syntax such as ObjectId("…")), and $where, $function and $accumulator are refused. Returns the raw command output as text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Database type | |
| query | Yes | SQL query (SELECT only) or MongoDB find query | |
| dbHost | No | Database host (default: localhost) | |
| dbPort | No | Database port | |
| dbUser | No | Database user | |
| server | Yes | Server name | |
| database | Yes | Database name | |
| collection | No | Collection name (MongoDB only) | |
| dbPassword | No | Database password |