by aliyundms · v0.0.8
Powerful plugins developed by AliyunDMS, makes it easy for users to set up Data+AI workflows.
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Author: aliyundms
Version: 0.0.8
Type: Tool Provider Plugin for Dify
AliyunDMS Plugin is a powerful Dify plugin developed by Alibaba Cloud Data Mangement Service that makes it easy for users to set up Data+AI workflows. This plugin provides comprehensive database management and natural language processing capabilities, enabling users to interact with databases using natural language queries and execute SQL operations securely.
NL2SQL (Natural Language to SQL)
SQL Executor
Advanced SQL Executor
Get MSchema
Data Visualizer
Data2SQL
LLM Reranker
mysql+pymysql:// connection stringspostgresql+psycopg2:// connection stringsmssql+pymssql:// connection stringsoracle+oracledb:// connection stringsclickhouse+native:// connection stringsmongodb:// connection stringsInstall dependencies:
pip install -r requirements.txt
Configure the plugin:
Deploy to Dify:
dify-plugin plugin package ./
Convert natural language questions to SQL queries:
# Example parameters
query: "Show me all users who registered in the last 30 days"
dms_db_info: '{"dialect": "mysql", "database": "users_db"}'
model: "dms-ai/xiyan-sql-32b"
level: "base"
Execute SQL queries safely:
# Example parameters
sql: "SELECT * FROM users WHERE created_at > '2024-01-01'"
db_connection_url: "mysql+pymysql://user:pass@host:3306/database"
output_format: "markdown"
block_risky_sql: true
max_limit_rows: 100
decimal_precision: 3 # Number of decimal places (0-15), only affects Markdown output
Decimal Precision Control:
The plugin automatically detects and blocks potentially dangerous SQL operations including:
CREATE, DROP, DELETE, TRUNCATEALTER, UPDATE, INSERT, GRANTCreate a .env file based on .env.example:
# For local debugging
INSTALL_METHOD=remote
REMOTE_INSTALL_HOST=https://debug.dify.ai
REMOTE_INSTALL_PORT=5003
REMOTE_INSTALL_KEY=your_debug_key
Configure tools in provider/aliyundms.yaml:
aliyundms/
├── main.py # Plugin entry point
├── manifest.yaml # Plugin manifest
├── provider/
│ ├── aliyundms.yaml # Provider configuration
│ └── aliyundms.py # Provider implementation
├── tools/ # Tool implementations
│ ├── nl2sql.py # Natural language to SQL
│ ├── sql_executor.py # SQL execution engine
│ ├── data_visualizer.py # Data visualization
│ └── ...
├── scripts/ # Utility scripts
├── tests/ # Test files
└── requirements.txt # Python dependencies
dify_plugin==0.4.1 - Dify plugin frameworkpandas~=2.2.3 - Data manipulationsqlalchemy~=2.0.41 - Database ORMsqlglot~=26.11.1 - SQL parsing and transformationalibabacloud_dms_enterprise20181101 - AliyunDMS SDKRun tests using:
python -m pytest tests/
dify-plugin plugin package ./
This creates a plugin.difypkg file ready for deployment to Dify.
PRIVACY.mdFor support and documentation:
Please refer to PRIVACY.md for the plugin's privacy policy.
This plugin is developed and maintained by AliyunDMS. Please refer to the terms of service and licensing agreements for usage rights and restrictions.
Note: This plugin requires a Dify platform instance to function properly. Basic features work without API keys, while enterprise features require DMS API Key authentication.