Skip to content

Conversation

@fainc
Copy link
Contributor

@fainc fainc commented Aug 22, 2025

fix #4378
fix #4330

@fainc fainc requested review from Copilot and gqcn August 22, 2025 06:19

This comment was marked as outdated.

@fainc fainc requested a review from hailaz August 22, 2025 06:20
@hailaz hailaz changed the title fix(gendao): fix gen sharding dao in multiple shardingPattern tables … fix(cmd/gf): fix gen sharding dao in multiple shardingPattern tables … Aug 22, 2025
@fainc fainc requested a review from hailaz August 22, 2025 08:19
@fainc
Copy link
Contributor Author

fainc commented Aug 22, 2025

新增了pbentity的分表合并生成支持,更新表前缀导致gen dao 分表不生效的问题

@fainc fainc requested a review from Copilot August 22, 2025 08:20
Copy link
Contributor

Copilot AI left a 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.

fainc and others added 3 commits August 22, 2025 16:22
@fainc
Copy link
Contributor Author

fainc commented Aug 22, 2025

合并 #4330 ,属于同一模块问题

@hailaz hailaz merged commit 656ae07 into gogf:master Aug 22, 2025
11 checks passed
@fainc fainc deleted the fix/4378 branch August 22, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gf/gen: gen shardingPattern table bug cmd/gf: gen pbentity typeMapping decimal to float64 is ineffective

2 participants