Lodol Docs

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

ParameterTypeRequiredDescription
tablestringYesThe table name.

Response

{
  "columns": [
    {
      "Field": "id",
      "Type": "int"
    }
  ]
}

Run SQL query

Run a SQL query that you write yourself.

Parameters

ParameterTypeRequiredDescription
querystringYesThe SQL query to run.
paramsarrayNoA 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

ParameterTypeRequiredDescription
tablestringYesThe table name.
limitnumberNoMaximum number of rows to return.

Response

{
  "rows": [
    {
      "id": 1,
      "name": "John"
    }
  ]
}

Add row

Add a new row of data to a table.

Parameters

ParameterTypeRequiredDescription
tablestringYesThe table to add the row to.
valuesobjectYesThe 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

ParameterTypeRequiredDescription
schemastringNoThe database to list tables from. Leave blank to use the database from your connection.

Response

{
  "tables": [
    "users",
    "orders",
    "products"
  ]
}

On this page