The sql-run command executes the specified statement against the cluster.

JSON Input Data Format
{
    "id": string,
    "sql": string
}
id * Specifies the ID of the cluster.
sql * Specifies the SQL statement.
* Indicates a mandatory field.

Code Snippets
Here are several code snippets provided for your direct use. Simply select your preferred tool/language by clicking on it.


Successful Response
{
    "result": "OK",
    "payload": "database_name | owner | primary_region | secondary_region | regions | survival_goal\r\n----------------+-------+----------------+------------------+---------+----------------\r\n  defaultdb     | root  | NULL           | NULL             | {}      | NULL\r\n  mydb          | root  | NULL           | NULL             | {}      | NULL\r\n  postgres      | root  | NULL           | NULL             | {}      | NULL\r\n  system        | node  | NULL           | NULL             | {}      | NULL\r\n(4 rows)\r\n\r\nTime: 6ms\r\n\r\n"
}

Failed Response
{
    "result": "ERR",
    "message": "Error message ..."
}