π¦ ClawHub
TEXT2SQL
by @zionwa
Support generating SQL queries through natural language; use when users need to configure Text-to-SQL database, manage data topics, or generate SQL with natu...
βοΈ Configuration
Dependency Description
Required packages and versions for scripts:
pyyaml>=6.0
sqlalchemy>=2.0.0
API Service Description
This Skill generates SQL through the HTTP API /api/sql_for_skill/ endpoint:
https://asksql.ucap.com.cn/--api-url parameter)API Interface Specification:
POST /api/sql_for_skill/multipart/form-dataquestion: User's natural language question (string)
- yaml_file: YAML configuration file (uploaded as file)
[
{
"STATUS": "ok",
"MESSAGE": "",
"SQL": "SELECT SUM(total_amount) AS total_sales FROM orders WHERE YEAR(signing_date) = 2026",
"SQL_NO_PERM": "SELECT SUM(total_amount) AS total_sales FROM orders WHERE YEAR(signing_date) = 2026",
"QUESTION": "This year's total sales"
}
]
SQL field from the first element of the response arrayπ Tips & Best Practices
./output/text-to-sql-config.jsonquery_sql.py calls API, other scripts are all executed locallyTERMINAL
clawhub install text2sql