fix(cmd/gf): fix gen sharding dao in multiple shardingPattern tables …#4379
Merged
hailaz merged 12 commits intogogf:masterfrom Aug 22, 2025
Merged
fix(cmd/gf): fix gen sharding dao in multiple shardingPattern tables …#4379hailaz merged 12 commits intogogf:masterfrom
hailaz merged 12 commits intogogf:masterfrom
Conversation
…st for issue 4330
…and updating tests
Co-authored-by: Copilot <[email protected]>
hailaz
approved these changes
Aug 22, 2025
Contributor
Author
|
新增了pbentity的分表合并生成支持,更新表前缀导致gen dao 分表不生效的问题 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with generating sharding DAO configurations when working with multiple sharding pattern tables. The fix ensures that sharding handlers are properly named and configured with the correct table prefixes for different sharding patterns.
- Fixes hardcoded generic sharding handler name to be table-specific
- Adds proper sharding prefix template variable configuration
- Extends pbentity generation to support sharding patterns
- Updates test cases to cover multiple sharding table scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/gf/internal/consts/consts_gen_dao_template_dao.go | Updates DAO template to use table-specific sharding handler names and prefixes |
| cmd/gf/internal/cmd/testdata/gendao/sharding/sharding.sql | Replaces users_0003 table with orders_0001 and orders_0002 tables for multi-pattern testing |
| cmd/gf/internal/cmd/genpbentity/genpbentity.go | Adds sharding pattern support to pbentity generation |
| cmd/gf/internal/cmd/gendao/gendao_tag.go | Adds template variable for sharding prefix |
| cmd/gf/internal/cmd/gendao/gendao_dao.go | Configures sharding prefix in template variables |
| cmd/gf/internal/cmd/gendao/gendao.go | Fixes table name filtering logic for sharding scenarios |
| cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go | Adds comprehensive tests for pbentity sharding pattern functionality |
| cmd/gf/internal/cmd/cmd_z_unit_gen_dao_sharding_test.go | Updates DAO sharding tests for multiple patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
# Conflicts: # cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go
Contributor
Author
|
合并 #4330 ,属于同一模块问题 |
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.
fix #4378
fix #4330