Lodol Docs

MySQL

API actions for the MySQL integration.

MySQL

Query and manage tables in a MySQL database.


Describe table

Get the schema/structure of a table.

Parameters

ParameterTypeRequiredDescription
tablestringYesThe table name.

Response

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

Execute query

Execute a raw SQL query.

Parameters

ParameterTypeRequiredDescription
querystringYesThe SQL query to execute.
paramsarrayNoOptional query parameters as an array.

Response

{
  "affected_rows": 0,
  "rows": []
}

Fetch rows

Fetch rows from a table with optional filtering.

Parameters

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

Response

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

Insert row

Insert a row into a table.

Parameters

ParameterTypeRequiredDescription
tablestringYesTable to insert into.
valuesobjectYesKey-value pairs representing the new row.

Response

{
  "affected_rows": 1,
  "inserted_id": 1
}

List databases

List all databases accessible with the connection.

Response

{
  "databases": [
    "information_schema",
    "my_app"
  ]
}

List tables

List all tables in a database.

Parameters

ParameterTypeRequiredDescription
schemastringNoOptional schema name to query.

Response

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

On this page