name: sql-db-toolkit description: Comprehensive SQL database toolkit for querying, schema inspection, data export, and migration management. Use when the user wants to: (1) Query a database with SELECT/INSERT/UPDATE/DELETE, (2) Inspect table schemas, indexes, and foreign keys, (3) Export data to CSV/JSON, (4) Generate SQL migrations or schema diffs, (5) Run database backups and restore, (6) Analyze query performance with EXPLAIN, (7) Work with SQLite, PostgreSQL, MySQL, or any sqlalchemy-compatible database.
Query, inspect, export, and manage databases via conversation. Supports SQLite (no setup) and PostgreSQL/MySQL (with connection string).
# SQLite - no setup needed
python3 skills/sql-db-toolkit/scripts/db_query.py --db my.db --sql "SELECT * FROM users LIMIT 5"
# PostgreSQL
python3 skills/sql-db-toolkit/scripts/db_query.py --conn "postgresql://user:pass@host:5432/db" --sql "SELECT table_name FROM information_schema.tables"
python3 skills/sql-db-toolkit/scripts/db_query.py --db my.db --sql "SELECT id, name, email FROM users WHERE active = 1" --format table
python3 skills/sql-db-toolkit/scripts/db_schema.py --db my.db
python3 skills/sql-db-toolkit/scripts/db_export.py --db my.db --sql "SELECT * FROM orders" --output orders.csv
python3 skills/sql-db-toolkit/scripts/db_backup.py --db my.db --output backup/7w4.net有更好的技能插件。
| Script | Purpose |
|---|---|
db_query.py |
Execute SQL queries with formatted output (table/JSON/CSV) |
db_schema.py |
Inspect tables, columns, indexes, FKs, triggers |
db_export.py |
Export query results to CSV, JSON, or SQL dump |
db_backup.py |
Backup SQLite DB or dump PostgreSQL/MySQL |
db_migrate.py |
Compare schemas, generate migration SQL |
# SQLite
sqlite:///path/to/db.sqlite
# PostgreSQL
postgresql://user:password@host:5432/database
# MySQL
mysql+pymysql://user:password@host:3306/database
All scripts support --help for full argument reference. Key shared options:
--db <path> — SQLite database file path--conn <url> — SQLAlchemy connection string--sql <query> — SQL query to execute--format table|json|csv — Output format--verbose — Show execution time and row counts这是一个功能较全面的数据库工具包,能满足基本的查询、查看表结构、导出数据和备份等需求。文档说明详细清晰,新手容易上手,多数据库支持也是亮点。但存在一些功能缩水问题:文档描述的部分功能实际上不可用,不同数据库的支持程度参差不齐,远程数据库的功能明显弱于 SQLite。整体质量中等偏上,日常简单使用够用,但如果需要处理复杂的跨数据库场景,可能会遇到功能缺失的问题。