Trusted by 250,000+ developers from startups to Fortune 500 companies:
This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.
To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.
New Column on MySQL
Description:Emit new event when you add a new column to a table. [See the docs here](https://dev.mysql.com/doc/refman/8.0/en/show-columns.html)
Version:0.0.2
Key:mysql-new-column
import common from "../common/table.mjs";
export default {
...common,
key: "mysql-new-column",
name: "New Column",
description: "Emit new event when you add a new column to a table. [See the docs here](https://dev.mysql.com/doc/refman/8.0/en/show-columns.html)",
type: "source",
version: "0.0.2",
dedupe: "unique",
props: {
...common.props,
db: "$.service.db",
},
methods: {
...common.methods,
_getPreviousColumns() {
return this.db.get("previousColumns");
},
_setPreviousColumns(previousColumns) {
this.db.set("previousColumns", previousColumns);
},
async listResults() {
let previousColumns = this._getPreviousColumns() || [];
const columns = await this.mysql.listNewColumns(
this.table,
previousColumns,
);
this.iterateAndEmitEvents(columns);
const newColumnNames =
columns
.map((column) => column.Field)
.filter((c) => !previousColumns.includes(c));
previousColumns = previousColumns.concat(newColumnNames);
this._setPreviousColumns(previousColumns);
},
generateMeta(column) {
const columnName = column.Field;
return {
id: `${columnName}${this.table}`,
summary: columnName,
ts: Date.now(),
};
},
},
};
This component may be configured based on the props
defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
Label | Prop | Type | Description |
---|
MySQL | mysql | app | This component uses the MySQL app. |
| timer | $.interface.timer | |
Table | table | string | Select a value from the drop down menu. |
N/A | db | $.service.db | This component uses $.service.db to maintain state between component invocations. |
MySQL uses API keys for authentication. When you connect your MySQL account, Pipedream securely stores the keys so you can easily authenticate to MySQL APIs in both code and no-code steps.
These values correspond with your MySQL server:
- host: IP address or domain to access your MySQL server
- port: Default is
3306
- username: The account username to log in
- password: The account password to log in
- database: The name of the database to open after logging in. Please note, MySQL must be connectable from Pipedream's IP address range. Otherwise, you'll receive a
Connection Refused
error.
Open-source relational database