MySQL
API actions for the MySQL integration.
MySQL
Look up, add, and update data in your MySQL database.
Describe table
Get the structure of a table, including its columns and the type of data each one holds.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table name. |
Response
{
"columns": [
{
"Field": "id",
"Type": "int"
}
]
}Run SQL query
Run a SQL query that you write yourself.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The SQL query to run. |
params | array | No | A list of values to fill in for any %s placeholders in the query, in order. |
Response
{
"affected_rows": 0,
"rows": []
}Fetch rows
Fetch rows from a table, with an optional limit on how many are returned.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table name. |
limit | number | No | Maximum number of rows to return. |
Response
{
"rows": [
{
"id": 1,
"name": "John"
}
]
}Add row
Add a new row of data to a table.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
table | string | Yes | The table to add the row to. |
values | object | Yes | The column names and values for the new row. |
Response
{
"affected_rows": 1,
"inserted_id": 1
}List databases
List all databases your MySQL connection can access.
Response
{
"databases": [
"information_schema",
"my_app"
]
}List tables
List all tables in a database.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
schema | string | No | The database to list tables from. Leave blank to use the database from your connection. |
Response
{
"tables": [
"users",
"orders",
"products"
]
}