{"id":"f8cafa00-404d-4a76-bd4e-5fe1e5a30a7c","entityType":"agent","slug":"clawhub-lrg913427-dot-db-explorer-hermes","name":"Db Explorer","canonicalUrl":"https://www.xpersona.co/agent/clawhub-lrg913427-dot-db-explorer-hermes","canonicalPath":"/agent/clawhub-lrg913427-dot-db-explorer-hermes","generatedAt":"2026-10-12T10:13:23.053Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":null},"description":"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab... Skill: Db Explorer Owner: lrg913427-dot Summary: Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab... Tags: latest:2.4.0 Version history: v2.4.0 | 2026-05-28T16:02:10.665Z | auto - Version bumped to 2.4.0. - Documentation (SKILL.md) updated and improved. - Removed redundant skill-card.md file. v2.1.0 | 2026-05-","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 973 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s175nn6ap9fe4ne23bws9svzm185ywrq:db-explorer-hermes","sourceUrl":"https://clawhub.ai/lrg913427-dot/db-explorer-hermes","homepage":"https://clawhub.ai/lrg913427-dot/skills/db-explorer-hermes","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/lrg913427-dot/db-explorer-hermes","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/lrg913427-dot/skills/db-explorer-hermes","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":null},"stars":null,"forks":null,"downloads":973,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"2.4.0","tractionLabel":"973 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:51:13.904Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T23:51:13.954Z","lastCrawledAt":"2026-10-11T23:51:13.904Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T23:51:13.904Z","lastVerifiedAt":null,"highlights":[{"version":"2.4.0","createdAt":"2026-05-28T16:02:10.665Z","changelog":"- Version bumped to 2.4.0. - Documentation (SKILL.md) updated and improved. - Removed redundant skill-card.md file.","fileCount":3,"zipByteSize":5224},{"version":"2.1.0","createdAt":"2026-05-19T10:02:56.104Z","changelog":"No changes detected in the code or documentation between versions 2.0.0 and 2.1.0. - Version number updated to 2.1.0; no other modifications found. - No new features, bug fixes, or content changes included in this release.","fileCount":3,"zipByteSize":5132},{"version":"2.0.0","createdAt":"2026-05-12T16:03:53.812Z","changelog":"db-explorer 2.0.0 introduces major improvements for multi-database exploration, best practices, and workflow guidance: - Expanded support: now handles PostgreSQL, MySQL, SQLite, MongoDB, and Redis. - Detailed quick-start and workflow documentation for connecting, querying, and exporting data. - Comprehensive safety rules for read-only queries, limiting results, write confirmation, and transaction protection. - Ready-to-use diagnostic and performance queries for fast database insight. - Clear export and backup instructions for common formats and all supported databases.","fileCount":2,"zipByteSize":3992}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s175nn6ap9fe4ne23bws9svzm185ywrq:db-explorer-hermes","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T10:13:23.053Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-lrg913427-dot-db-explorer-hermes/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":null},"readme":"Skill: Db Explorer\n\nOwner: lrg913427-dot\n\nSummary: Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab...\n\nTags: latest:2.4.0\n\nVersion history:\n\nv2.4.0 | 2026-05-28T16:02:10.665Z | auto\n\n- Version bumped to 2.4.0.\n- Documentation (SKILL.md) updated and improved.\n- Removed redundant skill-card.md file.\n\nv2.1.0 | 2026-05-19T10:02:56.104Z | auto\n\nNo changes detected in the code or documentation between versions 2.0.0 and 2.1.0.\n\n- Version number updated to 2.1.0; no other modifications found.\n- No new features, bug fixes, or content changes included in this release.\n\nv2.0.0 | 2026-05-12T16:03:53.812Z | auto\n\ndb-explorer 2.0.0 introduces major improvements for multi-database exploration, best practices, and workflow guidance:\n\n- Expanded support: now handles PostgreSQL, MySQL, SQLite, MongoDB, and Redis.\n- Detailed quick-start and workflow documentation for connecting, querying, and exporting data.\n- Comprehensive safety rules for read-only queries, limiting results, write confirmation, and transaction protection.\n- Ready-to-use diagnostic and performance queries for fast database insight.\n- Clear export and backup instructions for common formats and all supported databases.\n\nArchive index:\n\nArchive v2.4.0: 3 files, 5224 bytes\n\nFiles: skill-card.md (2269b), SKILL.md (9834b), _meta.json (137b)\n\nFile v2.4.0:SKILL.md\n\n---\nname: db-explorer\ndescription: \"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\"\nversion: 2.4.0\nauthor: lrg913427-dot\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [database, sql, postgresql, mysql, sqlite, mongodb, redis, query, schema, data]\n    related_skills: [jupyter-live-kernel, airtable]\n---\n\n# DB Explorer\n\nConnect to databases, run queries, explore schemas, and export data — all from the terminal.\n\n## When to Use\n\nActivate this skill when the user:\n- Says \"check the database\", \"query the DB\", \"show me the data\"\n- Wants to see table structure, row counts, or sample data\n- Needs to export data to CSV/JSON\n- Wants to find slow queries or check DB health\n- Mentions a database connection string or DB name\n\n## Supported Databases\n\n| Database   | CLI Tool     | Install (macOS)           | Install (Linux)                    |\n|-----------|-------------|---------------------------|-----------------------------------|\n| PostgreSQL | psql        | brew install postgresql    | apt install postgresql-client      |\n| MySQL      | mysql       | brew install mysql         | apt install mysql-client           |\n| SQLite     | sqlite3     | (built-in on macOS)       | apt install sqlite3                |\n| MongoDB    | mongosh     | brew install mongosh       | See mongodb.com/docs/shell         |\n| Redis      | redis-cli   | brew install redis         | apt install redis-tools            |\n\n## Quick Start\n\n### 1. Identify the Database\n\nAsk the user for:\n- Database type (postgres/mysql/sqlite/mongo/redis)\n- Connection string OR host/port/database/user/password\n- For SQLite: just the file path\n\n### 2. Connect and Explore\n\n```bash\n# PostgreSQL\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\dt\"           # list tables\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\d table_name\" # describe table\npsql \"postgresql://user:password@host:5432/dbname\" -c \"SELECT count(*) FROM table_name;\"\n\n# MySQL\nmysql -h host -u user -p dbname -e \"SHOW TABLES;\"\nmysql -h host -u user -p dbname -e \"DESCRIBE table_name;\"\nmysql -h host -u user -p dbname -e \"SELECT count(*) FROM table_name;\"\n\n# SQLite\nsqlite3 /path/to/db.db \".tables\"                    # list tables\nsqlite3 /path/to/db.db \".schema table_name\"         # describe table\nsqlite3 /path/to/db.db \"SELECT count(*) FROM table_name;\"\n\n# MongoDB\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.getCollectionNames()\"\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.collection_name.countDocuments()\"\n\n# Redis\nredis-cli -h host -p 6379 -a password INFO keyspace\nredis-cli -h host -p 6379 -a password DBSIZE\nredis-cli -h host -p 6379 -a password KEYS \"*\"\n```\n\n### 3. Safety Rules\n\n**ALWAYS follow these rules:**\n\n1. **Read-only by default** — Never run INSERT/UPDATE/DELETE/DROP without explicit user confirmation\n2. **Limit results** — Always add `LIMIT 100` (or equivalent) to SELECT queries unless user asks for all\n3. **Show before execute** — For any write operation, show the exact SQL/command and ask for confirmation\n4. **No passwords in history** — Use environment variables or connection strings, don't echo passwords\n5. **Transaction safety** — For writes, wrap in BEGIN/ROLLBACK first, show results, then ask to COMMIT\n\n### 4. Schema Exploration Workflow\n\nWhen user says \"explore the database\" or \"show me the schema\":\n\n```bash\n# Step 1: List all tables\n# Step 2: For each table, show columns, types, and constraints\n# Step 3: Show row counts\n# Step 4: Show foreign key relationships\n# Step 5: Summarize as a readable schema map\n```\n\nPostgreSQL full schema dump:\n```bash\npsql \"$CONN\" -c \"\nSELECT table_name, column_name, data_type, is_nullable, column_default\nFROM information_schema.columns\nWHERE table_schema = 'public'\nORDER BY table_name, ordinal_position;\n\"\n```\n\nMySQL full schema dump:\n```bash\nmysql \"$CONN\" -e \"\nSELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_SCHEMA = DATABASE()\nORDER BY TABLE_NAME, ORDINAL_POSITION;\n\"\n```\n\n### 5. Export Formats\n\nExport query results to common formats:\n\n```bash\n# CSV (PostgreSQL)\npsql \"$CONN\" -c \"\\copy (SELECT * FROM table_name) TO '/tmp/export.csv' WITH CSV HEADER\"\n\n# CSV (MySQL)\nmysql \"$CONN\" -e \"SELECT * FROM table_name\" | sed 's/\\t/,/g' > /tmp/export.csv\n\n# JSON (PostgreSQL)\npsql \"$CONN\" -t -c \"SELECT json_agg(t) FROM (SELECT * FROM table_name LIMIT 100) t;\" > /tmp/export.json\n\n# SQLite to CSV\nsqlite3 /path/to/db.db \".mode csv\" \".headers on\" \".output /tmp/export.csv\" \"SELECT * FROM table_name;\" \".quit\"\n```\n\n### 6. Common Diagnostic Queries\n\n```sql\n-- PostgreSQL: Table sizes\nSELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename))\nFROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;\n\n-- PostgreSQL: Active connections\nSELECT pid, usename, application_name, client_addr, state, query_start, query\nFROM pg_stat_activity WHERE state != 'idle';\n\n-- PostgreSQL: Slow queries (> 1s)\nSELECT pid, now() - pg_stat_activity.query_start AS duration, query\nFROM pg_stat_activity WHERE state = 'active' AND now() - pg_stat_activity.query_start > interval '1 second';\n\n-- MySQL: Table sizes\nSELECT table_name, ROUND(data_length/1024/1024, 2) AS data_mb, table_rows\nFROM information_schema.tables WHERE table_schema = DATABASE() ORDER BY data_length DESC;\n\n-- MySQL: Process list\nSHOW FULL PROCESSLIST;\n```\n\n## Performance Analysis\n\n### PostgreSQL Performance\n\n```bash\n# Slow queries (active for > 1s)\npsql \"$CONN\" -c \"\nSELECT pid, now() - query_start AS duration, query\nFROM pg_stat_activity\nWHERE state = 'active' AND now() - query_start > interval '1 second'\nORDER BY duration DESC;\n\"\n\n# Index usage\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename, indexname, idx_scan, idx_tup_read\nFROM pg_stat_user_indexes\nORDER BY idx_scan ASC LIMIT 20;\n\"\n\n# Table bloat\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS total_size,\n  pg_size_pretty(pg_relation_size(schemaname||'.'||tablename)) AS table_size,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename) - pg_relation_size(schemaname||'.'||tablename)) AS index_size\nFROM pg_tables\nWHERE schemaname = 'public'\nORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC LIMIT 10;\n\"\n\n# Cache hit ratio (should be > 99%)\npsql \"$CONN\" -c \"\nSELECT\n  sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) AS cache_hit_ratio\nFROM pg_statio_user_tables;\n\"\n```\n\n### MySQL Performance\n\n```bash\n# Slow queries\nmysql \"$CONN\" -e \"SELECT * FROM information_schema.processlist WHERE TIME > 1 ORDER BY TIME DESC;\"\n\n# Index usage\nmysql \"$CONN\" -e \"\nSELECT table_name, index_name, cardinality\nFROM information_schema.statistics\nWHERE table_schema = DATABASE()\nORDER BY cardinality DESC LIMIT 20;\n\"\n\n# Table sizes\nmysql \"$CONN\" -e \"\nSELECT table_name,\n  ROUND(data_length/1024/1024, 2) AS data_mb,\n  ROUND(index_length/1024/1024, 2) AS index_mb,\n  table_rows\nFROM information_schema.tables\nWHERE table_schema = DATABASE()\nORDER BY data_length DESC LIMIT 10;\n\"\n```\n\n## Backup & Restore\n\n### PostgreSQL\n\n```bash\n# Backup single database\npg_dump \"$CONN\" > backup_$(date +%Y%m%d).sql\n\n# Backup single table\npg_dump \"$CONN\" -t table_name > table_backup.sql\n\n# Restore\npsql \"$CONN\" < backup.sql\n\n# Backup with compression\npg_dump \"$CONN\" | gzip > backup_$(date +%Y%m%d).sql.gz\n```\n\n### MySQL\n\n```bash\n# Backup single database\nmysqldump -h host -u user -p dbname > backup_$(date +%Y%m%d).sql\n\n# Backup single table\nmysqldump -h host -u user -p dbname table_name > table_backup.sql\n\n# Restore\nmysql -h host -u user -p dbname < backup.sql\n```\n\n### SQLite\n\n```bash\n# Backup\nsqlite3 /path/to/db.db \".backup /tmp/backup.db\"\n\n# Or just copy\ncp /path/to/db.db /tmp/backup_$(date +%Y%m%d).db\n```\n\n## Data Migration Helpers\n\n### Copy table between databases\n\n```bash\n# PostgreSQL to CSV to MySQL\npsql \"$PG_CONN\" -c \"\\copy table_name TO '/tmp/export.csv' WITH CSV HEADER\"\nmysql \"$MYSQL_CONN\" -e \"LOAD DATA LOCAL INFILE '/tmp/export.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' ENCLOSED BY '\\\"' LINES TERMINATED BY '\\n' IGNORE 1 ROWS;\"\n```\n\n### Schema comparison\n\n```bash\n# Get PostgreSQL schema hash for comparison\npsql \"$CONN\" -c \"\nSELECT md5(string_agg(table_name || column_name || data_type, '' ORDER BY table_name, ordinal_position))\nFROM information_schema.columns\nWHERE table_schema = 'public';\n\"\n```\n\n## Pitfalls\n\n- **Connection strings with special chars** — URL-encode passwords containing @, :, /, etc.\n- **SSL requirements** — Many cloud databases (RDS, Cloud SQL, Supabase) require `?sslmode=require` or `--ssl-mode=REQUIRED`\n- **Timeout on large tables** — Always LIMIT unless user explicitly wants full export\n- **SQLite locking** — Only one writer at a time; use WAL mode for concurrent reads: `PRAGMA journal_mode=WAL;`\n- **MongoDB auth database** — Sometimes auth is on `admin` db, not the target db: `?authSource=admin`\n- **Redis SELECT** — Redis has 16 databases (0-15); check which one: `redis-cli INFO keyspace`\n\n## Verification\n\nAfter connecting:\n1. Run a simple query to confirm connection works\n2. List tables/collections to show the schema\n3. Run a count query on a key table to verify data access\n4. Check cache hit ratio (PostgreSQL) or slow queries (MySQL)\n5. Verify backup capability with a test dump\n\n## Environment Variables\n\nThe skill uses these if available:\n- `DATABASE_URL` — Full connection string (takes priority)\n- `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` — Individual params\n- `DB_TYPE` — postgres/mysql/sqlite/mongo/redis\n\nFile v2.4.0:_meta.json\n\n{\n  \"ownerId\": \"kn78qy8qw1m82vx09qkaawp9c985z0mn\",\n  \"slug\": \"db-explorer-hermes\",\n  \"version\": \"2.4.0\",\n  \"publishedAt\": 1779984130665\n}\n\nFile v2.4.0:skill-card.md\n\n## Description:\n\nConnect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[lrg913427-dot](https://clawhub.ai/user/lrg913427-dot)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to inspect database schemas, run diagnostic queries, export selected data, and troubleshoot PostgreSQL, MySQL, SQLite, MongoDB, and Redis systems from the terminal.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Database backup, restore, migration, and export commands can affect sensitive or production data if run with broad privileges or unclear scope.\n\nMitigation: Use read-only, least-privilege credentials by default; require explicit approval for exports, backups, restores, migrations, and any write operation; confirm scope and rollback plans before production use.\n\nRisk: Database credentials can be exposed through command history, process listings, logs, or exported files.\n\nMitigation: Prefer environment variables or secure prompts for credentials, avoid passwords in command lines, and write exports or backups only to protected output locations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/lrg913427-dot/skills/db-explorer-hermes)\n- [ClawHub publisher profile](https://clawhub.ai/user/lrg913427-dot)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Code, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline SQL, shell commands, and configuration guidance]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include database queries, export commands, backup and restore commands, migration helpers, and safety checks.]\n\n## Skill Version(s):\n\n2.4.0 (source: server release evidence and SKILL.md frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v2.1.0: 3 files, 5132 bytes\n\nFiles: skill-card.md (2067b), SKILL.md (9834b), _meta.json (137b)\n\nFile v2.1.0:SKILL.md\n\n---\nname: db-explorer\ndescription: \"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\"\nversion: 2.0.0\nauthor: lrg913427-dot\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [database, sql, postgresql, mysql, sqlite, mongodb, redis, query, schema, data]\n    related_skills: [jupyter-live-kernel, airtable]\n---\n\n# DB Explorer\n\nConnect to databases, run queries, explore schemas, and export data — all from the terminal.\n\n## When to Use\n\nActivate this skill when the user:\n- Says \"check the database\", \"query the DB\", \"show me the data\"\n- Wants to see table structure, row counts, or sample data\n- Needs to export data to CSV/JSON\n- Wants to find slow queries or check DB health\n- Mentions a database connection string or DB name\n\n## Supported Databases\n\n| Database   | CLI Tool     | Install (macOS)           | Install (Linux)                    |\n|-----------|-------------|---------------------------|-----------------------------------|\n| PostgreSQL | psql        | brew install postgresql    | apt install postgresql-client      |\n| MySQL      | mysql       | brew install mysql         | apt install mysql-client           |\n| SQLite     | sqlite3     | (built-in on macOS)       | apt install sqlite3                |\n| MongoDB    | mongosh     | brew install mongosh       | See mongodb.com/docs/shell         |\n| Redis      | redis-cli   | brew install redis         | apt install redis-tools            |\n\n## Quick Start\n\n### 1. Identify the Database\n\nAsk the user for:\n- Database type (postgres/mysql/sqlite/mongo/redis)\n- Connection string OR host/port/database/user/password\n- For SQLite: just the file path\n\n### 2. Connect and Explore\n\n```bash\n# PostgreSQL\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\dt\"           # list tables\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\d table_name\" # describe table\npsql \"postgresql://user:password@host:5432/dbname\" -c \"SELECT count(*) FROM table_name;\"\n\n# MySQL\nmysql -h host -u user -p dbname -e \"SHOW TABLES;\"\nmysql -h host -u user -p dbname -e \"DESCRIBE table_name;\"\nmysql -h host -u user -p dbname -e \"SELECT count(*) FROM table_name;\"\n\n# SQLite\nsqlite3 /path/to/db.db \".tables\"                    # list tables\nsqlite3 /path/to/db.db \".schema table_name\"         # describe table\nsqlite3 /path/to/db.db \"SELECT count(*) FROM table_name;\"\n\n# MongoDB\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.getCollectionNames()\"\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.collection_name.countDocuments()\"\n\n# Redis\nredis-cli -h host -p 6379 -a password INFO keyspace\nredis-cli -h host -p 6379 -a password DBSIZE\nredis-cli -h host -p 6379 -a password KEYS \"*\"\n```\n\n### 3. Safety Rules\n\n**ALWAYS follow these rules:**\n\n1. **Read-only by default** — Never run INSERT/UPDATE/DELETE/DROP without explicit user confirmation\n2. **Limit results** — Always add `LIMIT 100` (or equivalent) to SELECT queries unless user asks for all\n3. **Show before execute** — For any write operation, show the exact SQL/command and ask for confirmation\n4. **No passwords in history** — Use environment variables or connection strings, don't echo passwords\n5. **Transaction safety** — For writes, wrap in BEGIN/ROLLBACK first, show results, then ask to COMMIT\n\n### 4. Schema Exploration Workflow\n\nWhen user says \"explore the database\" or \"show me the schema\":\n\n```bash\n# Step 1: List all tables\n# Step 2: For each table, show columns, types, and constraints\n# Step 3: Show row counts\n# Step 4: Show foreign key relationships\n# Step 5: Summarize as a readable schema map\n```\n\nPostgreSQL full schema dump:\n```bash\npsql \"$CONN\" -c \"\nSELECT table_name, column_name, data_type, is_nullable, column_default\nFROM information_schema.columns\nWHERE table_schema = 'public'\nORDER BY table_name, ordinal_position;\n\"\n```\n\nMySQL full schema dump:\n```bash\nmysql \"$CONN\" -e \"\nSELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_SCHEMA = DATABASE()\nORDER BY TABLE_NAME, ORDINAL_POSITION;\n\"\n```\n\n### 5. Export Formats\n\nExport query results to common formats:\n\n```bash\n# CSV (PostgreSQL)\npsql \"$CONN\" -c \"\\copy (SELECT * FROM table_name) TO '/tmp/export.csv' WITH CSV HEADER\"\n\n# CSV (MySQL)\nmysql \"$CONN\" -e \"SELECT * FROM table_name\" | sed 's/\\t/,/g' > /tmp/export.csv\n\n# JSON (PostgreSQL)\npsql \"$CONN\" -t -c \"SELECT json_agg(t) FROM (SELECT * FROM table_name LIMIT 100) t;\" > /tmp/export.json\n\n# SQLite to CSV\nsqlite3 /path/to/db.db \".mode csv\" \".headers on\" \".output /tmp/export.csv\" \"SELECT * FROM table_name;\" \".quit\"\n```\n\n### 6. Common Diagnostic Queries\n\n```sql\n-- PostgreSQL: Table sizes\nSELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename))\nFROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;\n\n-- PostgreSQL: Active connections\nSELECT pid, usename, application_name, client_addr, state, query_start, query\nFROM pg_stat_activity WHERE state != 'idle';\n\n-- PostgreSQL: Slow queries (> 1s)\nSELECT pid, now() - pg_stat_activity.query_start AS duration, query\nFROM pg_stat_activity WHERE state = 'active' AND now() - pg_stat_activity.query_start > interval '1 second';\n\n-- MySQL: Table sizes\nSELECT table_name, ROUND(data_length/1024/1024, 2) AS data_mb, table_rows\nFROM information_schema.tables WHERE table_schema = DATABASE() ORDER BY data_length DESC;\n\n-- MySQL: Process list\nSHOW FULL PROCESSLIST;\n```\n\n## Performance Analysis\n\n### PostgreSQL Performance\n\n```bash\n# Slow queries (active for > 1s)\npsql \"$CONN\" -c \"\nSELECT pid, now() - query_start AS duration, query\nFROM pg_stat_activity\nWHERE state = 'active' AND now() - query_start > interval '1 second'\nORDER BY duration DESC;\n\"\n\n# Index usage\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename, indexname, idx_scan, idx_tup_read\nFROM pg_stat_user_indexes\nORDER BY idx_scan ASC LIMIT 20;\n\"\n\n# Table bloat\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS total_size,\n  pg_size_pretty(pg_relation_size(schemaname||'.'||tablename)) AS table_size,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename) - pg_relation_size(schemaname||'.'||tablename)) AS index_size\nFROM pg_tables\nWHERE schemaname = 'public'\nORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC LIMIT 10;\n\"\n\n# Cache hit ratio (should be > 99%)\npsql \"$CONN\" -c \"\nSELECT\n  sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) AS cache_hit_ratio\nFROM pg_statio_user_tables;\n\"\n```\n\n### MySQL Performance\n\n```bash\n# Slow queries\nmysql \"$CONN\" -e \"SELECT * FROM information_schema.processlist WHERE TIME > 1 ORDER BY TIME DESC;\"\n\n# Index usage\nmysql \"$CONN\" -e \"\nSELECT table_name, index_name, cardinality\nFROM information_schema.statistics\nWHERE table_schema = DATABASE()\nORDER BY cardinality DESC LIMIT 20;\n\"\n\n# Table sizes\nmysql \"$CONN\" -e \"\nSELECT table_name,\n  ROUND(data_length/1024/1024, 2) AS data_mb,\n  ROUND(index_length/1024/1024, 2) AS index_mb,\n  table_rows\nFROM information_schema.tables\nWHERE table_schema = DATABASE()\nORDER BY data_length DESC LIMIT 10;\n\"\n```\n\n## Backup & Restore\n\n### PostgreSQL\n\n```bash\n# Backup single database\npg_dump \"$CONN\" > backup_$(date +%Y%m%d).sql\n\n# Backup single table\npg_dump \"$CONN\" -t table_name > table_backup.sql\n\n# Restore\npsql \"$CONN\" < backup.sql\n\n# Backup with compression\npg_dump \"$CONN\" | gzip > backup_$(date +%Y%m%d).sql.gz\n```\n\n### MySQL\n\n```bash\n# Backup single database\nmysqldump -h host -u user -p dbname > backup_$(date +%Y%m%d).sql\n\n# Backup single table\nmysqldump -h host -u user -p dbname table_name > table_backup.sql\n\n# Restore\nmysql -h host -u user -p dbname < backup.sql\n```\n\n### SQLite\n\n```bash\n# Backup\nsqlite3 /path/to/db.db \".backup /tmp/backup.db\"\n\n# Or just copy\ncp /path/to/db.db /tmp/backup_$(date +%Y%m%d).db\n```\n\n## Data Migration Helpers\n\n### Copy table between databases\n\n```bash\n# PostgreSQL to CSV to MySQL\npsql \"$PG_CONN\" -c \"\\copy table_name TO '/tmp/export.csv' WITH CSV HEADER\"\nmysql \"$MYSQL_CONN\" -e \"LOAD DATA LOCAL INFILE '/tmp/export.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' ENCLOSED BY '\\\"' LINES TERMINATED BY '\\n' IGNORE 1 ROWS;\"\n```\n\n### Schema comparison\n\n```bash\n# Get PostgreSQL schema hash for comparison\npsql \"$CONN\" -c \"\nSELECT md5(string_agg(table_name || column_name || data_type, '' ORDER BY table_name, ordinal_position))\nFROM information_schema.columns\nWHERE table_schema = 'public';\n\"\n```\n\n## Pitfalls\n\n- **Connection strings with special chars** — URL-encode passwords containing @, :, /, etc.\n- **SSL requirements** — Many cloud databases (RDS, Cloud SQL, Supabase) require `?sslmode=require` or `--ssl-mode=REQUIRED`\n- **Timeout on large tables** — Always LIMIT unless user explicitly wants full export\n- **SQLite locking** — Only one writer at a time; use WAL mode for concurrent reads: `PRAGMA journal_mode=WAL;`\n- **MongoDB auth database** — Sometimes auth is on `admin` db, not the target db: `?authSource=admin`\n- **Redis SELECT** — Redis has 16 databases (0-15); check which one: `redis-cli INFO keyspace`\n\n## Verification\n\nAfter connecting:\n1. Run a simple query to confirm connection works\n2. List tables/collections to show the schema\n3. Run a count query on a key table to verify data access\n4. Check cache hit ratio (PostgreSQL) or slow queries (MySQL)\n5. Verify backup capability with a test dump\n\n## Environment Variables\n\nThe skill uses these if available:\n- `DATABASE_URL` — Full connection string (takes priority)\n- `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` — Individual params\n- `DB_TYPE` — postgres/mysql/sqlite/mongo/redis\n\nFile v2.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn78qy8qw1m82vx09qkaawp9c985z0mn\",\n  \"slug\": \"db-explorer-hermes\",\n  \"version\": \"2.1.0\",\n  \"publishedAt\": 1779184976104\n}\n\nFile v2.1.0:skill-card.md\n\n## Description: <br>\nConnect to and explore databases including PostgreSQL, MySQL, SQLite, MongoDB, and Redis, run queries, inspect schemas, and export data. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[lrg913427-dot](https://clawhub.ai/user/lrg913427-dot) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, operators, and data practitioners use this skill to inspect database schemas, run diagnostic queries, export data, and prepare backup, restore, or migration commands from a terminal workflow. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Database export, restore, import, migration, or write commands can expose data or change production state. <br>\nMitigation: Confirm the target database and exact command before execution, use read-only access by default, require explicit approval for writes, and keep backups before changes. <br>\nRisk: Database credentials and exported data can be exposed through shell history, logs, or local files. <br>\nMitigation: Use secure environment variables or secret handling, avoid echoing passwords, limit and redact exports, and store generated files only where appropriate. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/lrg913427-dot/db-explorer-hermes) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Code, Shell commands, Configuration] <br>\n**Output Format:** [Markdown with shell and SQL code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Commands depend on user-supplied database type, connection details, and locally available database CLI tools.] <br>\n\n## Skill Version(s): <br>\n2.1.0 (source: ClawHub release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v2.0.0: 2 files, 3992 bytes\n\nFiles: SKILL.md (9834b), _meta.json (137b)\n\nFile v2.0.0:SKILL.md\n\n---\nname: db-explorer\ndescription: \"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\"\nversion: 2.0.0\nauthor: lrg913427-dot\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [database, sql, postgresql, mysql, sqlite, mongodb, redis, query, schema, data]\n    related_skills: [jupyter-live-kernel, airtable]\n---\n\n# DB Explorer\n\nConnect to databases, run queries, explore schemas, and export data — all from the terminal.\n\n## When to Use\n\nActivate this skill when the user:\n- Says \"check the database\", \"query the DB\", \"show me the data\"\n- Wants to see table structure, row counts, or sample data\n- Needs to export data to CSV/JSON\n- Wants to find slow queries or check DB health\n- Mentions a database connection string or DB name\n\n## Supported Databases\n\n| Database   | CLI Tool     | Install (macOS)           | Install (Linux)                    |\n|-----------|-------------|---------------------------|-----------------------------------|\n| PostgreSQL | psql        | brew install postgresql    | apt install postgresql-client      |\n| MySQL      | mysql       | brew install mysql         | apt install mysql-client           |\n| SQLite     | sqlite3     | (built-in on macOS)       | apt install sqlite3                |\n| MongoDB    | mongosh     | brew install mongosh       | See mongodb.com/docs/shell         |\n| Redis      | redis-cli   | brew install redis         | apt install redis-tools            |\n\n## Quick Start\n\n### 1. Identify the Database\n\nAsk the user for:\n- Database type (postgres/mysql/sqlite/mongo/redis)\n- Connection string OR host/port/database/user/password\n- For SQLite: just the file path\n\n### 2. Connect and Explore\n\n```bash\n# PostgreSQL\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\dt\"           # list tables\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\d table_name\" # describe table\npsql \"postgresql://user:password@host:5432/dbname\" -c \"SELECT count(*) FROM table_name;\"\n\n# MySQL\nmysql -h host -u user -p dbname -e \"SHOW TABLES;\"\nmysql -h host -u user -p dbname -e \"DESCRIBE table_name;\"\nmysql -h host -u user -p dbname -e \"SELECT count(*) FROM table_name;\"\n\n# SQLite\nsqlite3 /path/to/db.db \".tables\"                    # list tables\nsqlite3 /path/to/db.db \".schema table_name\"         # describe table\nsqlite3 /path/to/db.db \"SELECT count(*) FROM table_name;\"\n\n# MongoDB\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.getCollectionNames()\"\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.collection_name.countDocuments()\"\n\n# Redis\nredis-cli -h host -p 6379 -a password INFO keyspace\nredis-cli -h host -p 6379 -a password DBSIZE\nredis-cli -h host -p 6379 -a password KEYS \"*\"\n```\n\n### 3. Safety Rules\n\n**ALWAYS follow these rules:**\n\n1. **Read-only by default** — Never run INSERT/UPDATE/DELETE/DROP without explicit user confirmation\n2. **Limit results** — Always add `LIMIT 100` (or equivalent) to SELECT queries unless user asks for all\n3. **Show before execute** — For any write operation, show the exact SQL/command and ask for confirmation\n4. **No passwords in history** — Use environment variables or connection strings, don't echo passwords\n5. **Transaction safety** — For writes, wrap in BEGIN/ROLLBACK first, show results, then ask to COMMIT\n\n### 4. Schema Exploration Workflow\n\nWhen user says \"explore the database\" or \"show me the schema\":\n\n```bash\n# Step 1: List all tables\n# Step 2: For each table, show columns, types, and constraints\n# Step 3: Show row counts\n# Step 4: Show foreign key relationships\n# Step 5: Summarize as a readable schema map\n```\n\nPostgreSQL full schema dump:\n```bash\npsql \"$CONN\" -c \"\nSELECT table_name, column_name, data_type, is_nullable, column_default\nFROM information_schema.columns\nWHERE table_schema = 'public'\nORDER BY table_name, ordinal_position;\n\"\n```\n\nMySQL full schema dump:\n```bash\nmysql \"$CONN\" -e \"\nSELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_SCHEMA = DATABASE()\nORDER BY TABLE_NAME, ORDINAL_POSITION;\n\"\n```\n\n### 5. Export Formats\n\nExport query results to common formats:\n\n```bash\n# CSV (PostgreSQL)\npsql \"$CONN\" -c \"\\copy (SELECT * FROM table_name) TO '/tmp/export.csv' WITH CSV HEADER\"\n\n# CSV (MySQL)\nmysql \"$CONN\" -e \"SELECT * FROM table_name\" | sed 's/\\t/,/g' > /tmp/export.csv\n\n# JSON (PostgreSQL)\npsql \"$CONN\" -t -c \"SELECT json_agg(t) FROM (SELECT * FROM table_name LIMIT 100) t;\" > /tmp/export.json\n\n# SQLite to CSV\nsqlite3 /path/to/db.db \".mode csv\" \".headers on\" \".output /tmp/export.csv\" \"SELECT * FROM table_name;\" \".quit\"\n```\n\n### 6. Common Diagnostic Queries\n\n```sql\n-- PostgreSQL: Table sizes\nSELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename))\nFROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;\n\n-- PostgreSQL: Active connections\nSELECT pid, usename, application_name, client_addr, state, query_start, query\nFROM pg_stat_activity WHERE state != 'idle';\n\n-- PostgreSQL: Slow queries (> 1s)\nSELECT pid, now() - pg_stat_activity.query_start AS duration, query\nFROM pg_stat_activity WHERE state = 'active' AND now() - pg_stat_activity.query_start > interval '1 second';\n\n-- MySQL: Table sizes\nSELECT table_name, ROUND(data_length/1024/1024, 2) AS data_mb, table_rows\nFROM information_schema.tables WHERE table_schema = DATABASE() ORDER BY data_length DESC;\n\n-- MySQL: Process list\nSHOW FULL PROCESSLIST;\n```\n\n## Performance Analysis\n\n### PostgreSQL Performance\n\n```bash\n# Slow queries (active for > 1s)\npsql \"$CONN\" -c \"\nSELECT pid, now() - query_start AS duration, query\nFROM pg_stat_activity\nWHERE state = 'active' AND now() - query_start > interval '1 second'\nORDER BY duration DESC;\n\"\n\n# Index usage\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename, indexname, idx_scan, idx_tup_read\nFROM pg_stat_user_indexes\nORDER BY idx_scan ASC LIMIT 20;\n\"\n\n# Table bloat\npsql \"$CONN\" -c \"\nSELECT schemaname, tablename,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS total_size,\n  pg_size_pretty(pg_relation_size(schemaname||'.'||tablename)) AS table_size,\n  pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename) - pg_relation_size(schemaname||'.'||tablename)) AS index_size\nFROM pg_tables\nWHERE schemaname = 'public'\nORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC LIMIT 10;\n\"\n\n# Cache hit ratio (should be > 99%)\npsql \"$CONN\" -c \"\nSELECT\n  sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) AS cache_hit_ratio\nFROM pg_statio_user_tables;\n\"\n```\n\n### MySQL Performance\n\n```bash\n# Slow queries\nmysql \"$CONN\" -e \"SELECT * FROM information_schema.processlist WHERE TIME > 1 ORDER BY TIME DESC;\"\n\n# Index usage\nmysql \"$CONN\" -e \"\nSELECT table_name, index_name, cardinality\nFROM information_schema.statistics\nWHERE table_schema = DATABASE()\nORDER BY cardinality DESC LIMIT 20;\n\"\n\n# Table sizes\nmysql \"$CONN\" -e \"\nSELECT table_name,\n  ROUND(data_length/1024/1024, 2) AS data_mb,\n  ROUND(index_length/1024/1024, 2) AS index_mb,\n  table_rows\nFROM information_schema.tables\nWHERE table_schema = DATABASE()\nORDER BY data_length DESC LIMIT 10;\n\"\n```\n\n## Backup & Restore\n\n### PostgreSQL\n\n```bash\n# Backup single database\npg_dump \"$CONN\" > backup_$(date +%Y%m%d).sql\n\n# Backup single table\npg_dump \"$CONN\" -t table_name > table_backup.sql\n\n# Restore\npsql \"$CONN\" < backup.sql\n\n# Backup with compression\npg_dump \"$CONN\" | gzip > backup_$(date +%Y%m%d).sql.gz\n```\n\n### MySQL\n\n```bash\n# Backup single database\nmysqldump -h host -u user -p dbname > backup_$(date +%Y%m%d).sql\n\n# Backup single table\nmysqldump -h host -u user -p dbname table_name > table_backup.sql\n\n# Restore\nmysql -h host -u user -p dbname < backup.sql\n```\n\n### SQLite\n\n```bash\n# Backup\nsqlite3 /path/to/db.db \".backup /tmp/backup.db\"\n\n# Or just copy\ncp /path/to/db.db /tmp/backup_$(date +%Y%m%d).db\n```\n\n## Data Migration Helpers\n\n### Copy table between databases\n\n```bash\n# PostgreSQL to CSV to MySQL\npsql \"$PG_CONN\" -c \"\\copy table_name TO '/tmp/export.csv' WITH CSV HEADER\"\nmysql \"$MYSQL_CONN\" -e \"LOAD DATA LOCAL INFILE '/tmp/export.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' ENCLOSED BY '\\\"' LINES TERMINATED BY '\\n' IGNORE 1 ROWS;\"\n```\n\n### Schema comparison\n\n```bash\n# Get PostgreSQL schema hash for comparison\npsql \"$CONN\" -c \"\nSELECT md5(string_agg(table_name || column_name || data_type, '' ORDER BY table_name, ordinal_position))\nFROM information_schema.columns\nWHERE table_schema = 'public';\n\"\n```\n\n## Pitfalls\n\n- **Connection strings with special chars** — URL-encode passwords containing @, :, /, etc.\n- **SSL requirements** — Many cloud databases (RDS, Cloud SQL, Supabase) require `?sslmode=require` or `--ssl-mode=REQUIRED`\n- **Timeout on large tables** — Always LIMIT unless user explicitly wants full export\n- **SQLite locking** — Only one writer at a time; use WAL mode for concurrent reads: `PRAGMA journal_mode=WAL;`\n- **MongoDB auth database** — Sometimes auth is on `admin` db, not the target db: `?authSource=admin`\n- **Redis SELECT** — Redis has 16 databases (0-15); check which one: `redis-cli INFO keyspace`\n\n## Verification\n\nAfter connecting:\n1. Run a simple query to confirm connection works\n2. List tables/collections to show the schema\n3. Run a count query on a key table to verify data access\n4. Check cache hit ratio (PostgreSQL) or slow queries (MySQL)\n5. Verify backup capability with a test dump\n\n## Environment Variables\n\nThe skill uses these if available:\n- `DATABASE_URL` — Full connection string (takes priority)\n- `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` — Individual params\n- `DB_TYPE` — postgres/mysql/sqlite/mongo/redis\n\nFile v2.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn78qy8qw1m82vx09qkaawp9c985z0mn\",\n  \"slug\": \"db-explorer-hermes\",\n  \"version\": \"2.0.0\",\n  \"publishedAt\": 1778601833812\n}","readmeExcerpt":"Skill: Db Explorer Owner: lrg913427-dot Summary: Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab... Tags: latest:2.4.0 Version history: v2.4.0 | 2026-05-28T16:02:10.665Z | auto - Version bumped to 2.4.0. - Documentation (SKILL.md) updated and improved. - Removed redundant skill-card.md file. v2.1.0 | 2026-05-","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# PostgreSQL\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\dt\"           # list tables\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\d table_name\" # describe table\npsql \"postgresql://user:password@host:5432/dbname\" -c \"SELECT count(*) FROM table_name;\"\n\n# MySQL\nmysql -h host -u user -p dbname -e \"SHOW TABLES;\"\nmysql -h host -u user -p dbname -e \"DESCRIBE table_name;\"\nmysql -h host -u user -p dbname -e \"SELECT count(*) FROM table_name;\"\n\n# SQLite\nsqlite3 /path/to/db.db \".tables\"                    # list tables\nsqlite3 /path/to/db.db \".schema table_name\"         # describe table\nsqlite3 /path/to/db.db \"SELECT count(*) FROM table_name;\"\n\n# MongoDB\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.getCollectionNames()\"\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.collection_name.countDocuments()\"\n\n# Redis\nredis-cli -h host -p 6379 -a password INFO keyspace\nredis-cli -h host -p 6379 -a password DBSIZE\nredis-cli -h host -p 6379 -a password KEYS \"*\""},{"language":"bash","snippet":"# Step 1: List all tables\n# Step 2: For each table, show columns, types, and constraints\n# Step 3: Show row counts\n# Step 4: Show foreign key relationships\n# Step 5: Summarize as a readable schema map"},{"language":"bash","snippet":"psql \"$CONN\" -c \"\nSELECT table_name, column_name, data_type, is_nullable, column_default\nFROM information_schema.columns\nWHERE table_schema = 'public'\nORDER BY table_name, ordinal_position;\n\""},{"language":"bash","snippet":"mysql \"$CONN\" -e \"\nSELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_SCHEMA = DATABASE()\nORDER BY TABLE_NAME, ORDINAL_POSITION;\n\""},{"language":"bash","snippet":"# CSV (PostgreSQL)\npsql \"$CONN\" -c \"\\copy (SELECT * FROM table_name) TO '/tmp/export.csv' WITH CSV HEADER\"\n\n# CSV (MySQL)\nmysql \"$CONN\" -e \"SELECT * FROM table_name\" | sed 's/\\t/,/g' > /tmp/export.csv\n\n# JSON (PostgreSQL)\npsql \"$CONN\" -t -c \"SELECT json_agg(t) FROM (SELECT * FROM table_name LIMIT 100) t;\" > /tmp/export.json\n\n# SQLite to CSV\nsqlite3 /path/to/db.db \".mode csv\" \".headers on\" \".output /tmp/export.csv\" \"SELECT * FROM table_name;\" \".quit\""},{"language":"sql","snippet":"-- PostgreSQL: Table sizes\nSELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename))\nFROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;\n\n-- PostgreSQL: Active connections\nSELECT pid, usename, application_name, client_addr, state, query_start, query\nFROM pg_stat_activity WHERE state != 'idle';\n\n-- PostgreSQL: Slow queries (> 1s)\nSELECT pid, now() - pg_stat_activity.query_start AS duration, query\nFROM pg_stat_activity WHERE state = 'active' AND now() - pg_stat_activity.query_start > interval '1 second';\n\n-- MySQL: Table sizes\nSELECT table_name, ROUND(data_length/1024/1024, 2) AS data_mb, table_rows\nFROM information_schema.tables WHERE table_schema = DATABASE() ORDER BY data_length DESC;\n\n-- MySQL: Process list\nSHOW FULL PROCESSLIST;"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: db-explorer\ndescription: \"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\"\nversion: 2.4.0\nauthor: lrg913427-dot\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [database, sql, postgresql, mysql, sqlite, mongodb, redis, query, schema, data]\n    related_skills: [jupyter-live-kernel, airtable]\n---\n\n# DB Explorer\n\nConnect to databases, run queries, explore schemas, and export data — all from the terminal.\n\n## When to Use\n\nActivate this skill when the user:\n- Says \"check the database\", \"query the DB\", \"show me the data\"\n- Wants to see table structure, row counts, or sample data\n- Needs to export data to CSV/JSON\n- Wants to find slow queries or check DB health\n- Mentions a database connection string or DB name\n\n## Supported Databases\n\n| Database   | CLI Tool     | Install (macOS)           | Install (Linux)                    |\n|-----------|-------------|---------------------------|-----------------------------------|\n| PostgreSQL | psql        | brew install postgresql    | apt install postgresql-client      |\n| MySQL      | mysql       | brew install mysql         | apt install mysql-client           |\n| SQLite     | sqlite3     | (built-in on macOS)       | apt install sqlite3                |\n| MongoDB    | mongosh     | brew install mongosh       | See mongodb.com/docs/shell         |\n| Redis      | redis-cli   | brew install redis         | apt install redis-tools            |\n\n## Quick Start\n\n### 1. Identify the Database\n\nAsk the user for:\n- Database type (postgres/mysql/sqlite/mongo/redis)\n- Connection string OR host/port/database/user/password\n- For SQLite: just the file path\n\n### 2. Connect and Explore\n\n```bash\n# PostgreSQL\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\dt\"           # list tables\npsql \"postgresql://user:password@host:5432/dbname\" -c \"\\d table_name\" # describe table\npsql \"postgresql://user:password@host:5432/dbname\" -c \"SELECT count(*) FROM table_name;\"\n\n# MySQL\nmysql -h host -u user -p dbname -e \"SHOW TABLES;\"\nmysql -h host -u user -p dbname -e \"DESCRIBE table_name;\"\nmysql -h host -u user -p dbname -e \"SELECT count(*) FROM table_name;\"\n\n# SQLite\nsqlite3 /path/to/db.db \".tables\"                    # list tables\nsqlite3 /path/to/db.db \".schema table_name\"         # describe table\nsqlite3 /path/to/db.db \"SELECT count(*) FROM table_name;\"\n\n# MongoDB\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.getCollectionNames()\"\nmongosh \"mongodb://user:password@host:27017/dbname\" --eval \"db.collection_name.countDocuments()\"\n\n# Redis\nredis-cli -h host -p 6379 -a password INFO keyspace\nredis-cli -h host -p 6379 -a password DBSIZE\nredis-cli -h host -p 6379 -a password KEYS \"*\"\n```\n\n### 3. Safety Rules\n\n**ALWAYS follow these rules:**\n\n1. **Read-only by default** — Never run INSERT/UPDATE/DELETE/DROP without explicit user confirmation\n"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn78qy8qw1m82vx09qkaawp9c985z0mn\",\n  \"slug\": \"db-explorer-hermes\",\n  \"version\": \"2.4.0\",\n  \"publishedAt\": 1779984130665\n}"},{"path":"skill-card.md","content":"## Description:\n\nConnect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a database, explore schema, check data, export results, or debug database issues.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[lrg913427-dot](https://clawhub.ai/user/lrg913427-dot)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to inspect database schemas, run diagnostic queries, export selected data, and troubleshoot PostgreSQL, MySQL, SQLite, MongoDB, and Redis systems from the terminal.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Database backup, restore, migration, and export commands can affect sensitive or production data if run with broad privileges or unclear scope.\n\nMitigation: Use read-only, least-privilege credentials by default; require explicit approval for exports, backups, restores, migrations, and any write operation; confirm scope and rollback plans before production use.\n\nRisk: Database credentials can be exposed through command history, process listings, logs, or exported files.\n\nMitigation: Prefer environment variables or secure prompts for credentials, avoid passwords in command lines, and write exports or backups only to protected output locations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/lrg913427-dot/skills/db-explorer-hermes)\n- [ClawHub publisher profile](https://clawhub.ai/user/lrg913427-dot)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Code, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline SQL, shell commands, and configuration guidance]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include database queries, export commands, backup and restore commands, migration helpers, and safety checks.]\n\n## Skill Version(s):\n\n2.4.0 (source: server release evidence and SKILL.md frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab... Skill: Db Explorer Owner: lrg913427-dot Summary: Connect to and explore databases (PostgreSQL, MySQL, SQLite, MongoDB, Redis). Run queries, inspect schemas, export data. Use when user wants to query a datab... Tags: latest:2.4.0 Version history: v2.4.0 | 2026-05-28T16:02:10.665Z | auto - Version bumped to 2.4.0. - Documentation (SKILL.md) updated and improved. - Removed redundant skill-card.md file. v2.1.0 | 2026-05-","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1031,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:51:13.954Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T10:13:23.053Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}