MySQL
Run queries, insert, update, and delete rows in a MySQL database.
On this page
Connect
Auth type: Credentials form (custom_auth). Fill in the fields the provider needs (listed below). They are stored encrypted in the vault.
| Field | Type | Description |
|---|---|---|
hostrequired | text | Database server hostname or IP address |
portrequired | text | Database server port (default 3306) |
userrequired | text | Database username |
passwordrequired | secret | Database password |
databaserequired | text | Database name to connect to |
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("mysql", "delete_row", {
"table": "<table>",
"search_column": "<search column>",
"search_value": "<search value>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("MySQL answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "mysql-delete-row",
name: "MySQL: Delete Row",
description: "Calls MySQL when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("mysql", {
"action": "delete_row",
"table": "<table>",
"search_column": "<search column>",
"search_value": "<search value>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/mysql/delete_row" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"table":"<table>","search_column":"<search column>","search_value":"<search value>"}}'Actions
delete_rowin catalog
Delete Row. Deletes one or more rows from a table
| Input | Type | Description |
|---|---|---|
timezoneoptional | text | Timezone for the MySQL server to use |
tablerequired | id (picked from your account) | Table |
search_columnrequired | text | Search Column |
search_valuerequired | text | Search Value |
insert_rowin catalog
Insert Row. Inserts a new row into a table
| Input | Type | Description |
|---|---|---|
timezoneoptional | text | Timezone for the MySQL server to use |
tablerequired | id (picked from your account) | Table |
valuesrequired | object | Values |
update_rowin catalog
Update Row. Updates one or more rows in a table
| Input | Type | Description |
|---|---|---|
timezoneoptional | text | Timezone for the MySQL server to use |
tablerequired | id (picked from your account) | Table |
valuesrequired | object | Values |
search_columnrequired | text | Search Column |
search_valuerequired | text | Search Value |
execute_query
Execute Query. Executes a query on the mysql database and returns the results
| Input | Type | Description |
|---|---|---|
timezoneoptional | text | Timezone for the MySQL server to use |
queryrequired | text | The query string to execute, use ? for arguments to avoid SQL injection. |
argsoptional | array | Arguments to use in the query, if any. Should be in the same order as the ? in the query string.. |
find_rows
Find Rows. Reads rows from a table
| Input | Type | Description |
|---|---|---|
timezoneoptional | text | Timezone for the MySQL server to use |
tablerequired | id (picked from your account) | Table |
conditionrequired | text | SQL condition, can also include logic operators, etc. |
argsoptional | array | Arguments can be used using ? in the condition |
columnsoptional | array | Specify the columns you want to select |
get_tables
Get Tables. Returns a list of tables in the database
No input.
Details
- Id
mysql- Category
- Data and storage
- Tags
- database, sql, relational, open-source
- Package
@activepieces/piece-mysql@0.2.3- Tier
- Built in