Execute and manage SQL queries, inspect schemas, export data, create migrations, and backup databases for SQLite, PostgreSQL, MySQL, and SQLAlchemy-compatibl...
Query, inspect, export, and manage databases via conversation. Supports SQLite (no setup) and PostgreSQL/MySQL (with connection string).
bash
# 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"
bash
python3 skills/sql-db-toolkit/scripts/db_query.py --db my.db --sql "SELECT id, name, email FROM users WHERE active = 1" --format table
bash
python3 skills/sql-db-toolkit/scripts/db_schema.py --db my.db
bash
python3 skills/sql-db-toolkit/scripts/db_export.py --db my.db --sql "SELECT * FROM orders" --output orders.csv
bash
python3 skills/sql-db-toolkit/scripts/db_backup.py --db my.db --output backup/
ScriptPurposedb_query.pyExecute SQL queries with formatted output (table/JSON/CSV)db_schema.pyInspect tables, columns, indexes, FKs, triggersdb_export.pyExport query results to CSV, JSON, or SQL dumpdb_backup.pyBackup SQLite DB or dump PostgreSQL/MySQLdb_migrate.pyCompare schemas, generate migration SQL
python
# 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