db-explorer

Extract database schemas and relationships into JSON and Markdown with Mermaid ERD diagrams.

18|1|Updated Nov 5, 2015
One-click install
npx skills add https://github.com/cristianoliveira/dotfiles --skill db-explorer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-explorer
Source: https://github.com/cristianoliveira/dotfiles/tree/main/ai/shared/skills/db-explorer
Command: npx skills add https://github.com/cristianoliveira/dotfiles --skill db-explorer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psql, mysql, sqlite3, and includes scripts (resource) components.

What problem does it solve?

This Skill extracts and documents database schemas and relationships from PostgreSQL, MySQL, or SQLite, producing structured JSON and Markdown with Mermaid ERD diagrams.

Core Features & Use Cases

  • Live-schema extraction: fetch tables, columns, primary/foreign keys, and indexes from supported databases.
  • Documentation generation: produce Markdown reports with an embedded Mermaid ERD for quick visualization.
  • Use Case: onboarding a new data team by auto-generating a database schema doc for an existing system.

Quick Start

Run the schema_extractor script with appropriate flags to target your database, for example: python3 scripts/schema_extractor.py --type postgres --database mydb --output markdown

Frequently Asked Questions about db-explorer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract a database schema and generate an ERD diagram from PostgreSQL?

Yes, you can auto-detect your database type from environment variables or a connection string to extract schemas from PostgreSQL, MySQL, and SQLite. The skill uses CLI queries to fetch table structures and relationships for live-system analysis.

How do I document an existing database schema for team onboarding?

To document an existing database schema for onboarding, run the extraction script with the Markdown output flag. It generates a Markdown report containing structured schema details and an embedded Mermaid ERD diagram for quick visualization.

Do I need psql, mysql, or sqlite3 installed to extract database schemas?

Yes, the schema extraction script requires psql, mysql, or sqlite3 CLI dependencies to query your live database. It uses these tools to enumerate tables, columns, primary and foreign keys, and indexes to build schema objects and diagrams.

What is the best way to export database schema relationships into JSON format?

The best way to export database schema relationships into JSON format is using a schema extraction script that queries your database and structures the output. This skill fetches tables, columns, and keys, outputting structured JSON for refactoring or compliance reviews.

Can I generate Mermaid ERD diagrams from a MySQL database schema?

Yes, you can generate Mermaid ERD diagrams from a MySQL database schema by running the schema extractor script. It queries your MySQL database to map tables, columns, and foreign keys, producing a Mermaid ERD diagram within a Markdown report.