Skip to content

feat(design-first): DBML import — design a schema without a database#487

Open
seonghobae wants to merge 1 commit into
mainfrom
feat/dbml-import
Open

feat(design-first): DBML import — design a schema without a database#487
seonghobae wants to merge 1 commit into
mainfrom
feat/dbml-import

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

Independent PR against main. #1 priority from the market research (#486): dbdiagram.io's core workflow. POST /api/dbml/convert parses DBML (tables, quoted/schema-qualified names, pk/not-null/unique, inline & standalone refs incl. reverse <; Project/Enum/TableGroup skipped) into the same snapshot JSON introspection produces — so the ERD, DDL export, diff, migration, and every analyzer work on a design that never touched a database. Also derives the constraints array so ddl/export renders PK/FK. Line-oriented parser: hostile input degrades to skipped lines, never an exception. +5 tests incl. end-to-end DBML→DDL; mypy clean.

🤖 Generated with Claude Code

Top priority from docs/erd-tool-feature-research.md (#486): dbdiagram.io's core workflow. parse_dbml(text) converts the dbdiagram DBML dialect (tables, quoted/schema-qualified names, pk/not null/unique settings, inline & standalone refs incl. reverse '<', Project/Enum/TableGroup blocks skipped) into the SAME snapshot JSON introspection produces — so DDL export, diff, migration, and all analyzers work on a design that never touched a database. Derives the constraints array (PK attnums, FK defs) that ddl/export renders. POST /api/dbml/convert returns snapshot_json + optional dialect DDL. Line-oriented parser: hostile input degrades to skipped lines, never an exception. +5 tests incl. end-to-end DBML->DDL; suite green; mypy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AxU2xaupAjp912oDNFuWyd
seonghobae added a commit that referenced this pull request Jul 6, 2026
Documents gap->PR traceability: DBML import shipped (#487), MySQL in progress, remaining queue ordered.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AxU2xaupAjp912oDNFuWyd
@seonghobae seonghobae enabled auto-merge (squash) July 6, 2026 08:52
in_ignored_block = 1 # block opens on a following line
continue

m = _TABLE_RE.match(line)
@opencode-agent opencode-agent Bot disabled auto-merge July 6, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants