refactor: use dbterd 1.28 built-in json ERD target#4
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Migrate ERD extraction from our custom
@register_target("json")adapter to dbterd 1.28's built-in, schema-validatedjsontarget. dbterd now owns the{nodes, edges, metadata}contract, so the locally-registered target (and its module) are no longer needed.build_erd(target="json")forces the official target andbuild_erd_datamaps its payload into the SPA's{nodes, edges}shape, patching two known dbterd quirks: short-name edge ids underentity_name_format(resolved via aname_to_idmap) and missingis_foreign_keyflags on some algos likemodel_contract(back-filled from each edge'sfrom_columns). The dbterd floor is bumped to>=1.28(the built-injsontarget floor), anddbdocs/extract/erd_json.pyplus its unit test are deleted.Type of change
Area
generate/serve/deploy)extract/(nodes / erd / graph / column_lineage / health)site/(data dict / builder / 3-tier SPA / deploy)frontend/(React Flow graph bundle)dbdocs.yml) / packaging / CI / docsHow to test
Checklist
task lintpasses (ruff format --check+ruff check). — clean, 60 files formatted, all checks passed.task testpasses at 100% coverage (the gate is enforced in CI). — 331 passed, TOTAL 100.00%..claude/design_patterns.md(extended an existing seam, didn't fork one). The "ERD from dbterd's built-in json target" pattern entry + TOC are updated in this PR to match the new implementation.{nodes, edges}shape the builder emits is unchanged; the graph bundle consumes the same keys. Payload is not re-inlined.dbdocs/site/bundle/assets/graph/index.jscarries a small aligned tweak toerd_algo/is_foreign_keyhandling;frontend/src/**is unchanged so no full bundle rebuild was needed.dbdocs/site/bundle/**covered by thepyproject.tomlartifacts glob. — n/a, no new bundle files (a module was deleted).dbdocs.yml.exampleupdated for any new config knob or CLI flag. — n/a, no new config knob or CLI flag;.claude/skills/spa-site/SKILL.mdand the design-pattern doc were updated to reflect the dbterd 1.28 floor.Screenshots / notes
>=1.27→>=1.28;uv.lockupdated to match.task frontend:e2eon future dbterd bumps to confirm they still hold.