plugin-mysql (1.0.0)
Installation
registry=npm install plugin-mysql@1.0.0"plugin-mysql": "1.0.0"About this package
MySQL
Query and manage MySQL/MariaDB databases (mysql2): ping, databases, tables, describe, read-only queries and guarded writes
- Package:
plugin-mysql - Author: Kai
- Version: 1.0.0
Credentials
| Key | Label | Type | Required | Default |
|---|---|---|---|---|
host |
Host | string | yes | – |
port |
Port | number | no | 3306 |
user |
User | string | yes | – |
password |
Password | secret | yes | – |
database |
Default database | string | no | – |
Settings
| Key | Label | Type | Required | Default |
|---|---|---|---|---|
timeoutMs |
Query timeout (ms) | number | no | 15000 |
connectTimeoutMs |
Connect timeout (ms) | number | no | 10000 |
maxRows |
Max rows per result | number | no | 200 |
allowDestructive |
Allow destructive tools (mysql_execute) | boolean | no | false |
Tools
| Tool | Description |
|---|---|
mysql_ping |
Connects to the MySQL/MariaDB server, authenticates and reports server details (server version, thread id, user, default database) |
mysql_list_databases |
Lists the databases on the server (SHOW DATABASES), optionally filtered by a LIKE pattern |
mysql_list_tables |
Lists the tables of a database (default: instance database), optionally filtered by a LIKE pattern |
mysql_describe_table |
Describes the columns of a table (name, type, nullable, key, default, extra) and optionally its row count (SELECT COUNT(*)) |
mysql_query |
Runs a read-only SQL statement (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH). Write statements are rejected - use mysql_execute. Returns up to maxRows rows as JSON-safe values (dates as ISO strings, bigints as strings, binary as base64:). Positional ? placeholders are supported via params |
mysql_execute |
Runs one write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, ...). Destructive: requires the instance setting allowDestructive and a confirm argument containing the affected table or database name (statements without a target object require 'execute'). Single statement only - multipleStatements is disabled |
Dependencies
Dependencies
| ID | Version |
|---|---|
| mysql2 | ^3.12.0 |
Details
Assets (1)
Versions (3)
View all
plugin-mysql-1.0.0.tgz
4.8 KiB