Add pdmaner CLI harness for PDManer database modeling tool#302
Conversation
PDManer (元数建模) is an open-source database modeling tool. This harness provides: - Project CRUD (create, open, save .chnr.json files) - Entity/table management with fields, indexes - View, diagram, dictionary, domain management - DDL/SQL export for MySQL, PostgreSQL, Oracle, etc. - Interactive REPL with undo/redo - JSON output mode for AI agent consumption 64 tests (51 unit + 13 E2E), all passing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24740ee4ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| def diagram_add_table(ctx, diagram, entity, x, y): | ||
| """Add an entity table to a diagram.""" | ||
| data = _get_data(ctx) | ||
| node = diagram.add_table_to_diagram(data, diagram, entity, x, y) |
There was a problem hiding this comment.
Rename diagram arg before invoking diagram helpers
diagram add-table (and the same pattern in diagram add-relation) always crashes because the Click argument named diagram shadows the imported diagram module, so diagram.add_table_to_diagram(...) resolves against a string and raises AttributeError. This makes the diagram relation/table CLI paths unusable in normal workflows.
Useful? React with 👍 / 👎.
| if proj_path and sess and sess.data is not None: | ||
| sess.save(proj_path) |
There was a problem hiding this comment.
Limit auto-save callback to actual mutations
The result callback currently saves whenever --project is provided, regardless of which subcommand ran. That means read-only commands like entity list rewrite the project file and bump updatedTime, and they can also fail in read-only environments even though no mutation was requested. Auto-save should be gated by a mutation flag/command set instead of running unconditionally.
Useful? React with 👍 / 👎.
| if m.get("defKey"): | ||
| return m |
There was a problem hiding this comment.
Resolve domain type mapping by applyFor key
DDL type resolution is incorrect for domain-based fields when multiple mappings exist: _get_type_mapping returns the first mapping entry and _resolve_field_type then uses that row for every domain, ignoring the domain’s applyFor mapping key. In practice this emits wrong column types (e.g., an INT domain can become VARCHAR) and corrupts generated SQL.
Useful? React with 👍 / 👎.
|
Thanks for adding the PDManer harness. Before merge, please bring it in line with the repo's in-repo harness conventions and fix the current runtime issues:
|
PDManer (元数建模) is an open-source database modeling tool. This harness provides:
64 tests (51 unit + 13 E2E), all passing.
Description
Fixes #
Type of Change
For New Software CLIs (in-repo)
<SOFTWARE>.mdSOP document exists at<software>/agent-harness/<SOFTWARE>.mdSKILL.mdexists atskills/cli-anything-<software>/SKILL.mdSKILL.mdexists atcli_anything/<software>/skills/SKILL.mdcli_anything/<software>/tests/test_core.pyare present and pass without backendcli_anything/<software>/tests/test_full_e2e.pyare presentREADME.mdincludes the new software (with link to harness directory)registry.jsonincludes an entry withsource_url: null(see Contributing guide)repl_skin.pyinutils/is an unmodified copy from the pluginFor New Software CLIs (standalone repo)
pip install <package-name>or apip install git+https://...URLSKILL.mdexists in the external reporegistry.jsonentry includessource_urlpointing to the external reporegistry.jsonentry includesskill_mdwith full URL to the external SKILL.mdinstall_cmdinregistry.jsonworks (tested locally)For Existing CLI Modifications
python3 -m pytest cli_anything/<software>/tests/test_core.py -vpython3 -m pytest cli_anything/<software>/tests/test_full_e2e.py -vregistry.jsonentry is updated if version, description, or requirements changedGeneral Checklist
--jsonflag is supported on any new commandsfeat:,fix:,docs:,test:)Test Results