{"_id":"@agentxin-ai/plugin-mysql","_rev":"4-87387d00b9235740f8892b862db20e88","name":"@agentxin-ai/plugin-mysql","dist-tags":{"latest":"0.0.10"},"versions":{"0.0.7":{"name":"@agentxin-ai/plugin-mysql","version":"0.0.7","license":"AGPL-3.0","_id":"@agentxin-ai/plugin-mysql@0.0.7","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"dist":{"shasum":"a4c662829235faf3078240f72f7945fd6273f30a","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-mysql/-/plugin-mysql-0.0.7.tgz","fileCount":2,"integrity":"sha512-pZrHh/1Zk+MoLR+sEFBBGyR+jrdjkcsIjCqtBuTA29qp0nnPyJj2AsS/CdlooiU1UQ/rqw6nEgdr8BGHUAVdxQ==","signatures":[{"sig":"MEUCIDnvUqyRM5eV8yTpBtjTi1M+6/Q++fd4gxNqkrVL0dY+AiEA73/qjcPlB/LkVjod8UqyXZpNLyCHgPVGFnchmMbaWDQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7348},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","@agentxin-plugins-starter/source":"./src/index.ts"},"./package.json":"./package.json"},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"repository":{"url":"git+https://github.com/agentxin-ai/agentxin-plugins.git","type":"git"},"_npmVersion":"10.9.4","description":"`@agentxin-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, A","directories":{},"_nodeVersion":"22.22.0","dependencies":{"mysql":"^2.18.1","tslib":"^2.3.0","mysql2":"^3.15.3"},"_hasShrinkwrap":false,"devDependencies":{"@types/mysql":"^2.15.27"},"peerDependencies":{"zod":"3.25.67","axios":"1.12.2","chalk":"4.1.2","lodash-es":"4.17.21","@nestjs/common":"^11.1.6","@agentxin-ai/plugin-sdk":"^3.6.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-mysql_0.0.7_1773917061371_0.041471641966637884","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@agentxin-ai/plugin-mysql","version":"0.0.8","license":"AGPL-3.0","_id":"@agentxin-ai/plugin-mysql@0.0.8","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"dist":{"shasum":"962c728302ef8af9112352b1b84944bd6dbaee3a","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-mysql/-/plugin-mysql-0.0.8.tgz","fileCount":26,"integrity":"sha512-po8QeHpwMQvMGNq8s2tPSgAufueNJrH6G0WJsuio/6ffNmJpuP9FbMK0Zy1XNSe8t1s9mY5lEn6zpCK/PKxxYQ==","signatures":[{"sig":"MEUCIQCIzBoic6nT0Tisyqsywh/Z2o6YKtixX+uId7PzgiCuTwIgc5sFdmlO8hlfnHLjH32Mn9jNJZbfWoFHzjwNoHH2SIU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85646},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","@xpert-plugins-starter/source":"./src/index.ts"},"./package.json":"./package.json"},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"repository":{"url":"git+https://github.com/agentxin-ai/agentxin-plugins.git","type":"git"},"_npmVersion":"10.9.4","description":"`@xpert-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [Xpert AI](https://github.com/xpert-ai/xpert) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, Amazon RDS, A","directories":{},"_nodeVersion":"22.22.0","dependencies":{"mysql":"^2.18.1","tslib":"^2.3.0","mysql2":"^3.15.3"},"_hasShrinkwrap":false,"devDependencies":{"@types/mysql":"^2.15.27"},"peerDependencies":{"zod":"3.25.67","axios":"1.12.2","chalk":"4.1.2","lodash-es":"4.17.21","@nestjs/common":"^11.1.6","@xpert-ai/plugin-sdk":"^3.6.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-mysql_0.0.8_1774329912493_0.8334177322332255","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"@agentxin-ai/plugin-mysql","version":"0.0.9","license":"AGPL-3.0","_id":"@agentxin-ai/plugin-mysql@0.0.9","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"dist":{"shasum":"955222cf66bf41ef15da03aaefd1e2b42d6a3256","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-mysql/-/plugin-mysql-0.0.9.tgz","fileCount":26,"integrity":"sha512-T1OFlYApGEJl3JXR1mPNgrE6J6tpfDQm3HqMbx+4hy+4vmxrBa3xS8wPUTl4EYetWlE2s7UoLLWdXWZNwfaXvw==","signatures":[{"sig":"MEUCIQD/xudOUgiEWiiGjvQLOBALDKmecv0UXQL+yRbO3CQA2wIgf8ecnKf7/qXcJrd1Gsf+1t+ITosNDXkoWilUbevzLho=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85757},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","@agentxin-plugins-starter/source":"./src/index.ts"},"./package.json":"./package.json"},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"repository":{"url":"git+https://github.com/agentxin-ai/agentxin-plugins.git","type":"git"},"_npmVersion":"10.9.4","description":"`@agentxin-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, A","directories":{},"_nodeVersion":"22.22.0","dependencies":{"mysql":"^2.18.1","tslib":"^2.3.0","mysql2":"^3.15.3"},"_hasShrinkwrap":false,"devDependencies":{"@types/mysql":"^2.15.27"},"peerDependencies":{"zod":"3.25.67","axios":"1.12.2","chalk":"4.1.2","lodash-es":"4.17.21","@nestjs/common":"^11.1.6","@agentxin-ai/plugin-sdk":"^3.6.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-mysql_0.0.9_1774575504367_0.09038707293859316","host":"s3://npm-registry-packages-npm-production"}},"0.0.10":{"name":"@agentxin-ai/plugin-mysql","version":"0.0.10","license":"AGPL-3.0","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"@agentxin-plugins-starter/source":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{"mysql":"^2.18.1","mysql2":"^3.15.3","tslib":"^2.3.0"},"peerDependencies":{"zod":"3.25.67","@agentxin-ai/plugin-sdk":"^3.6.2","@nestjs/common":"^11.1.6","axios":"1.12.2","lodash-es":"4.17.21","chalk":"4.1.2"},"devDependencies":{"@types/mysql":"^2.15.27"},"_id":"@agentxin-ai/plugin-mysql@0.0.10","description":"`@agentxin-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, A","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-ApH8ATz2F7NyNGEAyJZkg29ncNS0MVp6EwtdNqgrMdVD4vX3Fb8ZBJXA0MyY4We0BI7b3Vnbd7Bu0zwwzacWBA==","shasum":"5915c5383878446bc2527dfa911a9051b80fcf03","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-mysql/-/plugin-mysql-0.0.10.tgz","fileCount":26,"unpackedSize":85758,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDeWf8b7Hsx9QBbsNxe8XwZnrgIq0BsGyBgAszxwB7O/AiA4i0ahWf34l3/AYe8Ko3cGBbOgVaBxWGeg8cVWuJ5emA=="}]},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"directories":{},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-mysql_0.0.10_1775182026784_0.9785878078124304"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T10:44:21.245Z","modified":"2026-04-03T02:07:07.079Z","0.0.7":"2026-03-19T10:44:21.523Z","0.0.8":"2026-03-24T05:25:12.654Z","0.0.9":"2026-03-27T01:38:24.506Z","0.0.10":"2026-04-03T02:07:06.947Z"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"license":"AGPL-3.0","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"description":"`@agentxin-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, A","maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"readme":"# AgentXin Plugin: MySQL Data Source\n\n`@agentxin-ai/plugin-mysql` brings MySQL-compatible database connectivity to the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack. The plugin registers a global NestJS module that exposes actionable strategies for native MySQL, Amazon RDS, Apache Doris, and StarRocks engines, enabling AgentXin workflows to run SQL queries, explore schemas, and ingest datasets without custom glue code.\n\n## Key Features\n\n- Ships four data-source strategies (`mysql`, `rds_mysql`, `doris`, `starrocks`) that plug directly into the AgentXin data analysis runtime.\n- Wraps `mysql2`/`mysql` drivers with a shared query runner that handles catalog discovery, table introspection, `DESCRIBE` previews, and JDBC metadata.\n- Provides managed ingestion helpers that create tables, load batches, or execute stream-load pipelines for OLAP engines.\n- Supports SSL credentials, timezone overrides, and query timeouts to match enterprise deployments.\n- Exposes lifecycle hooks (`register`, `onStart`, `onStop`) and structured logging for observability.\n\n## Installation\n\n```bash\npnpm add @agentxin-ai/plugin-mysql\n# or\nnpm install @agentxin-ai/plugin-mysql\n```\n\n> **Note**: This plugin lists `@agentxin-ai/plugin-sdk`, `@nestjs/common@^11`, `axios@1`, `chalk@4`, `lodash-es@4`, and `zod@3.25.67` as peer dependencies. Ensure they are already available in your host service.\n\n## Quick Start\n\n1. **Register the Plugin**  \n   Include the package in the `PLUGINS` environment variable (or equivalent registration hook) when starting AgentXin:\n\n   ```sh\n   PLUGINS=@agentxin-ai/plugin-mysql\n   ```\n\n   The plugin returns the `MySQLPlugin` NestJS module during registration.\n2. **Collect Credentials**  \n   Prepare the connection details for the target engine (host, port, username, password, optional SSL bundle, and default database/catalog).\n\n3. **Configure in AgentXin**  \n   Define a data source integration via the AgentXin AI platform. Example JSON payload:\n\n   ```json\n   {\n     \"type\": \"mysql\",\n     \"options\": {\n       \"host\": \"db.internal\",\n       \"port\": 3306,\n       \"username\": \"analytics\",\n       \"password\": \"******\",\n       \"catalog\": \"sales\",\n       \"use_ssl\": false\n     }\n   }\n   ```\n\n   Swap `\"type\"` for `rds_mysql`, `doris`, or `starrocks` to target other engines.\n\n## Data Source Types\n\n| Type        | Strategy Class                 | Description                               |\n| ----------- | ------------------------------ | ----------------------------------------- |\n| `mysql`     | `MySQLDataSourceStrategy`      | Standard MySQL and compatible community builds. |\n| `rds_mysql` | `RDSMySQLDataSourceStrategy`   | Amazon RDS for MySQL with tailored naming. |\n| `doris`     | `DorisDataSourceStrategy`      | Apache Doris (via MySQL protocol and HTTP stream load). |\n| `starrocks` | `StarRocksDataSourceStrategy`  | StarRocks OLAP engine with Doris-derived runner. |\n\n## Configuration\n\n### Shared Connection Options\n\n| Field            | Type      | Description                                                  | Required | Default          |\n| ---------------- | --------- | ------------------------------------------------------------ | -------- | ---------------- |\n| `host`           | string    | Database endpoint hostname or IP.                            | Yes      | —                |\n| `port`           | number    | TCP port for the MySQL-compatible service.                   | No       | `3306` (MySQL)   |\n| `username`       | string    | Login username.                                              | Yes      | —                |\n| `password`       | string    | Login password (handled as a secret value).                  | Yes      | —                |\n| `catalog`        | string    | Default database/catalog name used when none is provided.    | No       | —                |\n| `timezone`       | string    | Client session timezone sent to the driver.                  | No       | `+08:00`         |\n| `serverTimezone` | string    | Server timezone used to build JDBC URLs.                     | No       | `Asia/Shanghai`  |\n| `queryTimeout`   | number    | Per-query timeout in milliseconds.                           | No       | `3600000` (1h)   |\n| `use_ssl`        | boolean   | Enables SSL/TLS connections.                                 | No       | `false`          |\n| `ssl_cacert`     | textarea  | Certificate authority bundle (required when `use_ssl` is on).| Cond.    | —                |\n| `ssl_cert`       | textarea  | Client certificate (if mutual TLS is needed).                | No       | —                |\n| `ssl_key`        | textarea  | Client private key.                                          | No       | —                |\n\n### Doris & StarRocks Options\n\n| Field      | Type   | Description                                               | Default |\n| ---------- | ------ | --------------------------------------------------------- | ------- |\n| `apiHost`  | string | REST API endpoint for stream-load operations.             | `host`  |\n| `apiPort`  | number | HTTP port for stream-load requests.                       | `8030`  |\n| `version`  | number | StarRocks version hint (affects CSV header handling).     | `0`     |\n\n`DorisDataSourceStrategy` and `StarRocksDataSourceStrategy` extend the base runner with HTTP stream-load support so large CSV/JSON files can be imported efficiently.\n\n## Schema & Import Utilities\n\n- `getCatalogs()` lists user databases while filtering system schemas.\n- `getSchema(catalog, table)` returns table metadata with column types normalized for AgentXin.\n- `describe(catalog, statement)` executes a guarded preview (`LIMIT 1`) to infer result columns.\n- `import()` can recreate tables, batch insert data, or trigger stream-load pipelines depending on engine capabilities.\n- `jdbcUrl()` exposes prebuilt JDBC connection strings when downstream integrations require them.\n\n## Development & Testing\n\n```bash\nnpm install\nnpx nx build @agentxin-ai/plugin-mysql\nnpx nx test @agentxin-ai/plugin-mysql\n```\n\nTypeScript build artifacts are emitted to `packages/mysql/dist`. Run tests against a staging database before publishing new versions.\n\n## License\n\nThis project follows the [AGPL-3.0 License](../../../LICENSE) located at the repository root.\n","readmeFilename":"README.md"}