-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(cmd/gf): fix gen sharding dao in multiple shardingPattern tables … #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…st for issue 4330
…and updating tests
Co-authored-by: Copilot <[email protected]>
|
新增了pbentity的分表合并生成支持,更新表前缀导致gen dao 分表不生效的问题 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
合并 #4330 ,属于同一模块问题 |
fix #4378
fix #4330