Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(mysql): ui improvement (#16801)

Talal Jaber8d2ddca18bb0
diff --git a/bun.lock b/bun.lock
index a838747f58a..b870f811f4e 100644
--- a/bun.lock
+++ b/bun.lock
@@ -6401,7 +6401,7 @@
},
"packages/pieces/community/mysql": {
"name": "@activepieces/piece-mysql",
- "version": "0.3.0",
+ "version": "0.4.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/mysql/package.json b/packages/pieces/community/mysql/package.json
index bf14ab4ea89..5ebdf26200f 100644
--- a/packages/pieces/community/mysql/package.json
+++ b/packages/pieces/community/mysql/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-mysql",
- "version": "0.3.0",
+ "version": "0.4.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/mysql/src/i18n/de.json b/packages/pieces/community/mysql/src/i18n/de.json
index ca1bdb01ba3..3c38f944d52 100644
--- a/packages/pieces/community/mysql/src/i18n/de.json
+++ b/packages/pieces/community/mysql/src/i18n/de.json
@@ -11,7 +11,7 @@
"The password to use to identify at the mysql server": "Das Passwort, mit dem man sich auf dem mysql-Server identifizieren soll",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "Der Name der zu verwendenden Datenbank. Wird benötigt, wenn Sie die Aktion \"Ausführen\" nicht verwenden",
"Find Rows": "Zeilen finden",
- "Insert Row": "Insert Row",
+ "Insert Row": "Zeile einfügen",
"Update Row": "Zeile aktualisieren",
"Delete Row": "Zeile löschen",
"Get Tables": "Tische holen",
@@ -23,7 +23,7 @@
"Returns a list of tables in the database": "Gibt eine Liste von Tabellen in der Datenbank zurück",
"Executes a query on the mysql database and returns the results": "Führt eine Abfrage in der mysql-Datenbank aus und gibt die Ergebnisse zurück",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "Zeitzone",
"Table": "Tisch",
"Condition": "Bedingung",
"Arguments": "Argumente",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "Argumente können verwendet werden ? in der Bedingung",
"Specify the columns you want to select": "Geben Sie die Spalten an, die Sie auswählen möchten",
"The query string to execute, use ? for arguments to avoid SQL injection.": "Der auszuführende Abfrage-String, ? für Argumente verwenden, um SQL-Einschleusung zu vermeiden.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumente, die in der Abfrage verwendet werden sollen, falls vorhanden. Sollte in der gleichen Reihenfolge sein wie die ? im Abfrage-String.."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumente, die in der Abfrage verwendet werden sollen, falls vorhanden. Sollte in der gleichen Reihenfolge sein wie die ? im Abfrage-String..",
+ "The server's hostname or IP address.": "Hostname oder IP-Adresse des Servers.",
+ "The port the server listens on, usually 3306.": "Der Port, auf dem der Server lauscht, meist 3306.",
+ "The database user to sign in as.": "Der Datenbankbenutzer für die Anmeldung.",
+ "The password for that user.": "Das Kennwort dieses Benutzers.",
+ "The database to use. Only Run Query works without one.": "Die zu verwendende Datenbank. Nur Abfrage ausführen funktioniert ohne sie.",
+ "Run Query": "Abfrage ausführen",
+ "Runs a SQL statement on the database and returns its results": "Führt eine SQL-Anweisung in der Datenbank aus und gibt die Ergebnisse zurück",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Tragen Sie dynamische Werte nie direkt in das SQL ein. Schreiben Sie stattdessen ? und geben Sie die Werte unter Argumente an, um SQL-Injection zu verhindern.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Zeitzone der Datumswerte auf dem Server: Z für UTC oder ein Versatz wie +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "Das SQL nach WHERE. Schreiben Sie ? an die Stelle jedes Werts.",
+ "Values for each ? in the condition, in order.": "Werte für jedes ? in der Bedingung, in Reihenfolge.",
+ "Leave empty to return every column.": "Leer lassen, um jede Spalte zurückzugeben.",
+ "Column names and the values to store in them.": "Spaltennamen und die darin zu speichernden Werte.",
+ "The column to match rows on.": "Die Spalte, über die Zeilen abgeglichen werden.",
+ "The value that column must equal.": "Der Wert, dem diese Spalte entsprechen muss.",
+ "Columns you leave out keep their current value.": "Nicht angegebene Spalten behalten ihren aktuellen Wert.",
+ "Columns to change and their new values.": "Zu ändernde Spalten und ihre neuen Werte.",
+ "Every matching row is deleted, and this cannot be undone.": "Jede passende Zeile wird gelöscht, und das lässt sich nicht rückgängig machen.",
+ "The SQL to run. Write ? where each value goes.": "Das auszuführende SQL. Schreiben Sie ? an die Stelle jedes Werts.",
+ "Values for each ? in the query, in order.": "Werte für jedes ? in der Abfrage, in Reihenfolge.",
+ "Rows to find": "Zu suchende Zeilen",
+ "What to return": "Was zurückgegeben wird",
+ "Row to insert": "Einzufügende Zeile",
+ "Data to insert": "Einzufügende Daten",
+ "Rows to update": "Zu aktualisierende Zeilen",
+ "Changes": "Änderungen",
+ "Rows to delete": "Zu löschende Zeilen",
+ "SQL statement": "SQL-Anweisung",
+ "Insert Multiple Rows": "Mehrere Zeilen einfügen",
+ "Inserts many rows into a table in a single transaction": "Fügt viele Zeilen in einer einzigen Transaktion in eine Tabelle ein",
+ "Rows": "Zeilen",
+ "Keep Empty Strings": "Leere Strings beibehalten",
+ "Insert empty fields as empty strings instead of the column default.": "Leere Felder als leere Strings statt mit dem Spaltenstandard einfügen."
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/es.json b/packages/pieces/community/mysql/src/i18n/es.json
index 5bee1405d45..76624f1fe86 100644
--- a/packages/pieces/community/mysql/src/i18n/es.json
+++ b/packages/pieces/community/mysql/src/i18n/es.json
@@ -11,7 +11,7 @@
"The password to use to identify at the mysql server": "La contraseña a utilizar para identificarse en el servidor willing ql",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "El nombre de la base de datos a utilizar. Requerido si no está utilizando la acción \"Ejecutar consulta\"",
"Find Rows": "Encontrar filas",
- "Insert Row": "Insert Row",
+ "Insert Row": "Insertar fila",
"Update Row": "Actualizar fila",
"Delete Row": "Eliminar fila",
"Get Tables": "Obtener Tablas",
@@ -23,7 +23,7 @@
"Returns a list of tables in the database": "Devuelve una lista de tablas en la base de datos",
"Executes a query on the mysql database and returns the results": "Ejecuta una consulta en la base de datos del servidor de correo y retorna los resultados",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "Zona horaria",
"Table": "Tabla",
"Condition": "Condición",
"Arguments": "Argumentos",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "Argumentos pueden ser usados ? en la condición",
"Specify the columns you want to select": "Especifique las columnas que desea seleccionar",
"The query string to execute, use ? for arguments to avoid SQL injection.": "La cadena de consulta a ejecutar, use ? para los argumentos para evitar la inyección SQL.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumentos a usar en la consulta, si los hay. Debe estar en el mismo orden que el ? en la cadena de consultas.."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumentos a usar en la consulta, si los hay. Debe estar en el mismo orden que el ? en la cadena de consultas..",
+ "The server's hostname or IP address.": "El nombre de host o la dirección IP del servidor.",
+ "The port the server listens on, usually 3306.": "El puerto en el que escucha el servidor, normalmente 3306.",
+ "The database user to sign in as.": "El usuario de la base de datos con el que iniciar sesión.",
+ "The password for that user.": "La contraseña de ese usuario.",
+ "The database to use. Only Run Query works without one.": "La base de datos que se usará. Solo Ejecutar consulta funciona sin ella.",
+ "Run Query": "Ejecutar consulta",
+ "Runs a SQL statement on the database and returns its results": "Ejecuta una sentencia SQL en la base de datos y devuelve sus resultados",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Nunca escribas valores dinámicos directamente en el SQL. Escribe ? en su lugar y pon los valores en Argumentos para evitar la inyección SQL.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Zona horaria de las fechas en el servidor: Z para UTC, o un desfase como +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "El SQL después de WHERE. Escribe ? donde va cada valor.",
+ "Values for each ? in the condition, in order.": "Valores para cada ? de la condición, en orden.",
+ "Leave empty to return every column.": "Déjalo vacío para devolver todas las columnas.",
+ "Column names and the values to store in them.": "Nombres de columna y los valores que se guardarán en ellas.",
+ "The column to match rows on.": "La columna por la que se buscan las filas.",
+ "The value that column must equal.": "El valor que debe tener esa columna.",
+ "Columns you leave out keep their current value.": "Las columnas que no incluyas conservan su valor actual.",
+ "Columns to change and their new values.": "Columnas que cambiar y sus nuevos valores.",
+ "Every matching row is deleted, and this cannot be undone.": "Se elimina cada fila que coincida, y no se puede deshacer.",
+ "The SQL to run. Write ? where each value goes.": "El SQL que se ejecutará. Escribe ? donde va cada valor.",
+ "Values for each ? in the query, in order.": "Valores para cada ? de la consulta, en orden.",
+ "Rows to find": "Filas a buscar",
+ "What to return": "Qué devolver",
+ "Row to insert": "Fila a insertar",
+ "Data to insert": "Datos a insertar",
+ "Rows to update": "Filas a actualizar",
+ "Changes": "Cambios",
+ "Rows to delete": "Filas a eliminar",
+ "SQL statement": "Sentencia SQL",
+ "Insert Multiple Rows": "Insertar varias filas",
+ "Inserts many rows into a table in a single transaction": "Inserta muchas filas en una tabla en una sola transacción",
+ "Rows": "Filas",
+ "Keep Empty Strings": "Mantener cadenas vacías",
+ "Insert empty fields as empty strings instead of the column default.": "Inserta los campos vacíos como cadenas vacías en lugar del valor por defecto de la columna."
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/fr.json b/packages/pieces/community/mysql/src/i18n/fr.json
index a836afe27d5..cab01554b57 100644
--- a/packages/pieces/community/mysql/src/i18n/fr.json
+++ b/packages/pieces/community/mysql/src/i18n/fr.json
@@ -3,7 +3,7 @@
"Host": "Hôte",
"Port": "Port",
"Username": "Nom d'utilisateur",
- "Password": "Password",
+ "Password": "Mot de passe",
"Database": "Base de données",
"The hostname or address of the mysql server": "Le nom d'hôte ou l'adresse du serveur mysql",
"The port to use for connecting to the mysql server": "Le port à utiliser pour se connecter au serveur mysql",
@@ -11,7 +11,7 @@
"The password to use to identify at the mysql server": "Le mot de passe à utiliser pour l'identification sur le serveur mysql",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "Le nom de la base de données à utiliser. Obligatoire si vous n'utilisez pas l'action \"Exécuter la requête\"",
"Find Rows": "Trouver des lignes",
- "Insert Row": "Insert Row",
+ "Insert Row": "Insérer une ligne",
"Update Row": "Mettre à jour la ligne",
"Delete Row": "Supprimer la ligne",
"Get Tables": "Récupérer les tables",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "Les arguments peuvent être utilisés en utilisant ? dans la condition",
"Specify the columns you want to select": "Spécifiez les colonnes que vous voulez sélectionner",
"The query string to execute, use ? for arguments to avoid SQL injection.": "La chaîne de requête à exécuter, utilisez ? pour les arguments pour éviter l'injection SQL.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Arguments à utiliser dans la requête, le cas échéant. Doit être dans le même ordre que le ? dans la chaîne de requête."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Arguments à utiliser dans la requête, le cas échéant. Doit être dans le même ordre que le ? dans la chaîne de requête.",
+ "The server's hostname or IP address.": "Le nom d'hôte ou l'adresse IP du serveur.",
+ "The port the server listens on, usually 3306.": "Le port sur lequel le serveur écoute, généralement 3306.",
+ "The database user to sign in as.": "L'utilisateur de la base de données avec lequel se connecter.",
+ "The password for that user.": "Le mot de passe de cet utilisateur.",
+ "The database to use. Only Run Query works without one.": "La base de données à utiliser. Seul Exécuter la requête fonctionne sans elle.",
+ "Run Query": "Exécuter la requête",
+ "Runs a SQL statement on the database and returns its results": "Exécute une instruction SQL sur la base de données et renvoie ses résultats",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Ne saisissez jamais de valeurs dynamiques directement dans le SQL. Écrivez ? à la place et mettez les valeurs dans Arguments pour empêcher l'injection SQL.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Fuseau horaire des dates sur le serveur : Z pour UTC, ou un décalage comme +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "Le SQL après WHERE. Écrivez ? à la place de chaque valeur.",
+ "Values for each ? in the condition, in order.": "Valeurs pour chaque ? de la condition, dans l'ordre.",
+ "Leave empty to return every column.": "Laissez vide pour renvoyer toutes les colonnes.",
+ "Column names and the values to store in them.": "Les noms de colonnes et les valeurs à y enregistrer.",
+ "The column to match rows on.": "La colonne servant à trouver les lignes.",
+ "The value that column must equal.": "La valeur que cette colonne doit avoir.",
+ "Columns you leave out keep their current value.": "Les colonnes que vous omettez gardent leur valeur actuelle.",
+ "Columns to change and their new values.": "Les colonnes à modifier et leurs nouvelles valeurs.",
+ "Every matching row is deleted, and this cannot be undone.": "Chaque ligne correspondante est supprimée, et c'est irréversible.",
+ "The SQL to run. Write ? where each value goes.": "Le SQL à exécuter. Écrivez ? à la place de chaque valeur.",
+ "Values for each ? in the query, in order.": "Valeurs pour chaque ? de la requête, dans l'ordre.",
+ "Rows to find": "Lignes à trouver",
+ "What to return": "Ce qu'il faut renvoyer",
+ "Row to insert": "Ligne à insérer",
+ "Data to insert": "Données à insérer",
+ "Rows to update": "Lignes à mettre à jour",
+ "Changes": "Modifications",
+ "Rows to delete": "Lignes à supprimer",
+ "SQL statement": "Instruction SQL",
+ "Insert Multiple Rows": "Insérer plusieurs lignes",
+ "Inserts many rows into a table in a single transaction": "Insère de nombreuses lignes dans une table en une seule transaction",
+ "Rows": "Lignes",
+ "Keep Empty Strings": "Conserver les chaînes vides",
+ "Insert empty fields as empty strings instead of the column default.": "Insère les champs vides comme chaînes vides au lieu de la valeur par défaut de la colonne."
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/ja.json b/packages/pieces/community/mysql/src/i18n/ja.json
index a76b5e16c3c..c3a7b3f8e25 100644
--- a/packages/pieces/community/mysql/src/i18n/ja.json
+++ b/packages/pieces/community/mysql/src/i18n/ja.json
@@ -3,7 +3,7 @@
"Host": "ホスト",
"Port": "ポート",
"Username": "ユーザー名",
- "Password": "Password",
+ "Password": "パスワード",
"Database": "データベース",
"The hostname or address of the mysql server": "mysql サーバーのホスト名またはアドレス",
"The port to use for connecting to the mysql server": "mysqlサーバーへの接続に使用するポート",
@@ -11,7 +11,7 @@
"The password to use to identify at the mysql server": "mysql サーバーで識別するために使用するパスワード",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "使用するデータベースの名前。「クエリの実行」アクションを使用していない場合に必要です。",
"Find Rows": "行を検索",
- "Insert Row": "Insert Row",
+ "Insert Row": "行を挿入",
"Update Row": "行を更新",
"Delete Row": "行を削除",
"Get Tables": "テーブルの取得",
@@ -23,7 +23,7 @@
"Returns a list of tables in the database": "データベース内のテーブルのリストを返します",
"Executes a query on the mysql database and returns the results": "mysql データベースのクエリを実行し、結果を返します",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "タイムゾーン",
"Table": "表",
"Condition": "条件",
"Arguments": "引数",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "引数は?を使用して使用できます。",
"Specify the columns you want to select": "選択する列を指定します",
"The query string to execute, use ? for arguments to avoid SQL injection.": "実行するクエリ文字列は、SQLインジェクションを避けるために引数に?を使用します。",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "クエリで使用する引数がある場合は、クエリ文字列の?と同じ順にする必要があります。"
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "クエリで使用する引数がある場合は、クエリ文字列の?と同じ順にする必要があります。",
+ "The server's hostname or IP address.": "サーバーのホスト名または IP アドレス。",
+ "The port the server listens on, usually 3306.": "サーバーが待ち受けるポート。通常は 3306 です。",
+ "The database user to sign in as.": "サインインに使うデータベースユーザー。",
+ "The password for that user.": "そのユーザーのパスワード。",
+ "The database to use. Only Run Query works without one.": "使用するデータベース。これがなくても動くのはクエリの実行だけです。",
+ "Run Query": "クエリの実行",
+ "Runs a SQL statement on the database and returns its results": "データベースで SQL ステートメントを実行し、その結果を返します",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "動的な値を SQL に直接入力しないでください。代わりに ? を書き、値は引数に入れて SQL インジェクションを防ぎます。",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "サーバー上の日付のタイムゾーン: UTC なら Z、または +02:00 のようなオフセット。",
+ "The SQL after WHERE. Write ? where each value goes.": "WHERE の後に続く SQL。各値の位置に ? を書きます。",
+ "Values for each ? in the condition, in order.": "条件内の各 ? に入る値 (順番どおり)。",
+ "Leave empty to return every column.": "空にするとすべての列を返します。",
+ "Column names and the values to store in them.": "列名と、そこに保存する値。",
+ "The column to match rows on.": "行を照合する列。",
+ "The value that column must equal.": "その列が一致すべき値。",
+ "Columns you leave out keep their current value.": "指定しない列は現在の値のままです。",
+ "Columns to change and their new values.": "変更する列とその新しい値。",
+ "Every matching row is deleted, and this cannot be undone.": "一致するすべての行が削除され、元に戻せません。",
+ "The SQL to run. Write ? where each value goes.": "実行する SQL。各値の位置に ? を書きます。",
+ "Values for each ? in the query, in order.": "クエリ内の各 ? に入る値 (順番どおり)。",
+ "Rows to find": "検索する行",
+ "What to return": "返す内容",
+ "Row to insert": "挿入する行",
+ "Data to insert": "挿入するデータ",
+ "Rows to update": "更新する行",
+ "Changes": "変更内容",
+ "Rows to delete": "削除する行",
+ "SQL statement": "SQL ステートメント",
+ "Insert Multiple Rows": "複数行を挿入",
+ "Inserts many rows into a table in a single transaction": "1 つのトランザクションでテーブルに多数の行を挿入します",
+ "Rows": "行",
+ "Keep Empty Strings": "空の文字列を保持",
+ "Insert empty fields as empty strings instead of the column default.": "空のフィールドを列のデフォルト値ではなく空の文字列として挿入します。"
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/nl.json b/packages/pieces/community/mysql/src/i18n/nl.json
index 483331acda9..3b735780e54 100644
--- a/packages/pieces/community/mysql/src/i18n/nl.json
+++ b/packages/pieces/community/mysql/src/i18n/nl.json
@@ -23,7 +23,7 @@
"Returns a list of tables in the database": "Geeft een lijst van tabellen in de database terug",
"Executes a query on the mysql database and returns the results": "Voert een query uit op de mysql database en geeft de resultaten weer",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "Tijdzone",
"Table": "Tabel",
"Condition": "Voorwaarde",
"Arguments": "Argumenten",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "Argumenten kunnen worden gebruikt ? in de staat",
"Specify the columns you want to select": "Geef de kolommen op die u wilt selecteren",
"The query string to execute, use ? for arguments to avoid SQL injection.": "De uit te voeren query-tekenreeks, gebruik ? voor argumenten om SQL injectie te voorkomen.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumenten om te gebruiken in de query, indien van toepassing. Moet in dezelfde volgorde staan als de ? in de querystring.."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumenten om te gebruiken in de query, indien van toepassing. Moet in dezelfde volgorde staan als de ? in de querystring..",
+ "The server's hostname or IP address.": "De hostnaam of het IP-adres van de server.",
+ "The port the server listens on, usually 3306.": "De poort waarop de server luistert, meestal 3306.",
+ "The database user to sign in as.": "De databasegebruiker om mee in te loggen.",
+ "The password for that user.": "Het wachtwoord van die gebruiker.",
+ "The database to use. Only Run Query works without one.": "De database om te gebruiken. Alleen Query uitvoeren werkt zonder.",
+ "Run Query": "Query uitvoeren",
+ "Runs a SQL statement on the database and returns its results": "Voert een SQL-instructie uit op de database en geeft de resultaten terug",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Typ nooit dynamische waarden rechtstreeks in de SQL. Schrijf in plaats daarvan ? en zet de waarden in Argumenten om SQL-injectie te voorkomen.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Tijdzone van datums op de server: Z voor UTC, of een verschuiving zoals +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "De SQL na WHERE. Schrijf ? waar elke waarde komt.",
+ "Values for each ? in the condition, in order.": "Waarden voor elk ? in de voorwaarde, op volgorde.",
+ "Leave empty to return every column.": "Laat leeg om elke kolom terug te geven.",
+ "Column names and the values to store in them.": "Kolomnamen en de waarden die erin worden opgeslagen.",
+ "The column to match rows on.": "De kolom waarop rijen worden gematcht.",
+ "The value that column must equal.": "De waarde waaraan die kolom gelijk moet zijn.",
+ "Columns you leave out keep their current value.": "Kolommen die je weglaat, houden hun huidige waarde.",
+ "Columns to change and their new values.": "Te wijzigen kolommen en hun nieuwe waarden.",
+ "Every matching row is deleted, and this cannot be undone.": "Elke overeenkomende rij wordt verwijderd, en dit kan niet ongedaan worden gemaakt.",
+ "The SQL to run. Write ? where each value goes.": "De SQL om uit te voeren. Schrijf ? waar elke waarde komt.",
+ "Values for each ? in the query, in order.": "Waarden voor elk ? in de query, op volgorde.",
+ "Rows to find": "Te zoeken rijen",
+ "What to return": "Wat terug te geven",
+ "Row to insert": "In te voegen rij",
+ "Data to insert": "In te voegen gegevens",
+ "Rows to update": "Bij te werken rijen",
+ "Changes": "Wijzigingen",
+ "Rows to delete": "Te verwijderen rijen",
+ "SQL statement": "SQL-instructie",
+ "Insert Multiple Rows": "Meerdere rijen invoegen",
+ "Inserts many rows into a table in a single transaction": "Voegt veel rijen in één transactie aan een tabel toe",
+ "Rows": "Rijen",
+ "Keep Empty Strings": "Lege tekenreeksen behouden",
+ "Insert empty fields as empty strings instead of the column default.": "Voeg lege velden in als lege tekenreeksen in plaats van de standaardwaarde van de kolom."
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/pt.json b/packages/pieces/community/mysql/src/i18n/pt.json
index d156bea2781..4289fafc5b9 100644
--- a/packages/pieces/community/mysql/src/i18n/pt.json
+++ b/packages/pieces/community/mysql/src/i18n/pt.json
@@ -11,7 +11,7 @@
"The password to use to identify at the mysql server": "A senha para identificar no servidor mysql",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "O nome do banco de dados a ser usado. Necessário se você não estiver usando a ação \"Executar consulta\"",
"Find Rows": "Encontrar linhas",
- "Insert Row": "Insert Row",
+ "Insert Row": "Inserir linha",
"Update Row": "Atualizar linha",
"Delete Row": "Excluir linha",
"Get Tables": "Obter tabelas",
@@ -23,7 +23,7 @@
"Returns a list of tables in the database": "Retorna uma lista de tabelas no banco de dados",
"Executes a query on the mysql database and returns the results": "Executa uma consulta no banco de dados mysql e retorna os resultados",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "Fuso horário",
"Table": "Classificações",
"Condition": "Condição",
"Arguments": "Parâmetros",
@@ -38,5 +38,38 @@
"Arguments can be used using ? in the condition": "Os argumentos podem ser utilizados ? na condição",
"Specify the columns you want to select": "Especifique as colunas que você deseja selecionar",
"The query string to execute, use ? for arguments to avoid SQL injection.": "A string de consulta a ser executada, use ? para argumentos que evitem a injeção de SQL.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumentos para usar na consulta, se houver. Deve estar na mesma ordem que o ? na string de consulta.."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Argumentos para usar na consulta, se houver. Deve estar na mesma ordem que o ? na string de consulta..",
+ "The server's hostname or IP address.": "O nome do host ou o endereço IP do servidor.",
+ "The port the server listens on, usually 3306.": "A porta em que o servidor escuta, geralmente 3306.",
+ "The database user to sign in as.": "O usuário do banco de dados para entrar.",
+ "The password for that user.": "A senha desse usuário.",
+ "The database to use. Only Run Query works without one.": "O banco de dados a usar. Só Executar Consulta funciona sem ele.",
+ "Run Query": "Executar Consulta",
+ "Runs a SQL statement on the database and returns its results": "Executa uma instrução SQL no banco de dados e retorna os resultados",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Nunca digite valores dinâmicos diretamente no SQL. Escreva ? no lugar e coloque os valores em Parâmetros para evitar injeção de SQL.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Fuso horário das datas no servidor: Z para UTC ou um deslocamento como +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "O SQL depois do WHERE. Escreva ? onde vai cada valor.",
+ "Values for each ? in the condition, in order.": "Valores para cada ? da condição, em ordem.",
+ "Leave empty to return every column.": "Deixe vazio para retornar todas as colunas.",
+ "Column names and the values to store in them.": "Nomes das colunas e os valores a guardar nelas.",
+ "The column to match rows on.": "A coluna usada para encontrar as linhas.",
+ "The value that column must equal.": "O valor que essa coluna deve ter.",
+ "Columns you leave out keep their current value.": "Colunas que você deixar de fora mantêm o valor atual.",
+ "Columns to change and their new values.": "Colunas a alterar e seus novos valores.",
+ "Every matching row is deleted, and this cannot be undone.": "Cada linha correspondente é excluída, e isso não pode ser desfeito.",
+ "The SQL to run. Write ? where each value goes.": "O SQL a executar. Escreva ? onde vai cada valor.",
+ "Values for each ? in the query, in order.": "Valores para cada ? da consulta, em ordem.",
+ "Rows to find": "Linhas a encontrar",
+ "What to return": "O que retornar",
+ "Row to insert": "Linha a inserir",
+ "Data to insert": "Dados a inserir",
+ "Rows to update": "Linhas a atualizar",
+ "Changes": "Alterações",
+ "Rows to delete": "Linhas a excluir",
+ "SQL statement": "Instrução SQL",
+ "Insert Multiple Rows": "Inserir várias linhas",
+ "Inserts many rows into a table in a single transaction": "Insere muitas linhas em uma tabela em uma única transação",
+ "Rows": "Linhas",
+ "Keep Empty Strings": "Manter strings vazias",
+ "Insert empty fields as empty strings instead of the column default.": "Insere campos vazios como strings vazias em vez do padrão da coluna."
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/translation.json b/packages/pieces/community/mysql/src/i18n/translation.json
index 15392235020..813cda9eee8 100644
--- a/packages/pieces/community/mysql/src/i18n/translation.json
+++ b/packages/pieces/community/mysql/src/i18n/translation.json
@@ -5,25 +5,25 @@
"Username": "Username",
"Password": "Password",
"Database": "Database",
- "The hostname or address of the mysql server": "The hostname or address of the mysql server",
- "The port to use for connecting to the mysql server": "The port to use for connecting to the mysql server",
- "The username to use for connecting to the mysql server": "The username to use for connecting to the mysql server",
- "The password to use to identify at the mysql server": "The password to use to identify at the mysql server",
- "The name of the database to use. Required if you are not using the \"Execute Query\" Action": "The name of the database to use. Required if you are not using the \"Execute Query\" Action",
+ "The server's hostname or IP address.": "The server's hostname or IP address.",
+ "The port the server listens on, usually 3306.": "The port the server listens on, usually 3306.",
+ "The database user to sign in as.": "The database user to sign in as.",
+ "The password for that user.": "The password for that user.",
+ "The database to use. Only Run Query works without one.": "The database to use. Only Run Query works without one.",
"Find Rows": "Find Rows",
"Insert Row": "Insert Row",
"Insert Multiple Rows": "Insert Multiple Rows",
"Update Row": "Update Row",
"Delete Row": "Delete Row",
"Get Tables": "Get Tables",
- "Execute Query": "Execute Query",
+ "Run Query": "Run Query",
"Reads rows from a table": "Reads rows from a table",
"Inserts a new row into a table": "Inserts a new row into a table",
"Inserts many rows into a table in a single transaction": "Inserts many rows into a table in a single transaction",
"Updates one or more rows in a table": "Updates one or more rows in a table",
"Deletes one or more rows from a table": "Deletes one or more rows from a table",
"Returns a list of tables in the database": "Returns a list of tables in the database",
- "Executes a query on the mysql database and returns the results": "Executes a query on the mysql database and returns the results",
+ "Runs a SQL statement on the database and returns its results": "Runs a SQL statement on the database and returns its results",
"Markdown": "Markdown",
"Timezone": "Timezone",
"Table": "Table",
@@ -36,12 +36,26 @@
"Search Column": "Search Column",
"Search Value": "Search Value",
"Query": "Query",
- "\n **DO NOT** use dynamic input directly in the query string or column names.\n \n\n Use **?** in the query and dynamic values in args/values for parameterized queries to prevent **SQL injection**.": "\n **DO NOT** use dynamic input directly in the query string or column names.\n \n\n Use **?** in the query and dynamic values in args/values for parameterized queries to prevent **SQL injection**.",
- "Timezone for the MySQL server to use": "Timezone for the MySQL server to use",
- "SQL condition, can also include logic operators, etc.": "SQL condition, can also include logic operators, etc.",
- "Arguments can be used using ? in the condition": "Arguments can be used using ? in the condition",
- "Specify the columns you want to select": "Specify the columns you want to select",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "Timezone of dates on the server: Z for UTC, or an offset like +02:00.",
+ "The SQL after WHERE. Write ? where each value goes.": "The SQL after WHERE. Write ? where each value goes.",
+ "Values for each ? in the condition, in order.": "Values for each ? in the condition, in order.",
+ "Leave empty to return every column.": "Leave empty to return every column.",
+ "Column names and the values to store in them.": "Column names and the values to store in them.",
"Insert empty fields as empty strings instead of the column default.": "Insert empty fields as empty strings instead of the column default.",
- "The query string to execute, use ? for arguments to avoid SQL injection.": "The query string to execute, use ? for arguments to avoid SQL injection.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Arguments to use in the query, if any. Should be in the same order as the ? in the query string.."
+ "The column to match rows on.": "The column to match rows on.",
+ "The value that column must equal.": "The value that column must equal.",
+ "Columns you leave out keep their current value.": "Columns you leave out keep their current value.",
+ "Columns to change and their new values.": "Columns to change and their new values.",
+ "Every matching row is deleted, and this cannot be undone.": "Every matching row is deleted, and this cannot be undone.",
+ "The SQL to run. Write ? where each value goes.": "The SQL to run. Write ? where each value goes.",
+ "Values for each ? in the query, in order.": "Values for each ? in the query, in order.",
+ "Rows to find": "Rows to find",
+ "What to return": "What to return",
+ "Row to insert": "Row to insert",
+ "Data to insert": "Data to insert",
+ "Rows to update": "Rows to update",
+ "Changes": "Changes",
+ "Rows to delete": "Rows to delete",
+ "SQL statement": "SQL statement"
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/i18n/zh.json b/packages/pieces/community/mysql/src/i18n/zh.json
index 6394bccbf85..061bf98eec3 100644
--- a/packages/pieces/community/mysql/src/i18n/zh.json
+++ b/packages/pieces/community/mysql/src/i18n/zh.json
@@ -1,42 +1,75 @@
{
- "The world's most popular open-source database": "The world's most popular open-source database",
+ "The world's most popular open-source database": "全球最流行的开源数据库",
"Host": "主机",
"Port": "端口",
"Username": "用户名",
"Password": "密码",
- "Database": "Database",
+ "Database": "数据库",
"The hostname or address of the mysql server": "The hostname or address of the mysql server",
"The port to use for connecting to the mysql server": "The port to use for connecting to the mysql server",
"The username to use for connecting to the mysql server": "The username to use for connecting to the mysql server",
"The password to use to identify at the mysql server": "The password to use to identify at the mysql server",
"The name of the database to use. Required if you are not using the \"Execute Query\" Action": "The name of the database to use. Required if you are not using the \"Execute Query\" Action",
"Find Rows": "查找行",
- "Insert Row": "Insert Row",
+ "Insert Row": "插入行",
"Update Row": "更新行",
"Delete Row": "删除行",
- "Get Tables": "Get Tables",
+ "Get Tables": "获取表",
"Execute Query": "Execute Query",
- "Reads rows from a table": "Reads rows from a table",
- "Inserts a new row into a table": "Inserts a new row into a table",
- "Updates one or more rows in a table": "Updates one or more rows in a table",
- "Deletes one or more rows from a table": "Deletes one or more rows from a table",
- "Returns a list of tables in the database": "Returns a list of tables in the database",
+ "Reads rows from a table": "从表中读取行",
+ "Inserts a new row into a table": "向表中插入一行新数据",
+ "Updates one or more rows in a table": "更新表中的一行或多行",
+ "Deletes one or more rows from a table": "删除表中的一行或多行",
+ "Returns a list of tables in the database": "返回数据库中的表列表",
"Executes a query on the mysql database and returns the results": "Executes a query on the mysql database and returns the results",
"Markdown": "Markdown",
- "Timezone": "Timezone",
+ "Timezone": "时区",
"Table": "表",
"Condition": "条件",
- "Arguments": "Arguments",
- "Columns": "Columns",
+ "Arguments": "参数",
+ "Columns": "列",
"Values": "值",
- "Search Column": "Search Column",
+ "Search Column": "搜索列",
"Search Value": "搜索值",
- "Query": "Query",
+ "Query": "查询",
"\n **DO NOT** use dynamic input directly in the query string or column names.\n \n\n Use **?** in the query and dynamic values in args/values for parameterized queries to prevent **SQL injection**.": "\n **DO NOT** use dynamic input directly in the query string or column names.\n \n\n Use **?** in the query and dynamic values in args/values for parameterized queries to prevent **SQL injection**.",
"Timezone for the MySQL server to use": "Timezone for the MySQL server to use",
"SQL condition, can also include logic operators, etc.": "SQL condition, can also include logic operators, etc.",
"Arguments can be used using ? in the condition": "Arguments can be used using ? in the condition",
"Specify the columns you want to select": "Specify the columns you want to select",
"The query string to execute, use ? for arguments to avoid SQL injection.": "The query string to execute, use ? for arguments to avoid SQL injection.",
- "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Arguments to use in the query, if any. Should be in the same order as the ? in the query string.."
+ "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..": "Arguments to use in the query, if any. Should be in the same order as the ? in the query string..",
+ "The server's hostname or IP address.": "服务器的主机名或 IP 地址。",
+ "The port the server listens on, usually 3306.": "服务器监听的端口,通常为 3306。",
+ "The database user to sign in as.": "用于登录的数据库用户。",
+ "The password for that user.": "该用户的密码。",
+ "The database to use. Only Run Query works without one.": "要使用的数据库。只有“运行查询”可以不设置。",
+ "Run Query": "运行查询",
+ "Runs a SQL statement on the database and returns its results": "在数据库上运行 SQL 语句并返回结果",
+ "Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.": "切勿将动态值直接写入 SQL。请改写 ?,并把值放在“参数”中,以防止 SQL 注入。",
+ "Timezone of dates on the server: Z for UTC, or an offset like +02:00.": "服务器上日期的时区:Z 表示 UTC,或类似 +02:00 的偏移量。",
+ "The SQL after WHERE. Write ? where each value goes.": "WHERE 之后的 SQL。在每个值的位置写 ?。",
+ "Values for each ? in the condition, in order.": "条件中每个 ? 对应的值,按顺序填写。",
+ "Leave empty to return every column.": "留空则返回所有列。",
+ "Column names and the values to store in them.": "列名以及要存入的值。",
+ "The column to match rows on.": "用于匹配行的列。",
+ "The value that column must equal.": "该列必须等于的值。",
+ "Columns you leave out keep their current value.": "未填写的列保留其当前值。",
+ "Columns to change and their new values.": "要更改的列及其新值。",
+ "Every matching row is deleted, and this cannot be undone.": "每一条匹配的行都会被删除,且无法撤销。",
+ "The SQL to run. Write ? where each value goes.": "要运行的 SQL。在每个值的位置写 ?。",
+ "Values for each ? in the query, in order.": "查询中每个 ? 对应的值,按顺序填写。",
+ "Rows to find": "要查找的行",
+ "What to return": "返回内容",
+ "Row to insert": "要插入的行",
+ "Data to insert": "要插入的数据",
+ "Rows to update": "要更新的行",
+ "Changes": "更改",
+ "Rows to delete": "要删除的行",
+ "SQL statement": "SQL 语句",
+ "Insert Multiple Rows": "插入多行",
+ "Inserts many rows into a table in a single transaction": "在单个事务中向表中插入多行",
+ "Rows": "行",
+ "Keep Empty Strings": "保留空字符串",
+ "Insert empty fields as empty strings instead of the column default.": "将空字段作为空字符串插入,而不是使用列默认值。"
}
\ No newline at end of file
diff --git a/packages/pieces/community/mysql/src/index.ts b/packages/pieces/community/mysql/src/index.ts
index 38bdff315e2..15bc9d6e9e9 100644
--- a/packages/pieces/community/mysql/src/index.ts
+++ b/packages/pieces/community/mysql/src/index.ts
@@ -11,27 +11,28 @@ export const mysqlAuth = PieceAuth.CustomAuth({
host: Property.ShortText({
displayName: 'Host',
required: true,
- description: 'The hostname or address of the mysql server',
+ description: "The server's hostname or IP address.",
+ placeholder: 'db.example.com',
}),
port: Property.Number({
displayName: 'Port',
defaultValue: 3306,
- description: 'The port to use for connecting to the mysql server',
+ description: 'The port the server listens on, usually 3306.',
required: true,
}),
user: Property.ShortText({
displayName: 'Username',
required: true,
- description: 'The username to use for connecting to the mysql server',
+ description: 'The database user to sign in as.',
}),
password: PieceAuth.SecretText({
displayName: 'Password',
- description: 'The password to use to identify at the mysql server',
+ description: 'The password for that user.',
required: true,
}),
database: Property.ShortText({
displayName: 'Database',
- description: 'The name of the database to use. Required if you are not using the "Execute Query" Action',
+ description: 'The database to use. Only Run Query works without one.',
required: false,
}),
},
@@ -42,7 +43,7 @@ export const mysql = createPiece({
displayName: 'MySQL',
description: "The world's most popular open-source database",
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/mysql.png',
categories: [PieceCategory.DEVELOPER_TOOLS],
authors: ["JanHolger","kishanprmr","khaledmashaly","abuaboud"],
diff --git a/packages/pieces/community/mysql/src/lib/actions/delete-row.ts b/packages/pieces/community/mysql/src/lib/actions/delete-row.ts
index 7575930eff5..1e6598c2be8 100644
--- a/packages/pieces/community/mysql/src/lib/actions/delete-row.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/delete-row.ts
@@ -1,8 +1,7 @@
-import { createAction, Property } from '@activepieces/pieces-framework';
-import { mysqlCommon, mysqlConnect, sanitizeColumnName, warningMarkdown } from '../common';
+import { createAction, MarkdownVariant, Property } from '@activepieces/pieces-framework';
+import { mysqlCommon, mysqlConnect, sanitizeColumnName } from '../common';
import { mysqlAuth } from '../..';
import { deleteRowOutputSchema } from '../output-schemas';
-import sqlstring from 'sqlstring';
export default createAction({
auth: mysqlAuth,
@@ -13,18 +12,36 @@ export default createAction({
outputSchema: deleteRowOutputSchema,
aiMetadata: { description: 'Deletes every row in a MySQL table whose search column equals a given value. Use to remove records matched by a single column. Idempotent: once the matching rows are gone, re-running with the same input deletes nothing further.', idempotent: true },
props: {
- markdown: warningMarkdown,
+ markdown: Property.MarkDown({
+ value: 'Every matching row is deleted, and this cannot be undone.',
+ variant: MarkdownVariant.WARNING,
+ }),
timezone: mysqlCommon.timezone,
table: mysqlCommon.table(),
search_column: Property.ShortText({
displayName: 'Search Column',
+ description: 'The column to match rows on.',
+ placeholder: 'id',
required: true,
+ width: 'half',
}),
search_value: Property.ShortText({
displayName: 'Search Value',
+ description: 'The value that column must equal.',
+ placeholder: '42',
required: true,
+ width: 'half',
}),
},
+ propertyGroups: [
+ {
+ key: 'match',
+ display: 'section',
+ label: 'Rows to delete',
+ icon: 'trash',
+ props: ['markdown', 'table', 'search_column', 'search_value'],
+ },
+ ],
async run(context) {
const tableName = sanitizeColumnName(context.propsValue.table);
const searchColumn = sanitizeColumnName(context.propsValue.search_column);
diff --git a/packages/pieces/community/mysql/src/lib/actions/execute-query.ts b/packages/pieces/community/mysql/src/lib/actions/execute-query.ts
index b5758036b97..179c7b19a18 100644
--- a/packages/pieces/community/mysql/src/lib/actions/execute-query.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/execute-query.ts
@@ -5,21 +5,31 @@ import { mysqlAuth } from '../..';
export default createAction({
auth: mysqlAuth,
name: 'execute_query',
- displayName: 'Execute Query',
- description: 'Executes a query on the mysql database and returns the results',
+ displayName: 'Run Query',
+ description: 'Runs a SQL statement on the database and returns its results',
audience: 'both',
aiMetadata: { description: 'Runs an arbitrary SQL statement against the MySQL database and returns its results. Use as the escape hatch when the dedicated find/insert/update/delete actions cannot express the operation (joins, DDL, multi-table writes, aggregates). Pass dynamic values through the args array as ? placeholders to avoid SQL injection. Not idempotent in general: the effect and repeat-safety depend entirely on the SQL you supply (a SELECT is safe to repeat, an INSERT or UPDATE may not be).', idempotent: false },
+ propertyGroups: [
+ {
+ key: 'sql',
+ display: 'section',
+ label: 'SQL statement',
+ icon: 'code',
+ props: ['markdown', 'query', 'args'],
+ },
+ ],
props: {
markdown: warningMarkdown,
timezone: mysqlCommon.timezone,
query: Property.ShortText({
displayName: 'Query',
- description: 'The query string to execute, use ? for arguments to avoid SQL injection.',
+ description: 'The SQL to run. Write ? where each value goes.',
+ placeholder: 'SELECT * FROM orders WHERE id = ?',
required: true,
}),
args: Property.Array({
displayName: 'Arguments',
- description: 'Arguments to use in the query, if any. Should be in the same order as the ? in the query string..',
+ description: 'Values for each ? in the query, in order.',
required: false,
}),
},
diff --git a/packages/pieces/community/mysql/src/lib/actions/find-rows.ts b/packages/pieces/community/mysql/src/lib/actions/find-rows.ts
index 1a4bf363f38..e1152f79061 100644
--- a/packages/pieces/community/mysql/src/lib/actions/find-rows.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/find-rows.ts
@@ -11,31 +11,48 @@ export default createAction({
audience: 'both',
outputSchema: findRowsOutputSchema,
aiMetadata: { description: 'Reads rows from a MySQL table that match a SQL WHERE condition, optionally limited to specific columns. Use to look up or filter records by arbitrary criteria. The condition is required and is interpolated raw into the query, so pass dynamic values through the args array (referenced as ? placeholders) to avoid SQL injection. Read-only and idempotent.', idempotent: true },
+ propertyGroups: [
+ {
+ key: 'rows',
+ display: 'section',
+ label: 'Rows to find',
+ icon: 'filter',
+ props: ['markdown', 'table', 'condition', 'args'],
+ },
+ {
+ key: 'result',
+ display: 'section',
+ label: 'What to return',
+ icon: 'sliders',
+ props: ['columns'],
+ },
+ ],
props: {
markdown: warningMarkdown,
timezone: mysqlCommon.timezone,
table: mysqlCommon.table(),
condition: Property.ShortText({
displayName: 'Condition',
- description: 'SQL condition, can also include logic operators, etc.',
+ description: 'The SQL after WHERE. Write ? where each value goes.',
+ placeholder: 'status = ? AND age > ?',
required: true,
}),
args: Property.Array({
displayName: 'Arguments',
- description: 'Arguments can be used using ? in the condition',
+ description: 'Values for each ? in the condition, in order.',
required: false,
}),
columns: Property.Array({
displayName: 'Columns',
- description: 'Specify the columns you want to select',
+ description: 'Leave empty to return every column.',
required: false,
}),
},
async run(context) {
- const columns = (context.propsValue.columns as string[]) || ['*'];
- const qsColumns = columns
- .map((c) => sanitizeColumnName(c))
- .join(',');
+ const columns = context.propsValue.columns ?? [];
+ const qsColumns = columns.length === 0
+ ? '*'
+ : columns.map((column) => sanitizeColumnName(String(column))).join(',');
const qs = `SELECT ${qsColumns} FROM ${sanitizeColumnName(context.propsValue.table)} WHERE ${context.propsValue.condition};`;
diff --git a/packages/pieces/community/mysql/src/lib/actions/insert-row.ts b/packages/pieces/community/mysql/src/lib/actions/insert-row.ts
index b2b472ad58d..14842d48410 100644
--- a/packages/pieces/community/mysql/src/lib/actions/insert-row.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/insert-row.ts
@@ -1,8 +1,7 @@
import { createAction, Property } from '@activepieces/pieces-framework';
-import { mysqlCommon, mysqlConnect, sanitizeColumnName, warningMarkdown } from '../common';
+import { mysqlCommon, mysqlConnect, sanitizeColumnName } from '../common';
import { mysqlAuth } from '../..';
import { insertRowOutputSchema } from '../output-schemas';
-import sqlstring from 'sqlstring';
export default createAction({
auth: mysqlAuth,
@@ -17,9 +16,19 @@ export default createAction({
table: mysqlCommon.table(),
values: Property.Object({
displayName: 'Values',
+ description: 'Column names and the values to store in them.',
required: true,
}),
},
+ propertyGroups: [
+ {
+ key: 'row',
+ display: 'section',
+ label: 'Row to insert',
+ icon: 'inbox',
+ props: ['table', 'values'],
+ },
+ ],
async run(context) {
const fields = Object.keys(context.propsValue.values);
const qsFields = fields.map((f) => sanitizeColumnName(f)).join(',');
diff --git a/packages/pieces/community/mysql/src/lib/actions/insert-rows.ts b/packages/pieces/community/mysql/src/lib/actions/insert-rows.ts
index 65d52dae96a..ebf5d822747 100644
--- a/packages/pieces/community/mysql/src/lib/actions/insert-rows.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/insert-rows.ts
@@ -58,8 +58,18 @@ export const insertRows = createAction({
description: 'Insert empty fields as empty strings instead of the column default.',
required: false,
defaultValue: false,
+ advanced: true,
}),
},
+ propertyGroups: [
+ {
+ key: 'rows',
+ display: 'section',
+ label: 'Data to insert',
+ icon: 'inbox',
+ props: ['table', 'batch'],
+ },
+ ],
async run(context) {
const { table, batch, keep_empty_strings } = context.propsValue;
const records = insertRowsUtils.toRecords({ rows: batch?.['rows'], keepEmptyStrings: keep_empty_strings === true });
diff --git a/packages/pieces/community/mysql/src/lib/actions/update-row.ts b/packages/pieces/community/mysql/src/lib/actions/update-row.ts
index 6d4fc4b30b4..881bef0078d 100644
--- a/packages/pieces/community/mysql/src/lib/actions/update-row.ts
+++ b/packages/pieces/community/mysql/src/lib/actions/update-row.ts
@@ -1,4 +1,4 @@
-import { createAction, Property } from '@activepieces/pieces-framework';
+import { createAction, MarkdownVariant, Property } from '@activepieces/pieces-framework';
import { mysqlCommon, mysqlConnect, sanitizeColumnName } from '../common';
import { mysqlAuth } from '../..';
import { updateRowOutputSchema } from '../output-schemas';
@@ -14,21 +14,51 @@ export default createAction({
props: {
timezone: mysqlCommon.timezone,
table: mysqlCommon.table(),
- values: Property.Object({
- displayName: 'Values',
- required: true,
- }),
search_column: Property.ShortText({
displayName: 'Search Column',
+ description: 'The column to match rows on.',
+ placeholder: 'id',
required: true,
+ width: 'half',
}),
search_value: Property.ShortText({
displayName: 'Search Value',
+ description: 'The value that column must equal.',
+ placeholder: '42',
+ required: true,
+ width: 'half',
+ }),
+ changes_info: Property.MarkDown({
+ value: 'Columns you leave out keep their current value.',
+ variant: MarkdownVariant.INFO,
+ }),
+ values: Property.Object({
+ displayName: 'Values',
+ description: 'Columns to change and their new values.',
required: true,
}),
},
+ propertyGroups: [
+ {
+ key: 'match',
+ display: 'section',
+ label: 'Rows to update',
+ icon: 'filter',
+ props: ['table', 'search_column', 'search_value'],
+ },
+ {
+ key: 'changes',
+ display: 'section',
+ label: 'Changes',
+ icon: 'text',
+ props: ['changes_info', 'values'],
+ },
+ ],
async run(context) {
const fields = Object.keys(context.propsValue.values);
+ if (fields.length === 0) {
+ throw new Error('Values must contain at least one column.');
+ }
const qsValues = fields.map((f) => sanitizeColumnName(f) + '=?').join(',');
const qs = `UPDATE ${sanitizeColumnName(context.propsValue.table)} SET ${qsValues} WHERE ${sanitizeColumnName(context.propsValue.search_column)}=?;`;
const conn = await mysqlConnect(context.auth, context.propsValue);
diff --git a/packages/pieces/community/mysql/src/lib/common/index.ts b/packages/pieces/community/mysql/src/lib/common/index.ts
index 42e0259d584..a11ade023da 100644
--- a/packages/pieces/community/mysql/src/lib/common/index.ts
+++ b/packages/pieces/community/mysql/src/lib/common/index.ts
@@ -1,23 +1,21 @@
import {
AppConnectionValueForAuthProperty,
- PiecePropValueSchema,
+ MarkdownVariant,
Property,
- StaticPropsValue,
+ tryCatch,
} from '@activepieces/pieces-framework';
import { Connection, createConnection } from 'promise-mysql';
import { mysqlAuth } from '../..';
import sqlstring from 'sqlstring';
export const warningMarkdown = Property.MarkDown({
- value: `
- **DO NOT** use dynamic input directly in the query string or column names.
- \n
- Use **?** in the query and dynamic values in args/values for parameterized queries to prevent **SQL injection**.`
+ value: 'Never type dynamic values into the SQL. Write ? instead and put the values in Arguments to prevent SQL injection.',
+ variant: MarkdownVariant.WARNING,
});
export async function mysqlConnect(
auth: AppConnectionValueForAuthProperty<typeof mysqlAuth>,
- propsValue: StaticPropsValue<any>
+ propsValue: MysqlConnectOptions
): Promise<Connection> {
const conn = await createConnection({
host: auth.props.host,
@@ -52,8 +50,10 @@ export async function mysqlGetColumns({ conn, table }: { conn: Connection; table
export const mysqlCommon = {
timezone: Property.ShortText({
displayName: 'Timezone',
- description: 'Timezone for the MySQL server to use',
+ description: 'Timezone of dates on the server: Z for UTC, or an offset like +02:00.',
+ placeholder: '+02:00',
required: false,
+ advanced: true,
}),
table: (required = true) =>
Property.Dropdown({
@@ -69,12 +69,21 @@ export const mysqlCommon = {
options: [],
};
}
- const conn = await mysqlConnect(
- auth,
- { auth }
- );
- const tables = await mysqlGetTableNames(conn);
- await conn.end();
+ const { data: tables, error } = await tryCatch(() => listTableNames({ auth }));
+ if (error) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: 'Could not load tables. Check the connection and its Database.',
+ };
+ }
+ if (tables.length === 0) {
+ return {
+ disabled: false,
+ options: [],
+ placeholder: 'No tables found in this database.',
+ };
+ }
return {
disabled: false,
options: tables.map((table) => {
@@ -96,6 +105,19 @@ export function sanitizeColumnName(name: string | undefined): string {
return sqlstring.escapeId(name);
}
+async function listTableNames({ auth }: { auth: AppConnectionValueForAuthProperty<typeof mysqlAuth> }): Promise<string[]> {
+ const conn = await mysqlConnect(auth, {});
+ try {
+ return await mysqlGetTableNames(conn);
+ } finally {
+ await conn.end();
+ }
+}
+
+export type MysqlConnectOptions = {
+ timezone?: string;
+};
+
export type MysqlColumn = {
column_name: string;
data_type: string;