Skip to content
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

如何注册不同的shardingkey 分表策略 #62

Closed
Tk4s opened this issue Aug 15, 2022 · 6 comments
Closed

如何注册不同的shardingkey 分表策略 #62

Tk4s opened this issue Aug 15, 2022 · 6 comments
Assignees

Comments

@Tk4s
Copy link

Tk4s commented Aug 15, 2022

Your Question

The document you expected this should be explained

Expected answer

Hi,
目前有需求是注册不同类型的shardingkey 切片表, gorm (db.Use()) 如果多次使用相同name的插件会被返回已注册.
请问该如何实现, 谢谢

@huacnlee
Copy link
Collaborator

描述不够详细,无法解答

@Tk4s
Copy link
Author

Tk4s commented Aug 16, 2022

我有多张不同的表, shardingkey 也不一致, 这个时候当db.USE() 其中一个类型shardingkey的时候, 无法再USE第二个sharding 组件.

@zouguobing
Copy link

sharding.Register func will be get the same plugin name for sharding,so different sharding-key column could not register successfully when invoking db.USE()

@hyperphoton
Copy link
Collaborator

Not supported now.
Multiple database connections with different sharding rules can be used in this scenario.

@ppanphper
Copy link

看gorm文档里写的是支持链式注册多shardingkey 分表规则, 怎么现在不支持了。。

@Vingurzhou
Copy link

目前不支持。 该场景可以使用具有不同分片规则的多个数据库连接。

那事务怎么办呢

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

No branches or pull requests

7 participants