query
Run a read-only SQL query against the Reactome database. Returns results with row count and truncation flags.
Instructions
Run a single READ-ONLY SQL statement against the Reactome DB.
Accepts one `SELECT` / `WITH` / `SHOW` / `DESCRIBE` / `EXPLAIN` statement.
Writes are impossible (the connection is a SELECT-only user) and multiple
statements are rejected. If a `SELECT`/`WITH` has no `LIMIT`, one is injected
automatically. Call `schema_overview` first to learn the join patterns.
Args:
sql: The statement to run. Use parameter-free SQL; quote literals
normally. e.g. `SELECT d.DB_ID, d._displayName FROM DatabaseObject d
JOIN StableIdentifier si ON d.stableIdentifier = si.DB_ID
WHERE si.identifier = 'R-HSA-69278'`.
max_rows: Max rows to return (1-5000, default 200). Long text cells are
also truncated; `truncated` flags either kind.
Returns:
Dict `{columns, rows, row_count, truncated, sql}` where `rows` is a list
of lists aligned to `columns`, and `sql` is the statement actually run
(with any auto-injected LIMIT). On a bad statement or DB error, returns
`{"error": ...}`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| max_rows | No |