Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe read-only queries. Triggered by requests to explore a database, view table structures, describe tables, generate diagrams, or query data, and by keywords like database exploration, schema, ER diagram, or SQL query.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-22 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -12% | 0% |
Read-only exploration tool for SQLite / PostgreSQL databases — inspect table schemas, preview data, generate ER diagrams, and run safe queries.
| Feature | Description | |---------|-------------| | List all tables | Show tables and views in the database, with row counts | | Inspect table schema | Column names, types, constraints (PK/FK/NOT NULL), indexes, defaults | | Data preview | View the first N rows of a table | | ER diagram generation | Output Mermaid erDiagram syntax, ready to render | | Safe read-only queries | Only SELECT/WITH/EXPLAIN allowed; write operations are blocked |
?mode=ro URI; PostgreSQL uses SET SESSION READ ONLYbash# List all tables in a SQLite database python3 scripts/db_explorer.py --db-path data.db list-tables # Inspect table schema python3 scripts/db_explorer.py --db-path data.db describe users # Preview data (default 20 rows) python3 scripts/db_explorer.py --db-path data.db preview orders --limit 10 # Generate Mermaid ER diagram python3 scripts/db_explorer.py --db-path data.db er-diagram # Run a read-only query python3 scripts/db_explorer.py --db-path data.db query "SELECT name, age FROM users WHERE age > 18 LIMIT 10"
bash# Connect to PostgreSQL python3 scripts/db_explorer.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" list-tables # Inspect table schema python3 scripts/db_explorer.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" describe orders
| Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | --db-type | No | sqlite | Database type: sqlite or postgres | | --db-path | Yes (for SQLite) | — | Path to the SQLite database file | | --dsn | Yes (for PostgreSQL) | — | PostgreSQL connection string |
| Command | Description | Example | |---------|-------------|---------| | list-tables | List all tables/views | list-tables | | describe <table> | Show detailed table schema | describe users | | preview <table> [--limit N / -n N] | Preview the first N rows | preview orders --limit 5 | | er-diagram | Generate Mermaid ER diagram | er-diagram | | query "<sql>" | Run a read-only SQL query | query "SELECT count(*) FROM users" |
json[ {"name": "users", "type": "table", "row_count": 1500}, {"name": "orders", "type": "table", "row_count": 8200}, {"name": "user_stats", "type": "view", "row_count": 1500} ]
json{ "table": "orders", "row_count": 8200, "columns": [ {"cid": 0, "name": "id", "type": "INTEGER", "notnull": true, "default": null, "primary_key": true}, {"cid": 1, "name": "user_id", "type": "INTEGER", "notnull": true, "default": null, "primary_key": false}, {"cid": 2, "name": "amount", "type": "REAL", "notnull": false, "default": "0.0", "primary_key": false} ], "foreign_keys": [ {"from": "user_id", "to_table": "users", "to_column": "id"} ], "indexes": [ {"name": "idx_orders_user_id", "unique": false, "columns": ["user_id"]} ] }
mermaiderDiagram users { INTEGER id PK TEXT name TEXT email INTEGER age } orders { INTEGER id PK INTEGER user_id FK REAL amount TEXT created_at } users ||--o{ orders : "user_id"
sqlite3 is a built-in module)pip install psycopg2-binaryOther measured skills in the registry, with their headline benchmark lift.