feat(cmd/gf): 支持达梦数据库驱动#4776
Open
hailaz wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds optional support for the 达梦 (DM) database driver in the gf CLI DAO generator by gating the DM driver import behind a dm build tag, enabling go run|install -tags dm ... usage without impacting default builds.
Changes:
- Removes the previously commented-out DM driver import note from the default DAO generator command file.
- Adds a new
//go:build dm-guarded file that blank-imports the DM driver when thedmtag is enabled. - Updates
cmd/gfmodule dependencies (go.mod/go.sum) to include the DM driver and its indirect dependencies.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/gf/internal/cmd/cmd_gen_dao.go | Removes the old “do not add dm” commented guidance from the default driver import list. |
| cmd/gf/internal/cmd/cmd_gen_dao_dm.go | Adds a dm build-tagged blank import to enable DM driver registration when requested. |
| cmd/gf/go.mod | Adds contrib/drivers/dm/v2 and related indirect dependencies to support -tags dm builds. |
| cmd/gf/go.sum | Records checksums for the newly introduced DM driver dependency chain. |
Comments suppressed due to low confidence (1)
cmd/gf/go.mod:12
cmd/gfadds a direct requirement ongithub.com/gogf/gf/contrib/drivers/dm/v2, but the only import is behind the non-default build tagdm(seecmd_gen_dao_dm.go). Runninggo mod tidywithoutGOFLAGS=-tags=dmwill typically drop this requirement/go.sum entries, which can silently break the advertisedgo run|install -tags dm ...flow after routine tidying (CI currently runsgo mod tidyin each module without tags). Consider updating the repo’s tidy automation forcmd/gfto run withGOFLAGS=-tags=dm(or otherwise preserve tag-gated deps) so the dependency isn’t removed.
require (
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/dm/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.2
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.10.2
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Uh oh!
There was an error while loading. Please reload this page.