Back to browse
Pg_dbml – A dependency-free CLI to export Postgres to DBML

Pg_dbml – A dependency-free CLI to export Postgres to DBML

by heptau·Apr 23, 2026·1 point·0 comments

AI Analysis

●●SolidSolve My ProblemShip It

Pure SQL introspection means zero driver hell when exporting Postgres schemas to DBML.

Strengths
  • Pure SQL introspection avoids Node/Python dependency hell entirely for simpler deployment.
  • Direct pg_catalog queries ensure 100% schema fidelity without requiring external ORMs.
  • Perfect for feeding LLM context without requiring live database connections.
Weaknesses
  • Requires psql installed locally, limiting Windows usability significantly without WSL.
  • DBML format is niche compared to standard SQL dumps for general backup.
Target Audience

Backend developers, AI engineers

Similar To

dbdocs · pgmodeler · SchemaSpy

Post Description

I built this because I needed a clean way to feed my database schema to LLMs (Claude/Cursor) to get better context for coding.

Most existing tools felt too heavy—they required Node.js, Python, or complex setups. I wanted something that follows the Unix philosophy: a simple tool that uses psql to talk directly to pg_catalog.

It's a single SQL script wrapped in a CLI that produces clean DBML. No external dependencies, just pure SQL.

I'd love to hear what you think about the output format or if there are any edge cases in Postgres schemas I should handle better!

Similar Projects

Open‑Source Capital Formation OS (Postgres and AI Agents)

Spreadsheet-driven fundraising as infrastructure problem, but still pre-code—specs without execution.

Big BrainBold Bet
tgiordano
103mo ago