MySQL

MySQL é um sistema de banco de dados relacional open-source amplamente usado. O bloco MySQL conecta seu workflow diretamente a um banco MySQL, permitindo ler e escrever dados sem sair do Zoen. Ele cuida dos detalhes de conexão — host, porta, database, credenciais e modo SSL — para que os blocos possam consultar, inserir, atualizar, excluir e executar SQL bruto no seu banco.

Com o bloco MySQL, você pode:

  • Consultar dados: Executar statements SELECT e obter linhas com a contagem de registros
  • Inserir, atualizar e excluir registros: Escrever dados chave-valor em uma tabela ou modificar linhas existentes com uma cláusula WHERE
  • Executar SQL bruto: Rodar statements SQL arbitrários, como DDL para criar tabelas
  • Inspecionar o schema: Recuperar estruturas de tabelas, colunas, chaves, índices e a lista de databases disponíveis no servidor

No Zoen, o bloco MySQL permite que seus agentes leiam e escrevam em um banco MySQL como parte de um workflow — consultando registros para alimentar a lógica seguinte, inserindo ou atualizando linhas com base na saída do agente, limpando dados com deletes, executando SQL customizado para operações pontuais e inspecionando o schema para entender a estrutura das tabelas antes de gerar consultas.

Usage Instructions

Integrate MySQL into the workflow. Can query, insert, update, delete, and execute raw SQL.

Actions

mysql_query

Execute SELECT query on MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesSQL SELECT query to execute (e.g., SELECT * FROM users WHERE active = 1)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

mysql_insert

Insert new record into MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to insert into (e.g., users, orders)
dataobjectYesData to insert as key-value pairs

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of inserted rows
rowCountnumberNumber of rows inserted

mysql_update

Update existing records in MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to update (e.g., users, orders)
dataobjectYesData to update as key-value pairs
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of updated rows
rowCountnumberNumber of rows updated

mysql_delete

Delete records from MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to delete from (e.g., users, orders)
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of deleted rows
rowCountnumberNumber of rows deleted

mysql_execute

Execute raw SQL query on MySQL database

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesRaw SQL query to execute (e.g., CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(255)))

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows affected

mysql_introspect

Introspect MySQL database schema to retrieve table structures, columns, and relationships

Input

ParameterTypeRequiredDescription
hoststringYesMySQL server hostname or IP address
portnumberYesMySQL server port (default: 3306)
databasestringYesDatabase name to connect to (e.g., my_database)
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns, keys, and indexes
databasesarrayList of available databases on the server

On this page